/* CrossModal Align Lab — borderless, open, Apple / Gemini / OpenAI keynote aesthetic. */
:root {
  color-scheme: light;
  --canvas: #fbfbfd;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --hairline: rgba(29, 29, 31, 0.08);
  --blue: #0071e3;
  --blue-soft: rgba(0, 113, 227, 0.09);
  --teal: #2b9c94;
  --teal-soft: rgba(43, 156, 148, 0.10);
  --coral: #e66a4e;
  --coral-soft: rgba(230, 106, 78, 0.11);
  --violet: #7b6bb0;
  --amber: #b7791f;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Google Sans Text", "Google Sans", "DM Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Google Sans Display", "Google Sans", "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Roboto Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 113, 227, 0.055), transparent 32rem),
    radial-gradient(circle at 86% 14%, rgba(230, 106, 78, 0.042), transparent 26rem),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  line-height: 1.68;
  letter-spacing: 0.012em;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.92em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Topbar with Trilogy Navigation Capsule */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 251, 253, 0.80);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.topbar__inner {
  width: min(1240px, calc(100% - 48px));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: var(--blue-soft);
}

.brand__mark svg { width: 17px; height: 17px; }
.brand__text { display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.brand__text strong { font-weight: 650; }
.brand__text span { color: var(--muted); font-weight: 450; }

.trilogy-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.045);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.trilogy-nav a { transition: color 200ms var(--ease); }
.trilogy-nav a:hover { color: var(--ink); }
.trilogy-nav a.is-current { color: var(--blue); font-weight: 620; }
.trilogy-nav__sep { color: rgba(29, 29, 31, 0.22); }

.topbar__meta { display: flex; align-items: center; gap: 9px; }

.live-pill, .compact-button {
  border: 0;
  background: rgba(29, 29, 31, 0.045);
  color: var(--ink-soft);
  border-radius: 999px;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
}

.compact-button:hover { background: rgba(29, 29, 31, 0.085); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(43, 156, 148, 0.12);
}

/* Main open scroll story */
.story {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 96px;
}

