/* The Carseum site: full-screen scenes that snap, like a car brand's page,
   in the app's own look: dark, Carseum blue, Barlow and IBM Plex. */
:root {
  --bg: #07080b;
  --surface: #10141a;
  --raised: #181e26;
  --ink: #eef2f6;
  --muted: #8f9aa7;
  --line: #222932;
  --accent: #168bff;
  --accent-soft: #0e2540;
  --gold: #ffc043;
  --display: "Barlow", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }
@media (min-width: 900px) and (pointer: fine) { html.snap { scroll-snap-type: y mandatory; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img, video, canvas { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); line-height: 0.98; margin: 0; text-wrap: balance; }
h1, h2 { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.005em; }
h1 { font-size: clamp(54px, 10vw, 128px); }
h2 { font-size: clamp(40px, 6.4vw, 84px); }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 0; max-width: 46ch; }
.mono { font-family: var(--mono); }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.kicker.gold { color: var(--gold); }
.gutter {
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
}

/* ---- Top bar: clear over the hero, solid once you scroll ---- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.top.solid { background: rgba(7, 8, 11, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.top .bar { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand span { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: 0.03em; line-height: 1; }
.brand small { display: block; color: var(--accent); font-size: 10px; letter-spacing: 0.35em; }
nav.links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
nav.links a { color: var(--ink); opacity: 0.78; text-decoration: none; font-weight: 500; font-size: 14.5px; padding: 6px 12px; border-radius: 8px; transition: background 0.25s, opacity 0.25s; }
nav.links a:hover { opacity: 1; background: rgba(255, 255, 255, 0.07); }
nav.links a[aria-current="page"] { opacity: 1; }
@media (max-width: 560px) { nav.links a.opt { display: none; } }

/* ---- Scenes ---- */
.scene {
  position: relative; min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start; overflow: hidden;
  display: grid; align-items: center;
  padding-block: calc(84px + env(safe-area-inset-top, 0px)) 56px;
}
.scene .inner {
  width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 90px); align-items: center;
}
.scene.flip .copy { order: 2; }
.copy { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.copy p { color: var(--muted); font-size: clamp(17px, 1.7vw, 20px); }
.media { display: grid; place-items: center; min-width: 0; }
.glow::before {
  content: ""; position: absolute; inset: auto; width: 70vmin; height: 70vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 139, 255, 0.22), transparent 62%);
  right: 6%; top: 50%; transform: translateY(-50%); pointer-events: none;
}
.scene.flip.glow::before { right: auto; left: 6%; }

/* Buttons: wide and calm, like a car configurator */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 190px;
  padding: 13px 26px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px;
  color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px); transition: transform 0.25s var(--ease), background 0.25s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2f98ff; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; padding: 7px 14px; border-radius: 99px; border: 1px solid rgba(22, 139, 255, 0.6); color: #7dbbff; background: rgba(14, 37, 64, 0.7); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---- Phone frame ---- */
.phone {
  position: relative; height: min(76svh, 760px); aspect-ratio: 1206 / 2622;
  padding: 11px; border-radius: 52px; background: linear-gradient(160deg, #2a313b, #0d1015 40%, #1a1f27);
  box-shadow: 0 0 0 1px #343c47, 0 50px 120px rgba(0, 0, 0, 0.6), 0 0 90px rgba(22, 139, 255, 0.16);
}
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 42px; overflow: hidden; background: #000; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.sample-tag {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap;
}

/* CarPlay: the car's screen in a dashboard bezel */
.car-screen {
  position: relative; width: min(100%, 720px); aspect-ratio: 800 / 480; padding: 14px;
  border-radius: 26px; background: linear-gradient(170deg, #252b33, #0b0d11);
  box-shadow: 0 0 0 1px #343c47, 0 50px 120px rgba(0, 0, 0, 0.6), 0 0 90px rgba(22, 139, 255, 0.14);
}
.car-screen video, .car-screen img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.car-screen .sample-tag { bottom: -32px; }

/* Renders of the Dash mounts, blended into the page */
.render { width: 100%; border-radius: 22px; -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 58%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 58%, transparent 100%); }

/* ---- Hero ---- */
.hero { text-align: center; }
.hero .inner { grid-template-columns: 1fr; justify-items: center; }
.hero .copy { justify-items: center; position: relative; z-index: 2; }
.hero .copy p { max-width: 52ch; }
.hero .cta { justify-content: center; }
.hero h1 .word { display: inline-block; }
.collage { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 4vw; z-index: 0; pointer-events: none; }
.collage .phone { height: min(70svh, 620px); opacity: 0.32; filter: blur(1px) saturate(0.9); }
.collage .phone:nth-child(1) { transform: rotate(-10deg) translateY(6%); }
.collage .phone:nth-child(2) { transform: translateY(-4%); }
.collage .phone:nth-child(3) { transform: rotate(10deg) translateY(8%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 45%, rgba(7, 8, 11, 0.55), rgba(7, 8, 11, 0.94) 70%); }
.scroll-hint { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); z-index: 2; transform: translateX(-50%); color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; display: grid; justify-items: center; gap: 6px; text-decoration: none; }
.scroll-hint::after { content: ""; width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

/* ---- Feature list scene ---- */
.points { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--muted); }
.points li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: var(--accent); }

