/* khns.dev v2, top of the page: fixed layers, nav, the hero and its trailer screen (all states, the theater),
   the Feled Stories scene and the console. Builds on base.css; the sections below the console are in lower.css. */


/* Nav --------------------------------------------------------------------------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--nav-h); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(7, 8, 11, .68); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  opacity: 0; transition: opacity .4s var(--ease);
}
.nav.is-scrolled::before, html.is-menu .nav::before, html:not(.js) .nav::before { opacity: 1; }
.nav-in { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { margin-right: auto; padding: 14px 0; font: 600 17px/1 var(--display); letter-spacing: .32em; color: var(--text); }
.brand:hover { color: var(--accent-hi); }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 2.3vw, 34px); margin-right: clamp(4px, 1vw, 14px); }
.nav-links a {
  position: relative; display: inline-flex; align-items: center; height: 44px;
  font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--text-2);
  transition: color .25s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: #fff; }
.nav-links a[aria-current]::after { transform: scaleX(1); }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.nav-console, .menu-btn { display: none; }

.nav-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
  box-shadow: 0 0 12px rgba(77, 184, 255, .7);
  transform: scaleX(var(--progress, 0)); transform-origin: 0 50%; will-change: transform;
}

/* The Motion switch: a real button, pressed = motion on. */
.motion-wrap { position: relative; }
.motion-switch {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r-s); background: none;
  font: 600 12.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
  transition: color .25s var(--ease), border-color .25s var(--ease), background-color .25s var(--ease);
}
.motion-switch:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .03); }
.motion-switch .ico { width: 18px; height: 18px; }
.motion-track { position: relative; width: 30px; height: 16px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.motion-knob { position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); transition: transform .3s var(--ease-out), background-color .25s var(--ease), box-shadow .25s var(--ease); }
.motion-switch[aria-pressed="true"] .motion-track { border-color: var(--accent-line); background: var(--accent-soft); }
.motion-switch[aria-pressed="true"] .motion-knob { transform: translateX(14px); background: var(--accent); box-shadow: 0 0 10px rgba(77, 184, 255, .8); }
.motion-hint {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 2;
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; white-space: nowrap;
  border-color: var(--accent-line); box-shadow: var(--glow-soft);
  font-size: 14px; color: var(--text);
  animation: hint-in .6s var(--ease-out) both;
}
.motion-hint::before { content: ""; position: absolute; right: 26px; top: -5px; width: 8px; height: 8px; border-left: 1px solid var(--accent-line); border-top: 1px solid var(--accent-line); background: #0b0d12; transform: rotate(45deg); }
.motion-hint p { text-wrap: nowrap; }
.motion-hint button { height: 40px; border: 0; background: none; border-radius: 5px; }
.hint-off { padding: 0 10px; font: 600 12.5px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hint-off:hover { color: var(--accent-hi); background: var(--accent-soft); }
.hint-x { width: 40px; display: grid; place-items: center; color: var(--dim); }
.hint-x:hover { color: var(--text); }
@keyframes hint-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } }

/* Menu sheet (under 900px) */
.menu-btn { width: 42px; height: 42px; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r-s); background: rgba(255, 255, 255, .03); }
.menu-lines, .menu-lines::before { display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--text); transition: transform .35s var(--ease-out); }
.menu-lines { position: relative; transform: translateY(-3.5px); }
.menu-lines::before { content: ""; position: absolute; left: 0; top: 7px; }
.menu-btn[aria-expanded="true"] .menu-lines { transform: translateY(0) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(-7px) rotate(-90deg); }
.menu {
  position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; gap: 36px;
  padding: calc(var(--nav-h) + 24px) var(--gut) 40px;
  background: rgba(7, 8, 11, .86); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  overflow-y: auto; animation: sheet-in .45s var(--ease-out) both;
}
/* Centred by auto margins, not justify-content: when the list is taller than the window (a phone on its side) it
   starts under the nav and scrolls, instead of losing its first link above the top edge. */
