:root {
  --black: #0a0a0a;
  --black-mid: #1a1a1a;
  --yellow: #FFD700;
  --white: #F5F5F5;
  --gray: #8a8a8a;
  --display: 'Bebas Neue', Impact, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { background: var(--black); }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 50; background: var(--yellow); color: var(--black); padding: 8px 14px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px var(--pad);
  background: rgba(10, 10, 10, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.bar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.bar-brand img { border-radius: 6px; }
.bar-tag { font: 500 12px/1 var(--body); letter-spacing: .18em; color: var(--yellow); }
.bar-cta {
  margin-left: auto; text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border: 1px solid rgba(255, 215, 0, .55); border-radius: 999px; color: var(--yellow);
}
.bar-cta:hover { background: var(--yellow); color: var(--black); }

#gl { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#gl canvas { display: block; width: 100%; height: 100%; }
/* the canvas fades in once its first frames are drawn (lab.js adds gl-live), never popping in over the hero */
body.gl-on #gl canvas { opacity: 0; transition: opacity .6s ease-out; }
body.gl-live #gl canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) { body.gl-on #gl canvas { transition: none; } }
main, .foot { position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--pad) clamp(48px, 9vh, 96px);
}
.label { margin: 0 0 14px; font-size: 13px; font-weight: 500; letter-spacing: .2em; color: var(--yellow); }
.hero-title {
  margin: 0; max-width: 11ch;
  font: 400 clamp(68px, 13vw, 208px)/.86 var(--display);
  letter-spacing: .005em;
}
.hero-sub { margin: 22px 0 0; max-width: 34ch; font-size: clamp(18px, 2vw, 24px); color: #d6d6d6; }
.hero-hint {
  margin: 40px 0 0; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gray);
}
.hero-hint::after { content: ' ↓'; color: var(--yellow); }

/* ---------- cards: the fallback grid (no WebGL, reduced motion) ---------- */
.gallery { padding: 40px var(--pad) 80px; }
.cards {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card {
  display: block; text-decoration: none;
  background: var(--black-mid); border: 1px solid #262626; border-radius: 14px; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: rgba(255, 215, 0, .6); outline: none; }
.card-shot { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #141414; }
.card-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* the full page over the thumbnail: shown and scrolled top → bottom on hover (motion allowed only) */
.card-shot .card-tall { opacity: 0; object-position: 50% 0%; }
@media (prefers-reduced-motion: no-preference) {
  .card-shot .card-tall { transition: opacity .3s ease, object-position .6s ease; }
  .card:hover .card-tall, .card:focus-visible .card-tall {
    opacity: 1; object-position: 50% 100%;
    transition: opacity .3s ease, object-position 7s cubic-bezier(.45, 0, .55, 1) .3s;
  }
}
.card-text { display: block; padding: 14px 16px 16px; }
.card-title { display: block; font: 400 26px/1.05 var(--display); letter-spacing: .01em; }
.card-kind { display: block; margin-top: 4px; font-size: 14px; color: var(--gray); }
.card-open { display: block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--yellow); }

/* chapter titles: the grouped fallback grid only */
.chapter-title {
  grid-column: 1 / -1; margin: 28px 0 0;
  font: 400 clamp(34px, 5vw, 56px)/1 var(--display); letter-spacing: .01em; color: var(--white);
  border-bottom: 1px solid #262626; padding-bottom: 10px;
}
.chapter-title:first-child { margin-top: 0; }
body.gl-on .chapter-title { display: none; }

/* ---------- cards: labels floating over the 3D planes ---------- */
body.gl-on .gallery { height: calc(var(--cards, 25) * 46vh); padding: 0; }
body.gl-on .cards {
  position: fixed; inset: 0; z-index: 5; display: block; pointer-events: none;
}
body.gl-on .card {
  position: absolute; left: 0; top: 0; width: max-content; max-width: 46vw;
  background: rgba(10, 10, 10, .72); border-color: rgba(255, 215, 0, .35);
  backdrop-filter: blur(6px);
  transform: translate3d(-200vw, 0, 0); transition: opacity .25s ease;
  opacity: 0; pointer-events: none;
}
body.gl-on .card-shot { display: none; }
body.gl-on .card-text { padding: 10px 14px 12px; }
body.gl-on .card-title { font-size: 22px; }
body.gl-on .card-kind { font-size: 13px; }
body.gl-on .card-open { display: none; }
body.gl-on .card.is-on { opacity: .72; pointer-events: auto; }
body.gl-on .card.is-front { opacity: 1; border-color: var(--yellow); }
body.gl-on .card.is-front .card-open { display: block; margin-top: 6px; }
/* iOS treats the section as tappable only if it looks clickable */
@media (hover: none) { body.gl-on .gallery { cursor: pointer; } }
body.gl-on .card:focus-visible { opacity: 1; transform: translate3d(var(--pad), 90px, 0) !important; }

/* ---------- chapter HUD (3D tiers, while the gallery is up) ---------- */
.hud {
  position: fixed; z-index: 6; right: var(--pad); bottom: max(22px, env(safe-area-inset-bottom));
  width: min(280px, 60vw); pointer-events: none;
}
.hud[hidden] { display: none; }
.hud-now { margin: 0; font: 500 12px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--white); text-shadow: 0 1px 8px #000; }
.hud-num { color: var(--yellow); }
.hud-bar { display: block; height: 2px; margin: 9px 0 10px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.hud-fill { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }
.hud-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; pointer-events: auto; }
.hud-index button {
  all: unset; box-sizing: border-box; cursor: pointer;
  font: 500 12px/1.9 var(--body); letter-spacing: .12em; text-transform: uppercase; color: rgba(245, 245, 245, .82);
  text-shadow: 0 0 3px #000, 0 1px 8px #000, 0 0 14px rgba(0, 0, 0, .8); padding: 0 6px; margin-left: -6px; border-radius: 4px;
}
.hud-index button::before { content: attr(data-n) "  "; color: rgba(255, 215, 0, .9); }
.hud-index button:hover, .hud-index button[aria-current] { color: var(--white); }
.hud-index button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; color: var(--white); background: rgba(10, 10, 10, .7); }

/* ---------- close ---------- */
.close {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  /* top room for the bar, bottom room for the footer that overlaps this section,
     so at the end of the page the whole section is exactly one screen */
  padding: 96px var(--pad) 84px;
}
.close-title { margin: 0; font: 400 clamp(56px, 10vw, 160px)/.9 var(--display); }
/* the particles write this line when 3D runs; the heading stays for screen readers */
body.gl-on .close-title { color: transparent; }
.close-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 34px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 17px;
  padding: 15px 28px; border-radius: 999px; border: 1px solid var(--yellow);
}
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: #ffe24d; }
.btn-ghost { color: var(--yellow); }
.btn-ghost:hover { background: rgba(255, 215, 0, .1); }

/* ---------- sections between the gallery and the close ----------
   They sit over the living 3D background (colour field + gold cloud): panels are semi-opaque,
   never a flat black page; text carries a soft shadow where it stands on the field. */
:root { --bar-h: 72px; --panel: rgba(12, 12, 12, .74); --line: rgba(255, 255, 255, .09); }
.sec-title {
  margin: 0; font: 400 clamp(48px, 6.2vw, 108px)/.9 var(--display); letter-spacing: .005em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .6);
}
.build .label, .services .label { text-shadow: 0 1px 10px #000; }

/* how we build: head + steps on the left, one browser frame on the right */
.build {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "head frame" "copy frame";
  align-content: center; column-gap: clamp(32px, 5vw, 88px); row-gap: clamp(18px, 3.4vh, 40px);
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--bar-h) + clamp(16px, 4vh, 48px)) var(--pad) clamp(24px, 5vh, 56px);
}
/* a soft shade behind the copy so it reads over the moving gold */
.build::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 62% 75% at 20% 55%, rgba(10, 10, 10, .74), rgba(10, 10, 10, 0) 72%);
}
.build-head { grid-area: head; align-self: end; }
/* sized by the screen's height as well: the pinned section must fit one screen (1280x720 too) */
.build-head .sec-title { max-width: 12ch; font-size: clamp(44px, min(6vw, 8.6vh), 104px); }
@media (min-width: 761px) and (max-height: 820px) {
  .build-step { padding: 10px 0 12px; }
  .build-step h3 { font-size: 26px; }
  .build-step p { margin-top: 4px; font-size: 15px; }
}
.build-copy { grid-area: copy; align-self: start; }
.build-steps { list-style: none; margin: 0; padding: 0; }
.build-step { position: relative; padding: 14px 0 16px; border-top: 1px solid var(--line); transition: opacity .4s ease; }
.build-step-head { display: flex; align-items: baseline; gap: 14px; }
.build-num { font: 500 12px/1 var(--body); letter-spacing: .18em; color: var(--yellow); }
.build-step h3 { margin: 0; font: 400 clamp(28px, 2.3vw, 36px)/1 var(--display); letter-spacing: .02em; }
.build-step p { margin: 6px 0 0; max-width: 42ch; font-size: 16px; line-height: 1.5; color: #d0d0d0; text-shadow: 0 1px 12px rgba(0, 0, 0, .85); }
.build.is-pinned .build-step { opacity: .34; }
.build.is-pinned .build-step.is-done { opacity: .55; }
.build.is-pinned .build-step.is-active { opacity: 1; }
.build-progress { height: 2px; margin-top: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.build-progress span { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }
.build:not(.is-pinned) .build-progress { display: none; }

.build-frame {
  grid-area: frame; align-self: center; justify-self: end;
  width: min(100%, calc((100svh - var(--bar-h) - 150px) * 4 / 3));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px; background: #111; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .5);
}
.build-frame[hidden] { display: none; }
/* the pointer: a soft gold light over the frame where it is (--mx/--my from the reveal kit's
   data-tilt, mouse pointers only), over the content, so it shows on the sketch, code and page */
.build-frame { position: relative; isolation: isolate; }
.build-frame::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 215, 0, .16), rgba(255, 215, 0, 0) 62%);
  mix-blend-mode: screen;
}
.build-frame:hover::before { opacity: 1; }
.build-frame:hover { border-color: rgba(255, 215, 0, .4); }
.build-chrome {
  display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; flex: none;
  background: #1b1b1b; border-bottom: 1px solid rgba(255, 255, 255, .08);
  font: 500 12px/1 var(--body); color: #9a9a9a;
}
.build-dots { display: flex; gap: 6px; }
.build-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3b3b3b; }
.build-dots i:first-child { background: rgba(255, 215, 0, .8); }
.build-url { flex: 1; min-width: 0; padding: 5px 10px; border-radius: 6px; background: #0e0e0e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  background: rgba(70, 210, 130, .14); color: #62e295; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.build-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.build-view {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; container-type: inline-size;
  background: #121212 radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.3px) 0 0 / 20px 20px;
}
.build-sketch { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 50%; }
.build-sketch path, .build-sketch rect, .build-sketch circle, .build-sketch ellipse {
  fill: none; stroke: rgba(245, 245, 245, .72); stroke-width: 2; stroke-linejoin: round;
}
.build-sketch .sk-b { stroke: rgba(245, 245, 245, .34); }
.build-sketch .sk-t { stroke-width: 6; stroke: rgba(245, 245, 245, .4); }
.build-sketch .sk-t--s { stroke-width: 5; }
.build-sketch .sk-t--l { stroke-width: 10; stroke: rgba(245, 245, 245, .62); }
.build-sketch .sk-t--xl { stroke-width: 24; stroke: rgba(245, 245, 245, .72); }
.build-sketch .sk-y { stroke: var(--yellow); }
.build-sketch .sk-mark { stroke-width: 2.5; }
.build-sketch .sk-note { fill: var(--yellow); font: italic 500 22px var(--body); }
.build-code {
  position: absolute; inset: 0; margin: 0; padding: 5.5cqi 6cqi; overflow: hidden; background: #0d0d0d;
  font: 400 clamp(9px, 3.25cqi, 17px)/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #ececec; white-space: pre;
}
.hl-pn { color: #7a7a7a; }
.hl-tg { color: var(--yellow); }
.hl-at { color: #c8c8c8; font-style: italic; }
.hl-st { color: #ffe68f; }
.caret { display: inline-block; width: .55em; height: 1.15em; margin-left: 1px; vertical-align: -.22em; background: var(--yellow); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.build-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.build-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px; margin-top: -1px; pointer-events: none;
  background: var(--yellow); box-shadow: 0 0 18px 4px rgba(255, 215, 0, .5); visibility: hidden;
}

/* stacked (reduced motion, fallback tier, screens too short to pin): every step its own frame */
.build.is-stacked {
  min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "copy";
  padding-top: clamp(80px, 12vh, 140px); padding-bottom: clamp(56px, 8vh, 100px);
}
.build.is-stacked .build-step {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 5vw, 88px); padding: 28px 0;
}
.build.is-stacked .build-step-head { grid-column: 1; align-self: end; }
.build.is-stacked .build-step p { grid-column: 1; align-self: start; }
.build.is-stacked .build-step > .build-frame { grid-column: 2; grid-row: 1 / span 2; width: min(100%, 640px); }
.build-frame--sketch .build-code, .build-frame--sketch .build-shot,
.build-frame--code .build-shot, .build-frame--code .build-sketch { display: none; }
.build-frame--sketch .build-live, .build-frame--code .build-live { visibility: hidden; }

/* facts: four counters */
.facts { padding: clamp(72px, 12vh, 140px) var(--pad); }
.facts-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1440px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px);
}
.fact {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(22px, 2.4vw, 36px); border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
}
.fact::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 215, 0, .16), rgba(255, 215, 0, 0) 65%);
}
.fact:hover::before { opacity: 1; }
.fact::after { content: ''; position: absolute; left: clamp(22px, 2.4vw, 36px); top: 0; width: 44px; height: 3px; background: var(--yellow); }
.fact-num { display: block; font: 400 clamp(88px, 10.5vw, 176px)/.82 var(--display); letter-spacing: .01em; color: var(--yellow); }
.fact-label { display: block; margin-top: 14px; max-width: 20ch; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.4; color: #dedede; }

/* marquee: the 25 project names, outlined */
.marquee {
  position: relative; overflow: hidden; padding: clamp(16px, 3vh, 34px) 0;
  border-block: 1px solid var(--line);
  /* the same shade as the build copy: the outlines stand on a calm band, not on the cloud */
  background: linear-gradient(90deg, rgba(10, 10, 10, .78), rgba(10, 10, 10, .6) 50%, rgba(10, 10, 10, .78));
}
.marquee-track {
  display: flex; width: max-content; margin: 0; white-space: nowrap; will-change: transform;
  font: 400 clamp(64px, 8.4vw, 120px)/1.02 var(--display); letter-spacing: .01em;
}
.marquee-track span { display: block; padding: 0 .16em; }
.mq-name { color: transparent; -webkit-text-stroke: 1.5px rgba(245, 245, 245, .85); transition: color .35s ease, -webkit-text-stroke-color .35s ease; }
.mq-name:hover { color: var(--yellow); -webkit-text-stroke-color: var(--yellow); }
.mq-sep { color: var(--yellow); opacity: .85; }

/* services: eight cards, tilt + glow under the pointer */
.services { padding: clamp(80px, 13vh, 150px) var(--pad) clamp(80px, 12vh, 140px); }
.services-head { margin-bottom: clamp(28px, 4.4vh, 52px); }
.svc-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.svc-grid li { display: flex; }
.svc {
  position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  min-height: clamp(250px, 31vh, 300px); padding: 22px 22px 24px; border-radius: 18px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); transition: border-color .3s ease, background-color .3s ease;
}
.svc::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 215, 0, .2), rgba(255, 215, 0, 0) 62%);
}
.svc:hover, .svc:focus-visible { border-color: rgba(255, 215, 0, .55); background-color: rgba(16, 16, 16, .82); }
/* transparent outline: invisible normally, drawn by forced-colors (high contrast) modes */
.svc:focus-visible { outline: 2px solid transparent; outline-offset: 2px; }
.svc:focus-visible { box-shadow: 0 0 0 2px var(--yellow); }
.svc:hover::before, .svc:focus-visible::before { opacity: 1; }
.svc-num { font: 500 12px/1 var(--body); letter-spacing: .18em; color: var(--gray); }
.svc-icon { width: 36px; height: 36px; margin-top: 22px; fill: none; stroke: var(--yellow); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.svc-title { margin: auto 0 0; padding-top: 24px; font: 400 clamp(30px, 2.5vw, 40px)/.95 var(--display); letter-spacing: .01em; }
/* three lines reserved, so the titles of a row line up whatever their sentence length */
.svc-line { min-height: 4.5em; margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: #c6c6c6; }
.svc-go { position: absolute; top: 18px; right: 20px; font-size: 20px; line-height: 1; color: var(--yellow); transition: transform .35s ease; }
.svc:hover .svc-go, .svc:focus-visible .svc-go { transform: translate(3px, -3px); }

@media (max-width: 1100px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

/* phones, and screens too short for three open steps: the steps become three tabs over one
   line of text (pinned only; the stacked layout keeps every step open) */
@media (max-width: 760px), (max-height: 700px) {
  .build.is-pinned .build-steps { display: grid; }
  .build.is-pinned .build-step { grid-area: 1 / 1; padding: 0; border: 0; opacity: 1; pointer-events: none; }
  .build.is-pinned .build-step-head {
    width: calc((100% - 20px) / 3); margin-left: calc(var(--i) * ((100% - 20px) / 3 + 10px));
    padding-top: 10px; border-top: 2px solid rgba(255, 255, 255, .18); opacity: .45;
    transition: opacity .3s ease, border-color .3s ease;
  }
  .build.is-pinned .build-step.is-active .build-step-head,
  .build.is-pinned .build-step.is-done .build-step-head { opacity: 1; border-color: var(--yellow); }
  .build.is-pinned .build-step h3 { font-size: 24px; }
  .build.is-pinned .build-step p { margin-top: 12px; font-size: 15px; opacity: 0; transition: opacity .3s ease; }
  .build.is-pinned .build-step.is-active p { opacity: 1; }
  .build.is-pinned .build-progress { display: none; }
}

.foot {
  height: 72px; margin-top: -72px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--pad); font-size: 14px; color: var(--gray);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--yellow); }

@media (max-width: 760px) {
  /* how we build, phone: head, frame, then the three steps as tabs over one line of text */
  :root { --bar-h: 68px; }
  .build {
    /* the heading arrives first (top), the frame + steps share the rest of the screen, centred */
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "." "frame" "copy" ".";
    grid-template-rows: auto minmax(0, 1fr) auto auto minmax(0, 1fr);
    align-content: stretch; row-gap: 18px; padding: calc(var(--bar-h) + 18px) var(--pad) 22px;
  }
  .build::before { background: linear-gradient(rgba(10, 10, 10, 0), rgba(10, 10, 10, .35) 22%, rgba(10, 10, 10, .2) 50%, rgba(10, 10, 10, .6) 82%, rgba(10, 10, 10, 0)); }
  .build-head .label { margin-bottom: 8px; }
  .build-head .sec-title { max-width: none; font-size: clamp(40px, 11.2vw, 60px); }
  .build-frame { justify-self: center; width: min(100%, calc((100svh - 430px) * 4 / 3)); border-radius: 10px; }
  .build-chrome { height: 28px; gap: 8px; padding: 0 9px; font-size: 10.5px; }
  .build-dots i { width: 7px; height: 7px; }
  .build-url { padding: 4px 8px; }
  .build-live { padding: 3px 7px; font-size: 9.5px; }
  .build.is-stacked { grid-template-areas: "head" "copy"; grid-template-rows: auto auto; }
  .build.is-stacked .build-step { grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding: 22px 0; }
  .build.is-stacked .build-step > .build-frame { grid-column: 1; grid-row: auto; width: 100%; }

  .facts-list { gap: 10px; }
  .fact { padding: 18px 16px 18px; border-radius: 14px; }
  .fact::after { left: 16px; }
  .fact-num { font-size: 84px; }
  .fact-label { margin-top: 10px; font-size: 14.5px; }

  .svc-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .svc { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; min-height: 0; padding: 18px 18px 18px 16px; border-radius: 14px; }
  .svc-num { display: none; }
  .svc-icon { grid-row: 1 / span 2; width: 32px; height: 32px; margin: 2px 0 0; }
  .svc-title { margin: 0; padding: 0 28px 0 0; font-size: 30px; }
  .svc-line { grid-column: 2; min-height: 0; margin-top: 6px; font-size: 14.5px; }
  .svc-go { top: 18px; right: 16px; }
}

@media (max-width: 640px) {
  .bar-tag { display: none; }
  .bar-cta { padding: 8px 13px; font-size: 13px; }
  body.gl-on .card { max-width: 70vw; }
}
/* phone, upright or on its side (a short screen has no room for the five-line menu): one compact
   line at the bottom — the chapter, a thin bar, and five numbered buttons */
@media (max-width: 640px), (max-height: 500px) {
  .hud { left: var(--pad); right: var(--pad); width: auto; bottom: max(14px, env(safe-area-inset-bottom)); }
  .hud-now { font-size: 11px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-bar { margin: 7px 0 6px; }
  .hud-index { flex-direction: row; gap: 4px; }
  .hud-index li { flex: 1; }
  .hud-index button { display: block; width: 100%; text-align: center; margin: 0; padding: 0; font-size: 0; line-height: 1; min-height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .18); background: rgba(10, 10, 10, .55); }
  .hud-index button::before { content: attr(data-n); font-size: 12px; color: inherit; }
  .hud-index button[aria-current] { border-color: var(--yellow); color: var(--yellow); }
}
/* on its side the screen is wide: the line keeps to the right-hand corner */
@media (max-height: 500px) and (min-width: 641px) {
  .hud { left: auto; width: min(300px, 38vw); }
}
