@import url("/basis-flags.css");
@import url("/samples/site-shell.css");

/* Basis — shared audio sample styles for /audio2, /emotional, /conversations
   and the admin sample preview, on the Basis sky/light palette. The clips /
   play / take / player class names are shared with the Mood Swings sample so the
   ported player JS renders the embedded "Data Sample" identically. */
:root {
  --bg: #ffffff;
  --panel: #f5f9fc;
  --bg-band: #eaf4fc;
  --ink: #0e2a3a;
  --ink-soft: #2c4a5c;
  --muted: #5f7787;
  --rule: #e7eef3;
  --accent: #1f8fd8;
  --highlight: #cfe8fa;
  --sky-top: #5cb2e6;
  --sky-mid: #74c1ec;
  --sky-bottom: #93d2f2;
  --serif: "Archivo", sans-serif;
  /* Surfaces (overridden in dark). */
  --card: #ffffff;
  --on-ink: #ffffff; /* text on ink-filled buttons/badges */
}

/* Dark palette — applied when the OS prefers dark (unless the visitor forced
   light) or when the header toggle sets data-theme="dark". Values mirror the
   app's globals.css dark palette so all Basis surfaces match. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b161e;
    --panel: #0f1e29;
    --bg-band: #14252f;
    --ink: #e9f1f7;
    --ink-soft: #b8ccd8;
    --muted: #8aa0af;
    --rule: #223441;
    --accent: #4fb3f0;
    --highlight: #14384f;
    --sky-top: #16324a;
    --sky-mid: #1d4364;
    --sky-bottom: #2f6690;
    --card: #122230;
    --on-ink: #0b1b26;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b161e;
  --panel: #0f1e29;
  --bg-band: #14252f;
  --ink: #e9f1f7;
  --ink-soft: #b8ccd8;
  --muted: #8aa0af;
  --rule: #223441;
  --accent: #4fb3f0;
  --highlight: #14384f;
  --sky-top: #16324a;
  --sky-mid: #1d4364;
  --sky-bottom: #2f6690;
  --card: #122230;
  --on-ink: #0b1b26;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, opacity 160ms ease;
}
a:hover { border-bottom-color: currentColor; }

main, .footer { max-width: 1120px; margin: 0 auto; padding: 0 40px; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}

.viz-hero { padding: 136px 0 110px; max-width: 900px; position: relative; z-index: 1; }
.viz-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.03;
  letter-spacing: -0.018em;
  margin: 0 0 28px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(20, 60, 90, 0.22);
}
.lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  max-width: 760px;
  margin: 0 0 22px;
  letter-spacing: -0.005em;
  text-shadow: 0 1px 10px rgba(20, 60, 90, 0.18);
}

/* ---------- Capacity band (statement + projects left, stats right) ---------- */
.capacity { padding: 56px 0 8px; }
.capacity-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px 64px;
  align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.capacity-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
  color: var(--ink);
  max-width: 22ch;
}
.meta-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.meta-list li {
  font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 12.5px; letter-spacing: 0.02em; color: var(--ink-soft);
  display: flex; align-items: center; gap: 12px;
}
.meta-list li.cap-note { margin-top: 12px; color: var(--muted); }
.tick { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }

.cap-stats { display: flex; flex-direction: column; gap: 24px; margin: 0; }
.cap-stats-label { margin: 0 0 -10px; }
.cap-stats > div {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
.cap-stats dt {
  font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); order: 2;
}
.cap-stats dd {
  margin: 0; font-family: var(--serif); font-size: 44px; font-weight: 400; line-height: 1;
  letter-spacing: -0.02em; order: 1;
  background: linear-gradient(160deg, var(--ink) 0%, var(--accent) 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.stat-unit { font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums; font-size: 14px; letter-spacing: 0.04em; color: var(--muted); margin-left: 6px; -webkit-text-fill-color: var(--muted); }
.stat-suffix { font-family: var(--serif); font-size: 30px; letter-spacing: -0.01em; color: var(--muted); margin-left: 2px; -webkit-text-fill-color: var(--muted); }

/* The overview's capacity figures share the sky with the introduction. */
.viz-hero--with-stats { max-width: none; padding-bottom: 54px; }
.viz-hero--with-stats .viz-title { max-width: 900px; }
.hero-capacity { margin-top: 30px; }
.hero-capacity .cap-stats-label { margin: 0 0 12px; color: #fff; }
.hero-capacity .cap-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hero-capacity .cap-stats > div { padding: 18px 20px; gap: 10px; }
.hero-capacity .cap-stats dd { white-space: nowrap; font-size: clamp(32px, 3.8vw, 44px); }
@media (max-width: 760px) {
  .viz-hero.viz-hero--with-stats { padding-bottom: 42px; }
  .hero-capacity { margin-top: 24px; }
  .hero-capacity .cap-stats { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Clips / Data Sample section ---------- */
.clips { padding: 56px 0 80px; }
.clips-header { margin: 0 0 16px; }
.clips-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 12px; }
.clips-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.clips-note { margin: 0; max-width: 640px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

/* "Full & custom samples…" sub-line + a Reach-out pill (send icon → email) */
.clips-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.reach-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  border-bottom: 0; white-space: nowrap;
  transition: background 140ms ease, transform 140ms ease;
}
.reach-pill:hover { background: var(--accent); color: #fff; transform: translateY(-1px); border-bottom: 0; }
.reach-pill svg { display: block; }
:root[data-theme="dark"] .reach-pill:hover { color: #06131c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .reach-pill:hover { color: #06131c; }
}

.pill {
  display: inline-flex; align-items: center; padding: 4px 11px;
  font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px; line-height: 1.2; background: var(--panel);
}
.pill--new { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill--demo { background: var(--panel); }

/* Single reading column (portal-style), centered and capped for legibility. */
.clips-header { max-width: 940px; margin: 0 auto; }
.ds-toolbar { display: flex; align-items: center; justify-content: flex-end; }
#clips-mount, .sample-list { display: flex; flex-direction: column; gap: 22px; padding-top: 24px; max-width: 940px; margin: 0 auto; }

/* ---------- Play box (one shared line + its steered takes) ---------- */
.play {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 22px 22px 20px;
  box-shadow: 0 1px 2px rgba(20, 60, 90, 0.04), 0 12px 32px rgba(20, 60, 90, 0.05);
}
.play-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.play-line { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.play-demographics { display: flex; flex-wrap: wrap; gap: 6px; }
.play-takes { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Take (steering prompt above a slim player) ---------- */
.take { display: flex; flex-direction: column; gap: 6px; }
.take-steer { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.3; font-style: italic; text-align: left; color: var(--ink-soft); }
.take-steer .hi {
  font-style: italic; font-weight: 600; color: var(--accent);
  background: linear-gradient(transparent 60%, var(--highlight) 60%);
  padding: 0 1px; border-radius: 1px;
}

/* ---------- Audio player ---------- */
.clip-audio-wrap { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-band); border-radius: 999px; }
.clip-audio { display: none; }
.clip-play {
  appearance: none; border: 0; background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 600;
  font-size: 12px; letter-spacing: 0.02em; padding: 6px 12px; border-radius: 999px; cursor: var(--basis-cursor-pointer, pointer);
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  transition: background 140ms ease, transform 140ms ease;
}
.clip-play:hover { background: var(--accent); }
.clip-play:disabled { opacity: 0.5; cursor: not-allowed; }
.clip-play-icon { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; margin-left: 1px; }
.clip-play.is-playing .clip-play-icon {
  /* two 3px bars with 3px of air — at 8px wide the gap was 2px and read as a square (owner, 2026-09-02) */
  width: 9px; height: 10px; border: 0; background: currentColor;
  -webkit-mask: linear-gradient(currentColor, currentColor) left/3px 100% no-repeat, linear-gradient(currentColor, currentColor) right/3px 100% no-repeat;
          mask: linear-gradient(currentColor, currentColor) left/3px 100% no-repeat, linear-gradient(currentColor, currentColor) right/3px 100% no-repeat;
  margin: 0;
}
.clip-scrubber { flex: 1; height: 12px; cursor: var(--basis-cursor-pointer, pointer); display: flex; align-items: center; outline: none; position: relative; }
.clip-scrubber::before { content: ""; display: block; width: 100%; height: 3px; background: rgba(14, 42, 58, 0.14); border-radius: 2px; position: relative; }
.clip-scrubber-fill { position: absolute; height: 3px; width: 0%; background: var(--accent); border-radius: 2px; pointer-events: none; transition: width 80ms linear; top: 50%; transform: translateY(-50%); left: 0; }
.clip-duration { font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; flex-shrink: 0; }

/* ---------- Foot / contact ---------- */
.viz-foot { padding: 72px 0 96px; border-top: 1px solid var(--rule); }
.viz-foot > p:first-child {
  max-width: 720px; font-weight: 500; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.3;
  letter-spacing: -0.018em; margin: 0 0 36px; color: var(--ink);
}
.contact-line { display: flex; gap: 16px; font-size: 17px; margin: 0; align-items: baseline; }
.contact-line .muted { min-width: 220px; font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: 0.04em; }
.contact-line a { font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--rule); }
.contact-line a:hover { border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding-top: 40px; padding-bottom: 56px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.footer-meta { font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: 0.04em; color: var(--muted); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .capacity-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  main, .footer, .sky-inner { padding: 0 22px; }
  .viz-hero { padding: 104px 0 96px; }  /* clear the fixed floating nav pill */
  #clips-mount, .sample-list { gap: 18px; padding-top: 20px; }
  .contact-line { flex-direction: column; gap: 4px; }
  .contact-line .muted { min-width: 0; }
}

/* ======================================================================
   Data Sample — Soundstage (speaker-grouped) + Mood Swings (translated)
   Mirrors the customer portal's in-world project view.
   ====================================================================== */

/* Translations toggle */
.ds-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  background: none; border: 0; cursor: var(--basis-cursor-pointer, pointer); padding: 6px 0;
}
.ds-toggle .track { position: relative; width: 38px; height: 20px; border-radius: 999px; background: var(--rule); transition: background 160ms ease; flex: none; }
.ds-toggle .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(20, 60, 90, 0.3); transition: left 160ms ease; }
.ds-toggle.on .track { background: var(--accent); }
.ds-toggle.on .knob { left: 20px; }

/* Small uppercase eyebrow label (Direction / Script / Line / Neutral) */
.eyebrow-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ELO badge + info popover */
.elo-wrap { display: inline-flex; align-items: center; gap: 7px; }
.elo-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
.info-btn {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--card); color: var(--muted);
  font-size: 11px; font-weight: 700; line-height: 1; cursor: var(--basis-cursor-pointer, pointer); padding: 0;
  transition: border-color 140ms ease, color 140ms ease;
}
.info-btn:hover { border-color: var(--accent); color: var(--accent); }

.popover-wrap { position: relative; display: inline-flex; }
.popover-backdrop { position: fixed; inset: 0; z-index: 30; cursor: var(--basis-cursor-default, default); }
.popover {
  position: absolute; z-index: 40; top: calc(100% + 8px); width: 264px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 14px;
  text-align: left; box-shadow: 0 12px 30px rgba(20, 60, 90, 0.18);
}
.popover--right { right: 0; }
.popover--left { left: 0; }
.popover-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.popover-body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); }

/* Card wrapper — one per Soundstage speaker / per Mood Swings line. */
.ds-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 22px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 60, 90, 0.04), 0 12px 32px rgba(20, 60, 90, 0.05);
}
/* Shared header: data-TYPE label + flag + demographics (+ ELO for Soundstage).
   The two data types are tinted differently so they read distinctly. */