.menu-links { display: grid; margin-top: auto; }
.menu-foot { margin-bottom: auto; }
.menu-links a {
  display: flex; align-items: baseline; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line);
  font: 600 clamp(26px, 8vw, 38px)/1.1 var(--display); color: var(--text);
  animation: sheet-row .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms + 80ms);
}
.menu-links a:nth-child(2) { --i: 1; } .menu-links a:nth-child(3) { --i: 2; } .menu-links a:nth-child(4) { --i: 3; } .menu-links a:nth-child(5) { --i: 4; }
.menu-links a[aria-current] { color: var(--accent); }
.menu-n { font: 500 12px/1 var(--mono); color: var(--dim); }
.menu-foot { animation: sheet-row .6s var(--ease-out) both; animation-delay: .38s; }
.menu-foot .btn { width: 100%; }
@keyframes sheet-in { from { opacity: 0; } }
@keyframes sheet-row { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
/* A phone on its side: tighter rows (after the rules above, which they replace), and room under Contact at the end of
   the sheet, also when it is scrolled into view by the keyboard. */
@media (max-height: 500px) {
  .menu { gap: 20px; padding-top: calc(var(--nav-h) + 10px); padding-bottom: 0; scroll-padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .menu-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .menu-links a { padding: 9px 0; font-size: 26px; }
}

@media (max-width: 900px) {
  .nav-links, .nav-contact { display: none; }
  .nav-console { display: inline-flex; }
  .menu-btn { display: grid; }
  .nav-in { gap: 12px; }
  .nav-tools { gap: 8px; }
}
/* The narrowest windows that still show the links in the nav: the switch drops its word (as on a phone) so that every
   link keeps to one line. */
@media (min-width: 901px) and (max-width: 960px) {
  .nav-links { gap: 16px; margin-right: 2px; }
  .motion-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .motion-switch { padding: 0 8px; gap: 7px; }
}
@media (max-width: 520px) {
  .brand { font-size: 15px; letter-spacing: .26em; }
  .motion-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .motion-switch { padding: 0 8px; gap: 7px; }
  .nav-console { padding: 0 12px; letter-spacing: .1em; }
  .motion-hint { right: -96px; top: calc(100% + 6px); }
  .motion-hint::before { right: 122px; }
}
/* The hint hangs where the hero's label is: the label waits until the hint has gone (main.js: has-hint). */
@media (max-width: 620px) { html.has-hint .hero-copy > .label { visibility: hidden; } }

/* 1. Hero ------------------------------------------------------------------------ */
.hero { --len: 240; }
.hero .stage, .feled .stage { pointer-events: none; }
/* Nor does the Feled section's own box: it scrolls up over the hero's fixed control bar while that is still in use.
   (Its content takes clicks through .feled-grid.) */
html.js[data-motion="on"] .scene.feled { pointer-events: none; }
.hero-in { position: static; }
.hero-copy { grid-column: 1 / span 5; position: relative; z-index: 2; pointer-events: auto; }
.hero-title { margin-top: var(--label-gap); white-space: nowrap; }
.hero-title .line { display: block; }
.hero-copy .lead { margin-top: 24px; max-width: 31em; }
.hero-actions { margin-top: 36px; }

/* The placeholder in the grid: the screen starts from this rectangle. It must stay untransformed and unfiltered,
   or the fixed screen inside it would stop being fixed to the viewport. --film is the shape of the film on the
   screen: 16:9, and 4:5 on a portrait phone once the script runs (see "A portrait phone" below). */
.screen-slot { grid-column: 6 / -1; position: relative; --film: 16 / 9; aspect-ratio: var(--film); }
/* On wide windows the screen reaches a little past the content edge, up to about 860px wide. */
@media (min-width: 1500px) and (max-width: 1699px) { .screen-slot { margin-right: calc(-1 * min(106px, (100vw - 1500px) / 2)); } }

/* The screen. With motion on it is a fixed, viewport-sized layer; the rig inside has the film's shape and is laid out
   at the size that covers the viewport, and main.js moves it with transform + clip-path only. */
.screen { position: fixed; left: 0; top: 0; z-index: 1; width: 100%; height: 100%; overflow: hidden; pointer-events: none; opacity: 0; }
.screen.is-away { visibility: hidden; }
/* The room goes dark as the screen opens (main.js writes --back): a window wider than the opened frame shows the film
   on black, not on the page's own near-black with a seam beside the film's black bars. */
.screen::before { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--back, 0); }
.screen-rig {
  position: absolute; left: 50%; top: 50%;
  width: var(--rig-w, 100vw); height: var(--rig-h, calc(100vw / (var(--film))));
  margin-left: calc(var(--rig-w, 100vw) / -2); margin-top: calc(var(--rig-h, calc(100vw / (var(--film)))) / -2);
  transform-origin: 50% 50%; will-change: transform;
}
.screen-glow {
  position: absolute; inset: 0; border-radius: var(--r0, 14px); opacity: var(--glow, 1);
  box-shadow:
    0 0 0 calc(var(--inv0, 1) * 1px) rgba(155, 220, 255, .16),
    0 calc(var(--inv0, 1) * 34px) calc(var(--inv0, 1) * 90px) rgba(0, 0, 0, .62),
    0 0 calc(var(--inv0, 1) * 70px) rgba(77, 184, 255, .2),
    0 0 calc(var(--inv0, 1) * 180px) rgba(77, 184, 255, .1);
}
.screen-pic { position: absolute; inset: 0; overflow: hidden; background: #000; clip-path: inset(0 round var(--rad, 0px)); }
.screen-pic::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--rad, 0px); pointer-events: none; opacity: var(--rim, 1);
  background: linear-gradient(118deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 28%);
  box-shadow: inset 0 0 0 calc(var(--inv, 1) * 1px) rgba(255, 255, 255, .26);
}
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.screen-dim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 6, 10, .93), rgba(5, 6, 10, .82) 46%, rgba(5, 6, 10, .6)); opacity: var(--dim, 0); }
@media (min-width: 901px) and (hover: hover) {
  .screen.is-dimmed[data-mode="ambient"] video { filter: blur(var(--blur, 0px)); }
}
/* Phones and touch screens: no live blur on the film (too costly there). The dim layer carries a small blurred still
   of the film instead, so the captions burned into the picture never read through behind the text. */
@media (max-width: 900px), (hover: none) {
  .screen-dim { background: linear-gradient(180deg, rgba(5, 6, 10, .9) 0%, rgba(5, 6, 10, .76) 46%, rgba(5, 6, 10, .86) 100%), #05060a url("/img/feled-bg-m.jpg") center / cover no-repeat; }
}

/* idle: the poster and a play plate (motion off, or Save-Data) */
/* The plate's look is in base.css (.plate); here only its place: bottom left, clear of the title burned into the poster. */
.screen .plate { position: absolute; left: 3%; bottom: 5.2%; z-index: 2; transform-origin: 0 100%; transform: scale(var(--inv, 1)); pointer-events: auto; }
/* The trailer's poster is its end card, lettered down the middle from 10% to 85% of its height (COMING SOON from
   70%, the last line from 80%): the plate stands at the left just above COMING SOON, on the dark houses and Laci. */
.screen[data-cut="trailer"] .plate { bottom: 31%; }
/* Once the picture is full-screen the bar's own button takes over (Save-Data with motion on). */
.screen.plate-off .plate { opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility 0s .25s; }
.plate-text { display: inline-flex; align-items: baseline; gap: 8px; }

/* Chips around the screen */
.chip-pos { position: absolute; z-index: 3; --dy: 18px; }
.chip-pos .chip-stat { margin: 0; white-space: nowrap; }
.chip-a { left: 5%; top: -31px; }
.chip-b { right: -14px; bottom: 13%; }
.chip-c { right: 9%; top: -8px; }
.chip-c .tag { height: 26px; padding: 0 10px; background: rgba(9, 11, 15, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* Between 68% and 91% down the trailer's lines run out to 89% across ("NEIGHBOURHOOD WATCH.", "THE ONLY WITNESS."):
   with the trailer on the screen the cut's chip stands higher, where it stands with motion off. */
@media (min-width: 901px) { .screen[data-cut="trailer"] ~ .chip-b { bottom: 34%; } }
.floaty { animation: float 7s ease-in-out infinite; }
.floaty-2 { animation-duration: 8.5s; animation-delay: -3s; }
.floaty-3 { animation-duration: 6.2s; animation-delay: -1.6s; }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -7px, 0); } }
/* Off stage (main.js sets is-off on the hero's copy at p .165, when the chips and the cue have faded out) the endless
   loops stand still instead of ticking behind the opened picture and for the rest of the page. They go on from where
   they stopped when the copy returns. */
