/* Detail Technologies — shared visual system.
 *
 * Reusable across product demo pages (clear-demo, uhm-demo, future).
 * Drop-in: load Geist + Geist Mono, import this file, then a page-specific
 * stylesheet for layout. Primitives below are class-based (not utility),
 * so a page can compose them in markup without a build step.
 *
 * Tokens are declared on :root and can be overridden per-page.
 */

:root {
  /* Palette */
  --ink: #0a0a0f;
  --ink-soft: #2a2a33;
  --muted: #8a8a93;
  --line: #e8e8ea;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --accent: #5b3df5;
  --accent-soft: rgba(91, 61, 245, 0.12);

  /* Type */
  --font-display: "Geist", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-black: 900;

  /* Display type scale — keep large; the brand voice is loud. */
  --size-eyebrow: 0.78rem;
  --size-meta: 0.78rem;
  --size-body: 1.125rem;
  --size-lead: 1.5rem;
  --size-h3: 2.5rem;
  --size-h2: 4.5rem;
  --size-h1: 7rem;
  --size-stat: 5rem;

  /* Spacing */
  --pad-page: clamp(1.25rem, 4vw, 4.5rem);
  --gap-card: clamp(3rem, 7vw, 7rem);
  --radius: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  /* Brand is intentionally light. Force light so the page matches the cards. */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--size-body);
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─────────── Layout primitives ─────────── */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--pad-page);
}

.card {
  position: relative;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.card:last-of-type { border-bottom: 0; }

/* Eyebrow: small purple dot + uppercase mono label. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--size-eyebrow);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(2rem, 5vw, 4rem);
}
.eyebrow::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.eyebrow .right { margin-left: auto; color: var(--muted); }

/* Display headlines — three sizes. */
.display {
  font-weight: var(--weight-black);
  font-size: clamp(3rem, 9vw, var(--size-h1));
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0;
}
.display-md {
  font-weight: var(--weight-black);
  font-size: clamp(2.5rem, 6vw, var(--size-h2));
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
}
.display-sm {
  font-weight: var(--weight-bold);
  font-size: clamp(1.75rem, 3.5vw, var(--size-h3));
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
}
.display .accent,
.display-md .accent,
.display-sm .accent { color: var(--accent); }
.display .dot { color: var(--accent); }

/* Lead paragraph — slightly larger body, accent-able. */
.lead {
  font-size: clamp(1.125rem, 1.6vw, var(--size-lead));
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 38ch;
}
.lead .accent { color: var(--accent); font-weight: var(--weight-bold); }

/* Stat block — big number, mono caption. */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(1.25rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat .num {
  font-weight: var(--weight-black);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat .num.accent { color: var(--accent); }
.stat .label {
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Meta row — small mono labels separated by middots. */
.meta {
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Bar comparator — two stacked rows with rounded bars. */
.bar-compare {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) 1fr auto;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  margin: 1rem 0;
}
.bar-compare .lbl {
  display: flex; flex-direction: column;
}
.bar-compare .lbl .who { font-weight: var(--weight-bold); font-size: 1.05rem; }
.bar-compare .lbl .where {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase;
}
.bar-compare .track {
  height: 14px; border-radius: 999px; background: var(--surface-soft);
  overflow: hidden; position: relative;
}
.bar-compare .fill {
  height: 100%; border-radius: 999px;
  background: var(--ink);
}
.bar-compare .fill.accent { background: var(--accent); }
.bar-compare .val {
  font-weight: var(--weight-bold); font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  min-width: 4ch;
  text-align: right;
}
.bar-compare .val.accent { color: var(--accent); }

/* Pill button — used for play, model toggle, file picker. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.pill:hover { background: var(--surface-soft); }
.pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.pill.ghost { color: var(--muted); }
.pill:disabled { opacity: 0.4; cursor: not-allowed; }

/* App tile — used in CTA. */
.app-tile {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}
.app-tile .name {
  font-size: 1.75rem;
  font-weight: var(--weight-black);
  letter-spacing: -0.02em;
}
.app-tile .platforms {
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-tile .status {
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--accent);
  letter-spacing: 0.05em;
}
.app-tile .status.ghost { color: var(--muted); }

/* Footer — DETAIL TECHNOLOGIES / page count. */
.brand-footer {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Credits — sits above the brand footer; links to base models + datasets. */
.credits {
  padding: 1rem 0 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  color: var(--muted);
  letter-spacing: 0.05em;
  line-height: 1.7;
}
.credits .credits-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.6rem;
  color: var(--muted);
}
.credits a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.credits a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Inline link inside flowing prose — keeps the body type, just adds a subtle
   underline. Reserve plain <a> styling for menu/CTA contexts. */
.inline-link {
  color: inherit;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}
.inline-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Two-column grid — used on intro, devices, CTA. */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
}
@media (min-width: 760px) {
  .cols-2 { grid-template-columns: 1fr 1fr; }
}
