/* Chewi AI coming-soon page. One theme (dark), one accent (blue), four semantic data colours. */

@font-face { font-family: 'Space Grotesk'; font-weight: 400; font-display: swap; src: url('../fonts/space-grotesk-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url('../fonts/space-grotesk-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-display: swap; src: url('../fonts/jetbrains-mono-latin-600.woff2') format('woff2'); }

:root {
  --bg: #0b0d10;
  --bg-elevated: #12161b;
  --hairline: #1c2229;
  --fg: #e9edf1;
  --fg-muted: #8b95a1;
  --accent: #4da3ff;
  --accent-ink: #0b0d10;
  --c-contact: #4ade80;
  --c-grip: #38d6e0;
  --c-support: #a78bfa;
  --c-rotation: #f5b544;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 6px;
  --top: 64px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; font-size: 17px; overflow-x: hidden; }
::selection { background: rgba(77, 163, 255, 0.35); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }

/* ---- top bar ---------------------------------------------------------- */

.top {
  position: absolute; inset: 0 0 auto 0; height: var(--top);
  display: flex; align-items: center; padding: 0 var(--gutter);
  z-index: 2;
}
.wordmark {
  font-weight: 700; letter-spacing: 0.22em; font-size: 15px; text-decoration: none;
  display: inline-flex; gap: 0.35em;
}
.wordmark span { color: var(--accent); }

/* ---- hero ------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(100dvh, 700px);
  padding: calc(var(--top) + 16px) var(--gutter) 16px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero-copy { max-width: 40rem; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2.1rem, 3.6vw, 4.6rem); }
.lede { margin-top: 22px; font-size: clamp(1.0625rem, 1.15vw, 1.3rem); color: var(--fg-muted); max-width: 34rem; }

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 34px; padding: 14px 22px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; text-decoration: none; letter-spacing: 0.01em;
  border-radius: var(--radius); white-space: nowrap;
  transition: transform 160ms var(--ease-out), background 160ms var(--ease-out);
}
.cta:hover { background: #6ab4ff; }
.cta:active { transform: translateY(1px) scale(0.99); }
.cta svg { width: 16px; height: 16px; }

.holo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  max-height: calc(100dvh - var(--top) - 56px);
  align-self: center;
}
.holo-stage { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.holo-stage.is-hover { cursor: pointer; }
.holo-stage.is-dragging { cursor: grabbing; }
.holo-hint {
  position: absolute; left: 6px; bottom: 4px; margin: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--fg-muted);
  opacity: 0; transition: opacity 600ms var(--ease-out) 1.2s;
  pointer-events: none;
}
.holo[data-mode="webgl"] .holo-hint, .holo[data-mode="reduced"] .holo-hint { opacity: 0.7; }
.holo .holo-hint.is-done { opacity: 0; transition-delay: 0s; }
.holo-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 900ms var(--ease-out);
}
.holo[data-mode="webgl"] canvas, .holo[data-mode="reduced"] canvas { opacity: 1; }
.holo-stage canvas[hidden] { display: none; }
.hero-image { aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--top) - 56px); cursor: default; }
.hero-image img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  /* the render's own black is a shade darker than the page: feather the edges so it melts in */
  -webkit-mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, #000 58%, transparent 100%);
}
.hero-image .hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  opacity: 0; transition: opacity 700ms var(--ease-out);
  -webkit-mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, #000 58%, transparent 100%);
}
.hero-image.has-video .hero-video { opacity: 1; }
.hero-image .holo-leaders circle { filter: drop-shadow(0 0 3px currentColor); }
.hero-image .tag { opacity: 0; }
.hero-image.is-hover { cursor: pointer; }
.hero .holo-stage { max-height: calc(100dvh - var(--top) - 32px); }
.hero-image { perspective: 1400px; }
.hero-plate { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; transition: transform 120ms linear; }
.hero-image .holo-tags { pointer-events: none; }
.hero-image .tag { pointer-events: auto; cursor: pointer; background: rgba(11, 13, 16, 0.86); font: inherit; text-align: left; }
.hero-image .tag:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.hero-image .tag.is-active { background: color-mix(in srgb, var(--c) 28%, #0b0d10); box-shadow: 0 0 0 1px var(--c); }
.hero-image.is-scrubbing { cursor: grabbing; }
.hero-image .holo-hint { left: 10px; bottom: 8px; }
.hero-detail {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  width: min(360px, calc(100% - 24px));
  padding: 14px 40px 14px 16px;
  background: rgba(11, 13, 16, 0.94); border: 1px solid var(--c, var(--hairline)); border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.hero-detail[hidden] { display: none; }
.hero-detail-close { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: var(--fg-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.hero-detail-close:hover { color: var(--fg); }
.hero-detail-kind { display: flex; gap: 10px; align-items: baseline; font-family: var(--mono); }
.hero-detail-kind .tag-kind { font-size: 12px; }
.hero-detail-kind .tag-id { font-size: 12px; }
.hero-detail-role { margin-top: 6px; font-weight: 700; }
.hero-detail-note { margin-top: 6px; color: var(--fg-muted); font-size: 14px; line-height: 1.45; }
.hero-detail-link { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--accent); text-decoration: none; letter-spacing: 0.06em; }
.hero-detail-link:hover { text-decoration: underline; }
.manifest tr.is-active td { background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); }
.manifest tr.is-active .m-id { color: var(--c, var(--fg)); }
.holo-leaders, .holo-tags { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.holo-leaders line { stroke-width: 1; }

.tag {
  position: absolute; top: 0; left: 0;
  display: grid; gap: 1px; padding: 5px 8px 6px;
  font-family: var(--mono); line-height: 1.15;
  background: rgba(11, 13, 16, 0.86);
  border: 1px solid var(--c);
  border-radius: 4px;
  opacity: 0; will-change: transform, opacity;
  transition: background-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.tag.is-hot { background: color-mix(in srgb, var(--c) 22%, #0b0d10); box-shadow: 0 0 0 1px var(--c); }
.tag-kind { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--c); }
.tag-id { font-size: 10px; color: var(--fg-muted); }
@media (max-width: 599px) {
  .tag { padding: 3px 6px 4px; gap: 0; }
  .tag-kind { font-size: 9.5px; letter-spacing: 0.1em; }
  .tag-id { display: none; }
}

.holo-fallback { position: absolute; inset: 0; margin: 0; }
.holo-fallback img { width: 100%; height: 100%; object-fit: contain; display: block; }
.holo-fallback[hidden] { display: none; }

/* ---- demo ------------------------------------------------------------- */

section, footer { padding: 96px var(--gutter); }
.demo {
  padding-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.demo-copy .lede { max-width: 30rem; }
.demo-copy .caption { margin-top: 22px; }
.demo h2, .layers h2, .close h2 { font-size: clamp(1.7rem, 2.6vw, 3.1rem); }
.demo-frame {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.demo-frame video { width: 100%; height: 100%; display: block; object-fit: cover; background: var(--bg-elevated); }
.caption { margin-top: 14px; color: var(--fg-muted); font-size: 15px; max-width: 60ch; }

.deltas { grid-column: 1 / -1; margin-top: 8px; }
.deltas h3 { margin: 0 0 16px; font-size: clamp(1.05rem, 1.2vw, 1.35rem); font-weight: 700; letter-spacing: -0.01em; }
.delta-table { width: 100%; border-collapse: collapse; font-size: clamp(15px, 1vw, 18px); }
.delta-table th, .delta-table td { text-align: left; padding: 12px 24px 12px 0; vertical-align: top; }
.delta-table th { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; color: var(--fg-muted); border-bottom: 1px solid var(--hairline); }
.delta-table td { border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent); }
.delta-table tr:last-child td { border-bottom: 0; }
.delta-table td:nth-child(1) { color: var(--fg); width: 30%; }
.delta-table td:nth-child(2) { color: var(--fg-muted); font-family: var(--mono); font-size: 0.92em; width: 28%; }
.delta-table td:nth-child(3) { color: var(--c-contact); font-family: var(--mono); font-size: 0.92em; }
.deltas .caption { margin-top: 16px; }

/* ---- layers ----------------------------------------------------------- */

.layers .intro { margin-top: 18px; color: var(--fg-muted); max-width: 62ch; font-size: clamp(1.05rem, 1.15vw, 1.3rem); }
.layer-grid {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.layer-grid li {
  grid-column: span 2;
  padding: clamp(24px, 2vw, 36px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.layer-grid li:nth-child(1), .layer-grid li:nth-child(2) { grid-column: span 3; }
.layer-grid li[data-tint="grip"] { background: color-mix(in srgb, var(--c-grip) 9%, var(--bg-elevated)); border-color: color-mix(in srgb, var(--c-grip) 24%, var(--hairline)); }
.layer-grid li[data-tint="contact"] { background: color-mix(in srgb, var(--c-contact) 9%, var(--bg-elevated)); border-color: color-mix(in srgb, var(--c-contact) 24%, var(--hairline)); }
.layer-grid h3 { margin: 0 0 8px; font-size: clamp(1.05rem, 1.2vw, 1.35rem); font-weight: 700; letter-spacing: -0.01em; }
.layer-grid p { color: var(--fg-muted); font-size: clamp(15px, 1vw, 18px); }
.built-for { margin-top: 32px; font-family: var(--mono); font-size: 13px; color: var(--fg-muted); }

/* ---- section holograms ------------------------------------------------ */

.holo { position: relative; }
.holo[data-scene] .holo-stage { aspect-ratio: 5 / 4; max-height: 620px; }
.layers-head, .standards-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px); align-items: center;
}
.standards-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.layers-head .caption, .standards-head .caption { margin-top: 22px; max-width: 34rem; }
.layers-head + .layer-grid { margin-top: 56px; }
.standards-head + .standards-cols { margin-top: 64px; }

/* ---- problem + flow --------------------------------------------------- */

.problem h2 { max-width: 22ch; }
.problem .lede { margin-top: 22px; max-width: 62ch; }
.flow {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.flow li { position: relative; padding: 28px 40px 30px 0; display: grid; gap: 8px; }
.flow li + li { padding-left: 40px; border-left: 1px solid var(--hairline); }
.flow li + li::before {
  content: ''; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px;
  border-top: 1px solid var(--accent); border-right: 1px solid var(--accent);
  transform: translateY(-50%) rotate(45deg); background: var(--bg);
}
.flow li:nth-child(2) .flow-k { color: var(--accent); }
.flow-k { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }
.flow-v { color: var(--fg-muted); font-size: clamp(15px, 1vw, 18px); }

/* ---- manifest --------------------------------------------------------- */

.manifest-section {
  padding-top: 24px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px); align-items: start;
}
.manifest-copy .lede { max-width: 34rem; }
.manifest-copy .caption { margin-top: 22px; }
.manifest-wrap {
  overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--bg-elevated);
}
.manifest { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: clamp(12px, 0.85vw, 14px); }
.manifest th, .manifest td { text-align: left; padding: 11px 18px; white-space: nowrap; }
.manifest th { color: var(--fg-muted); font-weight: 400; letter-spacing: 0.08em; border-bottom: 1px solid var(--hairline); }
.manifest td { border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent); }
.manifest tr:last-child td { border-bottom: 0; }
.manifest .m-id { color: var(--fg); }
.manifest .m-kind { color: var(--c); font-weight: 600; letter-spacing: 0.1em; }
.manifest .m-joint { color: var(--fg-muted); }
.manifest td:nth-child(3) { color: var(--fg-muted); font-family: var(--sans); font-size: 15px; }

/* ---- where ------------------------------------------------------------ */

.where-list {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px);
}
.where-list li { padding: 22px 0 24px; border-top: 1px solid var(--hairline); }
.where-list h3, .where-notes h3 { margin: 0 0 6px; font-size: clamp(1.05rem, 1.2vw, 1.35rem); font-weight: 700; letter-spacing: -0.01em; }
.where-list p, .where-notes p { color: var(--fg-muted); font-size: clamp(15px, 1vw, 18px); }
.where-notes {
  margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px);
}
.where-notes p { max-width: 52ch; }

/* ---- standards -------------------------------------------------------- */

.standards .lede { margin-top: 22px; max-width: 62ch; }
.standards-cols {
  margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px);
}
.standards-cols > div { border-top: 2px solid var(--accent); padding-top: 22px; }
.standards-cols > div:nth-child(2) { border-top-color: var(--c-contact); }
.standards-cols h3 { margin: 0 0 6px; font-size: clamp(1.15rem, 1.4vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em; }
.standards-cols > div > p { color: var(--fg-muted); }
.standards-cols ul { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.standards-cols li { color: var(--fg-muted); font-size: clamp(15px, 1vw, 18px); padding-left: 0; }
.standards-cols li b { color: var(--fg); font-weight: 700; margin-right: 8px; }

/* ---- close ------------------------------------------------------------ */

.close { border-top: 1px solid var(--hairline); padding-bottom: 64px; }
.close .lede { margin-top: 18px; max-width: 58ch; }
.close { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.close .credit { grid-column: 1 / -1; }
.close .cta { justify-self: start; }
.credit { margin-top: 64px; font-family: var(--mono); font-size: 12px; color: var(--fg-muted); letter-spacing: 0.06em; }

/* ---- responsive ------------------------------------------------------- */

@media (max-width: 899px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: calc(var(--top) + 8px);
    padding-bottom: 32px;
    align-content: start;
    gap: 28px;
    min-height: 0;
  }
  .holo-stage { aspect-ratio: 4 / 3; max-height: none; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  .cta { margin-top: 26px; }
  section, footer { padding: 64px var(--gutter); }
  .demo, .close, .manifest-section, .where-list, .where-notes, .standards-cols, .layers-head, .standards-head { grid-template-columns: minmax(0, 1fr); }
  .standards-head .holo { order: 2; }
  .holo[data-scene] .holo-stage { aspect-ratio: 4 / 3; max-height: none; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--hairline); }
  .flow li + li::before { left: 0; top: -7px; transform: rotate(135deg); }
  .flow li { padding-right: 0; }
  .where-notes { margin-top: 24px; }
  .demo-copy { margin-top: 20px; }
  .layer-grid { grid-template-columns: minmax(0, 1fr); }
  .layer-grid li, .layer-grid li:nth-child(1), .layer-grid li:nth-child(2) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .holo-stage canvas, .cta { transition: none; }
}