.hero-copy.is-off ~ .screen-slot .floaty { animation-play-state: paused; }
.hero-in:has(> .hero-copy.is-off) ~ .scroll-cue .cue-line::after { animation-play-state: paused; }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: max(var(--gut), calc((100% - var(--wrap)) / 2)); bottom: clamp(22px, 4.4svh, 44px); z-index: 2;
  display: flex; align-items: center; gap: 14px;
  font: 600 11px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--dim);
}
.cue-line { position: relative; width: 1px; height: 38px; background: var(--line-2); overflow: hidden; }
.cue-line::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 16px; background: var(--accent); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { from { transform: translate3d(0, -18px, 0); } to { transform: translate3d(0, 40px, 0); } }

/* The control bar: rises over a soft scrim once the picture is full-screen. */
.bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; --dy: 26px; --blur: 8px; pointer-events: auto; }
/* With motion on the bar is fixed to the window like the picture it belongs to, so it fades in place while the hero's
   stage scrolls away under it. Until the script has placed it (it writes --in inline) it is not there at all. */
html.js[data-motion="on"] .bar { position: fixed; --in: 0; }
.bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -16px; bottom: 0; z-index: -1; pointer-events: none;
  /* Black behind the row of controls, like the room around the opened picture and the film's own bands, with a short
     soft edge above it: main.js keeps the films' lettering clear of the row, so nothing above the row is dimmed. */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .9) 16px, #000 30px);
}
.bar-in {
  width: min(100%, var(--wrap) + var(--gut) * 2); margin-inline: auto; padding: 0 var(--gut) clamp(20px, 3.6svh, 34px);
  display: flex; align-items: center; gap: 12px clamp(16px, 2.4vw, 34px);
}
.cuts { display: flex; align-items: stretch; gap: 4px; }
.cut {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px;
  border: 0; border-radius: var(--r-s); background: none;
  font: 600 14px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: var(--text-2);
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.cut::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 9px; height: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(77, 184, 255, .8); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease-out); }
.cut:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.cut[aria-selected="true"] { color: #fff; }
.cut[aria-selected="true"]::after { transform: scaleX(1); }
.bar-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.credit { font-size: 12.5px; line-height: 1.3; color: var(--text-2); }
/* The same credit on the picture itself: in its lower right corner while the screen is small (the bar is not there
   yet), and at the top left of the theater, level with Close. With motion off the bar under the screen carries it. */
.pic-credit {
  position: absolute; right: calc(2.4% + var(--edge, 0px)); bottom: 4.5%; z-index: 2; padding: 6px 9px 7px; border-radius: 4px; white-space: nowrap;
  background: rgba(7, 8, 11, .72); font-size: 11.5px; line-height: 1; color: var(--text);
  transform-origin: 100% 100%; transform: scale(var(--inv, 1)); transition: opacity .25s var(--ease);
}
/* The trailer's lowest line ("THE ONLY WITNESS.") ends 9% above the frame's bottom edge: its credit stands lower. */
.screen[data-cut="trailer"]:not([data-mode="theater"]) .pic-credit { bottom: 2%; }
.screen.credit-off:not([data-mode="theater"]) .pic-credit { opacity: 0; }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) .pic-credit { display: none; }
.screen[data-mode="theater"] .pic-credit {
  left: max(16px, env(safe-area-inset-left)); right: auto; top: max(16px, env(safe-area-inset-top)); bottom: auto;
  display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: var(--r-s);
  font-size: 12.5px; transform: none; opacity: 1;
}
.screen[data-mode="theater"] .pic-credit[hidden] { display: none; }
@media (max-width: 520px) {
  .pic-credit { font-size: 10.5px; padding: 5px 7px 6px; }
  .screen[data-mode="theater"] .pic-credit { padding: 0 9px; font-size: 11px; }
}
/* Under the two cut buttons of the Feled scene, where the walk plays dimmed behind the text. Out of the flow, so
   choosing the walk moves nothing. */
/* (Above the facts and the locals: on a short window a card that has yet to arrive waits a little lower, over the
   buttons, and would take their taps.) */
