/* Chalk's landing page. Tokens and components follow Chalk's own design system
   (src/ui/tokens.css and src/ui/chalk.css in the app): solid ink controls, paper content,
   no tints, gradients or textures. One family, two weights, no italics. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/chalk/fonts/AtkinsonHyperlegibleNext-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/chalk/fonts/AtkinsonHyperlegibleNext-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbfaf6;
  --paper-deep: #f1efe8;
  --surface: #ffffff;
  --rule: #dedbd1;
  --edge: #8d8a80;
  --graphite: #1d2320;
  --slate: #575e59;
  --marker-blue: #2a55c9;
  --pen-amber: #a85410;
  --on-ink: #ffffff;
  --ink-raised: #2e3632;
  --on-ink-muted: #aeb4b0;
  --edge-on-ink: #6b736e;
  --amber-on-ink: #f0954a;
  --blue-on-ink: #86a6f7;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-float: 0 1px 2px #1d23201f, 0 10px 28px #1d232029;

  --font-sans: "Atkinson Hyperlegible Next", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 112px);

  color-scheme: light;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 400 17px/1.55 var(--font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, iframe { display: block; max-width: 100%; }
em, i, cite, blockquote, address { font-style: normal; }

a { color: var(--marker-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--graphite); }

:focus-visible { outline: 2px solid var(--marker-blue); outline-offset: 2px; }
.ink :focus-visible { outline-color: var(--blue-on-ink); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--graphite);
  color: var(--on-ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-ink); }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Wordmark and buttons (as in the app) ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--graphite);
  text-decoration: none;
}
.wordmark-text {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.wordmark-text::after {
  content: "";
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.06em;
  border-radius: var(--radius-full);
  background: var(--pen-amber);
}
.wordmark:hover { color: var(--graphite); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-sm);
  font: 700 16px/24px var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.btn--md { height: 40px; padding: 0 16px; font-size: 14px; line-height: 20px; }

.btn--start { background: var(--marker-blue); color: var(--on-ink); }
.btn--start:hover { background: var(--graphite); color: var(--on-ink); }

.btn--primary { background: var(--graphite); color: var(--on-ink); }
.btn--primary:hover { background: var(--ink-raised); color: var(--on-ink); }

.btn--secondary { background: var(--surface); color: var(--graphite); box-shadow: inset 0 0 0 1.5px var(--graphite); }
.btn--secondary:hover { background: var(--graphite); color: var(--on-ink); }

.btn--inverse { background: var(--surface); color: var(--graphite); }
.btn--inverse:hover { background: var(--paper-deep); color: var(--graphite); }

.btn--outline-ink { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 1.5px var(--edge-on-ink); }
.btn--outline-ink:hover { background: var(--ink-raised); color: var(--on-ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a:not(.btn) {
  color: var(--slate);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--graphite); }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(56px, 8vw, 104px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--slate);
  font-size: 14px;
  font-weight: 700;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--pen-amber);
}

.hero h1 {
  max-width: 13em;
  margin-top: 24px;
  font-size: clamp(38px, 6.2vw, 64px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-sub {
  max-width: 34em;
  margin-top: 24px;
  color: var(--slate);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
}

.hero .actions { margin-top: 36px; }

.hero-note {
  margin-top: 16px;
  color: var(--slate);
  font-size: 14px;
}

/* ---------- Demo frame: the demo video, dressed as a YouTube embed before you press play ---------- */

.demo { margin-top: clamp(48px, 7vw, 80px); }

