/* Qento Design System — Colors & Type
 * The only saturated color in the system is accent/gold (#F3C43D).
 * Everything else is a neutral. No gradients except the reserved 12-tone cover palette.
 */

/* ─────────────────────────────────────────────────────────
 * Fonts — self-hosted brand TTFs (shipped in fonts/)
 * ───────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Literata';
  src: url('fonts/Literata-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('fonts/Literata-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('fonts/Literata-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('fonts/Literata-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('fonts/Literata-BoldItalic.ttf') format('truetype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
/* Inter SemiBold (600) — we ship Medium (500), which is the closest weight and
   reads far better at small sizes than Bold (700). Overlines stay legible without
   looking heavy. Swap to a real SemiBold TTF here if one is added to fonts/. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Medium.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  /* ── Colors — LIGHT (default) ── */
  --bg-page: #FAFAFA;
  --bg-surface-secondary: #FAF7F2; /* cream */
  --bg-card: #FFFFFF;
  --bg-pill: #F5F5F5;

  --text-primary: #111111;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-tertiary: #999999;

  --accent-gold: #F3C43D;          /* the only saturated color */
  --text-gold: #C4A028;             /* overline labels, premium accents */

  --border: #E5E5E5;
  --destructive: #D04030;

  /* ── Shadows ── */
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-premium-glow:
    0 0 3px rgba(196, 160, 40, 0.9),
    0 0 8px rgba(196, 160, 40, 0.6),
    0 0 16px rgba(196, 160, 40, 0.3);

  /* ── Spacing ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-xxxl: 32px;
  --space-huge: 40px;
  --space-massive: 60px;

  /* ── Radii ── */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-xxl: 24px;
  --radius-pill: 28px;
  --radius-circle: 999px;

  /* ── Motion ── */
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --spring-responsive: cubic-bezier(0.2, 0.8, 0.3, 1.2); /* approximation */
  --spring-gentle:    cubic-bezier(0.3, 0.7, 0.4, 1.1);  /* approximation */

  /* ── Type families ── */
  --font-serif: 'Literata', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Semantic type tokens ── */
  /* Display / hero — two-part pattern: regular setup + BoldItalic payload word */
  --type-hero-size: clamp(44px, 8vw, 110px);
  --type-hero-line-height: 1.02;
  --type-hero-tracking: -0.01em;

  --type-section-size: clamp(32px, 4.2vw, 48px);
  --type-section-line-height: 1.08;
  --type-section-tracking: -0.01em;

  --type-body-serif-size: 20px;
  --type-body-serif-line-height: 1.5;

  --type-body-ui-size: 16px;
  --type-body-ui-line-height: 1.5;

  --type-caption-size: 13px;
  --type-overline-size: 11px;
  --type-overline-tracking: 0.12em;   /* 1.2 of 11px ≈ 0.12em */
  --type-button-size: 16px;
}

/* Dark mode — midnight ink. First-class, not a variant. */
:root[data-theme="dark"],
.theme-dark {
  --bg-page: #0D0D14;
  --bg-surface-secondary: #1B1B27;
  --bg-card: #15151E;
  --bg-pill: #1F1F2B;

  --text-primary: #F4EDE4;           /* warm cream — never pure white */
  --text-secondary: rgba(244, 237, 228, 0.60);
  --text-tertiary: #ABABAE;

  --accent-gold: #F3C43D;            /* gold never shifts */
  --text-gold: #D4B640;              /* brighter gold for dark-mode contrast */

  --border: #282836;
  --destructive: #E85D4A;

  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.40);
  --shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #0D0D14;
    --bg-surface-secondary: #1B1B27;
    --bg-card: #15151E;
    --bg-pill: #1F1F2B;
    --text-primary: #F4EDE4;
    --text-secondary: rgba(244, 237, 228, 0.60);
    --text-tertiary: #ABABAE;
    --text-gold: #D4B640;
    --border: #282836;
    --destructive: #E85D4A;
    --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.40);
    --shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.55);
  }
}

/* ─────────────────────────────────────────────────────────
 * Semantic element styles
 * ───────────────────────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  font-size: var(--type-body-ui-size);
  line-height: var(--type-body-ui-line-height);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Hero: h1 — Literata Regular. Wrap the emphasized word in <em> for the BoldItalic payload. */
h1, .q-hero {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--type-hero-size);
  line-height: var(--type-hero-line-height);
  letter-spacing: var(--type-hero-tracking);
  color: var(--text-primary);
  margin: 0;
}
h1 em, .q-hero em, .q-payload {
  font-style: italic;
  font-weight: 700;
}

/* Section titles */
h2, .q-section {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--type-section-size);
  line-height: var(--type-section-line-height);
  letter-spacing: var(--type-section-tracking);
  color: var(--text-primary);
  margin: 0;
}

/* Smaller serif heading */
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

/* Body — in prose regions use serif; in UI regions use sans. */
p {
  font-family: var(--font-sans);
  font-size: var(--type-body-ui-size);
  line-height: var(--type-body-ui-line-height);
  color: var(--text-primary);
  margin: 0;
  text-wrap: pretty;
}

.q-prose, .q-body-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--type-body-serif-size);
  line-height: var(--type-body-serif-line-height);
  color: var(--text-primary);
  text-wrap: pretty;
}

.q-prose em, .q-italic {
  font-style: italic;
}

/* Overline — the "STORIES THAT LEARN WHO YOU ARE" register */
.q-overline {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--type-overline-size);
  letter-spacing: var(--type-overline-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.q-overline--gold { color: var(--text-gold); }

/* Caption */
.q-caption {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--type-caption-size);
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Buttons — pill, gold, Inter Bold 16 */
.q-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--type-button-size);
  color: #111111;
  background: var(--accent-gold);
  padding: 16px 28px;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-default),
              box-shadow var(--dur-fast) var(--ease-default);
}
.q-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.q-btn:active { transform: translateY(0); }

.q-btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* Gold accent line — 56 × 1px */
.q-accent-line {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--accent-gold);
  border: 0;
  margin: 22px 0 16px;
}
.q-accent-line--sm { width: 40px; }

/* Cursor — blinking gold bar on the text baseline, em-scaled so it works at any size */
.q-cursor {
  display: inline-block;
  width: 0.06em;
  height: 0.92em;
  background: var(--accent-gold);
  vertical-align: -0.08em;
  margin-left: 0.06em;
  animation: q-blink 1.2s steps(2, end) infinite;
  font-size: 0;
  line-height: 0;
}
@keyframes q-blink { 50% { opacity: 0; } }

/* Pulse ring — 1.6s easeOut, repeats */
@keyframes q-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(243, 196, 61, 0.55); }
  100% { box-shadow: 0 0 0 22px rgba(243, 196, 61, 0.0); }
}
.q-pulse { animation: q-pulse 1.6s ease-out infinite; }

/* Cards */
.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxl);
  box-shadow: var(--shadow-card);
}
.q-card--dense { border-radius: var(--radius-md); }
.q-card--cream { background: var(--bg-surface-secondary); }

/* Pill */
.q-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Reading column — a novel's column, not a SaaS slab */
.q-column { max-width: 720px; margin-inline: auto; }