.feled-btns { position: relative; z-index: 2; }
.feled-btns .credit { position: absolute; left: 0; top: calc(100% + 10px); white-space: nowrap; }
:is(html[data-motion="off"], html:not(.js)) .feled-btns .credit { display: none; }
.status { display: inline-flex; align-items: center; gap: 9px; font: 600 11.5px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.status[data-on]::before { background: var(--accent); box-shadow: 0 0 10px rgba(77, 184, 255, .9); }
.status:empty { display: none; }
.loop-toggle { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(7, 8, 11, .5); color: var(--text); transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.loop-toggle:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.loop-toggle .ico-play, .loop-toggle[data-loop="paused"] .ico-pause { display: none; }
.loop-toggle[data-loop="paused"] .ico-play { display: block; margin-left: 2px; }
.bar .tag { flex: none; }

/* Covering state: one row, whatever the width. The credit sits on a line of its own above the right-hand group,
   and narrower windows leave out what the page says elsewhere (the tag) or shows another way (the round button). */
html.js[data-motion="on"] .hero[data-end="cover"] .bar-meta { position: relative; }
/* (--credit-in, from main.js: when the picture ends before the controls do, the credit stays on the picture.) */
html.js[data-motion="on"] .hero[data-end="cover"] .bar .credit { position: absolute; right: var(--credit-in, 0px); bottom: calc(100% + 12px); white-space: nowrap; color: var(--text); text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
@media (max-width: 1140px) { html.js[data-motion="on"] .hero[data-end="cover"] .bar .tag { display: none; } }
@media (max-width: 1040px) { html.js[data-motion="on"] .hero[data-end="cover"] .bar .status { display: none; } }

/* The picture ends as a band with the bar under it when the window is taller than wide: the whole frame, as wide as
   the window or, in a short window, as tall as the room between the nav and the bar allows (main.js). */
.hero[data-end="band"] .bar { bottom: auto; top: var(--band-bottom, 60%); }
.hero[data-end="band"] .bar::before { content: none; }
.hero[data-end="band"] .bar-in { flex-wrap: wrap; justify-content: space-between; padding-top: 18px; padding-bottom: 0; }

/* Load-in: the hero assembles once. The keyframes have no end state, so they land on whatever the scroll says. */
@keyframes rise-in { from { opacity: 0; transform: translate3d(0, 30px, 0); filter: blur(12px); } }
@keyframes fade-down { from { opacity: 0; transform: translate3d(0, -14px, 0); } }
html.is-intro[data-motion="on"] .nav { animation: fade-down .9s var(--ease-out) backwards; }
/* Everything after the nav waits for is-go, which js/main.js sets once its start-up work is done (js/boot.js sets it
   after a second and a half whatever happens): on a slow phone the pieces still arrive one after another, not all at
   once when the processor comes free. */
html.is-intro[data-motion="on"]:not(.is-go) :is(.hero-copy .fx, .scroll-cue, .chip-pos) { opacity: 0; }
html.is-intro.is-go[data-motion="on"] .hero-copy .fx,
html.is-intro.is-go[data-motion="on"] .scroll-cue { animation: rise-in 1s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 85ms + 140ms); }
html.is-intro.is-go[data-motion="on"] .chip-pos { animation: rise-in .9s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 110ms + 780ms); }

/* Theater: the screen above everything, whole picture on black, native controls. Beats the inline transforms. */
html.is-theater .hero .stage { z-index: 100; }
.screen[data-mode="theater"] {
  position: fixed !important; inset: 0; z-index: 100; width: 100% !important; height: 100% !important;
  background: #000; opacity: 1 !important; visibility: visible !important; pointer-events: auto;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  animation: theater-in .5s var(--ease-out) both;
}
.screen[data-mode="theater"] .screen-rig { left: 0; top: 0; width: 100%; height: 100%; margin: 0; transform: none !important; }
.screen[data-mode="theater"] .screen-pic { clip-path: none !important; }
.screen[data-mode="theater"] .screen-pic::after, .screen[data-mode="theater"] .screen-glow, .screen[data-mode="theater"] .screen-dim { display: none; }
.screen[data-mode="theater"] video { object-fit: contain; filter: none !important; }
.screen video:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; }
.theater-close { position: absolute; right: max(16px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); z-index: 3; background: rgba(7, 8, 11, .72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@keyframes theater-in { from { opacity: 0; } }

@media (min-width: 901px) and (max-width: 1180px) {
  .hero-actions { gap: 10px; }
  .hero-actions .btn { min-height: 50px; padding: 0 14px; font-size: 13px; letter-spacing: .08em; }
}
@media (max-height: 700px) { .scroll-cue { display: none; } }

/* Stacked hero: copy first, the screen flat below it. */
@media (max-width: 900px) {
  .hero-in { align-content: center; row-gap: clamp(26px, 4.5svh, 44px); padding-top: calc(var(--nav-h) + 8px); }
  .hero-copy, .screen-slot { grid-column: 1 / -1; }
  .hero-title { font-size: clamp(40px, 11.6vw, 66px); margin-top: 18px; }
  .hero-copy .lead { margin-top: 18px; }
  .hero-actions { margin-top: 26px; }
  .scroll-cue { display: none; }
  .chip-a { left: 14px; top: -26px; }
  .chip-b { right: -10px; bottom: auto; top: 26%; }
  .chip-c { right: 16px; top: -13px; }
}
/* Not tall enough to centre the stack: start under the nav and let the screen run past the fold. */
@media (max-width: 900px) and (max-height: 940px) { .hero-in { align-content: start; } }
@media (max-width: 720px) {
  .hero-in { align-content: start; }
  .chip-a, .chip-b { display: none; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { min-height: 52px; padding: 0 12px; gap: 8px; font-size: 12.5px; letter-spacing: .08em; flex: 1 1 auto; }
  .bar-in { gap: 12px; }
  .bar-play { order: 2; flex: 1 1 100%; }
  .cuts { order: 1; flex: 1 1 100%; gap: 0; margin-inline: -8px; }
  .cut { flex: 1 1 auto; justify-content: center; padding: 0 8px; min-height: 46px; font-size: 12.5px; letter-spacing: .06em; gap: 7px; }
  .cut::after { left: 8px; right: 8px; bottom: 6px; }
  .bar-meta { order: 3; flex: 1 1 100%; margin-left: 0; flex-wrap: wrap; gap: 10px 12px; }
  .bar-meta .tag { margin-left: auto; }
  .credit { order: 5; flex: 1 1 100%; }
  .status { letter-spacing: .14em; }
}
/* The band's bar in a narrow window (a phone above all): two rows, the cuts and then Play with the round pause button
   beside it, so the room goes to the picture above. The status text is still read out but not shown, and the tag is
   left out (the card at rest and the Feled scene say "Coming soon"). The walk's credit keeps a line of its own. */
@media (max-width: 720px) {
  html.js[data-motion="on"] .hero[data-end="band"] .bar-in { padding-top: 14px; gap: 10px 12px; }
  html.js[data-motion="on"] .hero[data-end="band"] .bar-play { flex: 1 1 0; min-width: 0; }
  html.js[data-motion="on"] .hero[data-end="band"] .bar-meta { display: contents; }
  html.js[data-motion="on"] .hero[data-end="band"] .loop-toggle { order: 3; }
  html.js[data-motion="on"] .hero[data-end="band"] .bar .tag { display: none; }
  html.js[data-motion="on"] .hero[data-end="band"] .status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
}
/* The narrowest phones: the two cut names side by side need every pixel of a 320px window. */
@media (max-width: 340px) {
  .cut { padding: 0 5px; letter-spacing: .03em; gap: 6px; }
  .cut::after { left: 5px; right: 5px; }
  .feled .feled-btns .btn { padding: 0 6px; gap: 5px; letter-spacing: .02em; }
}
/* The nav's row (the name, the Motion switch, Console, the menu button) needs 360px as it stands: tighter below that,
   so the menu button stays whole down to a 320px window. */
@media (max-width: 359px) {
  .nav .brand { font-size: 14px; letter-spacing: .16em; }
  .nav .nav-in { gap: 8px; }
  .nav .nav-tools { gap: 6px; }
  .nav .motion-switch { padding: 0 5px; gap: 5px; }
  .nav .nav-console { padding: 0 8px; letter-spacing: .05em; }
}

/* A portrait phone (the same query as in js/player.js and js/main.js) with the script running: the screen shows the
   films' 4:5 edit in every mode, so the slot is 4:5, and so is the rig (--film). The 4:5 frame is lettered from edge
   to edge and is always shown whole. At rest main.js writes --slot-w, the largest card that fits what is left of the
   first screen; with motion off the slot is as wide as the column. Without JavaScript the slot stays 16:9, like the
   film and the poster in the markup. */
@media (orientation: portrait) and (max-width: 720px) {
  html.js .screen-slot { --film: 4 / 5; width: var(--slot-w, 100%); }
  /* The tag on the card's corner keeps clear of the lettering in the 4:5 walk, which starts 6% down. The walk's 4:5
     poster carries no "Coming soon" of its own (the trailer's posters do), so with motion off the tag stays for it. */
  html.js .chip-c { top: -16px; }
  html.js[data-motion="off"] .screen[data-cut="walk"] ~ .chip-c { display: block; }
  /* idle: the play plate (52px tall here) stands in the lowest 18% of the frame, clear of the lettering on both
     posters: on the trailer's, the near-black road under the end card's last line (which ends at 81%). */
  html.js .screen .plate { bottom: calc(9% - 26px * var(--inv, 1)); }
  /* (With Save-Data and the walk chosen, the plate and the walk's credit share the card: the credit stands above it.
     On the trailer's poster that is the end card's last line: its credit stands at the top left, under the tag.) */
  html.js .screen[data-mode="idle"] .pic-credit { bottom: calc(9% + 34px * var(--inv, 1)); }
  html.js .screen[data-mode="idle"][data-cut="trailer"] .pic-credit { left: 2.4%; right: auto; top: calc(12px * var(--inv, 1)); bottom: auto; transform-origin: 0 0; }
  /* Until player.js has put the 4:5 poster in place of the markup's 16:9 one, there is no picture to crop. */
  html.js .screen:not([data-mode="theater"]) video:not([poster*="-4x5."]) { visibility: hidden; }
  /* The still behind the Feled scene is cut from the same 4:5 film. */
  html.js .screen-dim { background-image: linear-gradient(180deg, rgba(5, 6, 10, .9) 0%, rgba(5, 6, 10, .76) 46%, rgba(5, 6, 10, .86) 100%), url("/img/feled-bg-m-4x5.jpg"); }
}

/* Motion off (and no JavaScript): the same hero as a finished still. The screen sits flat in its slot,
   the bar sits under it. */
:is(html[data-motion="off"], html:not(.js)) .hero .stage { pointer-events: auto; }
:is(html[data-motion="off"], html:not(.js)) .hero-in { height: auto; align-items: start; padding-top: calc(var(--nav-h) + clamp(40px, 9svh, 96px)); padding-bottom: clamp(56px, 9svh, 104px); row-gap: 0; }
:is(html[data-motion="off"], html:not(.js)) .hero-copy { align-self: center; grid-row: 1 / span 2; }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) {
  position: absolute; inset: 0; z-index: 1; opacity: 1; pointer-events: auto; visibility: visible;
  border-radius: 14px; box-shadow: 0 0 0 1px rgba(155, 220, 255, .2), 0 34px 90px rgba(0, 0, 0, .6), 0 0 70px rgba(77, 184, 255, .16);
}
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) .screen-rig { left: 0; top: 0; width: 100%; height: 100%; margin: 0; transform: none; }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) :is(.screen-glow, .screen-dim) { display: none; }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) .screen-pic { clip-path: none; border-radius: 14px; }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) .screen-pic::after { border-radius: 14px; opacity: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
:is(html[data-motion="off"], html:not(.js)) .screen:not([data-mode="theater"]) .plate { transform: none; }
:is(html[data-motion="off"], html:not(.js)) .chip-b { bottom: 34%; }
:is(html[data-motion="off"], html:not(.js)) .bar .tag { display: none; }
:is(html[data-motion="off"], html:not(.js)) .bar { position: relative; grid-column: 6 / -1; grid-row: 2; left: auto; right: auto; bottom: auto; top: auto; margin-top: 30px; }
:is(html[data-motion="off"], html:not(.js)) .bar::before { content: none; }
:is(html[data-motion="off"], html:not(.js)) .bar-in { width: auto; padding: 0; flex-wrap: wrap; row-gap: 14px; }
:is(html[data-motion="off"], html:not(.js)) .bar-meta { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
:is(html[data-motion="off"], html:not(.js)) .bar-meta .tag { margin-left: auto; }
:is(html[data-motion="off"], html:not(.js)) .scroll-cue { display: none; }
:is(html[data-motion="off"], html:not(.js)) .is-off, :is(html[data-motion="off"], html:not(.js)) .is-off * { pointer-events: auto !important; }
html[data-motion="off"] .floaty, html[data-motion="off"] .cue-line::after { animation: none; }
/* The poster carries the logo and its own "Coming soon": the two chips that say the same are left out here. */
:is(html[data-motion="off"], html:not(.js)) :is(.chip-a, .chip-c) { display: none; }
html[data-motion="off"] .screen.plate-off .plate { opacity: 1; visibility: visible; }
/* Without JavaScript: the video keeps its native controls; everything that needs a script is taken away. */
html:not(.js) :is(.bar, .plate, .motion-wrap, .menu-btn, .nav-contact, [data-play], [data-console-run], .console-log, .console-chips, .console-input, .console-clear, .updates, .press) { display: none; }
@media (max-width: 900px) {
  :is(html[data-motion="off"], html:not(.js)) .hero-in { padding-top: calc(var(--nav-h) + 28px); padding-bottom: 56px; }
  :is(html[data-motion="off"], html:not(.js)) .hero-copy { grid-row: auto; }
  :is(html[data-motion="off"], html:not(.js)) .screen-slot { margin-top: clamp(30px, 5svh, 44px); }
  :is(html[data-motion="off"], html:not(.js)) .bar { grid-column: 1 / -1; grid-row: auto; margin-top: 26px; }
}
@media (max-width: 720px) {
  .plate { min-height: 52px; padding: 0 18px 0 7px; gap: 10px; font-size: 12px; letter-spacing: .1em; }
  .plate-ico { width: 38px; height: 38px; }
}
/* The narrowest phones (a 240px column): the plate with its longer label stays inside the card, margins included. */
@media (max-width: 300px) { .plate { padding-right: 14px; gap: 8px; letter-spacing: .05em; } }

/* A phone on its side (the page is static there): a smaller headline so the buttons are on the first screen, and no
   picture taller than the window under the nav. */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  .hero-title { font-size: 40px; margin-top: 12px; }
  .hero-copy .lead { margin-top: 12px; }
  .hero-actions { margin-top: 18px; }
  :is(html[data-motion="off"], html:not(.js)) .hero-in { padding-top: calc(var(--nav-h) + 14px); }
  .screen-slot { width: 100%; max-width: calc((100svh - var(--nav-h) - 24px) * 16 / 9); margin-inline: auto; }
}

/* 2. Feled Stories ----------------------------------------------------------------- */
.feled { --len: 260; }
.feled .stage-in { display: block; }
.feled-grid {
  height: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 28px);
  grid-template-rows: auto auto auto; align-content: center; pointer-events: auto;
}
.feled-head { grid-column: 1 / span 6; grid-row: 1; }
.feled-eyebrow { display: flex; align-items: center; gap: 16px; margin-bottom: var(--label-gap); }
.feled-copy { grid-column: 1 / span 6; grid-row: 2; margin-top: 24px; max-width: 54ch; }
.feled-btns { grid-column: 1 / span 6; grid-row: 3; margin-top: 34px; }
.facts, .locals { grid-column: 8 / -1; grid-row: 1 / span 3; align-self: center; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
.fact { display: grid; align-content: start; gap: 12px; min-height: 128px; padding: 20px 20px 22px; background: linear-gradient(180deg, rgba(14, 17, 23, .72), rgba(9, 11, 15, .6)); }
.fact dt { font: 600 11px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.fact dd { font: 600 19px/1.25 var(--display); color: var(--text); text-wrap: balance; }
.locals > .h-m { margin-bottom: 22px; }
.local-list { display: grid; gap: 12px; }
.local {
  --who: var(--accent); position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 14px;
  padding: 18px 20px 19px 26px; overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 17, 23, .72), rgba(9, 11, 15, .6));
}
.local-laci { --who: var(--laci); } .local-mirko { --who: var(--mirko); } .local-reka { --who: var(--reka); }
.local::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--who); transform: scaleY(.28); transform-origin: 50% 50%; opacity: .55; transition: transform .6s var(--ease-out), opacity .4s var(--ease), box-shadow .4s var(--ease); }
.local .h-s { grid-column: 1; font-size: 22px; transition: color .4s var(--ease); }
.local-n { grid-column: 2; justify-self: end; font: 500 12px/1 var(--mono); color: var(--dim); transition: color .4s var(--ease); }
.local p { grid-column: 1 / -1; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.local > :not(.local-n) { transition: opacity .45s var(--ease), color .4s var(--ease); }
.local { transition: border-color .45s var(--ease), box-shadow .45s var(--ease); }
.local .h-s, .local p { opacity: .64; }
.local.is-lit { border-color: color-mix(in srgb, var(--who) 62%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--who) 22%, transparent), 0 0 44px color-mix(in srgb, var(--who) 14%, transparent); }
.local.is-lit::before { transform: scaleY(1); opacity: 1; box-shadow: 0 0 16px var(--who); }
.local.is-lit .h-s, .local.is-lit p { opacity: 1; }
.local.is-lit .local-n { color: var(--who); }
@media (min-width: 901px) { .feled-copy { --out: 0 !important; } }

