/* iGrid — third direction
   Bricolage Grotesque for headings and figures, Plus Jakarta Sans for text.
   The 3×3 grid from the logo is the one bold element; everything else stays quiet. */

:root {
  --paper: #f2f5f3;
  --paper-2: #e6ede9;
  --ink: #13302c;
  --muted: #4a5f5a;
  --line: #cbd8d2;
  --teal: #176b61;
  --teal-deep: #0f4740;
  --gold: #c5a675;
  --gold-ink: #6e5221;
  --violet: #5a47c2;
  --violet-deep: #43348f;
  --violet-soft: #ebe7fb;
  --white: #ffffff;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius-cell: 14px;
  --radius-panel: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 10; padding: 12px 16px; background: var(--ink); color: var(--white); border-radius: 8px; }
.skip:focus { top: 16px; }

/* Headings: condensed width, heavy, tight. */
h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}
h3 { font-weight: 600; font-size: 1.1875rem; line-height: 1.3; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--teal); }
.btn-violet { background: var(--violet); color: var(--white); }
.btn-violet:hover { background: var(--violet-deep); }
.btn-quiet { border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgb(242 245 243 / .82);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; padding-block: 16px; }
.brand { font-family: var(--display); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; }
.brand img { border-radius: 10px; }
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding-block: clamp(40px, 8vw, 104px) clamp(56px, 9vw, 120px);
}
.hero h1 { font-size: clamp(3rem, 6.2vw, 5.5rem); }
.lede { margin-top: 28px; max-width: 34em; font-size: 1.1875rem; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* The board: a 3×3 grid echoing the logo. */
.board { margin: 0; width: 100%; max-width: 520px; justify-self: end; }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.2vw, 14px); }
.cell { aspect-ratio: 1; border-radius: var(--radius-cell); }
.cell-empty {
  /* A quiet "+" marks each open slot. */
  border: 1px solid var(--line);
  background:
    linear-gradient(#b3c5be, #b3c5be) center / 14px 1.5px no-repeat,
    linear-gradient(#b3c5be, #b3c5be) center / 1.5px 14px no-repeat,
    linear-gradient(160deg, #eaf0ed, var(--paper-2));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .7);
}
.cell-orbit a { box-shadow: 0 18px 36px -18px rgb(67 52 143 / .55); }
.cell-next { box-shadow: 0 18px 36px -18px rgb(110 82 33 / .45); }
.cell-orbit a, .cell-next {
  display: flex; flex-direction: column; justify-content: flex-end;
  height: 100%; padding: clamp(10px, 1.4vw, 16px);
  border-radius: var(--radius-cell);
  text-decoration: none;
}
.cell-orbit a { background: var(--violet); color: var(--white); position: relative; transition: background-color .15s; }
.cell-orbit a:hover { background: var(--violet-deep); }
.cell-orbit img { width: clamp(36px, 4.4vw, 56px); height: auto; border-radius: 14px; margin-bottom: auto; }
.cell-next { background: var(--gold); color: var(--ink); }
.cell-name { font-family: var(--display); font-weight: 650; font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.1; }
.cell-meta { font-size: clamp(.75rem, .95vw, .8125rem); line-height: 1.3; opacity: .9; margin-top: 2px; }
.board figcaption { margin-top: 16px; font-size: .9375rem; color: var(--muted); }

/* One orchestrated moment: the grid assembles, then Orbit and the next cell fill in. */
@media (prefers-reduced-motion: no-preference) {
  .cell { animation: cell-in .5s cubic-bezier(.2,.7,.2,1) both; }
  .cell:nth-child(1) { animation-delay: .95s; animation-name: cell-pop; }
  .cell:nth-child(2) { animation-delay: .10s; }
  .cell:nth-child(4) { animation-delay: .15s; }
  .cell:nth-child(3) { animation-delay: .25s; }
  .cell:nth-child(5) { animation-delay: .30s; }
  .cell:nth-child(7) { animation-delay: .35s; }
  .cell:nth-child(6) { animation-delay: .45s; }
  .cell:nth-child(8) { animation-delay: .50s; }
  .cell:nth-child(9) { animation-delay: 1.15s; animation-name: cell-pop; }
  @keyframes cell-in { from { opacity: 0; transform: scale(.86); } }
  @keyframes cell-pop {
    0% { opacity: 0; transform: scale(.6); }
    70% { opacity: 1; transform: scale(1.04); }
    100% { transform: scale(1); }
  }
}

/* Orbit */
/* Apps */
.apps { padding-block: clamp(8px, 2vw, 24px) clamp(56px, 9vw, 120px); }
.apps-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.apps-head h2 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); }
.apps-head p { color: var(--muted); }
.orbit {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
  background: var(--violet-soft); border-radius: 24px; padding: clamp(24px, 4.5vw, 64px);
}
.orbit-mark { display: flex; align-items: center; gap: 16px; }
.orbit-mark h3 { font-family: var(--display); font-size: 2rem; line-height: 1; letter-spacing: -0.02em; color: var(--violet-deep); margin-bottom: 8px; }
.orbit-mark img { border-radius: 16px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--white); color: var(--violet-deep); font-size: .875rem; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3f9a6b; }
.orbit-tagline { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.125rem); line-height: 1.15; letter-spacing: -0.02em; color: var(--violet-deep); }
.orbit-copy > .orbit-tagline { margin-top: 28px; }
.orbit-copy > p:not(.orbit-tagline) { margin-top: 22px; max-width: 34em; color: #48416a; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 32px 0 36px; padding-top: 24px; border-top: 1px solid #d3cbf1; }
.facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; }
.facts dt { font-size: .8125rem; line-height: 1.35; color: #5f5785; }
.facts dd { font-family: var(--display); font-weight: 650; font-size: clamp(2rem, 3vw, 2.5rem); line-height: 1; letter-spacing: -0.02em; color: var(--violet-deep); font-variant-numeric: tabular-nums; }

/* Sample puzzle */
.puzzle {
  background: var(--white);
  border-radius: var(--radius-panel);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 1px 0 #d3cbf1, 0 24px 48px -24px #43348f40;
}
.puzzle-head { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--violet-deep); }
.puzzle-tag { margin-left: auto; font-size: .8125rem; font-weight: 500; color: #5f5785; background: var(--violet-soft); padding: 4px 10px; border-radius: 999px; }
.puzzle h4 { font-family: var(--display); margin-top: 28px; font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 650; }
.train { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 20px; }
.car { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: #f6f4fd; }
.car svg { width: 62%; fill: var(--violet); }
.car:nth-child(even) svg { fill: var(--gold); }
.car-blank { border: 2px dashed #b9aef0; background: transparent; font-weight: 700; font-size: 1.25rem; color: var(--violet); }
.car-blank.is-right { border-style: solid; border-color: #3f9a6b; background: #e7f5ec; }
.car-blank.is-right svg { fill: var(--gold); }
.answers { display: flex; gap: 12px; margin-top: 24px; }
.answers button {
  flex: 1; min-height: 64px; display: grid; place-items: center;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.answers button svg { width: 34px; fill: var(--ink); }
.answers button:hover { border-color: var(--violet); }
.answers button[aria-pressed="true"].is-wrong { border-color: #c4553f; background: #fbeeea; }
.answers button[aria-pressed="true"].is-right { border-color: #3f9a6b; background: #e7f5ec; }
.feedback { margin-top: 16px; min-height: 3.2em; font-weight: 500; }
.puzzle-note { margin-top: 8px; font-size: .8125rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .answers button.is-wrong { animation: nudge .3s; }
  @keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
}

/* Next app */
.next-app { display: flex; align-items: center; gap: 20px; margin-top: 16px; padding: 22px clamp(24px, 4.5vw, 64px); border: 1px dashed #c9b48c; border-radius: 24px; background: #f6f1e7; }
.next-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--gold); }
.next-app h3 { font-family: var(--display); font-weight: 700; }
.next-app p { color: var(--muted); font-size: .9375rem; }

/* How we build */
.how { background: var(--teal-deep); color: #eaf2ef; padding-block: clamp(56px, 9vw, 112px); }
.how h2 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); color: var(--white); }
.how-lede { margin-top: 16px; max-width: 36em; color: #bfd6cf; font-size: 1.125rem; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 56px; }
.principles li { padding-top: 24px; border-top: 1px solid #ffffff30; }
.glyph { width: 30px; height: 10px; overflow: visible; margin-bottom: 20px; }
.glyph rect { fill: #eaf2ef; }
.glyph .off { fill: #ffffff2e; }
.glyph .gold { fill: var(--gold); }
.principles h3 { color: var(--white); }
.principles p { margin-top: 8px; color: #bfd6cf; max-width: 30em; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(64px, 9vw, 128px); }
.about h2 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); }
.about-lead { font-family: var(--display); font-weight: 600; font-size: clamp(1.375rem, 2.4vw, 1.875rem); line-height: 1.25; letter-spacing: -0.015em; }
.about-copy p + p { margin-top: 20px; color: var(--muted); max-width: 36em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; gap: 32px; padding-block: 28px; }
.footer-inner .brand { font-size: 1.25rem; }
.footer-inner nav { display: flex; gap: 24px; margin-left: auto; }
.footer-inner nav a { text-decoration: none; color: var(--muted); }
.footer-inner nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-inner p { color: var(--muted); font-size: .9375rem; }

/* Tablet */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .board { justify-self: start; max-width: 460px; }
  .orbit { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .puzzle { max-width: 560px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }
}

/* Phone */
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .header-inner { gap: 16px; }
  .site-nav { display: none; }
  .header-inner .btn { margin-left: auto; }
  .lede { font-size: 1.0625rem; margin-top: 20px; }
  .hero-actions .btn { flex: 1; }
  .cell-meta { display: none; }
  .train { gap: 5px; }
  .car { border-radius: 8px; }
  .apps-head { display: block; }
  .apps-head p { margin-top: 8px; }
  .footer-inner { flex-wrap: wrap; gap: 16px 24px; }
  .footer-inner nav { margin-left: 0; width: 100%; order: 3; flex-wrap: wrap; gap: 10px 24px; }
  .footer-inner nav a { white-space: nowrap; }
  .footer-inner p { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
