/* ──────────────────────────────────────────────────────────
 * Viewership UI: foundation, Editorial preset
 * Warm paper, a serif display face, hairline rules and small radii. Reads like a magazine.
 *
 * Generated from the viewership-ui/theme v1 contract (preset "editorial").
 * A drop-in replacement for foundation.css with this preset as the
 * default: same tokens, keyframes and utilities. Paper unless
 * data-vs-mode="dark" or <html data-theme="dark">; otherwise follows the OS.
 * One preset only: data-vs-theme alternates (neutral and the themes.css
 * presets) are not included.
 * ────────────────────────────────────────────────────────── */

:root,
[data-vs-mode="light"] {
  color-scheme: light;
  --vs-page: #f4efe6;
  --vs-canvas: #ebe4d6;
  --vs-surface: #fffdf8;
  --vs-inset: #f8f3ea;
  --vs-field: #efe8db;
  --vs-hover: #f1eadd;
  --vs-hover-2: #e6dccb;
  --vs-ink: #1b1f1a;
  --vs-ink-2: #4b5148;
  --vs-ink-3: #747a6e;
  --vs-ink-inverse: #f4efe6;
  --vs-line: #ddd3c0;
  --vs-line-strong: #c9bda5;
  --vs-line-soft: #e8dfcd;
  --vs-accent: #a8421f;
  --vs-accent-ink: #8c3416;
  --vs-accent-tint: #f1dccf;
  --vs-on-accent: #fffdf8;
  --vs-green: #357045;
  --vs-green-tint: #dfe8da;
  --vs-orange: #9e5812;
  --vs-orange-tint: #f3e2c8;
  --vs-red: #b0341b;
  --vs-red-tint: #f4d9cc;
  --vs-tooltip-bg: #0d0809;
  --vs-tooltip-fg: #f2ece4;
  --vs-tooltip-muted: #a99e97;
  --vs-tooltip-border: #2b2023;
  --vs-elev-ring: #ddd3c0;
  --vs-elev-ring-strong: #c9bda5;
  --vs-shadow-xs: 0 1px 1px rgb(13 8 9 / 0.04), 0 1px 2px rgb(13 8 9 / 0.04);
  --vs-shadow-sm: 0 1px 2px rgb(13 8 9 / 0.04), 0 2px 4px rgb(13 8 9 / 0.04);
  --vs-shadow-md: 0 2px 4px rgb(13 8 9 / 0.04), 0 6px 14px rgb(13 8 9 / 0.05);
  --vs-shadow-lg: 0 4px 8px rgb(13 8 9 / 0.05), 0 16px 36px rgb(13 8 9 / 0.09);
  --vs-shadow-inset-field: inset 0 1px 2px rgb(13 8 9 / 0.1);
  --vs-font-sans: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --vs-font-stretch: 100%;
  --vs-font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --vs-radius-chip: 2px;
  --vs-radius-control: 2px;
  --vs-radius-card: 2px;
  --vs-radius-window: 4px;
  --vs-radius-pill: 2px;
  --vs-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --vs-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --vs-ease-link: cubic-bezier(0.16, 1, 0.3, 1);
  --vs-duration-fast: 150ms;
  --vs-duration: 300ms;
}

[data-vs-mode="dark"],
:root[data-theme="dark"] {
  color-scheme: dark;
  --vs-page: #10150f;
  --vs-canvas: #151b14;
  --vs-surface: #1b221a;
  --vs-inset: #161c15;
  --vs-field: #232b21;
  --vs-hover: #212920;
  --vs-hover-2: #2a3328;
  --vs-ink: #f1ebdd;
  --vs-ink-2: #b8bdab;
  --vs-ink-3: #858b79;
  --vs-ink-inverse: #10150f;
  --vs-line: #2c3529;
  --vs-line-strong: #3b4637;
  --vs-line-soft: #222a20;
  --vs-accent: #e08a62;
  --vs-accent-ink: #f0b595;
  --vs-accent-tint: rgb(224 138 98 / 0.16);
  --vs-on-accent: #10150f;
  --vs-green: #7fbf8e;
  --vs-green-tint: rgb(127 191 142 / 0.14);
  --vs-orange: #e2a35c;
  --vs-orange-tint: rgb(226 163 92 / 0.14);
  --vs-red: #f08a6b;
  --vs-red-tint: rgb(240 138 107 / 0.14);
  --vs-tooltip-bg: #2a1f22;
  --vs-tooltip-border: #3a2e31;
  --vs-elev-ring: rgb(241 235 221 / 0.1);
  --vs-elev-ring-strong: rgb(241 235 221 / 0.15);
  --vs-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.35);
  --vs-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.25), 0 2px 6px rgb(0 0 0 / 0.25);
  --vs-shadow-md: 0 2px 10px rgb(0 0 0 / 0.3);
  --vs-shadow-lg: 0 8px 28px rgb(0 0 0 / 0.45);
  --vs-shadow-inset-field: inset 0 1px 2px rgb(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --vs-page: #10150f;
    --vs-canvas: #151b14;
    --vs-surface: #1b221a;
    --vs-inset: #161c15;
    --vs-field: #232b21;
    --vs-hover: #212920;
    --vs-hover-2: #2a3328;
    --vs-ink: #f1ebdd;
    --vs-ink-2: #b8bdab;
    --vs-ink-3: #858b79;
    --vs-ink-inverse: #10150f;
    --vs-line: #2c3529;
    --vs-line-strong: #3b4637;
    --vs-line-soft: #222a20;
    --vs-accent: #e08a62;
    --vs-accent-ink: #f0b595;
    --vs-accent-tint: rgb(224 138 98 / 0.16);
    --vs-on-accent: #10150f;
    --vs-green: #7fbf8e;
    --vs-green-tint: rgb(127 191 142 / 0.14);
    --vs-orange: #e2a35c;
    --vs-orange-tint: rgb(226 163 92 / 0.14);
    --vs-red: #f08a6b;
    --vs-red-tint: rgb(240 138 107 / 0.14);
    --vs-tooltip-bg: #2a1f22;
    --vs-tooltip-border: #3a2e31;
    --vs-elev-ring: rgb(241 235 221 / 0.1);
    --vs-elev-ring-strong: rgb(241 235 221 / 0.15);
    --vs-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.35);
    --vs-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.25), 0 2px 6px rgb(0 0 0 / 0.25);
    --vs-shadow-md: 0 2px 10px rgb(0 0 0 / 0.3);
    --vs-shadow-lg: 0 8px 28px rgb(0 0 0 / 0.45);
    --vs-shadow-inset-field: inset 0 1px 2px rgb(0 0 0 / 0.45);
  }
}

