/* Copied from docs/1974-design-system/tokens.css, the source of truth. Do not edit here:
   change the original and copy it over again (see README.md). */
/* ==========================================================================
   1974 — Design Tokens
   "Roll 3d6 in order. No, you can't swap them."

   An OSR / old-school D&D design system for a mobile app, pulled out of the
   TOME lineage of Creature Feature: B/X & AD&D 1e module covers, the blue
   dungeon map, Monster Manual stat blocks, house rules and character
   record sheets. Set in clean, readable faces throughout.

   Every value here is mirrored in tokens.json for native (iOS / Android).
   Contrast ratios are noted next to each text pairing (WCAG 2.2).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=Archivo:wdth,wght@62..125,400..900&family=Rye&display=swap");

:root {
  /* ---------- Raw palette -------------------------------------------- */
  /* Ink & paper */
  --c-ink:          #120d0b;  /* pen & ink black, slightly warm             */
  --c-crypt:        #1c1512;  /* dungeon dark                               */
  --c-tomb:         #2a201b;  /* raised dark surface                        */
  --c-coffin:       #3b2d26;  /* borders on dark                            */
  --c-bone:         #f1e6cc;  /* module paper                               */
  --c-parchment:    #e4d3a6;  /* aged interior page                         */
  --c-vellum:       #f7f1e3;  /* light raised surface                       */
  --c-dust:         #a99a80;  /* muted text on dark                (7.0:1)  */
  --c-umber:        #5f5548;  /* muted text on white               (7.3:1)  */
  --c-pencil:       #3d3a3f;  /* No. 2 pencil                     (11.2:1)  */
  --c-graphite:     #bdb7c2;  /* pencil catching lamplight (dark)  (9.7:1)  */

  /* Module cover bands */
  --c-module-blue:  #2c5b98;  /* B-series band    bone on it 5.5:1          */
  --c-module-green: #2f6b3a;  /* X-series band    bone on it 5.2:1          */
  --c-dragon:       #a3221b;  /* red ink: drop caps, damage  6.0:1 on bone  */
  --c-lamp:         #c9861a;  /* lantern amber   ink on it 6.4:1            */

  /* Map */
  --c-map-blue:     #3f86c6;  /* solid rock on the blue map  ink on it 5.0:1 */
  --c-map-line:     #bcd8f0;  /* grid lines (decorative only)               */

  /* Dark-theme tints of the above */
  --c-module-blue-lit:  #7fb0e6;  /* 8.5:1 on ink */
  --c-dragon-lit:       #e0605a;  /* 5.5:1 on ink */
  --c-module-green-lit: #7cc08a;  /* 9.0:1 on ink */

  /* ---------- Semantic (light: "Daylight") --------------------------- */
  --bg:           #ffffff;
  --surface:      #ffffff;
  --surface-2:    var(--c-vellum);
  --line:         #c9c2b4;            /* decorative dividers only      */
  --line-strong:  var(--c-ink);       /* control borders: 19:1         */
  --text:         var(--c-ink);       /* 19.4:1                        */
  --text-muted:   var(--c-umber);     /* 7.3:1                         */
  --pencil:       var(--c-pencil);

  --primary:      var(--c-module-blue);   /* primary action       */
  --primary-ink:  var(--c-bone);          /* 5.5:1                */
  --danger:       var(--c-dragon);        /* damage, destructive  */
  --danger-ink:   var(--c-bone);          /* 6.0:1                */
  --success:      var(--c-module-green);  /* healed, saved        */
  --success-ink:  var(--c-bone);          /* 5.2:1                */
  --warning:      var(--c-lamp);          /* torches, encumbrance */
  --warning-ink:  var(--c-ink);           /* 6.4:1                */
  --focus:        var(--c-module-blue);   /* focus ring 6.9:1 on white */

  /* ---------- Type ---------------------------------------------------- */
  --font-logo:     "Rye", "Rosewood Std", Georgia, serif;   /* the logo, and nothing else  */
  --font-souvenir: "Fraunces", "Souvenir", "Cooper Black", Georgia, serif; /* titles, numbers   */
  --souvenir-axes: "SOFT" 50, "WONK" 0, "opsz" 72;
  --font-ui:       "Archivo", "Helvetica Neue", Arial, sans-serif;        /* UI, stat blocks   */
  --font-tome:     Georgia, "Iowan Old Style", "Noto Serif", serif;       /* lore, prose       */
  --font-type:     ui-monospace, "SF Mono", Menlo, "Roboto Mono", Consolas, monospace; /* rules, tables */
  --font-pencil:   var(--font-ui);                                        /* user's own input  */

  /* Mobile scale: body never below 16px; nothing interactive below 14px */
  --fs-xs:   0.8125rem;  /* 13px — labels only, always uppercase + bold */
  --fs-sm:   0.875rem;   /* 14px */
  --fs-md:   1rem;       /* 16px — body, inputs (stops iOS zoom-on-focus) */
  --fs-lg:   1.1875rem;  /* 19px — prose */
  --fs-xl:   1.5rem;     /* 24px */
  --fs-2xl:  2rem;       /* 32px */
  --fs-3xl:  2.75rem;    /* 44px — screen titles */
  --fs-hand: 1.25rem;    /* 20px — values the player entered */

  --lh-tight: 1.05;
  --lh-snug:  1.25;
  --lh-body:  1.55;
  --tracking-label: 0.08em;

  /* ---------- Space --------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;   /* screen gutter */
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;

  /* ---------- Touch --------------------------------------------------- */
  --tap-min:  48px;   /* every hit target, Android & iOS (44pt) safe */
  --tap-gap:  8px;    /* minimum space between adjacent targets       */

  /* ---------- Shape --------------------------------------------------- */
  --r-none: 0;
  --r-code: 6px;      /* the box around a module code, and nothing else */
  --bw:       2px;
  --bw-heavy: 3px;

  /* ---------- Shadow (hard offset, letterpress; never blurred) ------- */
  --shadow-ink:      var(--c-ink);   /* pure black in Torchlight */
  --shadow-print:    3px 3px 0 var(--shadow-ink);
  --shadow-print-lg: 6px 6px 0 var(--shadow-ink);

  /* ---------- Texture ------------------------------------------------- */
  --tex-grid: linear-gradient(var(--c-map-line) 1px, transparent 1px) 0 0 / 10px 10px,
              linear-gradient(90deg, var(--c-map-line) 1px, transparent 1px) 0 0 / 10px 10px;
  --tex-ruled: repeating-linear-gradient(transparent 0 calc(2rem - 1px), color-mix(in srgb, var(--text) 40%, transparent) calc(2rem - 1px) 2rem);

  /* ---------- Motion -------------------------------------------------- */
  --ease-roll: cubic-bezier(.2, .9, .3, 1.25);   /* a die settling */
  --dur-quick: 120ms;
  --dur-med:   240ms;

  color-scheme: light;
}

