/* Robots’ Last Exam — redesigned homepage (desktop-first).
   A pinned full-viewport stage: footage changes as you scroll, text sits on a hairline grid. */

@font-face { font-family: "Newsreader"; src: url("/assets/fonts/Newsreader-latin-var.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-latin-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono-latin-var.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --ink: #1d1d1f;
  --paper: #ffffff;
  --cream: #f5f5f7;
  --panel: #1d1d1f;
  --brass: #2997ff; --night: #000000; --accent: #0071e3;

  --rail: 78px;                 /* x of the left vertical line */
  --top: 76px;                  /* y of the top horizontal line */
  --base: max(71vh, 500px);     /* y of the line the headlines stand on */
  --right: 14.4vw;              /* distance of the right vertical line from the right edge */
  --pad: 32px;
  --panel-w: 39vw;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  /* Headlines follow Apple's typography: the system San Francisco face where the device has it
     (it may not be bundled with a website), Inter everywhere else, set semibold and tight. */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fg: var(--cream);           /* stage furniture: always over footage */
  --line: color-mix(in srgb, var(--fg) 30%, transparent);
  --top-fg: var(--cream);       /* fixed top band: follows the surface underneath */
}
html[data-top="ink"] { --top-fg: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; overflow-anchor: none; }   /* home-twoway.js keeps the screen still itself */
body { margin: 0; background: var(--night); color: var(--cream); font: 400 15.4px/1.32 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--cream); color: var(--ink); border-radius: 4px; }
.skip:focus { top: 12px; }

