/* ─────────────────────────────────────────────────────────────────
   Modern — console / instrument (cool greys + cyan rule)
   Sharper, more technical. Mono-led meta, Inter-led body.
   ───────────────────────────────────────────────────────────────── */

html[data-theme="modern"] {
  --color-background: oklch(98% 0.004 240);
  --color-foreground: oklch(18% 0.014 240);
  --color-card: oklch(99.4% 0.002 240);
  --color-card-foreground: oklch(18% 0.014 240);
  --color-popover: oklch(99.4% 0.002 240);
  --color-popover-foreground: oklch(18% 0.014 240);
  --color-primary: oklch(48% 0.13 240);
  --color-primary-foreground: oklch(99% 0.002 240);
  --color-secondary: oklch(94% 0.006 240);
  --color-secondary-foreground: oklch(20% 0.018 240);
  --color-muted: oklch(94% 0.006 240);
  --color-muted-foreground: oklch(46% 0.016 240);
  --color-accent: oklch(70% 0.13 200);
  --color-accent-foreground: oklch(18% 0.014 240);
  --color-destructive: oklch(56% 0.2 25);
  --color-destructive-foreground: oklch(99% 0.002 240);
  --color-border: oklch(88% 0.008 240);
  --color-input: oklch(88% 0.008 240);
  --color-ring: oklch(48% 0.13 240 / 0.45);

  --radius-sm: 0.125rem;
  --radius-md: 0.1875rem;
  --radius-lg: 0.25rem;
  --radius-xl: 0.375rem;

  --font-sans:
    "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Newsreader", ui-serif, Georgia, serif;
  --font-mono:
    "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --surface-page: var(--color-background);
  --surface-rail: oklch(96% 0.005 240);
  --surface-inset: oklch(94.5% 0.007 240);
  --surface-elevated: var(--color-card);
  --surface-dialog: var(--color-card);
  --surface-player: color-mix(in oklab, var(--color-primary) 8%, transparent);

  --surface-app: var(--surface-page);
  --surface-panel: var(--surface-rail);
  --surface-panel-strong: var(--surface-elevated);
  --surface-empty: color-mix(in oklab, var(--color-muted) 65%, transparent);
  --border-subtle: color-mix(in oklab, var(--color-border) 72%, transparent);

  --rule-color: oklch(86% 0.01 240);
  --rule-strong-color: oklch(28% 0.02 240);
  --rule-style: solid;

  --accent-primary: oklch(48% 0.13 240);
  --accent-secondary: oklch(64% 0.13 200);
  --accent-warning: oklch(70% 0.16 75);
  --accent-danger: oklch(56% 0.2 25);
  --accent-success: oklch(58% 0.15 155);

  /* Cool ambience — soft cyan glow at top */
  --ambience-image:
    radial-gradient(
      ellipse at 78% -10%,
      oklch(70% 0.13 200 / 0.16),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 5% 110%,
      oklch(50% 0.13 250 / 0.1),
      transparent 50%
    );
  --noise-opacity: 0.018;

  --radius-card: var(--radius-md);
  --radius-control: var(--radius-sm);
  --radius-dialog: var(--radius-lg);
  --radius-chip: 999px;

  --panel-header-height: 2.875rem;
  --panel-section-padding-x: 1rem;
  --panel-section-padding-y: 0.875rem;
  --composer-max-width: 56rem;
  --session-column-max-width: 56rem;

  --eyebrow-font-family: var(--font-mono);
  --eyebrow-font-size: 0.6875rem;
  --eyebrow-font-weight: 500;
  --eyebrow-letter-spacing: 0.16em;
  --eyebrow-text-transform: uppercase;

  --title-font-family: var(--font-sans);
  --title-font-style: normal;
  --title-font-weight: 600;
  --title-letter-spacing: -0.005em;
  --title-text-transform: none;

  --story-font-family: var(--font-sans);
  --story-font-size: 0.9375rem;
  --story-line-height: 1.72;
  --story-font-weight: 400;
  --story-letter-spacing: 0;
  --story-max-width: 54rem;

  --shadow-card: 0 1px 0 var(--color-border);
  --shadow-dialog: 0 24px 70px -32px oklch(20% 0.02 240 / 0.4);
  --shadow-pop: 0 8px 24px -16px oklch(20% 0.02 240 / 0.25);
}

/* Modern emphasizes the print-number marker meta */
html[data-theme="modern"] .ui-section-head {
  border-top: 1px solid var(--rule-strong-color);
  padding-top: 0.5rem;
}

html[data-theme="modern"] .ui-message-row {
  align-items: flex-start;
}

html[data-theme="modern"] .ui-message-player {
  background: transparent;
  color: var(--color-foreground);
  border-width: 0 0 0 2px;
  border-color: var(--accent-secondary);
  border-radius: 0;
  max-width: var(--story-max-width);
  padding: 0.25rem 0 0.25rem 0.875rem;
}

/* ── Dark scheme ─────────────────────────────────────────────── */
html.dark[data-theme="modern"],
html[data-theme="modern"].dark {
  --color-background: oklch(15% 0.018 240);
  --color-foreground: oklch(94% 0.006 240);
  --color-card: oklch(17% 0.02 240);
  --color-card-foreground: oklch(94% 0.006 240);
  --color-popover: oklch(17% 0.02 240);
  --color-popover-foreground: oklch(94% 0.006 240);
  --color-primary: oklch(72% 0.13 200);
  --color-primary-foreground: oklch(15% 0.018 240);
  --color-secondary: oklch(20% 0.022 240);
  --color-secondary-foreground: oklch(92% 0.008 240);
  --color-muted: oklch(20% 0.022 240);
  --color-muted-foreground: oklch(62% 0.018 240);
  --color-accent: oklch(72% 0.13 200);
  --color-accent-foreground: oklch(15% 0.018 240);
  --color-destructive: oklch(62% 0.2 25);
  --color-destructive-foreground: oklch(96% 0.005 240);
  --color-border: oklch(26% 0.022 240);
  --color-input: oklch(26% 0.022 240);
  --color-ring: oklch(72% 0.13 200 / 0.5);

  --surface-page: oklch(13% 0.016 240);
  --surface-rail: oklch(15% 0.018 240);
  --surface-inset: oklch(18% 0.02 240);
  --surface-elevated: oklch(20% 0.022 240);
  --surface-dialog: oklch(20% 0.022 240);
  --surface-player: color-mix(
    in oklab,
    var(--accent-secondary) 12%,
    transparent
  );

  --rule-color: oklch(28% 0.022 240);
  --rule-strong-color: oklch(64% 0.018 240);

  --accent-primary: oklch(72% 0.13 200);
  --accent-secondary: oklch(80% 0.1 200);
  --accent-warning: oklch(78% 0.16 80);
  --accent-success: oklch(68% 0.14 155);

  --ambience-image:
    radial-gradient(
      ellipse at 78% -10%,
      oklch(72% 0.13 200 / 0.1),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 5% 110%,
      oklch(60% 0.16 250 / 0.08),
      transparent 50%
    );
  --noise-opacity: 0.04;

  --shadow-card: 0 1px 0 var(--color-border);
  --shadow-dialog: 0 28px 80px -36px rgb(0 0 0 / 0.65);
}
