/* The home page, on top of the site's style.css, which gives it the theme: fonts, colours, nav, buttons and
   footer. The film is its surface, so no grain over it. */
body::after { content: none; }
:root { --words-left: max(40px, calc((100vw - var(--max)) / 2 + 40px)); }

/* The pointer is the system's own, as an arrow flight.js draws in the page's colours, so it never lags; it
   lights up over what can be clicked, and words take the text cursor, as anywhere on the web. It is hidden
   until the mouse moves (.fresh), and while the flight plays by itself and the visitor rests (.auto.rest). */
html { cursor: var(--cur, default); }
a, button, summary { cursor: var(--cur-link, pointer); }
html.fresh, html.fresh *, html.auto.rest, html.auto.rest * { cursor: none !important; }
.words :is(h1, h2, h3, p, li, figcaption, pre), .tail :is(h2, h3, p, li, code) { cursor: text; }
.js .place.shown .words :is(h1, h2, h3, p, li) { pointer-events: auto; }

/* Navigation: over the film, solid once the page's end scrolls under it (.scrolled). While the flight plays by
   itself and the visitor rests, the nav keeps the brand and the GitHub pill alone, and the rail goes. */
.nav nav a { transition: color 0.15s, opacity 0.6s, visibility 0.6s; }
html.auto.rest .nav nav a:not(.nav-gh), html.auto.rest .rail { opacity: 0; visibility: hidden; }
.nav nav a.active { color: #fff; }
.nav nav a.active:not(.nav-gh) { text-shadow: 0 0 18px rgba(243, 180, 140, 0.6); }

/* The flight fills the window behind everything, its poster frame 0 until the video plays; a little larger than
   the window (flight.js ZOOM), for the look round to move it. */
.film { position: fixed; inset: 0; z-index: 0; background: var(--bg); overflow: hidden; }
.film video, .film .sway { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04); will-change: transform; }
/* The film rocking at rest, drawn from frames kept as it played them (flight.js sway). */
.film .sway[hidden] { display: none; }
/* Words read on the left: the picture darkens there, never across the whole frame. */
.shade {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(10, 11, 13, 0.72) 0%, rgba(10, 11, 13, 0.38) 34%, rgba(10, 11, 13, 0) 60%);
    opacity: var(--shade, 1);
}

/* The page's end darkens the film under it, deeper as there is more to read. */
.veil { position: absolute; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; will-change: opacity; }

/* The places' words: fixed over the film, shown by the script as the camera passes. */
main { position: relative; z-index: 5; }
.js .place { position: fixed; left: 0; bottom: 0; top: 0; width: 100%; display: flex; align-items: center; pointer-events: none; opacity: 0; visibility: hidden; }
.js .place.shown { visibility: visible; }
.js .place a { pointer-events: auto; }
.words {
    width: min(520px, calc(100vw - 80px));
    margin-left: var(--words-left);
    text-shadow: 0 1px 18px rgba(10, 11, 13, 0.75);
    will-change: transform, opacity;
}
.hero .words { margin-top: 18vh; }
.hero h1 { font-size: clamp(2.8rem, 6.4vw, 5.6rem); line-height: 0.98; font-weight: 800; max-width: 14ch; margin: 0 0 22px; }
/* The shine on "not engines." (style.css's shimmer). A text-shadow paints over text-clipped backgrounds; a filter
   goes behind. */