/* ---- Dot rail ---- */
.rail { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); z-index: 15; display: grid; gap: 12px; }
.rail button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; cursor: pointer; transition: transform 0.3s var(--ease), background 0.3s; }
.rail button.on { background: var(--accent); border-color: var(--accent); transform: scale(1.35); }
@media (max-width: 899px) { .rail { display: none; } }

/* ---- Final scene and footer ---- */
.final .inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.final .copy { justify-items: center; }
footer { border-top: 1px solid var(--line); padding-block: 30px calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; scroll-snap-align: end; }
footer .inner { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer a { color: var(--muted); }

/* ---- Reading sections (Dash page): normal scrolling ---- */
.flow { padding-block: clamp(70px, 9vw, 120px); border-top: 1px solid var(--line); scroll-snap-align: start; }
.flow .inner { max-width: 1240px; margin: 0 auto; display: grid; gap: 22px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; width: 100%; }
.specs div { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; }
.specs b { font-family: var(--mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.specs small { color: var(--muted); font-size: 12.5px; }
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--raised); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); padding: 13px 15px; border-radius: 10px; max-width: none; }
.callout b { color: var(--gold); }
.dl { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.note { font-size: 13px; color: var(--muted); max-width: none; }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; color: var(--muted); }
ol.steps li::before { content: counter(s); font-family: var(--display); font-weight: 800; font-size: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
ol.steps li > div { padding-top: 5px; min-width: 0; }

/* 3D viewer */
.showcase { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; touch-action: pan-y; }
.showcase.in-media { position: relative; height: min(70svh, 640px); }
@media (max-width: 899px) { .showcase.in-media { height: 56svh; } }
.viewer-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
@media (max-width: 760px) { .viewer-wrap { grid-template-columns: 1fr; } }
.part-picker { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .part-picker { flex-direction: row; flex-wrap: wrap; } .group-label { width: 100%; } }
.group-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.part-picker button { font: 500 14.5px var(--body); text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; cursor: pointer; }
.part-picker button:hover { border-color: var(--accent); }
.part-picker button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: #7dbbff; font-weight: 600; }
.viewer { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(circle at 50% 35%, #1b222c, #0b0d11); overflow: hidden; }
#stage { width: 100%; height: clamp(320px, 52vw, 500px); touch-action: none; cursor: grab; }
.viewer-info { position: absolute; left: 14px; top: 12px; display: grid; pointer-events: none; }
.viewer-info b { font-family: var(--display); font-size: 21px; }
.viewer-info span { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.viewer-status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; max-width: none; }
.viewer-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.viewer-actions a, .viewer-actions button { font: 600 13px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; text-decoration: none; }

/* ---- Phones: the visual fills the scene, text over it at the bottom ---- */
@media (max-width: 899px) {
  .scene { align-items: end; padding-block: calc(70px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)); }
  .scene .inner { grid-template-columns: 1fr; gap: 0; }
  .scene .media { position: absolute; inset: calc(96px + env(safe-area-inset-top, 0px)) 0 auto; z-index: 0; }
  .scene .phone { height: 60svh; }
  .scene .car-screen { width: 92%; }
  .scene:not(.hero):not(.final)::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, transparent 30%, rgba(7, 8, 11, 0.78) 58%, var(--bg) 82%); pointer-events: none; }
  .scene .copy { position: relative; z-index: 2; order: 2; }
  .scene.flip .copy { order: 2; }
  .sample-tag { bottom: auto; top: -26px; }
  .glow::before { right: 50%; top: 32%; transform: translate(50%, -50%); }
  .scene.flip.glow::before { left: auto; }
  .hero, .final { align-items: center; }
  .collage .phone:nth-child(1), .collage .phone:nth-child(3) { display: none; }
  .collage .phone { height: 70svh; }
}

/* ---- Motion (only once the script has started, and not for reduced motion) ---- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 110ms); }
.js .in .reveal { opacity: 1; transform: none; }
.js .rise { opacity: 0; transform: translateY(60px) scale(0.94); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: 0.12s; }
.js .in .rise { opacity: 1; transform: none; }
.parallax { transform: translateY(calc(var(--p, 0) * -36px)); will-change: transform; }
.js .hero h1 .word { opacity: 0; transform: translateY(0.35em) skewX(-6deg); animation: word-in 1s var(--ease) forwards; animation-delay: calc(0.15s + var(--i) * 0.14s); }
@keyframes word-in { to { opacity: 1; transform: none; } }
.js .collage { animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(-1.5%) scale(1.02); } to { transform: translateY(1.5%) scale(1.06); } }
.scroll-hint::after { animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(0, 5px) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .rise, .js .hero h1 .word { opacity: 1; transform: none; transition: none; animation: none; }
  .js .collage, .scroll-hint::after { animation: none; }
  .parallax { transform: none; }
}

/* Reading sections */
.muted { color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 34px; }
.two-col .col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.flow .specs { margin-top: 4px; }

/* Hero with the visual beside the text (Dash page) */
.hero.hero-split { text-align: left; }
.hero.hero-split .inner { grid-template-columns: 1fr 1fr; justify-items: stretch; }
.hero.hero-split .copy { justify-items: start; }
.hero.hero-split .cta { justify-content: flex-start; }
.hero.hero-split::after { display: none; }
@media (max-width: 899px) { .hero.hero-split .inner { grid-template-columns: 1fr; } .hero.hero-split { align-items: end; } }