/* ---------- shared type ---------- */
.display { font: 600 clamp(44px, 5vw, 88px)/1.05 var(--display); letter-spacing: -0.022em; }
.display--sm { font-size: clamp(36px, 3.7vw, 64px); }
.lede { font: 400 clamp(18px, 1.6vw, 26px)/1.19 var(--display); letter-spacing: -0.008em; }
.eyebrow, .chip, .topbar nav a, .chapters button, .progress, .counter, .facts dt {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.19em;
}
.eyebrow { font-size: 13px; font-weight: 500; opacity: 0.86; }
.chip { display: inline-block; justify-self: start; padding: 6px 8px 5px; border-radius: 3px; font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: color-mix(in srgb, currentColor 15%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.body { max-width: 430px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 16px; border-radius: 4px; background: var(--ink); color: #f5f5f7; font: 500 15px/1.25 var(--sans); white-space: nowrap; transition: background .25s, color .25s, box-shadow .25s; }
.btn .arr { flex: none; font: 1em/1 var(--sans); }
.btn:hover { background: #161617; }
.btn--ghost { background: color-mix(in srgb, var(--ink) 28%, transparent); color: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 38%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--ghost:hover { background: color-mix(in srgb, var(--ink) 55%, transparent); }

/* ---------- fixed top band: mark, navigation, call to action ---------- */
.band { position: fixed; top: 0; left: 0; right: 0; z-index: 35; height: var(--top); border-bottom: 1px solid color-mix(in srgb, var(--top-fg) 30%, transparent); pointer-events: none; transition: background .35s, border-color .35s; }
html[data-band="paper"] .band { background: var(--paper); }
html[data-band="ink"] .band { background: var(--night); }
.mark { position: fixed; left: 0; top: 0; z-index: 40; display: grid; place-items: center; width: var(--rail); height: var(--top); border-right: 1px solid color-mix(in srgb, var(--top-fg) 30%, transparent); color: var(--top-fg); font: 600 16px/1 var(--display); letter-spacing: -0.01em; letter-spacing: -0.02em; transition: color .35s, border-color .35s; }
.topbar { position: fixed; top: 0; right: 0; left: var(--rail); z-index: 40; display: flex; align-items: center; justify-content: flex-end; gap: 34px; height: var(--top); padding: 0 29px 0 var(--pad); color: var(--top-fg); transition: color .35s; }
.topbar nav { display: flex; gap: 30px; }
.topbar nav a { position: relative; padding: 6px 0; font-size: 10.5px; font-weight: 500; }
.topbar nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.topbar nav a:hover::after, .topbar nav a:focus-visible::after { transform: scaleX(1); }
.topbar .btn { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }

/* ---------- stage furniture: hairline grid, chapter ticks, progress (scrolls away with the film) ---------- */
.grid { position: absolute; inset: 0; z-index: 3; pointer-events: none; color: var(--fg); }
.grid i { position: absolute; background: var(--line); transition: opacity .45s, right .45s; }
.grid .v1 { left: var(--rail); top: 0; bottom: 0; width: 1px; }
.grid .v2 { right: var(--right); top: var(--top); bottom: 0; width: 1px; }
.grid .h2 { top: var(--base); left: 0; right: 0; height: 1px; }
.spark { position: absolute; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; fill: currentColor; transition: opacity .45s; }
.spark.s1 { left: var(--rail); top: var(--base); }
.spark.s2 { left: calc(100% - var(--right)); top: var(--base); }
html[data-layout="split"] .grid .v2, html[data-layout="split"] .spark.s2 { opacity: 0; }
html[data-layout="split"] .grid .h2 { right: var(--panel-w); }

.chapters { position: absolute; left: var(--rail); top: 104px; z-index: 4; color: var(--fg); }
.chapters button { display: flex; align-items: center; gap: 12px; height: 26px; font-size: 10px; font-weight: 500; }
.chapters button::before { content: ""; width: 9px; height: 1px; background: currentColor; opacity: .75; transition: width .35s cubic-bezier(.2, .7, .2, 1), opacity .35s; }
.chapters button span { opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.chapters button:hover span, .chapters button:focus-visible span { opacity: .8; transform: none; }
.chapters button[aria-current="true"]::before { width: 22px; opacity: 1; }
.chapters button[aria-current="true"] span { opacity: 1; transform: none; }
.progress { position: absolute; left: 0; bottom: 20px; z-index: 4; width: var(--rail); text-align: center; color: var(--fg); font-size: 9.5px; font-weight: 500; letter-spacing: .12em; opacity: .8; }

/* ---------- the pinned stage ---------- */
.film { position: relative; height: 215vh; }   /* real height is set by home-redesign.js */
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--night); color: var(--cream); }
.stage-media, .steps { position: absolute; inset: 0; }
.steps { z-index: 2; }
.shade { z-index: 1; }

.media { position: absolute; inset: 0; opacity: 0; overflow: hidden; background: #000000; transition: opacity .9s ease; }
.media.is-active { opacity: 1; }
.media--split { right: var(--panel-w); }
.media .zoom { position: absolute; inset: 0; transform: scale(var(--z, 1.07)); will-change: transform; }
.media img, .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media img:not([src]) { visibility: hidden; }
.media video { opacity: 0; transition: opacity .7s ease; }
.media video.is-playing { opacity: 1; }

.shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.46) 0, rgba(0,0,0,0) 150px),
    linear-gradient(90deg, rgba(0,0,0,.62) 0, rgba(0,0,0,.34) 34%, rgba(0,0,0,0) 66%),
    linear-gradient(0deg, rgba(0,0,0,.66) 0, rgba(0,0,0,.22) 32%, rgba(0,0,0,0) 56%); }

.step { position: absolute; inset: 0; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .45s ease, visibility 0s linear .45s; }
.step.is-active { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .6s ease .12s, visibility 0s; }
.step .rise { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.step.is-active .rise { opacity: 1; transform: none; transition: opacity .9s cubic-bezier(.2, .7, .2, 1) calc(.2s + var(--i, 0) * .09s), transform 1.1s cubic-bezier(.2, .7, .2, 1) calc(.2s + var(--i, 0) * .09s); }
.step .rise:nth-child(2) { --i: 1; }
.step .rise:nth-child(3) { --i: 2; }
.step .rise:nth-child(4) { --i: 3; }
.step > .step-foot.rise { --i: 3; }

.step-head { position: absolute; left: calc(var(--rail) + var(--pad)); right: calc(var(--right) + var(--pad)); bottom: calc(100% - var(--base) + 30px); }
.step-head .eyebrow { margin-bottom: 20px; }
.step-head .lede { margin-top: 20px; }
.step-head .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 46px; }
.step-foot { position: absolute; left: calc(var(--rail) + var(--pad) + 6px); right: calc(var(--right) + var(--pad)); top: calc(var(--base) + 36px); display: grid; grid-template-columns: 195px minmax(0, 1fr); align-items: start; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 44px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 9.5px; font-weight: 500; opacity: .7; }
.facts dd { margin: 7px 0 0; font: 600 19px/1.1 var(--display); letter-spacing: -0.014em; }

.counter { position: absolute; z-index: 4; right: calc(var(--right) + 20px); top: calc(var(--base) + 14px); font-size: 10px; font-weight: 500; opacity: .86; }
html[data-layout="split"] .counter { opacity: 0; }

/* ---------- list steps: footage on the left, ruler panel on the right ---------- */
.step--split .step-head, .step--split .step-foot { right: calc(var(--panel-w) + var(--pad)); }
.panel { position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel-w); display: flex; flex-direction: column; padding: calc(var(--top) + 44px) 0 34px; background: var(--panel); color: var(--cream); }
.panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--cream) 34%, transparent); }
.panel > .eyebrow, .panel-title, .panel-note { padding: 0 40px; }
.panel-title { margin-top: 16px; font: 600 clamp(28px, 2.6vw, 44px)/1.07 var(--display); letter-spacing: -0.02em; }
.panel-note { margin-top: 14px; max-width: 34em; font-size: 14px; opacity: .78; }
.ruler { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); margin-top: 30px; max-height: calc(var(--n, 12) * 36px); }
.ruler li { position: relative; display: flex; min-height: 0; }
.ruler li::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; height: 1px; background: currentColor; opacity: .55; transition: width .4s cubic-bezier(.2, .7, .2, 1), opacity .3s, background .3s; }
.ruler li.is-current::before { width: 34px; opacity: 1; background: var(--brass); }
.ruler li.is-current::after { content: attr(data-pct); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); color: var(--cream); font: italic 500 9.5px/1 var(--mono); letter-spacing: .06em; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.ruler button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 0 10px; width: 100%; padding: 0 40px 0 50px; text-align: left; opacity: .6; transition: opacity .3s, transform .4s cubic-bezier(.2, .7, .2, 1); }
.ruler button:hover, .ruler button:focus-visible { opacity: .95; }
.ruler li.is-current button { opacity: 1; transform: translateX(8px); }
.ruler .n { font: 500 9.5px/1 var(--mono); letter-spacing: .12em; opacity: .7; }
.ruler .t { overflow: hidden; font-size: 14.6px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.ruler .g { font: 500 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .6; white-space: nowrap; }
.ruler li.is-current .t { font: 600 17px/1.15 var(--display); letter-spacing: -0.012em; }

/* ---------- film dialog ---------- */
.film-dialog { width: min(1180px, 92vw); max-width: none; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000000; color: var(--cream); box-shadow: 0 40px 120px rgba(0,0,0,.6); }
.film-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }
.film-dialog-top { display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 18px; }
.film-dialog-top h2 { flex: 1; min-width: 0; overflow: hidden; font: 600 18px/1.15 var(--display); letter-spacing: -0.012em; text-overflow: ellipsis; white-space: nowrap; }
.film-dialog video { display: block; width: 100%; max-height: 78vh; background: #000000; }

@media (max-height: 760px) {
  .step:not(.step--split) .step-head .eyebrow { display: none; }
  .step-head .actions { margin-top: 34px; }
}

/* ---------- small windows: keep it usable, not polished ---------- */
@media (max-width: 900px) {
  :root { --rail: 44px; --top: 60px; --right: 0px; --pad: 18px; --panel-w: 100vw; }
  .topbar nav, .chapters, .progress, .grid .v2, .spark.s2, .counter { display: none; }
  .mark { font-size: 15px; }
  .step-foot { grid-template-columns: 1fr; gap: 12px; }
  .media--split { right: 0; bottom: 46vh; }
  .step--split .step-head, .step--split .step-foot { display: none; }
  .panel { top: 54vh; padding-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .media .zoom { transform: none !important; }
  .media, .media video, .step, .step .rise, .spark, .grid i, .band { transition-duration: .01s !important; transition-delay: 0s !important; }
  .step .rise { transform: none; }
}

/* RLE-MARK:BEGIN (generated by scripts/homepage/make_rle_mark.py) */
/* The mark is the impossible triangle; the letters stay in the markup for assistive technology. */
.mark, .rle-shell .mark { font-size: 0 !important; letter-spacing: 0; }
.mark::before { content: ""; position: absolute; inset: 0; margin: auto; display: block; width: 34px; height: 34px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 9.52 9.52%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%220.26%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M0.76 0.863L8.76 0.863L9.26 1.729L8.26 1.729L5.26 6.925L4.76 6.059L7.26 1.729L1.26 1.729Z%22/%3E%3Cpath d=%22M9.26 1.729L5.26 8.657L4.26 8.657L4.76 7.791L1.76 2.595L2.76 2.595L5.26 6.925L8.26 1.729Z%22/%3E%3Cpath d=%22M4.26 8.657L0.26 1.729L0.76 0.863L1.26 1.729L7.26 1.729L6.76 2.595L1.76 2.595L4.76 7.791Z%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 9.52 9.52%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%220.26%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M0.76 0.863L8.76 0.863L9.26 1.729L8.26 1.729L5.26 6.925L4.76 6.059L7.26 1.729L1.26 1.729Z%22/%3E%3Cpath d=%22M9.26 1.729L5.26 8.657L4.26 8.657L4.76 7.791L1.76 2.595L2.76 2.595L5.26 6.925L8.26 1.729Z%22/%3E%3Cpath d=%22M4.26 8.657L0.26 1.729L0.76 0.863L1.26 1.729L7.26 1.729L6.76 2.595L1.76 2.595L4.76 7.791Z%22/%3E%3C/svg%3E") center / contain no-repeat; transform-origin: 50.00% 39.39%; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.mark:hover::before, .mark:focus-visible::before { transform: rotate(120deg); }
@media (max-width: 900px) { .mark::before { width: 26px; height: 26px; } }
@media (prefers-reduced-motion: reduce) { .mark::before { transition: none; } .mark:hover::before, .mark:focus-visible::before { transform: none; } }
/* RLE-MARK:END */
