/* Advanced Quantum Sensors: one deliberate dark look.
   Layout: a cinematic scroll. Pinned 100vh stages (hero, the car, applications)
   alternate with quiet text sections on a 1240px column. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0b0b0d;
  --panel-2: #0e0e11;
  --fg: #f5f5f7;
  --fg-2: #a1a1a6;
  --fg-3: #75757b;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --gold: #e2c07a;
  --gold-deep: #b8954f;
  --amber: #ffb340;
  --font: "Geist", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --maxw: 1240px;
  --nav-h: 52px;
  --gut-l: max(16px, 4vw, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, 4vw, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --radius: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--bg);
}
img, svg, canvas { max-width: 100%; }
img { display: block; }
p, h1, h2, h3, figure, dl, dd { margin: 0; }
a { color: inherit; }
::selection { background: rgba(226, 192, 122, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 8vw);
  margin-inline: auto;
  padding-left: var(--gut-l);
  padding-right: var(--gut-r);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--fg); color: #000; border-radius: 10px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold);
}
.h-hero {
  font-size: clamp(40px, min(6.6vw, 11.5vh), 112px); font-weight: 600; letter-spacing: -0.052em; line-height: 0.96;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f4 42%, #8f8f95 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
.h-hero span { display: inline-block; }
.hero-sub {
  font-size: clamp(22px, min(2.6vw, 4.4vh), 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--gold); margin-top: -4px;
}
.h-xl {
  font-size: clamp(40px, 6.2vw, 100px); font-weight: 600; letter-spacing: -0.052em; line-height: 0.98;
  text-wrap: balance;
}
.h-l {
  font-size: clamp(34px, 4.6vw, 68px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02;
  text-wrap: balance;
}
.dim { color: var(--fg-3); }
.lead {
  font-size: clamp(18px, 1.6vw, 23px); line-height: 1.45; color: var(--fg-2); max-width: 36ch;
  letter-spacing: -0.008em;
}
.fine { font-size: 12.5px; line-height: 1.5; color: var(--fg-3); max-width: 90ch; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; background: var(--fg); color: #000; text-decoration: none;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: #ffffff; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08); }
.btn-small { min-height: 34px; padding: 0 16px; font-size: 13.5px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none;
  color: var(--fg); font-size: 16px; transition: color 0.2s var(--ease);
}
.link-arrow::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
}
.link-arrow:hover { color: var(--gold); }
.cta-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: saturate(170%) blur(20px); -webkit-backdrop-filter: saturate(170%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled { background: rgba(0, 0, 0, 0.72); border-bottom-color: var(--line); }
.nav-inner {
  max-width: calc(var(--maxw) + 8vw); margin-inline: auto; height: var(--nav-h);
  padding-left: var(--gut-l); padding-right: var(--gut-r);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: 0.08em; font-size: 15px; }
.brand-text { display: grid; line-height: 1.05; }
.brand-short { font-size: 15px; letter-spacing: 0.1em; }
.brand-full { font-size: 9.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); margin-top: 2px; }
.brand.small { font-size: 13px; letter-spacing: 0.02em; color: var(--fg-2); }
.mark { width: 22px; height: 22px; color: var(--fg); }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { color: var(--fg-2); text-decoration: none; font-size: 13.5px; transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--fg); }
.nav .btn-small { margin-left: 0; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav .btn-small { margin-left: auto; }
}

/* ---------- the 3D canvas behind the pinned stages ---------- */
#gl {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block;
  opacity: 0; transition: opacity 0.6s var(--ease); pointer-events: none;
}
.gl-ready #gl { opacity: 1; }
.gl-ready #gl.off { opacity: 0; }
main { position: relative; z-index: 1; }
/* without WebGL, a still of the same chip stands in */
.gl-off .hero .sticky { background: url(../img/chip-poster.webp) center bottom / cover no-repeat; }
.footer { position: relative; z-index: 1; }

.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.concept-tag {
  position: absolute; right: var(--gut-r); bottom: calc(3.2vh + env(safe-area-inset-bottom, 0px));
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3);
}