.ds-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px;
  padding: 13px 22px; border-bottom: 1px solid var(--rule);
}
.ds-head--ss { background: var(--panel); }
.ds-head--ms { background: rgba(31, 143, 216, 0.09); }
.ds-type { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.ds-flag { --flag-width: 25.2px; }
.ds-meta { font-size: 13.5px; color: var(--muted); }
.ds-elo { margin-left: auto; }
.ds-body { padding: 18px 22px; }

/* Soundstage takes: two per row, each its own bordered cell. */
.ss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.ss-card { border: 1px solid var(--rule); border-radius: 16px; padding: 16px; }
.ss-card--neutral { padding: 14px 16px; }
/* Collapse a prolific speaker's takes to the first two; "More" reveals the rest. */
.ss-grid .ss-card:nth-child(n + 3) { display: none; }
.ds-card.is-expanded .ss-grid .ss-card:nth-child(n + 3) { display: block; }
.ss-more {
  appearance: none; cursor: var(--basis-cursor-pointer, pointer); display: inline-flex; align-items: center;
  margin: 0 16px 16px; padding: 7px 14px; border-radius: 999px;
  font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: transparent; border: 1px solid var(--rule);
  transition: background 140ms ease, border-color 140ms ease;
}
.ss-more:hover { background: var(--panel); border-color: var(--accent); }
.direction { min-width: 0; }
.direction-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.direction-text { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--accent); text-transform: capitalize; }
.direction-text--sm { font-size: 15px; font-weight: 600; color: var(--ink); text-transform: none; }
.subline { margin-top: 4px; font-size: 13px; font-style: italic; line-height: 1.35; color: var(--muted); }

.block { margin-top: 14px; }
.script { margin: 4px 0 0; font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.script--neutral { font-weight: 400; font-size: 14.5px; }
.emote {
  display: inline-flex; align-items: center; margin: 0 2px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--panel); vertical-align: baseline;
  font-size: 12px; font-style: italic; font-weight: 500; color: var(--muted);
}

/* Transcription disclosure */
.disclosure { margin-top: 11px; }
.disclosure-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: var(--basis-cursor-pointer, pointer);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  transition: color 140ms ease;
}
.disclosure-btn:hover { color: var(--ink); }
.disclosure-caret { font-size: 8px; transition: transform 160ms ease; }
.disclosure.open .disclosure-caret { transform: rotate(90deg); }
.disclosure-body { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* Player spacing inside cards */
.ss-card .clip-audio-wrap, .ms-take .clip-audio-wrap { margin-top: 12px; }

/* Mood Swings body: shared line + steered takes (two per row). */
.ms-line { margin-bottom: 16px; }
.ms-line-primary { margin-top: 3px; font-family: var(--serif); font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.ms-line-secondary { margin-top: 5px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.ms-takes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ms-take { background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; padding: 14px; }

@media (max-width: 640px) {
  .ms-takes, .ss-grid { grid-template-columns: 1fr; }
  .ds-head, .ds-body { padding-left: 18px; padding-right: 18px; }
}