@media (max-width: 900px) {
  .feled-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; }
  .feled-head, .feled-copy, .feled-btns, .facts, .locals { grid-column: 1; }
  .feled-head { grid-row: 1; } .feled-copy { grid-row: 2; margin-top: 18px; } .facts { grid-row: 3; margin-top: 22px; align-self: start; }
  .locals { grid-row: 2 / span 2; margin-top: 20px; align-self: start; }
  .feled-btns { grid-row: 4; margin-top: 24px; }
  .feled-eyebrow { margin-bottom: 16px; }
  .fact { min-height: 0; padding: 14px 14px 15px; gap: 9px; }
  .fact dd { font-size: 16.5px; }
  .locals > .h-m { margin-bottom: 14px; }
  .local-list { gap: 8px; }
  .local { padding: 12px 14px 13px 20px; gap: 3px 12px; }
  .local .h-s { font-size: 19px; }
  .local p { font-size: 15px; }
}
@media (max-width: 720px) {
  .feled .h-l { font-size: clamp(26px, 7.4vw, 31px); }

  .feled-btns { flex-wrap: nowrap; gap: 8px; }
  .feled-btns .btn { flex: 1 1 auto; min-height: 46px; padding: 0 9px; gap: 7px; font-size: 11.5px; letter-spacing: .04em; }
  .feled-btns .btn .ico { display: none; }
  .feled .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(10, 12, 17, .84); }
}