/* Derived tokens, re-declared on every scope so they resolve against its palette. */
:root,
[data-vs-mode],
[data-vs-theme] {
  --vs-grid-line: color-mix(in srgb, var(--vs-line) 78%, transparent);
  --vs-shadow-hairline: 0 0 0 1px var(--vs-line);
  --vs-shadow-btn: 0 0 0 1px var(--vs-elev-ring-strong), var(--vs-shadow-xs);
  --vs-shadow-card: 0 0 0 1px var(--vs-elev-ring), var(--vs-shadow-sm);
  --vs-shadow-raised: 0 0 0 1px var(--vs-elev-ring), var(--vs-shadow-md);
  --vs-shadow-overlay: 0 0 0 1px var(--vs-elev-ring-strong), var(--vs-shadow-lg);
  --vs-focus-ring: 0 0 0 2px var(--vs-surface), 0 0 0 3.5px var(--vs-accent);
}

[data-vs-mode],
[data-vs-theme] {
  color: var(--vs-ink);
  font-family: var(--vs-font-sans);
  font-stretch: var(--vs-font-stretch);
}

/* Structure tokens, on :root only so a nested mode scope still inherits them. */
:root {
  --vs-container: 1160px;
  --vs-gutter: clamp(20px, 5cqi, 48px);
  --vs-section-y: clamp(56px, 9cqi, 112px);
  --vs-border-w: 1px;
  --vs-display-weight: 400;
  --vs-display-stretch: 100%;
  --vs-display-tracking: -0.02em;
  --vs-display-leading: 1.04;
  --vs-display-transform: none;
  --vs-accent-style: italic;
  --vs-font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

/* ── Shared keyframes (prefixed so they never collide with app CSS) ── */

@keyframes vs-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes vs-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes vs-pop-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes vs-shimmer-text {
  from { background-position: 150% center; }
  to { background-position: -50% center; }
}
@keyframes vs-pixel-on {
  0%, 100% { opacity: 0.15; }
  18%, 42% { opacity: 1; }
  62% { opacity: 0.15; }
}
@keyframes vs-spin {
  to { transform: rotate(360deg); }
}
@keyframes vs-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes vs-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── Shared utilities ── */

/* `hidden` always wins, even over a component's own `display` rule. */
:where([hidden]) {
  display: none !important;
}

/* Visually hidden but announced by screen readers. */
.vs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Display type for section headlines. Themes change the face, weight, case
 * and how an <em> accent word is drawn (italic serif, highlighter, colour). */
.vs-display {
  font-family: var(--vs-font-display, var(--vs-font-sans));
  font-weight: var(--vs-display-weight);
  font-stretch: var(--vs-display-stretch);
  letter-spacing: var(--vs-display-tracking);
  line-height: var(--vs-display-leading);
  text-transform: var(--vs-display-transform);
  text-wrap: balance;
  margin: 0;
}
.vs-display em {
  font-style: var(--vs-accent-style);
  font-family: var(--vs-accent-family, inherit);
  color: var(--vs-em-color, var(--vs-accent-ink));
  background: var(--vs-em-bg, none);
  padding-inline: var(--vs-em-pad, 0);
}

/* ── Reduced motion: components still render their end state ── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --vs-duration-fast: 0ms;
    --vs-duration: 0ms;
  }
}