/* ---------- Dark: "Torchlight" ----------------------------------------
   Follows the OS unless the app pins a theme with data-theme. Paper objects
   (module covers, stat blocks, the character sheet) stay paper in both.   */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          var(--c-ink);
    --surface:     var(--c-crypt);
    --surface-2:   var(--c-tomb);
    --line:        var(--c-coffin);
    --line-strong: var(--c-bone);
    --text:        var(--c-bone);       /* 15.6:1 */
    --text-muted:  var(--c-dust);       /* 7.0:1  */
    --pencil:      var(--c-graphite);
    --primary:     var(--c-module-blue-lit);
    --primary-ink: var(--c-ink);        /* 8.5:1  */
    --danger:      var(--c-dragon-lit);
    --danger-ink:  var(--c-ink);        /* 5.5:1  */
    --success:     var(--c-module-green-lit);
    --success-ink: var(--c-ink);        /* 9.0:1  */
    --focus:       var(--c-module-blue-lit);
    --shadow-ink:  #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:          var(--c-ink);
  --surface:     var(--c-crypt);
  --surface-2:   var(--c-tomb);
  --line:        var(--c-coffin);
  --line-strong: var(--c-bone);
  --text:        var(--c-bone);
  --text-muted:  var(--c-dust);
  --pencil:      var(--c-graphite);
  --primary:     var(--c-module-blue-lit);
  --primary-ink: var(--c-ink);
  --danger:      var(--c-dragon-lit);
  --danger-ink:  var(--c-ink);
  --success:     var(--c-module-green-lit);
  --success-ink: var(--c-ink);
  --focus:       var(--c-module-blue-lit);
  --shadow-ink:  #000;
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-quick: 0ms; --dur-med: 0ms; }
}
