:root {
  --ink: #09090b;
  --deep: #18181b;
  --green: #10b981;
  --label: #d4d4d8;
  --snow: #f4f4f5;
  --mist: #d4d4d8;
  --ember: #34d399;
  --ember-hot: #a7f3d0;
  --grey: #a1a1aa;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --gutter: clamp(20px, 3.4vw, 56px);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--ink); color: var(--snow); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* a 5% black wash over the 3D so the copy stands out */
body::before { content: ''; position: fixed; inset: 0; z-index: 1; background: rgba(0, 0, 0, 0.05); pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#fade { position: fixed; inset: 0; pointer-events: none; z-index: 30; background: var(--ink, #09090b); opacity: 1; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 26px var(--gutter); pointer-events: none; }
.top > * { pointer-events: auto; }
.top::before { content: ''; position: absolute; inset: 0 0 -40px; z-index: -1; background: linear-gradient(rgba(9, 9, 11, 0.5), transparent); opacity: var(--top-scrim, 0.35); transition: opacity 0.8s; pointer-events: none; }
body[data-tone='light'] { --top-scrim: 1; }
body[data-tone='light'] .panel::before { background: radial-gradient(closest-side, rgba(9, 9, 11, 0.62), rgba(9, 9, 11, 0.32) 55%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--snow); text-decoration: none; }
.brand strong { font: 800 22px/1 var(--display); letter-spacing: -0.03em; }
.brand i { width: 10px; height: 10px; flex: none; background: var(--ember); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18), 0 0 18px rgba(52, 211, 153, 0.6); animation: pulse 2.4s ease-in-out infinite; }
.brand span { font: 500 10px/1 var(--mono); letter-spacing: 0.06em; color: var(--mist); background: rgba(9, 9, 11, 0.55); border: 1px solid rgba(212, 212, 216, 0.4); padding: 4px 6px 3px; margin-left: 4px; white-space: nowrap; }
.nav { display: flex; gap: 6px; }
.nav button { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 12px; color: rgba(244, 244, 245, 0.85); text-shadow: 0 1px 6px rgba(9, 9, 11, 0.9); position: relative; transition: color 0.25s; }
.nav button::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; background: var(--ember); transform: scaleX(0); transform-origin: left; transition: transform 0.4s cubic-bezier(0.2, 0.75, 0.15, 1); }
.nav button:hover, .nav button.on { color: var(--snow); }
.nav button.on::after { transform: scaleX(1); }
.nav .cta { border: 2px solid rgba(244, 244, 245, 0.4); margin-left: 8px; }
.nav .cta:hover { border-color: var(--ember); }
.nav .cta::after { display: none; }
.nav button:focus-visible, .brand:focus-visible, #hint:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.1), 0 0 26px rgba(52, 211, 153, 0.8); } }

/* ---------- panels ---------- */
#panels { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.panel { position: absolute; left: var(--gutter); top: clamp(110px, 17vh, 190px); width: min(560px, 44vw); visibility: hidden; }
.panel::before { content: ''; position: absolute; inset: -140px -200px -120px -240px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(9, 9, 11, 0.55), rgba(9, 9, 11, 0.25) 55%, transparent); opacity: 0; transition: opacity 0.8s; }
.panel.on { visibility: visible; pointer-events: auto; }
.panel.on::before { opacity: 1; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember-hot); display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--ember); box-shadow: 0 0 12px rgba(52, 211, 153, 0.8); }
.eyebrow b { font-weight: 600; color: #ecfdf5; background: rgba(4, 120, 87, 0.92); padding: 4px 6px 3px; margin: -4px 0 -3px; text-shadow: none; box-shadow: 0 1px 8px rgba(9, 9, 11, 0.5); }
h1, h2 { font: 800 clamp(44px, 5.4vw, 88px)/1 var(--display); letter-spacing: -0.04em; text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: var(--ember-hot); }
.lede { margin-top: 26px; font-size: clamp(15px, 1.12vw, 18px); line-height: 1.6; max-width: 40ch; color: rgba(244, 244, 245, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 5px rgba(0, 0, 0, 1), 0 0 14px rgba(0, 0, 0, 0.95), 0 2px 30px rgba(0, 0, 0, 0.9); }
h1, h2 { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 2px 12px rgba(0, 0, 0, 0.75); }
.eyebrow, .tags, .hint-steps, #contact legend, #contact label span, .sent { text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.9); }

/* staggered reveal: each line rises out of a mask */
.rv { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.3em 0.08em; margin: -0.1em -0.3em -0.08em; }
.rv > span { display: inline-block; transform: translateY(105%); transition: transform 0.9s cubic-bezier(0.2, 0.75, 0.15, 1); }
.panel.on .rv > span { transform: none; }
.fade { opacity: 0; transform: translateY(12px); transition: opacity 0.8s, transform 0.9s cubic-bezier(0.2, 0.75, 0.15, 1); }
.panel.on .fade { opacity: 1; transform: none; }

.tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember-hot); padding: 7px 9px 6px; border: 1px solid rgba(52, 211, 153, 0.45); background: rgba(9, 9, 11, 0.55); }
.lede.short { margin-top: 18px; max-width: 46ch; }
.hint-steps { margin-top: 28px; font: 400 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244, 244, 245, 0.6); display: flex; gap: 10px; align-items: center; }
.hint-steps span { width: 14px; height: 14px; border: 2px solid var(--ember); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { background: var(--ember); } }

