/* ==========================================================================
   FOLIO — design tokens & themes
   An elegant "modern literary journal" design system for Notion widgets.

   Light theme  = ivory paper, warm cream, parchment, ink, muted gold
   Dark theme   = dark paper, charcoal ink, muted warm highlights
   ========================================================================== */

:root {
  /* --- palette: light (ivory paper) --- */
  --paper-0: #f8f4e9;        /* page background */
  --paper-1: #fffdf5;        /* cards / raised surfaces */
  --paper-2: #f1ebda;        /* wells / inset surfaces */
  --ink-900: #242018;        /* headings */
  --ink-700: #40392b;        /* body text */
  --ink-500: #6f6654;        /* secondary text */
  --ink-300: #a39a86;        /* muted text */
  --line: #e4dcc6;           /* hairline borders */
  --line-strong: #cec2a2;    /* stronger borders */
  --accent: #8f2f26;         /* deep burgundy (per-widget override) */
  --accent-ink: #fdf6ea;     /* text on accent */
  --accent-soft: rgba(143, 47, 38, 0.09);
  --gold: #a17a2c;           /* muted gold */
  --gold-soft: rgba(161, 122, 44, 0.12);
  --forest: #3d6b50;         /* dark forest green */
  --forest-soft: rgba(61, 107, 80, 0.12);
  --danger: #a63b2c;
  --danger-soft: rgba(166, 59, 44, 0.1);

  /* --- shadows --- */
  --shadow-card: 0 1px 1px rgba(64, 48, 22, 0.05), 0 3px 12px rgba(64, 48, 22, 0.06);
  --shadow-pop: 0 14px 38px rgba(52, 40, 16, 0.24);
  --focus-ring: 0 0 0 3px rgba(143, 47, 38, 0.32);

  /* --- geometry --- */
  --radius: 12px;
  --radius-sm: 8px;

  /* --- typography --- */
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ==========================================================================
   DARK THEME — dark paper & charcoal ink (deliberately not an inversion)
   ========================================================================== */
[data-theme="dark"] {
  --paper-0: #191610;        /* dark paper */
  --paper-1: #221e17;        /* card */
  --paper-2: #2c271f;        /* inset */
  --ink-900: #efe6d2;        /* warm paper ink */
  --ink-700: #d9cfb8;
  --ink-500: #a89d85;
  --ink-300: #7d735f;
  --line: #372f26;
  --line-strong: #4c4233;
  --accent: #c4644a;         /* warm rust, readable on dark paper */
  --accent-ink: #1d130d;
  --accent-soft: rgba(196, 100, 74, 0.16);
  --gold: #c9a45c;
  --gold-soft: rgba(201, 164, 92, 0.13);
  --forest: #7aa685;
  --forest-soft: rgba(122, 166, 133, 0.14);
  --danger: #d0665a;
  --danger-soft: rgba(208, 102, 90, 0.14);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 16px 44px rgba(0, 0, 0, 0.6);
  --focus-ring: 0 0 0 3px rgba(196, 100, 74, 0.4);
}

/* ==========================================================================
   BASE
   ========================================================================== */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--paper-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 0.8em; }

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

::selection { background: var(--accent-soft); color: var(--ink-900); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid var(--paper-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* Respect reduced motion everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
