/* Build Beyond Classroom: one stylesheet.
   Concept: a build plan on blueprint paper. Calm tinted neutrals, one cobalt accent for action,
   one marker-yellow highlight, and three role colours that mean "how AI may be used".
   Fonts are self-hosted (static/fonts). Nothing here needs JavaScript to be readable. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #F1F4F0; --surface: #FFFFFF; --surface2: #E8EDE7; --ink: #10251E; --muted: #475A52; --line: #CBD5CD;
  --accent: #1D4ED8; --accent-ink: #FFFFFF; --mark: #F6C927; --focus: #B45309;
  --tutor: #0A6B5E; --tutor-bg: #D9EFEA; --build: #1D4ED8; --build-bg: #DEE7FC; --own: #9A4A06; --own-bg: #FBE5CF;
  --grid: rgba(16, 37, 30, .06);
  --shadow: 0 1px 2px rgba(16, 37, 30, .06), 0 10px 24px -14px rgba(16, 37, 30, .22);
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --gutter: max(1rem, env(safe-area-inset-left, 0px));
  --gutter-r: max(1rem, env(safe-area-inset-right, 0px));
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1A15; --surface: #13251E; --surface2: #1A3027; --ink: #E9F0EB; --muted: #A3B6AD; --line: #2A4238;
    --accent: #8EA9FF; --accent-ink: #0C1A15; --mark: #F6C927; --focus: #F6C927;
    --tutor: #4FD1BC; --tutor-bg: #123C35; --build: #8EA9FF; --build-bg: #1B2B57; --own: #F4A55C; --own-bg: #4A2E14;
    --grid: rgba(233, 240, 235, .06); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1A15; --surface: #13251E; --surface2: #1A3027; --ink: #E9F0EB; --muted: #A3B6AD; --line: #2A4238;
  --accent: #8EA9FF; --accent-ink: #0C1A15; --mark: #F6C927; --focus: #F6C927;
  --tutor: #4FD1BC; --tutor-bg: #123C35; --build: #8EA9FF; --build-bg: #1B2B57; --own: #F4A55C; --own-bg: #4A2E14;
  --grid: rgba(233, 240, 235, .06); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .6); color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; font-size: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  padding-left: var(--gutter); padding-right: var(--gutter-r);
  overflow-wrap: anywhere; /* long words and email addresses wrap instead of overflowing at 200% text */
}
.wrap { max-width: 70rem; margin: 0 auto; min-width: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus, h1:focus { outline: none; }
.mono { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.2rem; max-width: 60ch; }
.muted { color: var(--muted); }
.hint { font-size: .92rem; color: var(--muted); }
.small { font-size: .92rem; }
.hl {
  background: var(--mark); color: #10251E; padding: 0 .14em; border-radius: .14em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ic { width: 1.5rem; height: 1.5rem; flex: none; }
/* outside links get a small arrow so people know they leave the site */
.block p a[href^="https://"]::after, .block li a[href^="https://"]::after { content: "\2197"; content: "\2197" / ""; font-size: .8em; margin-left: .15em; }

.skip {
  position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--bg);
  padding: .65rem .9rem; border-radius: 6px; z-index: 50;
}
.skip:focus { left: .5rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .6rem 1.25rem;
  border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  max-width: 100%; text-align: center; /* wraps instead of overflowing at very large text sizes */
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--accent); padding-inline: .6rem; }
.btn.quiet:hover { background: rgba(255, 255, 255, .08); filter: none; }
.btn.small { min-height: 44px; padding: .5rem .95rem; font-size: .95rem; }
.btn .ic { width: 1.1em; height: 1.1em; }
.icon-btn {
  min-height: 44px; min-width: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; font: 700 .9rem var(--font-body); cursor: pointer; padding: 0; display: inline-grid; place-items: center;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { border-color: var(--accent); }
[hidden] { display: none !important; }

/* the theme button shows the icon for the theme you would switch to */
.i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
.menu-btn .i-close { display: none; }
html.menu-open .menu-btn .i-close { display: block; }
html.menu-open .menu-btn .i-open { display: none; }
@media (min-width: 861px) { .menu-btn { display: none !important; } }

/* ---------- draft banner and header ---------- */
.draft, header.site, .page-head, .cta-band, footer.site {
  margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter-r));
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
.draft { background: var(--surface2); border-bottom: 1px solid var(--line); font-size: .9rem; padding-top: .4rem; padding-bottom: .4rem; }
.draft .wrap { display: flex; gap: .65rem; align-items: baseline; flex-wrap: wrap; }
.d-short { display: none; }
.tag {
  font: 500 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--mark); color: #10251E; white-space: nowrap;
}
header.site {
  position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line);
}
@supports (background: color-mix(in srgb, red, blue)) {
  header.site { background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
}
.bar { max-width: 70rem; margin: 0 auto; display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand {
  display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); min-width: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-accent { fill: var(--accent); }
nav.main { display: flex; align-items: center; gap: 2px; margin-left: auto; min-width: 0; }
nav.main a:not(.btn) {
  padding: .6rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 700;
  font-size: .98rem; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center;
}
nav.main a:not(.btn):hover { background: var(--surface2); }
nav.main a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); border-radius: 8px 8px 0 0; }
nav.main .nav-cta { margin-left: .6rem; white-space: nowrap; }
.bar-end { display: flex; align-items: center; gap: .5rem; }