/* ---------- contact ---------- */
.panel.contact { top: clamp(88px, 11vh, 130px); width: min(720px, 46vw); }
.panel[data-i="0"] { width: min(740px, 54vw); }
.panel[data-i="0"] h1 { font-size: clamp(44px, 4.7vw, 80px); }
.contact h2 { font-size: clamp(30px, 2.9vw, 50px); white-space: nowrap; }
.contact .lede.short { max-width: 60ch; }
/* short desktop screens: tighten the form so the button stays clear of the footer */
@media (min-width: 900px) and (max-height: 860px) {
  .panel.contact { top: 84px; }
  .contact .lede.short { margin-top: 12px; }
  #contact { margin-top: 16px; gap: 10px; }
  #contact input, #contact textarea { padding: 9px 12px; }
  #contact textarea { height: 64px; }
}
#contact { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#contact label { display: grid; gap: 7px; }
#contact .topics { border: 0; padding: 0; margin: 0; min-width: 0; }
#contact .topics legend { padding: 0; margin-bottom: 9px; font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); }
#contact .topics .chips { display: flex; flex-wrap: wrap; gap: 8px; }
#contact .topics label { display: inline-flex; position: relative; cursor: pointer; }
#contact .topics input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
#contact .topics label span { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; text-transform: none; color: var(--mist); padding: 10px 12px 10px 28px; border: 2px solid rgba(212, 212, 216, 0.22); background: rgba(9, 9, 11, 0.62); position: relative; transition: border-color 0.2s, color 0.2s; }
#contact .topics label span::before { content: ''; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: 2px solid rgba(212, 212, 216, 0.5); }
#contact .topics input:checked + span { border-color: var(--ember); color: var(--snow); }
#contact .topics input:checked + span::before { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 10px rgba(52, 211, 153, 0.8); }
#contact .topics input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
#contact .wide { grid-column: 1 / -1; }
#contact label span { font: 400 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); }
#contact input, #contact textarea { font: inherit; font-size: 15px; color: var(--snow); background: rgba(9, 9, 11, 0.62); border: 2px solid rgba(212, 212, 216, 0.22); padding: 12px 13px; border-radius: 0; resize: none; backdrop-filter: blur(6px); transition: border-color 0.2s, background 0.2s; }
#contact input::placeholder, #contact textarea::placeholder { color: rgba(212, 212, 216, 0.4); }
#contact input:focus, #contact textarea:focus { outline: none; border-color: var(--ember); background: rgba(9, 9, 11, 0.8); }
#contact input[aria-invalid='true'], #contact textarea[aria-invalid='true'] { border-color: #ff8a8a; }
#contact button { grid-column: 1 / -1; justify-self: start; display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 15px 22px; font: 400 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; background: var(--ember); color: var(--ink); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5), 0 10px 40px -10px rgba(52, 211, 153, 0.8); transition: transform 0.2s, box-shadow 0.3s; }
#contact button:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22), 0 14px 50px -10px rgba(52, 211, 153, 0.95); }
#contact button:focus-visible { outline: 2px solid var(--snow); outline-offset: 3px; }
#contact button i { width: 8px; height: 8px; background: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#contact button[disabled] { opacity: 0.6; cursor: progress; }
.sent.err { color: #ff8a8a; }
.sent { grid-column: 1 / -1; min-height: 1.4em; font: 400 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember-hot); }