/* ---------- 1. hero ---------- */
.hero { height: 270vh; }
.hero-copy {
  position: relative; padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(28px, 7vh, 92px));
  display: grid; justify-items: center; gap: 20px; text-align: center;
  padding-left: var(--gut-l); padding-right: var(--gut-r);
  will-change: opacity, transform;
}
.hero-copy .lead { text-align: center; max-width: 40ch; }
.hero-copy .cta-row { justify-content: center; margin-top: 6px; }
.js .hero-copy > * { animation: rise 1.2s var(--ease) both; }
.js .hero-copy > :nth-child(2) { animation-delay: 0.1s; }
.js .hero-copy > :nth-child(3) { animation-delay: 0.22s; }
.js .hero-copy > :nth-child(4) { animation-delay: 0.34s; }
.js .hero-copy > :nth-child(5) { animation-delay: 0.46s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero-caption {
  position: absolute; left: 0; right: 0; bottom: 11vh; text-align: center; opacity: 0;
  font-size: clamp(22px, 2.6vw, 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15;
  padding-left: var(--gut-l); padding-right: var(--gut-r);
}
.hero-caption span { display: block; color: var(--fg-3); }

/* ---------- 2. statement ---------- */
.statement {
  position: relative; padding-block: 34vh 26vh;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000 26vh);
}
.statement-text {
  font-size: clamp(30px, 4.4vw, 66px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1;
  max-width: 21ch;
}
.js .statement-text .w { opacity: 0.18; transition: opacity 0.25s linear; }

/* ---------- 3. problem ---------- */
.problem { position: relative; height: 360vh; background: #000; }
.problem::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28vh; pointer-events: none;
  background: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0));
}
.problem-copy { position: absolute; left: 0; right: 0; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 5vh); display: grid; gap: 14px; z-index: 2; }
.ev { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ev-frame { position: relative; flex: none; width: min(94vw, 1700px, 190vh); aspect-ratio: 3136 / 1344; margin-top: 0; }
.ev-frame img, .ev-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.ev-xray { filter: brightness(0.4) saturate(0) contrast(1.12); clip-path: inset(0 100% 0 0); }
.scanline {
  position: absolute; left: 0; top: 30%; height: 52%; width: 2px; margin-left: -1px; opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(255, 246, 225, 0.95) 30%, rgba(255, 246, 225, 0.95) 70%, transparent);
  box-shadow: 0 0 22px 3px rgba(226, 192, 122, 0.45);
}
.problem-steps { position: absolute; left: 0; right: 0; bottom: 10vh; display: grid; align-items: end; z-index: 2; }
.problem-steps p {
  grid-area: 1 / 1; max-width: 44ch; margin-inline: auto; text-align: center;
  font-size: clamp(18px, 1.6vw, 23px); line-height: 1.4; letter-spacing: -0.012em; color: var(--fg);
  opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.problem-steps p.on { opacity: 1; transform: none; }
.problem-steps p[data-step="2"] { font-size: clamp(24px, 2.6vw, 38px); font-weight: 600; letter-spacing: -0.03em; max-width: 30ch; }
.problem-steps p[data-step="2"] span { display: block; margin-top: 8px; font-size: 0.62em; font-weight: 500; letter-spacing: -0.01em; color: var(--gold); }
.problem-fine { position: absolute; left: 0; right: 0; bottom: calc(3.2vh + env(safe-area-inset-bottom, 0px)); text-align: center; }
@media (max-width: 760px) {
  .ev-frame { width: 160vw; margin-top: 6vh; }
}

/* ---------- 4. technology ---------- */
.tech { position: relative; padding-block: 22vh 14vh; background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000 22vh); }
.tech-head { display: grid; gap: 16px; text-align: center; justify-items: center; }
.tech-head .h-xl { max-width: 13ch; }
.diamond-stage { position: relative; margin: clamp(8px, 2vh, 28px) auto 0; width: min(100vw, 1100px); overflow: hidden; }
.diamond-stage img {
  width: 100%; height: auto; transform-origin: 50% 55%; will-change: transform, opacity;
  -webkit-mask-image: radial-gradient(62% 70% at 50% 52%, #000 55%, transparent 100%);
  mask-image: radial-gradient(62% 70% at 50% 52%, #000 55%, transparent 100%);
}
.section-head { display: grid; gap: 18px; max-width: 820px; margin-bottom: clamp(40px, 6vw, 84px); }
.cap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(24px, 4vh, 56px); }
.cap {
  background: linear-gradient(180deg, var(--panel-2), #08080a); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 30px 34px; display: grid; gap: 10px; align-content: start; min-width: 0; overflow: hidden;
}
.cap-viz { width: 100%; height: auto; margin-bottom: 18px; overflow: hidden; }
.cap-title { font-size: clamp(28px, 2.6vw, 40px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.cap-text { color: var(--fg-2); font-size: 16.5px; line-height: 1.5; }
.viz-axis { stroke: rgba(245, 245, 247, 0.12); stroke-width: 1; }
.viz-wave { fill: none; stroke: var(--fg); stroke-width: 1.6; animation: drift 5s linear infinite; }
.viz-a { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 420; stroke-dashoffset: 420; }
.viz-b { fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-dasharray: 420; stroke-dashoffset: 420; }
.tech.seen .viz-a, .tech.seen .viz-b { animation: draw 2.4s var(--ease) forwards; }
.tech.seen .viz-b { animation-delay: 0.15s; }
.viz-rough { fill: none; stroke: rgba(245, 245, 247, 0.22); stroke-width: 1.2; stroke-linejoin: round; }
.viz-steady { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 330; stroke-dashoffset: 330; }
.tech.seen .viz-steady { animation: draw 2.4s var(--ease) forwards; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-120px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tech-line {
  margin-top: clamp(40px, 8vh, 96px); text-align: center;
  font-size: clamp(22px, 2.6vw, 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; color: var(--fg-2);
}
@media (max-width: 900px) { .cap-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .diamond-stage { width: 150vw; margin-left: -25vw; } }

/* ---------- 7. applications ---------- */
.apps { position: relative; background: #000; }
.apps .sticky { position: relative; height: auto; overflow: visible; padding-block: 14vh 10vh; }
.apps.pinned .sticky { position: sticky; height: 100vh; height: 100svh; overflow: hidden; padding-block: 0; display: grid; grid-template-rows: auto 1fr auto; }
.apps-head { display: grid; gap: 14px; padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 5vh); }
.apps-head .lead { max-width: 48ch; }
.rail { margin-top: 5vh; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut-l) var(--gut-r); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.apps.pinned .rail { overflow: hidden; align-self: start; margin-top: 4vh; scroll-snap-type: none; }
.track { display: flex; gap: 20px; width: max-content; padding-left: var(--gut-l); padding-right: var(--gut-r); will-change: transform; }
.card { width: clamp(260px, 26vw, 380px); flex: none; display: grid; gap: 8px; align-content: start; scroll-snap-align: start; }
.apps.pinned .card { width: clamp(220px, min(22vw, 30vh), 360px); }
.apps.pinned .card h3 { font-size: 21px; }
.apps.pinned .card p:not(.card-tag) { font-size: 15px; }
.card-media { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.2s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card-art .card-media { background: radial-gradient(80% 60% at 50% 45%, #121216, #070708 70%); }
.card-tag { margin-top: 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.card-tag.gold { color: var(--gold); }
.card h3 { font-size: 23px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.card p:not(.card-tag) { color: var(--fg-2); font-size: 16px; max-width: 30ch; }
.card p.card-note { color: var(--fg-3); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.apps.pinned .card p.card-note { font-size: 12.5px; }
.apps-fine { padding-top: 3vh; padding-bottom: calc(3vh + env(safe-area-inset-bottom, 0px)); }
@media (max-height: 820px) {
  .apps.pinned .apps-head { padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 3vh); }
  .apps.pinned .rail { margin-top: 3vh; }
  .apps.pinned .card p.card-note { display: none; }
  .apps.pinned .card p:not(.card-tag) { font-size: 14px; }
  .apps.pinned .apps-fine { padding-top: 1.5vh; }
  .apps.pinned .apps-head .h-xl { font-size: clamp(36px, 9vh, 80px); }
  .apps.pinned .apps-head .lead { font-size: 17px; }
  .apps.pinned .card { width: clamp(200px, min(22vw, 26vh), 360px); }
  .apps.pinned .card h3 { font-size: 19px; }
}

/* ---------- 6. team ---------- */
.team { padding-block: 16vh 12vh; background: #000; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.people li { display: grid; gap: 4px; align-content: start; min-width: 0; }
.portrait {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22px; margin-bottom: 18px;
  border: 1px solid var(--line);
}
.people h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.people p { color: var(--fg-2); font-size: 15px; }
.people .cred { color: var(--fg-3); font-size: 13.5px; margin-top: 6px; }
@media (max-width: 1100px) { .people { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; } }
@media (max-width: 640px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 10. contact + footer ---------- */
.contact {
  padding-block: 24vh; text-align: center;
  background: radial-gradient(56% 46% at 50% 62%, rgba(226, 192, 122, 0.1), rgba(0, 0, 0, 0) 70%), #000;
}
.contact .eyebrow { margin-bottom: 18px; }
.contact .h-xl { max-width: 15ch; margin-inline: auto; }
.contact .cta-row { margin-top: 44px; }
.steps-row {
  list-style: none; margin: clamp(40px, 7vh, 72px) auto 0; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; text-align: left; position: relative;
}
.steps-row::before {
  content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(226, 192, 122, 0.08));
}
.steps-row li { position: relative; padding-top: 34px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.steps-row .step-n {
  position: absolute; top: 0; left: 0; padding-right: 12px; background: #000; line-height: 20px;
  font-family: var(--mono); font-size: 11.5px; color: var(--gold); letter-spacing: 0.1em;
}
.steps-row b { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.steps-row span:not(.step-n) { color: var(--fg-2); font-size: 14px; line-height: 1.45; }
@media (max-width: 760px) {
  .steps-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .steps-row::before { display: none; }
}
.contact-mail { margin-top: 18px; font-family: var(--mono); font-size: 14px; color: var(--fg-3); user-select: all; }
.footer { border-top: 1px solid var(--line); padding-block: 30px calc(44px + env(safe-area-inset-bottom, 0px)); background: #000; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer .fine { max-width: 72ch; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .viz-a, .viz-b, .viz-steady { stroke-dashoffset: 0; }
}
