:root {
  --bg: #03070d;
  --bg-2: #07101c;
  --ink: #f2f7ff;
  --text: #d3deed;          /* body copy */
  --muted: #a3b2c8;         /* labels and secondary text */
  --accent: #4cc3ff;        /* the brand blue, lifted so small text on dark stays legible */
  --line: rgba(140, 190, 250, .13);
  --blue: #00a8ff;
  --blue-deep: #0071ac;
  --radius: 18px;
  --pad: clamp(20px, 5vw, 72px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg); color: var(--ink); font: 400 17px/1.65 Sora, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
em { font-style: normal; color: transparent; background: linear-gradient(100deg, #8fdbff, var(--blue) 50%, #4a8dff); -webkit-background-clip: text; background-clip: text; }

/* nav */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(1180px, calc(100% - 28px)); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 10px 10px 18px; border-radius: 999px; background: rgba(4, 10, 20, .74); border: 1px solid rgba(150, 200, 255, .16); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; letter-spacing: -.01em; color: #cfe3ff; font-weight: 400; }
.logo svg { width: 26px; height: 26px; color: #fff; }
.logo b { font-weight: 500; color: var(--blue); }
.links { display: flex; gap: 26px; }
.links a { text-decoration: none; font-size: 14.5px; color: #b8c6d9; transition: color .2s; }
.links a:hover { color: #fff; }
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding: 15px 26px; border-radius: 999px; font-size: 15px; font-weight: 500; background: #fff; color: #06111f; box-shadow: 0 10px 34px -12px rgba(0, 168, 255, .75), inset 0 -2px 0 rgba(0, 113, 172, .12); transition: transform .25s, box-shadow .25s, background .25s; }
.btn::after { content: "\2192"; color: #0a84c6; transition: transform .25s; }
.btn:hover { transform: translateY(-1px); background: #eaf7ff; box-shadow: 0 14px 44px -10px rgba(0, 168, 255, .95), inset 0 -2px 0 rgba(0, 113, 172, .12); }
.btn:hover::after { transform: translateX(3px); }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-ghost { background: rgba(255, 255, 255, .06); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost::after { content: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }

/* story: a sticky stage with the chapters scrolling over it */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; z-index: 0; overflow: hidden; }
#gl { width: 100%; height: 100%; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(3, 7, 13, .9) 0%, rgba(3, 7, 13, .66) 32%, rgba(3, 7, 13, .18) 55%, transparent 70%), linear-gradient(0deg, var(--bg) 0%, transparent 14%); }
.hud { position: absolute; z-index: 2; right: var(--pad); bottom: 28px; display: flex; gap: 22px; color: var(--muted); }
.hud span:first-child { color: var(--accent); }
.asm { opacity: 0; transition: opacity .4s; }
.asm.on { opacity: 1; }
.asm b { color: var(--ink); font-weight: 400; font-variant-numeric: tabular-nums; }
#gl { touch-action: pan-y; }

.hero { position: relative; z-index: 1; margin-top: -100vh; margin-top: -100svh; min-height: 100svh; padding: 140px var(--pad) 80px; display: flex; flex-direction: column; justify-content: center; max-width: 1320px; margin-inline: auto; }
.eyebrow { color: #b3c1d4; display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { font-weight: 300; font-size: clamp(46px, 7.6vw, 120px); line-height: .98; letter-spacing: -.045em; max-width: 10.5ch; }
.lede { margin-top: 30px; max-width: 520px; color: var(--text); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; }
.cta-row { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 12px; }

.chapter { position: relative; z-index: 1; min-height: 110vh; display: flex; align-items: center; padding: 0 var(--pad); max-width: 1320px; margin: 0 auto; }
.chapter-machine { min-height: 260vh; align-items: flex-start; }
.chapter-machine .card { position: sticky; top: 28vh; }
.card { max-width: 460px; padding: 34px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(10, 24, 46, .9), rgba(4, 10, 20, .86)); border: 1px solid rgba(150, 200, 255, .16); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7); backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%); }
.idx { color: var(--accent); margin-bottom: 16px; }
h2 { font-weight: 400; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.06; letter-spacing: -.035em; }
.card p:not(.idx) { margin-top: 18px; color: var(--text); }
.spec { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.spec li { font-size: 11.5px; padding: 7px 11px; border-radius: 6px; background: rgba(0, 168, 255, .13); color: #cdeeff; border: 1px solid rgba(76, 195, 255, .32); }

/* after the story */
.reel { position: relative; width: min(1320px, calc(100% - 2 * var(--pad))); margin: 6vh auto 0; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: #02060d; }
.reel video { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.reel-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(24px, 4vw, 56px); background: linear-gradient(0deg, rgba(2, 6, 13, .92), rgba(2, 6, 13, .5) 55%, transparent); }
.reel-copy h2 { max-width: 620px; }
.work, .process, .contact { max-width: 1320px; margin: 0 auto; padding: 16vh var(--pad) 0; }
.sec-head { margin-bottom: 48px; }
.sec-head h2 { max-width: 16ch; }

.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; gap: 12px; }
.tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 18, 34, .75); }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.tile:hover img, .tile:hover video { transform: scale(1.05); }
.tile:not(.t-txt)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(3, 7, 13, .94)); }
.tile-txt { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 18px; }
.tile .mono { color: var(--accent); }
.tile h3 { font-weight: 500; font-size: 22px; letter-spacing: -.02em; margin-top: 6px; color: #fff; }
.t-txt { padding: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.t-txt h3 { font-size: clamp(22px, 2vw, 30px); line-height: 1.1; }
.t-txt p { color: var(--text); font-size: 15px; }
.t-a { grid-column: span 2; grid-row: span 2; }
.t-b, .t-g { grid-column: span 2; }

/* process: a timeline that fills as you scroll, with a card under each step */
.proc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.proc-lede { max-width: 440px; color: var(--text); font-size: 17px; }
.flow { --p: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; padding-top: 4px; }
.flow::before, .flow::after { content: ""; position: absolute; left: 7px; right: 0; top: 11px; height: 2px; border-radius: 2px; }
.flow::before { background: rgba(150, 200, 255, .12); }
.flow::after { background: linear-gradient(90deg, #0a84c6, var(--accent) 70%, #bfe9ff); box-shadow: 0 0 14px rgba(0, 168, 255, .7); transform-origin: left; transform: scaleX(var(--p)); transition: transform .25s linear; }
.flow .pulse { position: absolute; top: 9px; left: 0; width: 90px; height: 6px; border-radius: 6px; background: radial-gradient(closest-side, rgba(191, 233, 255, .95), transparent); filter: blur(1px); z-index: 1; animation: pulse-run 3.2s cubic-bezier(.5, 0, .5, 1) infinite; pointer-events: none; }
@keyframes pulse-run { 0% { transform: translateX(-90px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(calc(var(--track) - 10px)); opacity: 0; } }
.step { position: relative; display: flex; flex-direction: column; gap: 22px; }
.node { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid rgba(150, 200, 255, .35); transition: border-color .4s, box-shadow .4s, background .4s; }
.node .mono { color: var(--muted); font-size: 11.5px; transition: color .4s; background: var(--bg); padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(150, 200, 255, .12); }
.step.on .dot { border-color: var(--accent); background: radial-gradient(circle, #e6f7ff 0 25%, var(--accent) 30% 100%); box-shadow: 0 0 0 5px rgba(0, 168, 255, .14), 0 0 18px rgba(0, 168, 255, .8); }
.step.on .node .mono { color: var(--accent); border-color: rgba(76, 195, 255, .35); }
.step-card { position: relative; flex: 1; overflow: hidden; padding: 26px 24px 24px; border-radius: 18px; border: 1px solid rgba(150, 200, 255, .13); background: linear-gradient(180deg, rgba(12, 28, 54, .78), rgba(5, 11, 22, .7)); display: flex; flex-direction: column; gap: 12px; transition: border-color .4s, transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.step-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(76, 195, 255, .6), transparent); opacity: 0; transition: opacity .4s; }
.step.on .step-card { border-color: rgba(76, 195, 255, .3); }
.step.on .step-card::before { opacity: 1; }
.step-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(0, 168, 255, .45); border-color: rgba(76, 195, 255, .5); }
.step-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 168, 255, .1); border: 1px solid rgba(76, 195, 255, .25); margin-bottom: 6px; }
.step-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.step-card h3 { font-weight: 500; font-size: 24px; letter-spacing: -.02em; }
.step-card p { color: var(--text); font-size: 15.5px; line-height: 1.6; }
.gets { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(150, 200, 255, .1); display: grid; gap: 10px; position: relative; z-index: 1; }
.gets > .mono { color: var(--muted); font-size: 10.5px; }
.gets ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.gets li { font-size: 11px; padding: 6px 10px; border-radius: 6px; background: rgba(0, 168, 255, .1); color: #cdeeff; border: 1px solid rgba(76, 195, 255, .26); }
.ghost { position: absolute; right: -4px; top: -16px; font-size: 112px; font-weight: 500; line-height: 1; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px rgba(76, 195, 255, .14); pointer-events: none; user-select: none; }

/* contact: a terminal that sends the brief, and the details beside it */
.contact { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-bottom: 14vh; }
.term { border: 1px solid rgba(150, 200, 255, .22); border-radius: 12px; overflow: hidden; background: #02050a; box-shadow: 0 40px 90px -40px rgba(0, 168, 255, .35); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; text-transform: none; letter-spacing: .04em; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #1d2a3d; }
.term-bar span { margin-left: 8px; }
.term-body { padding: 24px 24px 26px; display: grid; gap: 14px; font: 400 14.5px/1.6 "JetBrains Mono", ui-monospace, monospace; }
.out { color: var(--ink); }
.dim { color: var(--muted); }
.term label { display: flex; gap: 14px; align-items: baseline; }
.term label > span { color: var(--accent); min-width: 64px; }
.term input, .term textarea { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed rgba(150, 200, 255, .3); color: #fff; font: inherit; padding: 6px 0; outline: none; resize: vertical; caret-color: var(--accent); border-radius: 0; }
.term input:focus, .term textarea:focus { border-bottom-color: var(--accent); }
.term input[aria-invalid="true"], .term textarea[aria-invalid="true"] { border-bottom-color: #ff7a7a; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ts { min-height: 0; }
.term-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.term button { background: transparent; border: 1px solid var(--accent); color: var(--accent); font: inherit; padding: 11px 18px; border-radius: 6px; cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.term button:hover { background: var(--accent); color: #021020; }
.term button:disabled { opacity: .5; cursor: progress; }
.status { color: var(--muted); }
.status.ok { color: #6ee7a8; }
.status.err { color: #ff8b8b; }
.contact-side .idx { margin-bottom: 18px; }
.contact-side h2 { font-size: clamp(38px, 4.8vw, 72px); max-width: 12ch; }
.contact-side ul { list-style: none; margin-top: 38px; border-top: 1px solid var(--line); }
.contact-side li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; text-transform: none; letter-spacing: .02em; }
.contact-side li > span:first-child { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.contact-side a, .contact-side .v { color: var(--ink); text-decoration: none; }
.contact-side a:hover { color: var(--accent); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 30px var(--pad) 40px; max-width: 1320px; margin: 0 auto; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.foot-brand { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot-related { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.foot-related .mono { color: var(--muted); font-size: 11.5px; }
.foot-related a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(76, 195, 255, .35); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.foot-related a:hover { color: #fff; border-color: var(--accent); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.2, .7, .2, 1), transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .links { display: none; }
  .stage::after { background: linear-gradient(0deg, rgba(3, 7, 13, .95) 0%, rgba(3, 7, 13, .7) 40%, transparent 66%); }
  .hero { justify-content: flex-end; padding-bottom: 60px; }
  .chapter { align-items: flex-end; padding-bottom: 10vh; }
  .chapter-machine { align-items: flex-start; }
  .chapter-machine .card { top: 47vh; top: 47svh; margin-top: 60vh; }
  .chapter-machine .card p:not(.idx) { font-size: 15px; }
  .bento { grid-template-columns: 1fr 1fr; grid-auto-rows: 210px; }
  .t-a, .t-b, .t-g { grid-column: span 2; }
  .t-a { grid-row: span 1; }
  /* a vertical timeline on smaller screens */
  .flow { grid-template-columns: 1fr; gap: 28px; padding-left: 34px; }
  .flow::before, .flow::after { left: 7px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; }
  .flow::after { transform-origin: top; transform: scaleY(var(--p)); }
  .flow .pulse { display: none; }
  .node { position: absolute; left: -34px; top: 0; }
  .node .mono { display: none; }
  .step { gap: 0; }
  .reel video { aspect-ratio: 4 / 5; }
  .hud { left: var(--pad); right: auto; top: 86px; bottom: auto; }
  .contact { grid-template-columns: 1fr; }
  .contact-side { order: -1; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .term-body { padding: 20px 18px 22px; font-size: 14px; }
  .term label > span { min-width: 54px; }
  .t-a, .t-b, .t-g { grid-column: span 1; }
  .card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  .flow .pulse { display: none; }
}