/* Short phone screens (the browser's own bars take a fifth of the height): the stage is tightened until it fits,
   and it starts at the top, so whatever might still overflow runs off the bottom, never under the nav. */
@media (max-width: 900px) and (max-height: 700px) {
  html.js[data-motion="on"] .feled-grid { align-content: start; padding-top: 12px; }
  .feled .h-l { font-size: 24px; }
  .feled-eyebrow { margin-bottom: 12px; }
  .feled-copy { margin-top: 10px; font-size: 15.5px; line-height: 1.5; }
  .facts { margin-top: 12px; gap: 8px; }
  .fact { padding: 10px 12px 11px; gap: 7px; }
  .fact dd { font-size: 15.5px; }
  .locals { margin-top: 12px; }
  .locals > .h-m { margin-bottom: 10px; font-size: 21px; }
  .local-list { gap: 6px; }
  .local { padding: 9px 12px 10px 18px; }
  .local .h-s { font-size: 18px; }
  .local p { font-size: 14.5px; line-height: 1.45; }
  .feled-btns { margin-top: 16px; }
}
@media (max-width: 900px) and (max-height: 600px) {
  html.js[data-motion="on"] .feled-grid { padding-top: 4px; }
  .feled .h-l { font-size: 21px; }
  .feled-eyebrow { margin-bottom: 8px; }
  .feled-copy { margin-top: 8px; font-size: 14.5px; line-height: 1.45; }
  .facts { margin-top: 9px; gap: 6px; }
  .fact { padding: 7px 10px 8px; gap: 5px; }
  .fact dt { font-size: 10px; }
  .fact dd { font-size: 14.5px; }
  .locals { margin-top: 9px; }
  .locals > .h-m { margin-bottom: 8px; font-size: 19px; }
  .local { padding: 7px 12px 8px 18px; }
  .feled-btns { margin-top: 10px; }
  .feled-btns .btn { min-height: 40px; }
}