.hero h1 em { font-style: normal; text-shadow: none; filter: drop-shadow(0 1px 14px rgba(10, 11, 13, 0.7)); background: linear-gradient(90deg, #d9784f, var(--accent-hot) 25%, #fff1dc 50%, var(--accent-hot) 75%, #d9784f); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s ease-in-out infinite; }
.hero .lead { color: rgba(243, 238, 231, 0.84); font-size: 1.15rem; max-width: 560px; margin: 0 0 30px; }
.words h3 { font-size: clamp(2.3rem, 4vw, 3.4rem); line-height: 1; font-weight: 800; margin-bottom: 16px; }
.words p { color: rgba(243, 238, 231, 0.86); font-size: 1.12rem; line-height: 1.55; margin: 0 0 22px; max-width: 36ch; }
.words h2 { font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 0.98; font-weight: 800; margin-bottom: 18px; }
.button.glass { background: rgba(255, 255, 255, 0.12); }
/* A mouse, its wheel rolling down: at the hero's foot, in the middle of the page (the words' column starts at
   --words-left; --bar is the scrollbar, set by flight.js). */
.hint { margin: 34px 0 0; height: 38px; }
/* Only a picture: a click on it is a click on the film. */
.js .place.shown .words p.hint { pointer-events: none; }
/* It comes and goes with the autoplay's indicator: shown while the visitor moves, faded at rest. */
.hint i { display: block; left: calc((100vw - var(--bar, 0px)) / 2 - var(--words-left) - 13px); position: relative; width: 26px; height: 38px; border: 2px solid rgba(243, 238, 231, 0.7); border-radius: 13px; filter: drop-shadow(0 1px 8px rgba(10, 11, 13, 0.6)); transition: opacity 0.6s, visibility 0.6s; }
.hint i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { transform: none; opacity: 1; } 70%, 100% { transform: translateY(11px); opacity: 0; } }
html.rest .hint i { opacity: 0; visibility: hidden; }

/* The autoplay's indicator, under the rail: Playing or Paused; a click on it, or on the film, plays or pauses. */
.autoplay { position: fixed; right: 26px; bottom: 26px; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; color: rgba(243, 238, 231, 0.55); font: 500 0.74rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(10, 11, 13, 0.8); transition: color 0.2s, opacity 0.6s, visibility 0.6s; }
.autoplay[hidden] { display: none; }
/* Shown while the visitor moves, as a video's controls are. */
html.rest .autoplay:not(:focus-visible) { opacity: 0; visibility: hidden; }
.autoplay:hover, .autoplay:focus-visible { color: var(--text); }
.autoplay i { width: 9px; height: 10px; box-sizing: border-box; border: solid var(--accent); border-width: 0 3px; }
.autoplay[aria-pressed="true"] i { border: 0; background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* Where on the way the camera is: each place's line fills as the camera passes it. */
.rail { position: fixed; right: 34px; top: 50%; transform: translateY(-50%); z-index: 10; display: flex; flex-direction: column; gap: 9px; transition: opacity 0.6s, visibility 0.6s; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: rgba(243, 238, 231, 0.55); font: 500 0.66rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(10, 11, 13, 0.8); transition: color 0.2s; }
.rail a i { position: relative; width: 34px; height: 2px; background: rgba(243, 238, 231, 0.22); overflow: hidden; }
.rail a i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--fill, 0)); }
.rail a.on { color: var(--text); }

/* The page's length is the flight's: the scroll it takes to fly it. */
.track { height: 0; }
.js .track { height: 760vh; }

@media (max-width: 760px) {
    .nav { padding: 12px 18px; }
    .rail { display: none; }
    :root { --words-left: 22px; }
    .words { width: calc(100vw - 70px); }
    .shade { background: linear-gradient(0deg, rgba(10, 11, 13, 0.75), rgba(10, 11, 13, 0.2) 60%); }
    .hero .words { margin-top: 30vh; }
}

/* Chapters: 01 Features and the rest, the number ruled off from the name. */
.chapter { display: inline-block; margin-right: 12px; padding-right: 12px; border-right: 1px solid rgba(232, 135, 92, 0.45); color: var(--text); font: 500 0.78rem var(--mono); }

/* Wide places: words beside a code window, clear of the rail, whose labels end about 210px from the right. */
.words.wide { width: min(1080px, calc(100vw - var(--words-left) - 210px)); }
.words.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 44px; align-items: center; }
.js .place .words.split, .js .place .words.wide { pointer-events: auto; }