/* ---------- trail markers ---------- */
#markers { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.mk { position: absolute; left: 0; top: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; width: 250px; opacity: 0; transform: translate(-9999px, 0); transition: opacity 0.6s; }
.mk b { grid-row: span 2; font: 400 11px/1 var(--mono); color: var(--ink); background: var(--ember); padding: 5px 6px; align-self: start; }
.mk strong { font: 700 24px/1.05 var(--display); letter-spacing: -0.02em; color: var(--snow); text-shadow: 0 1px 3px rgba(0, 0, 0, 1), 0 2px 20px rgba(0, 0, 0, 0.95); }
.mk span { font-size: 14px; line-height: 1.45; color: rgba(244, 244, 245, 0.85); margin-top: 6px; text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 6px rgba(0, 0, 0, 1), 0 1px 14px rgba(0, 0, 0, 0.95); }
.mk.on { opacity: 1; }
.mk.past { opacity: 0.55; }

/* ---------- footer ---------- */
.bottom::before { content: ''; position: absolute; inset: -50px 0 0; z-index: -1; background: linear-gradient(transparent, rgba(9, 9, 11, 0.45)); pointer-events: none; }
.bottom { position: fixed; inset: auto 0 0; z-index: 20; display: flex; justify-content: space-between; align-items: flex-end; padding: 24px var(--gutter); pointer-events: none; font: 400 11px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244, 244, 245, 0.66); }
.foot-l { display: flex; gap: 22px; align-items: center; }
.made { color: var(--grey); text-shadow: 0 1px 8px rgba(9, 9, 11, 0.8); }
.made b { font-weight: 500; color: var(--snow); }
#coord { display: flex; gap: 14px; align-items: center; text-shadow: 0 1px 8px rgba(9, 9, 11, 0.8); }
#coord b { font-weight: 400; color: var(--snow); }
#coord i { width: 6px; height: 6px; background: var(--ember); }
.progress { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
#idx { color: var(--snow); }
#pips { display: flex; gap: 6px; }
#pips button { width: 22px; height: 6px; background: rgba(244, 244, 245, 0.22); transition: background 0.3s; padding: 0; }
#pips button:hover { background: rgba(244, 244, 245, 0.5); }
#pips button.on { background: var(--ember); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }

#hint { position: fixed; left: 50%; bottom: 26px; z-index: 20; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; font: 400 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(244, 244, 245, 0.75); transition: opacity 0.5s; }
#hint i { width: 10px; height: 10px; border-right: 3px solid var(--ember); border-bottom: 3px solid var(--ember); transform: rotate(45deg); animation: nudge 1.6s ease-in-out infinite; }
#hint.off { opacity: 0; pointer-events: none; }
@keyframes nudge { 50% { transform: translateY(5px) rotate(45deg); } }

.noscript { position: fixed; inset: 40% 10%; font: 600 20px var(--display); }

@media (max-width: 1100px) {
  .nav { gap: 0; }
  .nav button { padding: 10px 8px; }
}
@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .top { padding: 18px var(--gutter); }
  .nav button:not(.cta) { display: none; }
  .brand { display: grid; grid-template-columns: auto auto; column-gap: 9px; row-gap: 6px; justify-content: start; align-items: center; }
  .brand strong { font-size: 19px; }
  .brand span { grid-column: 2; justify-self: start; margin-left: 0; font-size: 9px; padding: 3px 5px 2px; }
  .tags { margin-top: 14px; gap: 6px; }
  .tags span { font-size: 10px; padding: 6px 7px 5px; }
  .foot-l { gap: 14px; }
  .panel, .panel.contact, .panel[data-i="0"] { width: calc(100vw - 2 * var(--gutter)); top: 84px; }
  .panel::before { inset: -100px -60px -80px -60px; }
  .eyebrow { margin-bottom: 14px; font-size: 11px; }
  h1, h2, .panel[data-i="0"] h1 { font-size: clamp(38px, 10.5vw, 60px); }
  .contact h2 { font-size: clamp(34px, 9vw, 52px); white-space: normal; }
  .lede { margin-top: 16px; font-size: 15px; }
  .hint-steps { margin-top: 18px; }
  #contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 18px; }
  #contact input, #contact textarea { width: 100%; min-width: 0; }
  .wide-only { display: none; }
  #contact input, #contact textarea { padding: 10px 12px; }
  .panel.contact { max-height: calc(100% - 140px); overflow-y: auto; overscroll-behavior: contain; }
  /* portrait phones: the form fills the space down to the footer, the message box takes the slack */
  @media (orientation: portrait) {
    .panel.contact { bottom: 64px; max-height: none; display: flex; flex-direction: column; }
    .panel.contact.on { pointer-events: none; }
    .panel.contact.on > * { pointer-events: auto; }
    #contact { flex: 1; min-height: 0; grid-template-rows: auto auto auto 1fr auto auto; align-content: stretch; }
    #contact label.wide { grid-template-rows: auto 1fr; }
    #contact textarea { height: 100%; min-height: 72px; }
  }
  /* tablets in portrait: the form keeps its natural height so the scene shows underneath */
  @media (orientation: portrait) and (min-width: 600px) {
    .panel.contact { bottom: auto; }
    #contact { flex: none; }
    #contact textarea { height: auto; min-height: 96px; }
  }
  /* the glow's negative inset made the scroll box think it overflowed */
  .panel.contact::before { inset: 0; }
  /* text panels sit high so each stop's feature shows underneath them (the world frames it in the lower half) */
  .panel:not(.contact) { bottom: 72px; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 2vh; }
  #coord { display: none; }
  .panel.on:not(.contact) { pointer-events: none; }
  .panel.on:not(.contact) > * { pointer-events: auto; }
  .eyebrow { align-self: flex-start; }
  /* trail lines sit as a card above the footer instead of beside the marker */
  .mk { left: var(--gutter) !important; right: var(--gutter); top: auto !important; bottom: 108px; width: auto; transform: none !important; padding: 14px 16px; background: rgba(9, 9, 11, 0.72); backdrop-filter: blur(6px); }
  .mk.past { opacity: 0; }
  .mk strong { font-size: 22px; }
  .bottom { padding: 16px var(--gutter); font-size: 10px; }
  #coord span { display: none; }
  #pips button { width: 14px; }
  #hint { bottom: 64px; }
}
@media (max-width: 860px) and (max-height: 700px) and (orientation: portrait) {
  .eyebrow { margin-bottom: 10px; }
  h1, h2, .panel[data-i="0"] h1 { font-size: clamp(32px, 9vw, 48px); }
  .lede { margin-top: 12px; font-size: 14px; line-height: 1.5; }
  .tags { margin-top: 10px; }
  .lede.short { display: none; }
  .hint-steps { margin-top: 12px; }
  /* contact: fit the whole form without scrolling */
  .panel.contact { top: 78px; }
  .contact h2 { font-size: clamp(32px, 9vw, 44px); }
  #contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto auto; gap: 10px; margin-top: 16px; }
  #contact input, #contact textarea { width: 100%; min-width: 0; padding: 10px 12px; font-size: 16px; }
  #contact textarea { min-height: 56px; }
  #contact .topics .chips { gap: 6px; }
  #contact .topics label span { font-size: 11px; padding: 9px 10px 9px 26px; }
  #contact button { margin-top: 4px; }
  .sent { min-height: 0; }
}
@media (max-width: 860px) and (max-height: 600px) and (orientation: portrait) {
  .panel.contact { top: 70px; bottom: 56px; }
  .contact h2 { font-size: 30px; }
  #contact { gap: 8px; margin-top: 10px; }
  #contact label { gap: 5px; }
  #contact input, #contact textarea { padding: 8px 10px; }
  #contact .topics legend { margin-bottom: 6px; }
  #contact .topics label span { padding: 7px 8px 7px 24px; }
  #contact .topics label span::before { left: 8px; }
  #contact textarea { min-height: 44px; }
  #contact button { margin-top: 2px; padding: 12px 18px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .panel, .panel.contact, .panel[data-i="0"] { top: 70px; width: min(560px, 60vw); }
  .panel:not(.contact), .panel[data-i="4"] { bottom: auto; display: block; }
  .eyebrow { margin-bottom: 10px; }
  h1, h2, .contact h2, .panel[data-i="0"] h1 { font-size: clamp(30px, 8vh, 52px); }
  .lede { display: block; margin-top: 10px; font-size: 13px; max-width: 46ch; }
  .hint-steps { margin-top: 10px; }
  .panel.contact { max-height: calc(100% - 118px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
  #contact { grid-template-columns: 1fr 1fr; margin-top: 12px; }
  #contact textarea { height: 64px; }
  .mk { left: auto !important; right: var(--gutter); width: min(340px, 38vw); bottom: 56px; }
  #hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rv > span, .fade { transition-duration: 0.01s; }
}
/* large displays: scale the chrome and type with the canvas */
@media (min-width: 1900px) {
  :root { --gutter: clamp(56px, 3.4vw, 96px); }
  .top { padding: 34px var(--gutter); }
  .brand strong { font-size: 28px; }
  .brand span { font-size: 12px; }
  .tags span { font-size: 13px; }
  .nav button { font-size: 14px; padding: 12px 16px; }
  .panel { width: min(760px, 40vw); top: clamp(160px, 17vh, 260px); }
  .panel[data-i="0"] { width: min(980px, 46vw); }
  .panel.contact { width: min(680px, 36vw); }
  h1, h2 { font-size: clamp(88px, 5.4vw, 140px); }
  .panel[data-i="0"] h1 { font-size: clamp(80px, 4.7vw, 124px); }
  .contact h2 { font-size: clamp(74px, 4.4vw, 112px); }
  .eyebrow { font-size: 14px; margin-bottom: 28px; }
  .lede { font-size: 20px; margin-top: 32px; }
  .hint-steps, #hint, .bottom { font-size: 13px; }
  .bottom { padding: 32px var(--gutter); }
  #pips button { width: 30px; height: 7px; }
  .mk { width: 320px; }
  .mk strong { font-size: 30px; }
  .mk span { font-size: 16px; }
  #contact label span, #contact .topics legend { font-size: 12px; }
  #contact input, #contact textarea { font-size: 17px; padding: 14px 16px; }
  #contact .topics label span { font-size: 14px; }
  #contact button { font-size: 14px; padding: 18px 26px; }
}

/* wide screens: a soft scrim down the left so the copy always reads, whatever the stop has behind it */
@media (min-width: 861px) {
  #panels::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background: linear-gradient(90deg, rgba(9, 9, 11, 0.5), rgba(9, 9, 11, 0.3) 30%, rgba(9, 9, 11, 0.08) 46%, transparent 56%); }
}

/* ---------- screen cards (js/screens.js): a framed clip of the real app at each stop ---------- */
.scr-card { position: fixed; z-index: 15; right: var(--gutter); bottom: 74px; width: clamp(300px, 24vw, 440px); margin: 0;
  opacity: 0; transform: translateY(14px); visibility: hidden; pointer-events: none;
  transition: opacity 0.45s, transform 0.6s cubic-bezier(0.2, 0.75, 0.15, 1), visibility 0s 0.6s; }
.scr-card.scr-top { bottom: auto; top: 104px; }
.scr-card.on { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.6s 0.15s, transform 0.8s 0.15s cubic-bezier(0.2, 0.75, 0.15, 1), visibility 0s; }
.scr-open { display: block; width: 100%; padding: 0; text-align: left; background: #18181b; border: 1px solid rgba(212, 212, 216, 0.18);
  box-shadow: 0 0 0 1px rgba(9, 9, 11, 0.6), 0 24px 60px -18px rgba(0, 0, 0, 0.85), 0 0 40px -12px rgba(52, 211, 153, 0.35); cursor: zoom-in;
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.3s; }
.scr-open:hover { border-color: rgba(52, 211, 153, 0.7); transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(9, 9, 11, 0.6), 0 28px 70px -18px rgba(0, 0, 0, 0.9), 0 0 48px -10px rgba(52, 211, 153, 0.55); }
.scr-open:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.scr-bar { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; background: #09090b; border-bottom: 1px solid rgba(212, 212, 216, 0.12); }
.scr-bar i { width: 7px; height: 7px; border-radius: 50%; background: #3f3f46; flex: none; }
.scr-bar i:first-child { background: var(--ember); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.scr-url { margin-left: 8px; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-shot { position: relative; aspect-ratio: 8 / 5; background: #f4f4f5; overflow: hidden; }
.scr-shot video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; background: #f4f4f5; }
.scr-play { display: none; position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; background: rgba(9, 9, 11, 0.78); border: 2px solid var(--ember); }
.scr-play::after { content: ''; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent var(--ember); }
.scr-card.still .scr-play { display: block; }
.scr-cap { margin-top: 10px; font: 400 11px/1.45 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244, 244, 245, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.9); }
.scr-cap::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 9px; vertical-align: 1px; background: var(--ember); }

/* the pill: phones and portrait tablets only */
.scr-pill { display: none; margin-left: 4px; padding: 7px 10px 6px; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); background: var(--ember); box-shadow: 0 4px 18px -6px rgba(52, 211, 153, 0.9); text-shadow: none; white-space: nowrap; }
.scr-pill::before { content: ''; display: inline-block; margin-right: 7px; vertical-align: -1px; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--ink); }
.scr-pill:focus-visible { outline: 2px solid var(--snow); outline-offset: 2px; }

/* the larger view */
.scr-dlg { --ar: 1.6; margin: auto; padding: 0; border: 0; background: transparent; width: min(1120px, calc(100vw - 48px), calc((100vh - 130px) * var(--ar))); max-width: none; max-height: none; overflow: visible; color: var(--snow); }
.scr-dlg::backdrop { background: rgba(9, 9, 11, 0.82); backdrop-filter: blur(4px); }
.scr-dlg[open] { animation: scr-in 0.35s cubic-bezier(0.2, 0.75, 0.15, 1); }
@keyframes scr-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.scr-frame { background: #18181b; border: 1px solid rgba(52, 211, 153, 0.45); box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.9), 0 0 60px -16px rgba(52, 211, 153, 0.45); }
.scr-frame .scr-bar { height: 38px; padding: 0 6px 0 14px; }
.scr-frame .scr-bar i { width: 9px; height: 9px; }
.scr-frame .scr-url { font-size: 11px; }
.scr-frame .scr-shot video { object-fit: contain; }
.scr-frame .scr-cap { margin: 0; padding: 12px 16px 14px; text-shadow: none; }
.scr-close { margin-left: auto; width: 32px; height: 32px; position: relative; flex: none; color: var(--snow); }
.scr-close::before, .scr-close::after { content: ''; position: absolute; left: 8px; right: 8px; top: 15px; height: 2px; background: currentColor; transform: rotate(45deg); }
.scr-close::after { transform: rotate(-45deg); }
.scr-close:hover { color: var(--ember); }
.scr-close:focus-visible { outline: 2px solid var(--ember); outline-offset: -2px; }

@media (max-width: 860px), (orientation: portrait) {
  .scr-card { display: none; }
  .scr-pill.on { display: inline-block; }
  .scr-dlg { width: min(calc(100vw - 24px), calc((100vh - 150px) * var(--ar))); }
}
@media (min-width: 1900px) {
  .scr-card { width: clamp(440px, 24vw, 620px); bottom: 96px; }
  .scr-card.scr-top { top: 130px; }
  .scr-cap { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .scr-card, .scr-card.on { transition-duration: 0.01s; transform: none; }
  .scr-dlg[open] { animation: none; }
}

/* phones and portrait tablets: no per-panel scrim (it gets clipped into a hard box); a smooth full-width fade from the top instead */
@media (max-width: 860px) {
  .panel::before, .panel.contact::before { display: none; }
  #panels::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 1;
    background: linear-gradient(180deg, rgba(9, 9, 11, 0.6) 0%, rgba(9, 9, 11, 0.48) 30%, rgba(9, 9, 11, 0.22) 52%, rgba(9, 9, 11, 0) 70%); }
  #panels:has(.contact.on)::before { background: linear-gradient(180deg, rgba(9, 9, 11, 0.62) 0%, rgba(9, 9, 11, 0.5) 45%, rgba(9, 9, 11, 0.38) 100%); }
}
@media (max-width: 860px) {
  /* the contact panel scrolls, which clips text shadows into a hard edge; run it full width with the gutter as padding instead */
  .panel.contact { left: 0; width: 100vw; box-sizing: border-box; padding-left: var(--gutter); padding-right: var(--gutter); }
}

/* ---------- soft edges everywhere ----------
   Anything that clips (the headline reveal masks, the scrolling Book a call panel) must never cut a text shadow
   into a hard line: the reveal mask opens fully once the line has risen, and the scroll panel fades its edges. */
.rv { overflow: visible; clip-path: inset(-1em -1em 0 -1em); }
.panel.on .rv { clip-path: inset(-1em); transition: clip-path 0s linear 1.6s; }
@media (prefers-reduced-motion: reduce) { .panel.on .rv { transition-delay: 0s; } }
.made { color: rgba(244, 244, 245, 0.72); text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.9); }
.made b { color: var(--snow); }
@media (max-width: 860px), (max-height: 560px) {
  .panel.contact { margin-top: -14px; padding-top: 14px; padding-bottom: 22px;
    -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 22px), transparent); }
}
/* shorter portrait phones: drop the intro so the whole form fits without scrolling */
@media (max-width: 860px) and (orientation: portrait) and (max-height: 780px) {
  .contact .lede.short { display: none; }
}
/* the Lat41 logo, exactly as on lat41.co.nz (teal ember, LAT41 wordmark, °S), sized for the footer */
.l41 { display: inline-flex; align-items: center; gap: 7px; margin: 0 5px; vertical-align: -2px; font: 800 15px/1 var(--display); letter-spacing: -0.03em; text-transform: none; color: var(--snow); }
.l41 i { width: 7px; height: 7px; flex: none; background: #19d3b8; box-shadow: 0 0 0 2px rgba(25, 211, 184, 0.18), 0 0 12px rgba(25, 211, 184, 0.6); }
.l41 span { color: #19d3b8; font: 500 9px/1 var(--mono); letter-spacing: 0; margin-left: -4px; transform: translateY(-4px); }
/* narrow phones: a smaller footer lockup and pips so the row never collides */
@media (max-width: 400px) {
  .l41 { font-size: 13px; gap: 6px; margin: 0 4px; }
  .l41 i { width: 6px; height: 6px; }
  .progress { gap: 8px; }
  #pips { gap: 4px; }
  #pips button { width: 10px; }
}
/* short portrait phones: tighter form so the button sits clear of the soft bottom edge */
@media (max-width: 860px) and (orientation: portrait) and (max-height: 700px) {
  #contact { gap: 7px; margin-top: 12px; }
  #contact input, #contact textarea { padding: 8px 11px; }
  #contact .topics legend { margin-bottom: 6px; }
  #contact .topics label span { padding: 8px 10px 8px 26px; }
  #contact textarea { min-height: 54px; }
  #contact button { padding: 12px 18px; margin-top: 2px; }
}
/* footer lockup: "a", the logo and "product" share one centre line */
.made { display: inline-flex; align-items: center; }
.l41 { vertical-align: baseline; margin: 0 8px; }
.l41 span { align-self: flex-start; transform: translateY(-1px); }
/* desktop: preview cards 30% larger and centred vertically on the right */
.scr-card, .scr-card.scr-top { top: 0; bottom: 0; height: fit-content; margin: auto 0; width: 429px; }
/* below 1100px there is no room beside the copy for anything larger than 429px */
@media (min-width: 1100px) { .scr-card, .scr-card.scr-top { width: clamp(493px, 39.4vw, 723px); } }
@media (min-width: 1900px) { .scr-card, .scr-card.scr-top { width: clamp(723px, 39.4vw, 1020px); } }
/* footer shows only the Lat41 lockup and the progress pips; no section label */
#coord { display: none !important; }