/* Short desktop windows (motion stays on down to 500px tall): the pinned two-column stage is tightened too, so it
   still stands centred between the nav and the bottom edge. */
@media (min-width: 901px) and (max-height: 620px) {
  html.js[data-motion="on"] .feled .h-l { font-size: clamp(27px, 3vw, 38px); }
  html.js[data-motion="on"] .feled-eyebrow { margin-bottom: 14px; }
  html.js[data-motion="on"] .feled-copy { margin-top: 14px; font-size: 16px; line-height: 1.5; }
  html.js[data-motion="on"] .feled-btns { margin-top: 20px; }
  html.js[data-motion="on"] .feled-btns .btn { min-height: 46px; }
  html.js[data-motion="on"] .fact { min-height: 0; padding: 14px 16px 15px; gap: 9px; }
  html.js[data-motion="on"] .fact dd { font-size: 17px; }
  html.js[data-motion="on"] .locals > .h-m { margin-bottom: 12px; }
  html.js[data-motion="on"] .local-list { gap: 8px; }
  html.js[data-motion="on"] .local { padding: 11px 16px 12px 22px; }
  html.js[data-motion="on"] .local .h-s { font-size: 19px; }
  html.js[data-motion="on"] .local p { font-size: 15px; line-height: 1.45; }
}

/* Motion off: one finished column of content on the page background. */
:is(html[data-motion="off"], html:not(.js)) .feled .stage { pointer-events: auto; border-top: 1px solid var(--line); }
:is(html[data-motion="off"], html:not(.js)) .feled .stage-in { padding-block: clamp(72px, 11svh, 136px); }
:is(html[data-motion="off"], html:not(.js)) .feled-grid { height: auto; align-content: start; row-gap: 0; }
:is(html[data-motion="off"], html:not(.js)) .facts { grid-row: 1 / span 3; align-self: center; }
:is(html[data-motion="off"], html:not(.js)) .feled-btns { grid-row: 3; align-self: start; }
:is(html[data-motion="off"], html:not(.js)) .locals { grid-column: 1 / -1; grid-row: 4; align-self: start; margin-top: clamp(48px, 7svh, 72px); }
:is(html[data-motion="off"], html:not(.js)) .local-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
:is(html[data-motion="off"], html:not(.js)) .local::before { transform: scaleY(1); opacity: 1; }
:is(html[data-motion="off"], html:not(.js)) .local .h-s, :is(html[data-motion="off"], html:not(.js)) .local p { opacity: 1; }
:is(html[data-motion="off"], html:not(.js)) .local .local-n { color: var(--who); }
@media (max-width: 900px) {
  :is(html[data-motion="off"], html:not(.js)) .facts { grid-row: 3; align-self: start; }
  :is(html[data-motion="off"], html:not(.js)) .feled-btns { grid-row: 4; }
  :is(html[data-motion="off"], html:not(.js)) .locals { grid-row: 5; margin-top: 44px; }
  :is(html[data-motion="off"], html:not(.js)) .local-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* 3. Console ------------------------------------------------------------------------- */
.console-block { z-index: 1; }
.console-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 28px); align-items: start; }
.console-side { grid-column: 1 / span 5; }
.console-block .console { grid-column: 7 / -1; }
.press { margin-top: 28px; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-2); }
.updates { margin-top: clamp(40px, 6svh, 64px); }
.updates-list { margin-top: 18px; border-top: 1px solid var(--line); }
.updates-list li { display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.updates-list time { font: 500 12.5px/1.75 var(--mono); color: var(--dim); white-space: nowrap; }

.console { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 12px; border-color: var(--line-2); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); transition: border-color .3s var(--ease), box-shadow .4s var(--ease), opacity .9s var(--ease-out), transform .9s var(--ease-out), filter .9s var(--ease-out); }
.console:focus-within { border-color: var(--accent-line); box-shadow: 0 30px 90px rgba(0, 0, 0, .5), var(--glow-soft); }
/* One fixed height (title bar 46, two rows of suggestions 113, input 58, and the log): when the suggestions change
   from two rows to one the log grows, and the input row stays where it is. */