.code-window { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); background: rgba(13, 14, 17, 0.88); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); text-shadow: none; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 236, 220, 0.08); }
.window-bar > i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 236, 220, 0.16); }
.window-bar .tabs { margin-left: 12px; display: flex; gap: 4px; }
.window-bar button { font: 0.8rem var(--mono); color: var(--muted); background: none; border: 0; padding: 4px 10px; border-radius: 6px; }
.window-bar button[aria-selected="true"] { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.code-window pre { margin: 0; padding: 16px 18px; font: 0.8rem/1.6 var(--mono); color: #d8d2ca; overflow: auto; max-height: 52vh; }
.code-window .k { color: #e8875c; } .code-window .t { color: #f3cf9a; } .code-window .f { color: #9fc9e8; }
.code-window .n { color: #c5a3f0; } .code-window .s { color: #a8d49a; } .code-window .c { color: #7c766f; }

@media (max-width: 1000px) {
    .words.split { grid-template-columns: 1fr; }
    .words.split .code-window { display: none; }
}

/* ---- The page's end: the download, the license and the footer, lying in the page over the film's last frames.
   Kept clear of the rail on the right. */
.tail { position: relative; z-index: 5; }
.heading { margin-bottom: 44px; max-width: 720px; }
.heading.center { margin-left: auto; margin-right: auto; text-align: center; }
.heading h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.02; font-weight: 800; }
.heading p { color: var(--muted); font-size: 1.08rem; margin: 16px 0 0; }
.tail .heading { text-shadow: 0 1px 16px rgba(10, 11, 13, 0.9); }
.link { font-weight: 600; display: inline-flex; gap: 6px; }
.link span { transition: transform 0.15s; }
.link:hover span { transform: translateX(3px); }
a.link:hover { color: var(--accent-hot); }
.dl-note code, .faq code { white-space: nowrap; font: 0.88em var(--mono); color: var(--text); background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 6px; }

/* Download. Its words lie on the film itself, under a light veil, so they take a shadow. The install line for the
   visitor's system, the other a tab away; the three steps; a line of notes. */
#download { padding-top: 34vh; }
.download { max-width: 900px; margin: 0 auto; text-align: center; }
.dl-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(10, 11, 13, 0.55); }
.dl-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 0.92rem var(--font); transition: color 0.2s, background 0.2s; }
.dl-tabs button svg { width: 15px; height: 15px; fill: currentColor; }
.dl-tabs button:hover { color: var(--text); }
.dl-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: var(--text); }
/* The install line: the whole command in a pill, scrolled sideways where the window is narrow, and a button that
   copies it. */
