/* ==========================================================================
   iooivault — design tokens ("Kami · 紙")
   Warm parchment canvas, single ink-blue accent, serif-led hierarchy,
   all grays warm-toned. Dark theme = token overrides under
   [data-theme="dark"] only (lamplit deep-dark, not pitch black).
   ========================================================================== */

:root {
  /* ---- color: parchment & ink ----------------------------------------- */
  --paper:        #f5f4ed;   /* page background — parchment, never pure white */
  --paper-raised: #faf9f5;   /* ivory — cards, callouts, inputs */
  --paper-sunken: #ecebe1;   /* code blocks, wells, hovers */
  --ink:          #141413;   /* primary text — near black, warm */
  --ink-soft:     #504e49;   /* secondary text, bylines — olive */
  --ink-faint:    #6b6a64;   /* tertiary: dates, captions, placeholders — stone */
  --hairline:     #e3e0d4;   /* 1px rules everywhere — warm border */
  --hairline-strong: #b9b6a8;

  /* ---- color: ink-blue accent (single accent, ≤5% of any surface) ----- */
  --brand:        #1B365D;   /* links, marks, Ray's 按, title bars */
  --brand-strong: #122440;   /* hover / active */
  --brand-wash:   #EEF2F7;   /* tinted backgrounds (solid, parchment-mixed) */

  /* ---- color: semantic ------------------------------------------------- */
  --ok:    #4a6741;
  --error: #8a3b2a;

  /* ---- type stacks (system fonts only — no webfonts, GFW-safe) -------- */
  /* One serif per page: headings and body share the same family. */
  --font-display: Charter, "Iowan Old Style", Georgia, "Palatino Linotype",
                  Palatino, "Songti SC", "Source Han Serif SC",
                  "Noto Serif CJK SC", "Noto Serif SC", STSong, serif;
  --font-body:    var(--font-display);
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas,
                  "Songti SC", monospace;

  /* ---- type scale ------------------------------------------------------ */
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;   /* UI chrome */
  --text-read: 1.125rem;    /* article body */
  --text-lg:   1.1875rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.375rem;

  --leading-tight: 1.25;
  --leading-ui:    1.55;
  --leading-read:  1.8;     /* CJK-comfortable reading rhythm */

  --tracking-caps: 0.12em;  /* small-caps section labels */

  /* ---- space scale ------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* ---- structure -------------------------------------------------------- */
  --sidebar-w: 17rem;
  --measure: 68ch;          /* article body max width */
  --radius: 6px;
  --radius-lg: 10px;        /* cards, hero images */
  /* whisper shadow — depth without hard drop shadows */
  --shadow-soft: 0 4px 24px rgba(20, 20, 19, 0.05);

  /* ---- motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms;
  --t-slow: 320ms;

  color-scheme: light;
}

/* ==========================================================================
   Dark theme — lamplit study on deep dark, warm silver text
   ========================================================================== */
[data-theme="dark"] {
  --paper:        #141413;
  --paper-raised: #1f1f1d;
  --paper-sunken: #0e0e0d;
  --ink:          #e8e6dc;
  --ink-soft:     #b0aea5;   /* warm silver */
  --ink-faint:    #7a786f;
  --hairline:     rgba(232, 230, 220, 0.12);
  --hairline-strong: rgba(232, 230, 220, 0.30);

  --brand:        #7C9FC4;   /* ink-blue, lifted for dark surfaces */
  --brand-strong: #9DBBD9;
  --brand-wash:   rgba(124, 159, 196, 0.10);

  --ok:    #8fae84;
  --error: #d98a73;

  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 24px rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}