html.js .console { height: calc(clamp(300px, 46svh, 430px) + 217px); }
html.js .console-log { flex: 1 1 0; height: auto; min-height: 0; }
html.js .console-chips, html.js .console-input, html.js .console-bar { flex: none; }
@media (max-height: 500px) {
  html.js .console { height: auto; }
  html.js .console-log { flex: none; height: 190px; }
}
/* The title bar is the shared .frame-bar; it is a little taller here because the Clear button is a 40px target. */
.console-bar { min-height: 46px; padding-right: 4px; }
.console-clear { height: 40px; padding: 0 12px; border: 0; border-radius: 5px; background: none; font: 600 11.5px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); transition: color .25s var(--ease), background-color .25s var(--ease); }
.console-clear:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.console-log {
  height: clamp(300px, 46svh, 430px); overflow-y: auto; padding: 18px 20px 20px;
  font: 400 13.5px/1.7 var(--mono); color: var(--text-2);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.console-log:focus-visible { outline-offset: -3px; border-radius: 0; }
.console-log > * + * { margin-top: 8px; }
.console-log p { overflow-wrap: anywhere; }
.console .echo { margin-top: 18px; color: var(--text); font-weight: 500; }
.console .echo:first-child { margin-top: 0; }
.console .sigil { color: var(--accent); margin-right: 4px; }
.console .echo-ask .sigil { color: var(--accent-hi); }
.console .out > * + *, .console .say > * + * { margin-top: 8px; }
.console .say { padding-left: 14px; border-left: 2px solid var(--accent-line); font: 400 15px/1.6 var(--body); color: var(--text); }
.console .muted { color: var(--dim); }
.console .say .muted { font-size: 14px; }
.console .ext, .console .out a, .console .say a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(77, 184, 255, .4); text-underline-offset: 3px; }
.console .ext:hover, .console .out a:hover, .console .say a:hover { color: var(--accent-hi); text-decoration-color: currentColor; }
.console .ext::after, .chip-ext::after {
  content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .4em; vertical-align: -.04em; background: currentColor;
  -webkit-mask: url("/img/i-out.svg") center / contain no-repeat; mask: url("/img/i-out.svg") center / contain no-repeat;
}
.console .proj-out .group { margin-top: 14px; font: 600 11px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.console .proj-out .group:first-child { margin-top: 2px; }
.console .cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; margin-top: 6px; }
.console .cmd {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 40px; padding: 4px 8px; margin-inline: -8px;
  border: 0; border-radius: 5px; background: none; text-align: left; font: inherit; color: var(--accent);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.console .cmd:hover { background: var(--accent-soft); color: var(--accent-hi); }
.console .cmd-extra { font-size: 11.5px; color: var(--dim); text-align: right; }
.console dl.rows-out { display: grid; grid-template-columns: max-content 1fr; gap: 3px 22px; margin: 0; }
.console dl.rows-out dt { color: var(--accent); white-space: nowrap; }
.console dl.rows-out dd { color: var(--text-2); }
.console ul.link-out { display: grid; gap: 2px; }
.console ul.link-out li { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.console .link-label { flex: 0 0 104px; color: var(--dim); }
.console .say ul.link-out { font: 400 13.5px/1.7 var(--mono); }
.console .copy { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0; border: 0; background: none; font: inherit; color: var(--accent); text-align: left; }
.console .copy:hover { color: var(--accent-hi); }
.console .copy-hint { padding: 3px 7px 4px; border: 1px solid var(--line-2); border-radius: 4px; font: 600 10px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.console ul.log-out { display: grid; gap: 4px; }
.console ul.log-out li { display: grid; grid-template-columns: 58px 1fr; gap: 12px; }
.console ul.log-out time { color: var(--dim); white-space: nowrap; }
.console pre { margin: 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, .03); font: inherit; color: var(--text-2); }

/* The mail form appears only here, inside the log. */
.console form.mail { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, .03); }
.console form.mail label { display: grid; gap: 7px; }
.console form.mail label > span { font: 600 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.console form.mail input, .console form.mail textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: rgba(7, 8, 11, .7);
  font: 400 16px/1.5 var(--body); color: var(--text); transition: border-color .25s var(--ease), box-shadow .3s var(--ease);
  /* What a visitor types is set with Inter's whole latin-ext file (base.css), here and in the status line, which repeats
     the email once the message is sent: the page's own text never needs it. */
  font-family: "Inter Typed", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.console form.mail textarea { resize: vertical; min-height: 96px; }
.console form.mail :is(input, textarea)::placeholder { color: var(--dim); opacity: 1; }
.console form.mail :is(input, textarea):focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--glow-soft); }
.console .trap { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.console .mail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.console .mail-actions .btn:is([disabled], [aria-disabled="true"]) { opacity: .5; cursor: default; box-shadow: none; }
.console .mail-alt { display: inline-flex; align-items: center; min-height: 40px; font-size: 14px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.console .mail-alt:hover { color: var(--text); }
.console .mail-status { font-size: 14px; line-height: 1.5; color: var(--text-2); font-family: "Inter Typed", system-ui, -apple-system, "Segoe UI", sans-serif; }
.console .mail-status:empty { display: none; }
.console .mail-status:focus { outline: none; }
.console .mail-status[data-tone="ok"] { color: var(--accent-hi); }
.console .mail-status[data-tone="error"] { color: #ff9a9a; }

.console-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 65px; padding: 12px 14px; border-top: 1px solid var(--line); }
.console-chips:empty { display: none; }
.console .chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 6px;
  background: rgba(255, 255, 255, .03); font: 500 13px/1.2 var(--mono); color: var(--text-2); text-align: left;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.console .chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.console-input { display: flex; align-items: stretch; height: 58px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: box-shadow .3s var(--ease), background-color .3s var(--ease); }
.console-input:focus-within { background: rgba(77, 184, 255, .05); box-shadow: inset 0 1px 0 var(--accent-line), inset 0 0 30px rgba(77, 184, 255, .1); }
.console-input label { display: grid; place-items: center; width: 46px; flex: none; }
.console-input .prompt { font: 700 16px/1 var(--mono); color: var(--accent); text-shadow: 0 0 12px rgba(77, 184, 255, .8); }
.console-input input { flex: 1 1 auto; min-width: 0; border: 0; background: none; font: 400 16px/1 var(--mono); color: var(--text); caret-color: var(--accent); }
.console-input input::placeholder { color: var(--dim); opacity: 1; }
.console-input input:placeholder-shown { text-overflow: ellipsis; }
.console-input input:focus-visible { outline: none; }
.console-input button { display: grid; place-items: center; width: 58px; flex: none; border: 0; border-left: 1px solid var(--line); background: none; color: var(--accent); transition: background-color .25s var(--ease), color .25s var(--ease); }
.console-input button:hover { background: var(--accent-soft); color: var(--accent-hi); }
.console-input button .ico { width: 18px; height: 18px; }
.console-nojs { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }

@media (max-width: 1100px) {
  .console-side { grid-column: 1 / span 5; }
  .console-block .console { grid-column: 6 / -1; }
}
@media (max-width: 900px) {
  .console-grid { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .console-side, .console-block .console { grid-column: 1; }
  .console-block .console { grid-row: 2; }
  .console-side { display: contents; }
  .console-side .head { grid-row: 1; }
  .press { display: none; }
  .updates { grid-row: 3; margin-top: 8px; }
}
@media (max-width: 520px) {
  .console-log { padding: 16px 14px 18px; font-size: 13px; }
  .console .link-label { flex-basis: 92px; }
  .console .cmd-list { grid-template-columns: 1fr; }
  .console-chips { padding: 10px; }
  .console-input label { width: 38px; }
  .console-input button { width: 50px; }
  .console-input input::placeholder { font-size: 13.5px; letter-spacing: -.01em; }
}