.dl-cmd { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; padding: 7px 7px 7px 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(10, 11, 13, 0.62); text-align: left; }
.dl-cmd code { min-width: 0; color: #e6e1da; font: 0.84rem/1.5 var(--mono); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.dl-cmd code::-webkit-scrollbar { display: none; }
.dl-cmd code::before { content: "$ "; color: var(--accent); }
.ps .dl-cmd code::before { content: "PS> "; }
.dl-cmd button { flex: none; border: 0; border-radius: 999px; padding: 7px 15px; background: rgba(232, 135, 92, 0.14); color: var(--accent-hot); font: 600 0.78rem var(--mono); transition: color 0.2s, background 0.2s; }
.dl-cmd button:hover { color: var(--text); background: rgba(232, 135, 92, 0.26); }
.dl-cmd button.done { color: #3fb950; }
/* The three steps to a game: a light row, each a number, a word and its command, an arrow between each. */
.flow { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 16px 44px; margin: 34px 0 0; padding: 0; }
.flow li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.flow li + li::before { content: "\2192"; position: absolute; left: -30px; bottom: 6px; color: var(--dim); font-size: 1.05rem; }
.flow span { color: var(--muted); font: 500 0.7rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.flow b { margin-right: 6px; color: var(--accent); font-weight: 500; }
.flow code { padding: 7px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); color: #e6e1da; font: 0.84rem/1.5 var(--mono); white-space: nowrap; }
.dl-note { max-width: 640px; margin: 30px auto 0; color: var(--muted); font-size: 0.9rem; text-shadow: 0 1px 12px rgba(10, 11, 13, 0.9); text-wrap: balance; }
.dl-note a { font-weight: 600; }

/* License: plain answers beside the heading. */
/* Half a window below the download, so the download is all there is when the play ends on it. */
#license { padding-top: 55vh; padding-bottom: 150px; }
.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-wrap .heading { margin-bottom: 0; }
.faq-wrap .heading p { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
    list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    padding: 16px 0;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem var(--font); color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { color: var(--muted); margin: 0 0 18px; max-width: 600px; }
.faq-note { color: var(--dim); font-size: 0.85rem; margin: 18px 0 0; }

/* The rail keeps the right edge: the page's end stays clear of it. */
@media (min-width: 761px) {
    .block, footer { max-width: min(var(--max), calc(100vw - 2 * 170px)); }
}

/* As they come into view, the end's parts fade up, and a heading rises a line at a time. */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.split .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .line > span { display: inline-block; transform: translateY(108%); transition: transform 0.55s cubic-bezier(.2, .7, .2, 1); }
.split .line + .line > span { transition-delay: 0.12s; }
.in .split .line > span { transform: none; }

@media (max-width: 960px) {
    #license { padding-top: 110px; }
    .faq-wrap { grid-template-columns: 1fr; gap: 32px; }
}
/* Phones: the steps go down the page, an arrow down between each. */
@media (max-width: 600px) {
    .flow { flex-direction: column; align-items: center; gap: 30px; }
    .flow li + li::before { content: "\2193"; left: 50%; top: -25px; bottom: auto; transform: translateX(-50%); }
}
/* Less motion: nothing rises or rolls, and the headline's shine runs at half the pace - it is a colour, not a move. */
@media (prefers-reduced-motion: reduce) {
    .reveal { transform: none; }
    .split .line > span { transform: none; transition: none; }
    .hint i::after { animation: none; }
    .hero h1 em { animation-duration: 14s; }
}

/* The hot reload's code window: still, in the top right of the picture (flight.js sets --x and --y), its status
   light, its line and the point on the crates in the crates' glow, orange before the reload and blue after, as the
   film's crates are. */
.pin { --glow: #ffa24a; margin: 32px 0 0; width: min(400px, 30vw); }
.pin[data-state="reloaded"] { --glow: #6cb4ff; }
.js .pin { position: fixed; left: 0; top: 0; margin: 0; pointer-events: none; overflow: visible;
    transform: translate(var(--x, -999px), var(--y, -999px)); }
.pin .window-bar .file { margin-left: 12px; font: 0.8rem var(--mono); color: var(--muted); }
.pin pre { font-size: 0.82rem; border-radius: 0; }
.pin .edit { border-radius: 4px; padding: 1px 2px; margin: 0 -2px; transition: background 0.3s; }
.pin:not([data-state="running"]) .edit { background: rgba(255, 236, 220, 0.08); }
.pin .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--text); }
.pin .status { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-top: 1px solid rgba(255, 236, 220, 0.08);
    font: 0.76rem var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.pin .status i { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.pin[data-state="building"] .status i { background: rgba(255, 236, 220, 0.5); box-shadow: none; animation: pin-build 0.8s ease-in-out infinite alternate; }
.pin[data-state="reloaded"] .status { color: var(--text); }
@keyframes pin-build { to { opacity: 0.25; } }
/* The line from the window's foot to the crates and the point on them (flight.js sets where). */
.pin .lead, .pin .dot { display: none; }
.js .pin .lead { display: block; position: absolute; height: 1px; transform-origin: 0 0; background: var(--glow); opacity: 0.7; }
.js .pin .dot { display: block; position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px var(--glow); }
.js .pin .gone { visibility: hidden; }
/* Drawn on the film's canvas with the picture instead, where WebGL 2 is there (flight.js). */
.js .pin.gl .lead, .js .pin.gl .dot { display: none; }
@media (max-width: 1000px) { .js .pin { display: none; } }

/* The name of the view the film plays (Albedo, Normals, ... Acoustics, Colliders), in the rail's mono caps; it
   cannot be clicked: the film plays the views by itself. */
.view-label { position: fixed; left: var(--words-left); bottom: 34px; z-index: 5; display: flex; align-items: center; gap: 12px; opacity: 0; pointer-events: none; color: var(--text); font: 500 0.74rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(10, 11, 13, 0.8); }
.view-label::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