/* Hero */
.hero.hero--story {
  min-height: calc(100svh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0 54px;
  text-align: center;
}

.hero__center { width: 100%; max-width: 1060px; margin: 0 auto; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero--story h1, .showcase h2 {
  font-family: var(--display);
  font-weight: 540;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

.hero--story h1 {
  font-size: clamp(46px, 6.3vw, 84px);
  line-height: 1.14;
}

.hero--story h1 span, .showcase h2 span { color: var(--faint); }

.hero--story .hero__lede {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(15.5px, 1.45vw, 18.5px);
  line-height: 1.88;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 21px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 220ms var(--ease), transform 200ms var(--ease);
}

.btn svg { width: 15px; height: 15px; }
.btn--primary { color: #fff; background: var(--blue); box-shadow: 0 8px 22px rgba(0, 113, 227, 0.20); }
.btn--primary:hover { background: #0077ed; transform: translateY(-1px); }
.btn--secondary { color: var(--ink-soft); background: rgba(29, 29, 31, 0.055); }
.btn--secondary:hover { background: rgba(29, 29, 31, 0.095); }
.btn--quiet { color: var(--muted); background: transparent; }
.btn--quiet:hover { color: var(--ink); background: rgba(29, 29, 31, 0.04); }

.kpi-strip {
  max-width: 880px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kpi-item__num { font-family: var(--mono); font-size: clamp(20px, 2.2vw, 27px); font-weight: 600; color: var(--blue); }
.kpi-item__num--teal { color: var(--teal); }
.kpi-item__num--coral { color: var(--coral); }
.kpi-item__label { font-size: 11.5px; color: var(--faint); }

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 52px;
  color: #a1a1a6;
  font-size: 9px;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-cue svg { width: 16px; height: 24px; animation: scroll-cue 2.2s var(--ease) infinite; }
@keyframes scroll-cue {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  45% { transform: translateY(5px); opacity: 0.9; }
}

/* Open Scroll-Linked Showcase Sections */
.showcase {
  position: relative;
  min-height: 96svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 11vh 0;
  will-change: opacity, transform;
}

.showcase__head {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
}

.showcase h2 {
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 1.16;
}

.showcase__side { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }
.showcase__lede { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.86; text-wrap: pretty; }

/* Borderless controls & pills */
.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.045);
}

.mode-pill {
  min-height: 31px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

.mode-pill:hover { color: var(--ink); }
.mode-pill.is-active { color: var(--blue); background: rgba(255, 255, 255, 0.94); }
.mode-pill.is-danger.is-active { color: #fff; background: var(--coral); }

.control-strip {
  width: min(1120px, 100%);
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto;
  gap: 28px;
  align-items: center;
}

.control__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.control__value { font-family: var(--mono); font-size: 11.5px; color: var(--blue); font-weight: 600; }
.control__hint { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--faint); }

input[type="range"] { width: 100%; height: 20px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 999px; background: rgba(29, 29, 31, 0.12); }
input[type="range"]::-webkit-slider-thumb {
  width: 14px; height: 14px; margin-top: -5.5px; appearance: none; border: 0; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 5px rgba(0, 113, 227, 0.14);
}

.trap-gauges { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gauge { display: flex; flex-direction: column; gap: 2px; }
.gauge__label { font-size: 10.5px; color: var(--faint); }
.gauge strong { font-size: 17px; }
.gauge__teal { color: var(--teal); }
.gauge__blue { color: var(--blue); }
.gauge__coral { color: var(--coral); }

.oov-meta-row, .fsq-metrics-bar {
  width: min(1120px, 100%);
  margin: 26px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.oov-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.oov-metrics { display: flex; gap: 18px; font-size: 11.5px; color: var(--muted); }
.oov-metrics strong { color: var(--blue); }

.temporal-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 560;
}
.inline-tag--teal { background: var(--teal-soft); color: var(--teal); }

.domain-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.soft-button {
  min-height: 33px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink-soft);
  background: rgba(29, 29, 31, 0.05);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

.soft-button.is-on { color: var(--blue); background: var(--blue-soft); }

.fsq-metrics-bar { font-size: 11.5px; color: var(--muted); }
.metric-teal { color: var(--teal); }
.fsq-warn { color: var(--coral); opacity: 0.88; }

/* 100% Borderless Stages */
.stage {
  position: relative;
  width: min(1120px, 100%);
  margin: 24px auto 0;
  border: 0;
  background: transparent;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 8% 4% 6%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, rgba(0, 113, 227, 0.055), rgba(43, 156, 148, 0.018) 46%, transparent 72%);
  filter: blur(28px);
}

.stage > canvas { display: block; width: 100%; height: 100%; }
.stage--trap { height: clamp(300px, 32vw, 375px); }
.stage--oov { height: clamp(360px, 38vw, 440px); }
.stage--temporal { height: clamp(390px, 41vw, 465px); }
.stage--domain { height: clamp(380px, 40vw, 455px); }

.stage-foot {
  width: min(1120px, 100%);
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 10.5px;
}

.stage-note { font-family: var(--mono); font-size: 10px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 14px; height: 2.5px; border-radius: 2px; background: currentColor; }
.legend--blue { color: var(--blue); }
.legend--teal { color: var(--teal); }
.legend--coral { color: var(--coral); }
.legend--violet { color: var(--violet); }
.legend--muted { color: var(--faint); }

.footer {
  width: min(1120px, 100%);
  margin: 60px auto 0;
  padding: 20px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 11px;
}

.footer a:hover { color: var(--blue); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
  font-size: 11.5px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 260ms var(--ease), transform 320ms var(--ease);
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

@media (max-width: 980px) {
  .trilogy-nav { display: none; }
  .showcase__head, .control-strip { grid-template-columns: 1fr; gap: 20px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar__inner, .story { width: min(100% - 32px, 1240px); }
  .stage-foot, .footer { flex-direction: column; align-items: flex-start; }
}