@media (max-width: 860px) {
  .bar { min-height: 56px; gap: .5rem; }
  .brand { font-size: 1.02rem; }
  .bar-end { margin-left: auto; }
  /* without JavaScript the menu is one scrolling row under the brand */
  .bar { flex-wrap: wrap; }
  nav.main { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: .35rem; }
  nav.main .nav-cta { margin-left: auto; }
  /* with JavaScript: one compact row, and the links open as a panel */
  html.has-menu .bar { flex-wrap: nowrap; }
  html.has-menu nav.main {
    display: none; position: absolute; left: 0; right: 0; top: 100%; width: auto; order: 0; overflow: visible;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .35);
    padding: .5rem var(--gutter-r) 1.1rem var(--gutter);
  }
  html.has-menu.menu-open nav.main { display: flex; }
  html.has-menu nav.main a:not(.btn) { min-height: 52px; font-size: 1.08rem; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  html.has-menu nav.main a[aria-current="page"] { color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); padding-left: 1rem; }
  html.has-menu nav.main .nav-cta { margin: 1rem 0 0; min-height: 50px; }
  .d-long { display: none; }
  .d-short { display: inline; }
}
@media (max-width: 380px) { .brand { font-size: .95rem; } .brand svg { width: 26px; height: 26px; } }