.demo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #070707;
  box-shadow: var(--shadow-float);
}
.yt-poster,
.yt iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
}
.yt-poster { color: #fff; text-decoration: none; cursor: pointer; }
.yt-poster:hover { color: #fff; }
.yt-poster:focus-visible { outline-offset: -4px; }
.yt-poster picture,
.yt-poster > picture img {
  display: block;
  width: 100%;
  height: 100%;
}
.yt-poster > picture img { object-fit: cover; }

.yt-top {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 40px;
  background: linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  font-family: Roboto, Arial, sans-serif;
}
.yt-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.yt-meta { display: flex; flex-direction: column; min-width: 0; }
.yt-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 18px;
  line-height: 1.35;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}
.yt-channel { font-size: 13px; color: rgba(255, 255, 255, 0.78); }

.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%) scale(1.25);
}
.yt-play svg { display: block; }
.yt-play-bg {
  fill: #212121;
  fill-opacity: 0.8;
  transition: fill 100ms cubic-bezier(0, 0, 0.2, 1), fill-opacity 100ms cubic-bezier(0, 0, 0.2, 1);
}
.yt-poster:hover .yt-play-bg,
.yt-poster:focus-visible .yt-play-bg { fill: #f00; fill-opacity: 1; }

.yt-time {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  font-family: Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
.yt.is-playing .yt-poster { display: none; }

.demo figcaption strong { color: var(--graphite); font-weight: 700; }
.demo figcaption {
  margin-top: 14px;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Sections ---------- */

.section { padding-top: var(--section); }

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px clamp(32px, 5vw, 72px);
  align-items: start;
}

.eyebrow {
  color: var(--slate);
  font-size: 14px;
  font-weight: 700;
}

.section h2,
.ink h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  color: var(--slate);
  font-size: 18px;
  line-height: 1.55;
}

/* The problem: three ruled lines. */
.ruled { border-top: 1px solid var(--rule); }
.ruled li {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
}
.ruled + .lead { margin-top: 24px; max-width: 36em; }

/* How it works: points beside a real board. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px clamp(32px, 5vw, 72px);
  align-items: center;
}

.points { margin-top: 28px; }
.points li + li { margin-top: 22px; }
.points h3 { font-size: 19px; line-height: 1.35; font-weight: 700; }
.points p { margin-top: 4px; color: var(--slate); }

.shot {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.shot img { width: 100%; height: auto; }

.boards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.boards figcaption,
.split figcaption,
.stage figcaption {
  margin-top: 10px;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.5;
}

/* The syllabus under the four steps. */
.stage { margin-top: 32px; }

/* Models propose, code decides: the one ink section. */
.ink {
  margin-top: var(--section);
  padding-block: var(--section);
  background: var(--graphite);
  color: var(--on-ink);
}
.ink .eyebrow { color: var(--on-ink-muted); }
.ink .section-head { max-width: 40em; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
  counter-reset: step;
}
.steps li {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--ink-raised);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: block;
  color: var(--amber-on-ink);
  font-size: 15px;
  font-weight: 700;
}
.steps h3 { margin-top: 10px; font-size: 21px; line-height: 1.3; font-weight: 700; }
.steps p { margin-top: 8px; color: var(--on-ink-muted); font-size: 16px; line-height: 1.5; }

/* The same four steps on paper (How it works). */
.steps--paper li { background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); }
.steps--paper li::before { color: var(--pen-amber); }
.steps--paper p { color: var(--slate); }

/* The ruled list on ink (Models propose, code decides). */
.ink .ruled,
.ink .ruled li { border-color: var(--edge-on-ink); }
.ink .lead { color: var(--on-ink-muted); }

/* A student's words. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.quote {
  max-width: 52em;
  padding-left: clamp(20px, 3vw, 32px);
  border-left: 3px solid var(--marker-blue);
}
.quote blockquote p {
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.quote figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 20px;
  font-size: 15px;
}
.quote figcaption strong { font-weight: 700; }
.quote figcaption span { color: var(--slate); }

/* Who it's for and privacy. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(32px, 5vw, 72px);
  align-items: start;
}
.pair .lead { margin-top: 16px; }
.pair .lead + .lead { margin-top: 12px; }

.card {
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--graphite);
}
.card h3 { font-size: 21px; line-height: 1.3; font-weight: 700; }
.card p { margin-top: 8px; color: var(--slate); }

.facts { margin-top: 20px; border-top: 1px solid var(--rule); }
.facts li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.facts li strong { display: block; font-weight: 700; }
.facts li span { color: var(--slate); }
.facts + p { margin-top: 16px; color: var(--slate); font-size: 15px; }

/* What's next. */
.next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.next .tag {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 700;
}

/* Closing call to action. */
.closing {
  padding-block: var(--section);
}
.closing-box {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-top: var(--section);
  border-top: 1px solid var(--rule);
}
.closing h2 {
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.closing h2 .dot { color: var(--pen-amber); }
.closing p { margin-top: 16px; color: var(--slate); max-width: 26em; }

/* Footer. */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 28px 40px;
  color: var(--slate);
  font-size: 14px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer .wordmark-text { font-size: 20px; }
.site-footer p a { color: var(--slate); }
.site-footer p a:hover { color: var(--graphite); }

/* ---------- Smaller screens ---------- */

@media (max-width: 960px) {
  .section-grid,
  .split,
  .pair { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .site-nav a:not(.btn) { display: none; }
  .boards { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .next { grid-template-columns: minmax(0, 1fr); }
  .closing-box { align-items: start; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { width: 100%; }
  .site-header .btn--md { padding: 0 12px; }
  .yt-top { padding: 10px 10px 24px; gap: 8px; }
  .yt-avatar { width: 28px; height: 28px; }
  .yt-title { font-size: 13px; }
  .yt-channel { font-size: 11.5px; }
  .yt-play { transform: translate(-50%, -50%) scale(0.85); }
  .yt-time { right: 10px; bottom: 10px; font-size: 12px; line-height: 18px; }
  .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