/* ---------- page structure ---------- */
.page-head {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; border-bottom: 1px solid var(--line);
}
.head { display: flex; flex-direction: column; gap: .7rem; padding-block: 2.5rem 2.25rem; }
.head h1 { max-width: 22ch; }
section.block { padding-block: 3.25rem; }
section.block > .head { padding-block: 0 1.4rem; }
section.block.alt { background: var(--surface2); box-shadow: 0 0 0 100vmax var(--surface2); clip-path: inset(0 -100vmax); }
.grid { display: grid; gap: 1.25rem; }
/* explicit columns, so a row of four never leaves one card alone on the next line */
.g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid > * { min-width: 0; }
.block > p, .block > .checks, .block > .legend, .block > ol.plain, .block > .note, .block > .emailbox { max-width: 70ch; }
section.block > * + * { margin-top: 1rem; }
section.block > .head + * { margin-top: 0; }
ul.plain, ol.plain { margin: 0; padding-left: 1.3em; display: grid; gap: .5rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.note { border-left: 4px solid var(--mark); background: var(--surface); padding: .85rem 1.1rem; border-radius: 0 10px 10px 0; }

/* ---------- cards, features, routes ---------- */
.card, .feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
}
.card h3, .feature h3 { margin: .1rem 0 .45rem; }
.ic-wrap {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; margin-bottom: .9rem;
  background: var(--build-bg); color: var(--build);
}
.ic-wrap .ic { width: 24px; height: 24px; }
.route {
  display: flex; flex-direction: column; gap: .45rem; padding: 1.35rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.route:hover { border-color: var(--accent); transform: translateY(-2px); }
.route .mono { color: var(--accent); }
.route strong { font: 700 1.2rem var(--font-display); }
.route .go { margin-top: auto; padding-top: .35rem; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
.route .go .ic { width: 1.05em; height: 1.05em; transition: transform .15s; }
.route:hover .go .ic { transform: translateX(3px); }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.checks li { display: flex; gap: .75rem; align-items: flex-start; }
.checks .ic { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--tutor-bg); color: var(--tutor); margin-top: .12rem; stroke-width: 2.4; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.legend li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.legend .pill { justify-self: start; }
@media (max-width: 560px) { .legend li { grid-template-columns: minmax(0, 1fr); gap: .25rem; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.stat { padding: 1.4rem 1.2rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 800 2.8rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent); }
.stat span { display: block; margin-top: .5rem; font-size: .95rem; color: var(--muted); }
@media (max-width: 640px) { .stat { border-right: 0; border-bottom: 1px solid var(--line); } .stat:last-child { border-bottom: 0; } }

.pill { font: 500 .75rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill.tutor { background: var(--tutor-bg); color: var(--tutor); }
.pill.build { background: var(--build-bg); color: var(--build); }
.pill.own { background: var(--own-bg); color: var(--own); }
.n {
  font: 500 .85rem var(--font-mono); width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink);
  display: grid; place-items: center; flex: none;
}

/* the eight-step journey: a connected timeline */
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: none; }
.journey li { position: relative; padding: 0 .3rem; text-align: center; }
.journey li::before { content: ""; position: absolute; top: 20px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.journey li:first-child::before { display: none; }
.journey a { display: flex; flex-direction: column; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); padding-bottom: .5rem; border-radius: 10px; }
.journey .n { width: 40px; height: 40px; font-size: .95rem; background: var(--surface); position: relative; z-index: 1; transition: background .15s, color .15s, border-color .15s; }
.journey a:hover .n { background: var(--ink); color: var(--bg); }
.journey .jt { font: 700 .95rem/1.2 var(--font-display); min-height: 2.4em; display: flex; align-items: center; }
.journey .pill { white-space: normal; }
@media (max-width: 860px) {
  .journey { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .journey li { text-align: left; padding: 0; }
  .journey li::before { top: -50%; bottom: 50%; left: 19px; right: auto; width: 2px; height: auto; }
  .journey a { flex-direction: row; align-items: center; gap: .85rem; padding: .55rem 0; min-height: 52px; }
  .journey .jt { min-height: 0; flex: 1; font-size: 1.02rem; }
}

/* ladder and stage path */
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 46rem; }
.rung {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .75rem; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem;
}
.rung .n { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.r2 { margin-left: clamp(0px, 2.2vw, 22px); } .r3 { margin-left: clamp(0px, 4.4vw, 44px); } .r4 { margin-left: clamp(0px, 6.6vw, 66px); }
.r5 { margin-left: clamp(0px, 8.8vw, 88px); } .r6 { margin-left: clamp(0px, 11vw, 110px); } .r7 { margin-left: clamp(0px, 13.2vw, 132px); }
@media (max-width: 560px) { .rung { margin-left: 0; } }
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; counter-reset: s; max-width: none; }
.block > .path { max-width: none; }
.path li {
  counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem;
  display: flex; flex-direction: column; gap: .4rem; box-shadow: var(--shadow);
}
.path li::before { content: "Stage " counter(s); font: 500 .75rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* ---------- studio ---------- */
.track-scroll { overflow-x: auto; padding-bottom: 6px; }
.track { min-width: 760px; display: grid; grid-template-columns: 104px repeat(8, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.rowlab { font: 500 .75rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; }
.step-btn {
  box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: .65rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 84px; text-align: left; font: inherit; color: var(--ink);
}
.step-btn:hover { border-color: var(--accent); }
.step-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--build-bg); }
.step-btn .t { font: 700 .92rem/1.2 var(--font-display); }
.cell {
  border-radius: 8px; display: grid; place-items: center; font: 500 .75rem var(--font-mono); letter-spacing: .03em;
  text-transform: uppercase; min-height: 34px; text-align: center; padding: 4px;
}
.cell.tutor { background: var(--tutor-bg); color: var(--tutor); }
.cell.build { background: var(--build-bg); color: var(--build); }
.cell.own { background: var(--own-bg); color: var(--own); }
.cell.none { color: var(--muted); background: transparent; border: 1px dashed var(--line); }
.cell.on { outline: 2px solid var(--ink); }
.panel { margin-top: 1.4rem; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.5rem; max-width: none; }
@media (max-width: 820px) { .panel { grid-template-columns: minmax(0, 1fr); } }
.panel .big { font: 800 clamp(3rem, 8vw, 5rem)/1 var(--font-display); color: var(--accent); }
.facts { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.facts li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .65rem; padding-block: .65rem; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
@media (max-width: 560px) { .facts li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tables and disclosures ---------- */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: none; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 38rem; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 500 .78rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface2); }
tbody th { font-weight: 700; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
.disclosures { max-width: 52rem; }
details { border-top: 1px solid var(--line); padding-block: 4px; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: .85rem; font: 700 1.08rem var(--font-display); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font: 500 1.2rem var(--font-mono); color: var(--accent); width: 20px; }
details[open] summary::before { content: "\2212"; }
details p { padding: 0 0 1rem 2.1rem; max-width: 64ch; color: var(--muted); }

/* ---------- tools (shown by JavaScript only) ---------- */
label { display: block; font-weight: 700; margin-bottom: .35rem; }
textarea, input[type=text], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 10px; padding: .6rem .75rem; min-height: 46px;
}
textarea { min-height: 84px; resize: vertical; }
.field { display: grid; gap: 4px; }
.spec { display: grid; gap: 1.1rem; align-content: start; }
.tool .grid { align-items: start; gap: 2rem; }
.tool .preview { position: sticky; top: 6rem; }
@media (max-width: 860px) { .tool .preview { position: static; } }
.tool .actions { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font: 700 .98rem var(--font-body); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:hover { border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.meter { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.alt .meter { background: var(--bg); }
.meter i { display: block; height: 100%; background: var(--accent); width: 0; }
.meter i.p1 { width: 20%; } .meter i.p2 { width: 40%; } .meter i.p3 { width: 60%; } .meter i.p4 { width: 80%; } .meter i.p5 { width: 100%; }
pre.brief {
  white-space: pre-wrap; word-break: break-word; font: 400 .92rem/1.5 var(--font-mono); background: var(--surface);
  border: 1px dashed var(--line); border-radius: 12px; padding: 1rem; margin: 0;
}
.tool { max-width: none; }
.sr-copy { position: absolute; left: -9999px; top: 0; }
.emailbox {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem;
}
.pick { user-select: all; -webkit-user-select: all; font-family: var(--font-mono); font-size: 1rem; word-break: break-all; }

/* ---------- home hero ---------- */
.hero {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; border-bottom: 1px solid var(--line); padding-block: 3rem 3.5rem;
  margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter-r));
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
/* On screen the hero is always a dark scene, whatever the page theme: a still of the 3D tour
   (static/hero-poster.jpg, loaded as a plain image, no script) under a veil that keeps text readable.
   The scene then comes alive behind it. Print keeps the plain light page. */
@media screen {
  .hero {
    --bg: #0C1A15; --surface: #13251E; --surface2: #1A3027; --ink: #E9F0EB; --muted: #A3B6AD; --line: #2A4238;
    --accent: #8EA9FF; --accent-ink: #0C1A15; --focus: #F6C927;
    --tutor: #4FD1BC; --tutor-bg: #123C35; --build: #8EA9FF; --build-bg: #1B2B57; --own: #F4A55C; --own-bg: #4A2E14;
    color: var(--ink);
    background-color: #0A1612;
    position: relative; isolation: isolate; overflow: hidden;
    background-image: url("/hero-poster.jpg");
    background-size: cover; background-position: 70% center; background-repeat: no-repeat;
  }
  /* the veil sits above the still and the live canvas, below the text */
  .hero::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .6s;
    background: linear-gradient(90deg, rgba(10, 22, 18, .94) 0%, rgba(10, 22, 18, .86) 38%, rgba(10, 22, 18, .5) 55%, rgba(10, 22, 18, .1) 75%, rgba(10, 22, 18, 0) 100%);
  }
  .hero .wrap { position: relative; z-index: 2; }
}
@media screen and (max-width: 860px) {
  /* narrow screens: text on top, the scene shows in its own band underneath */
  .hero { background-image: none; padding-block: 1.75rem 0; display: block; min-height: 0; }
  .hero::before { display: none; }
  .hero::after {
    content: ""; display: block; height: 13rem; margin: 1.75rem calc(-1 * var(--gutter)) 0;
    background: #0A1612 url("/hero-poster.jpg") 70% 40% / cover no-repeat;
  }
  .hero h1 { font-size: clamp(2rem, 9.5vw, 2.6rem); }
  .hero .lede { font-size: 1.05rem; }
}
@media (min-width: 861px) { .hero { min-height: min(74vh, 38rem); display: flex; align-items: center; } }
.hero .wrap { width: 100%; }
.hero-copy { max-width: 43rem; }
.hero-copy .mono { margin-bottom: .9rem; }
.hero .lede { margin-top: 1.1rem; }
.hero .actions { margin-top: 1.5rem; }
/* live scene: fades in over the still once the first frame is drawn */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: 0; transition: opacity 1s; touch-action: pan-y; }
.hero-canvas.ready { opacity: 1; }
@media (max-width: 860px) { .hero-canvas { inset: auto 0 0 0; height: 13rem; } }
/* guided tour, in place: the headline shrinks, the veil lifts, the scene fills the hero */
.hero { transition: min-height .5s; }
.hero.touring { scroll-margin-top: 4.75rem; min-height: clamp(560px, calc(100vh - 6rem), 860px); align-items: flex-start; }
.hero.touring::before { opacity: 0; }
.hero.touring::after { display: none; }
.hero.touring .hero-canvas { inset: 0; height: 100%; cursor: grab; }
.hero.touring .wrap { pointer-events: none; padding-top: 1.25rem; }
.hero.touring .hero-copy { max-width: 34ch; }
.hero.touring .hero-copy > :not(h1) { display: none; }
.hero.touring h1 { font-size: 1.05rem; letter-spacing: 0; font-weight: 700; text-shadow: 0 1px 8px #0A1612; }
.hero.touring .hl { background: none; color: inherit; padding: 0; }
.hero:focus { outline: none; }

/* ---------- closing call to action ---------- */
.cta-band { background: #10251E; color: #E9F0EB; margin-top: 0; padding-block: 3rem; }
@media screen {
  .cta-band { --ink: #E9F0EB; --muted: #A3B6AD; --accent: #8EA9FF; --accent-ink: #0C1A15; --focus: #F6C927; border-top: 1px solid #2A4238; }
}
.cta-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; }
.cta-in h2 { color: #fff; margin-bottom: .5rem; }
.cta-in p { max-width: 52ch; color: #C9D6CE; }
.cta-actions { flex: 0 1 auto; min-width: 0; max-width: 100%; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; color: var(--muted); font-size: .95rem; }
footer.site .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; }
@media (max-width: 760px) { footer.site .wrap { grid-template-columns: minmax(0, 1fr); } }
footer.site strong { color: var(--ink); }
footer.site .foot-title { font-family: var(--font-display); font-size: 1.1rem; }
footer a { color: var(--ink); }
footer ul { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .1rem; }
footer .foot-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
footer .foot-pages a { display: inline-block; padding-block: .35rem; }
footer p { margin-top: .5rem; }
.lang-links:empty { display: none; }

/* ---------- the 3D tour controls: always a dark world, independent of the page theme. Built by tour.js. ---------- */
.hintbar {
  position: absolute; right: max(1rem, env(safe-area-inset-right, 0px)); top: 4rem; margin: 0; max-width: 34ch; text-align: right;
  font: 500 .7rem/1.4 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: rgba(233, 240, 235, .62); pointer-events: none;
}
.ui { position: absolute; inset: 0; z-index: 3; padding-block: clamp(1.4rem, 4vw, 3rem); padding-left: var(--gutter); padding-right: var(--gutter-r); pointer-events: none; }
.ui-in { max-width: 70rem; margin: 0 auto; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1rem; min-width: 0; }
.ui-in button, .ui-in a, .tcard { pointer-events: auto; }
.tourbar { display: grid; grid-template-columns: minmax(0, 470px) auto; justify-content: space-between; align-items: end; gap: 1rem; }
.tcard {
  background: rgba(10, 22, 18, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 1.1rem 1.25rem; display: grid; gap: .5rem;
}
.tcard .mono { color: rgba(233, 240, 235, .7); }
.tcard .tt { font: 800 1.7rem/1.1 var(--font-display); color: #fff; }
.tcard p { margin: 0; color: #E9F0EB; }
.tcard .row { display: flex; flex-wrap: wrap; gap: .5rem .65rem; align-items: center; font-size: .92rem; }
.tcard .pill.tutor, .tcard .pill.build, .tcard .pill.own { color: #10251E; }
.tcard .pill.tutor { background: #35D0B5; } .tcard .pill.build { background: #7C9CFF; } .tcard .pill.own { background: #F4A55C; }
.linkbtn {
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; color: #9DB4FF; font: 700 1rem var(--font-body);
  text-decoration: underline; text-underline-offset: .2em; background: none; border: 0; padding: 0;
}
.tright { display: grid; gap: .75rem; justify-items: end; }
.tctl { display: flex; gap: .5rem; }
.rbtn {
  min-width: 46px; min-height: 46px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .45);
  background: rgba(10, 22, 18, .78); color: #fff; font: 700 1.3rem/1 var(--font-body); cursor: pointer; padding: 0 .9rem;
}
.rbtn.wide { font-size: .95rem; padding: 0 1.1rem; }
.rbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.rbtn:disabled { opacity: .35; cursor: default; }
.rbtn[aria-pressed="true"] { background: #F6C927; color: #10251E; border-color: #F6C927; }
.hero.touring :focus-visible { outline: 3px solid #F6C927; outline-offset: 2px; }
.dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.dot { width: 24px; height: 44px; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.dot i { display: block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .35); transition: transform .3s, background .3s; }
.dot[aria-current="true"] i { background: #F6C927; transform: scale(1.5); }
.dot.done i { background: rgba(246, 201, 39, .65); }
.stage-close { position: absolute; top: .9rem; right: var(--gutter-r); pointer-events: auto; z-index: 4; }
@media (max-width: 720px) {
  .tourbar { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .tright { justify-items: stretch; }
  .tctl { justify-content: space-between; }
  .dots { justify-content: center; }
  .hintbar { display: none; }
  .tcard .tt { font-size: 1.4rem; }
}


/* ---------- motion and polish (all of it switches off for reduced motion; the pages read fine without it) ---------- */
.btn { transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background-color .18s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn .ic { transition: transform .2s ease; }
.btn:hover .ic { transform: translateX(3px); }
.card, .feature, .stat, .rung, .path li { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.card:hover, .feature:hover, .path li:hover, .rung:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .5); }
.icon-btn { transition: transform .15s ease, background-color .15s ease; }
.icon-btn:active { transform: scale(.92); }
.nav a { transition: color .15s ease, background-color .15s ease; }
summary { transition: color .15s ease; }
summary:hover { color: var(--accent); }
.step-btn { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.step-btn:hover { transform: translateY(-2px); }
.step-btn:active { transform: scale(.97); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero-copy > *, .page-head .head > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2), .page-head .head > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3), .page-head .head > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4), .page-head .head > :nth-child(4) { animation-delay: .24s; }

html.js-reveal .rv { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
html.js-reveal .rv.in { opacity: 1; transform: none; }

.page-head { position: relative; overflow: hidden; }
.page-head .wrap { position: relative; z-index: 1; }
.art { position: absolute; right: max(2rem, 6vw); top: 50%; width: clamp(150px, 20vw, 250px); aspect-ratio: 1; transform: translateY(-50%); color: var(--accent); pointer-events: none; display: none; }
@media (min-width: 900px) { .art { display: block; } }
.art .ic { width: 100%; height: 100%; stroke-width: .7; opacity: .35; animation: floaty 7s ease-in-out infinite; }
.art i { position: absolute; border-radius: 50%; background: var(--mark); opacity: .55; }
.art .d1 { width: 12px; height: 12px; top: 6%; left: 12%; animation: floaty 5s ease-in-out infinite; }
.art .d2 { width: 8px; height: 8px; bottom: 14%; right: 4%; animation: floaty 6s ease-in-out -2s infinite; }
.art .d3 { width: 16px; height: 16px; bottom: 4%; left: 28%; background: var(--accent); opacity: .3; animation: floaty 8s ease-in-out -4s infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
header.site { transition: box-shadow .2s ease; }
header.site.scrolled { box-shadow: 0 6px 24px -14px rgba(0, 0, 0, .6); }
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.to-top {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 50;
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .55); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { filter: brightness(1.1); }
.to-top .ic { width: 22px; height: 22px; }
.to-top[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .progress, .to-top { display: none; }
  html.js-reveal .rv { opacity: 1; transform: none; }
}

/* ---------- print: paper first. Plain black on white, links shown, no navigation or tools. ---------- */
/* ---------- phones: stacked tables, roomier studio track ---------- */
@media (max-width: 640px) {
  .track { min-width: 900px; grid-template-columns: 92px repeat(8, minmax(0, 1fr)); }
  .track .rowlab { position: sticky; left: 0; background: var(--bg); z-index: 1; }
  .step-btn .t { overflow-wrap: normal; hyphens: none; }
  .tw { overflow: visible; }
  table { min-width: 0; }
  table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, th, td { display: block; width: 100%; box-sizing: border-box; }
  tbody tr { padding: .35rem 0; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  tbody th { border: 0; padding: .7rem .95rem .15rem; font-size: 1.02rem; }
  tbody td { border: 0; padding: .3rem .95rem; }
  tbody td[data-label]::before { content: attr(data-label); display: block; font: 500 .75rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface2: #fff; --ink: #000; --muted: #333; --accent: #000; --line: #999; --tutor-bg: #fff; --build-bg: #fff; --own-bg: #fff; --tutor: #000; --build: #000; --own: #000; --grid: transparent; --shadow: none; }
  body { font-size: 12pt; padding: 0; }
  header.site, .skip, .draft, .lang-links, .actions, .tool, #startTour, .btn, .icon-btn, .cta-band, .page-head::before, .art { display: none !important; }
  .page-head { background: none; border: 0; }
  .hero { background: none; padding-block: 0 1rem; min-height: 0; display: block; }
  .hero-canvas, .hero::before, .hero::after, .ui, .journey li::before { display: none !important; }
  .hero .wrap { display: block; }
  .wrap, .bar { max-width: none; }
  section.block.alt { background: none; box-shadow: none; clip-path: none; }
  .stat, .card, .feature, .route, .rung, .path li, .stats { border: 1px solid #000; box-shadow: none; }
  .ic-wrap { display: none; }
  .block a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  h2, h3 { break-after: avoid; }
  tr, .note, .card, .feature, details { break-inside: avoid; }
  details > :not(summary) { display: block; }
  footer.site { border: 0; margin-top: 1rem; }
  .tw { overflow: visible; }
  table { min-width: 0; }
  html.js-reveal .rv { opacity: 1 !important; transform: none !important; }
  .progress, .to-top { display: none !important; }
  .journey { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

a, button, summary, .btn, .step-btn { touch-action: manipulation; }
