/* ==========================================================================
   Dead Thinkers — design tokens
   The canonical source for every visual constant on this site.
   Rationale and the scale rungs are recorded in design.md § Design values.
   No component hardcodes a value this file owns.
   ========================================================================== */

:root {

  /* --- Ground -------------------------------------------------------------
     Aged laid paper. The photograph in assets/paper-ground.png sits on top of
     --paper, so if the asset is absent the page is still warm bone, not white. */
  --paper:        #ece0c7;   /* bone / parchment, the page itself            */
  --paper-deep:   #ddcfb2;   /* shadowed paper — plate wells, inset edges    */
  --plate:        #241c14;   /* the dark ground behind the vanitas art       */

  /* --- Ink ----------------------------------------------------------------
     Iron-gall: brown-black, never pure black. Pure black on parchment reads
     as printed-yesterday and kills the whole conceit. */
  --ink:          #2b2018;   /* body text, masthead                          */
  --ink-soft:     #5c4c3c;   /* secondary copy, captions                     */
  --ink-faint:    #8a7860;   /* footer, fine print                           */
  --rule:         #b8a586;   /* hairlines, borders, engraved rules           */

  /* --- The one accent -----------------------------------------------------
     Sealing wax. Used almost nowhere, which is what makes it land. */
  --wax:          #8c1c13;
  --wax-lit:      #a8281c;   /* hover only                                   */

  /* --- Type ---------------------------------------------------------------
     Humanist old-style serif throughout. EB Garamond when self-hosted;
     otherwise the best old-style face already on the machine. */
  --face-body:  "EB Garamond", Constantia, "Hoefler Text", "Iowan Old Style",
                Garamond, "Palatino Linotype", Palatino, Georgia, serif;

  /* Scale — five rungs. Each clamps so one screen holds at every viewport.
     The rungs are re-stated at the height breakpoints below: a short screen
     is the constraint on this page, and width alone cannot see it. */
  --t-masthead: clamp(2.1rem,  5.4vw, 3.9rem);
  --t-lede:     clamp(1.02rem, 1.9vw, 1.34rem);
  --t-body:     clamp(0.92rem, 1.4vw, 1.04rem);
  --t-small:    clamp(0.78rem, 1.1vw, 0.90rem);
  --t-fine:     clamp(0.68rem, 0.9vw, 0.78rem);

  --lead-tight: 1.18;
  --lead-body:  1.62;

  /* Letterspacing — engraved capitals need air; body does not. */
  --track-caps: 0.34em;
  --track-lede: 0.012em;

  /* --- Spacing — five rungs ---------------------------------------------- */
  --s1: 0.35rem;
  --s2: 0.75rem;
  --s3: 1.30rem;
  --s4: 2.10rem;
  --s5: clamp(1.8rem, 4.5vh, 3.4rem);

  /* --- Measure & frame --------------------------------------------------- */
  --measure:  47ch;          /* prose never runs wider than this             */
  --frame:    clamp(1.1rem, 3.2vw, 2.4rem);   /* page inset                  */
  --radius:   2px;           /* paper does not have rounded corners          */
}

/* --- Height rungs -----------------------------------------------------------
   This page's promise is one screen, no scroll. Laptop screens are wide and
   SHORT (1366×768, 1280×720), so the binding constraint is height, and a
   width-only scale walks straight past it. Each rung steps the vertical cost
   of the page down together — type, spacing and frame — rather than shrinking
   one thing and leaving the rest. Tall screens keep the full drama. */

@media (max-height: 900px) {
  :root {
    --t-masthead: clamp(1.9rem, 4.4vw, 3.0rem);
    --t-lede:     clamp(0.98rem, 1.7vw, 1.18rem);
    --s3: 1.05rem;
    --s4: 1.55rem;
    --frame: clamp(0.95rem, 2.4vw, 1.7rem);
  }
}

@media (max-height: 740px) {
  :root {
    --t-masthead: clamp(1.7rem, 3.8vw, 2.45rem);
    --t-lede:     clamp(0.94rem, 1.5vw, 1.06rem);
    --t-body:     clamp(0.86rem, 1.2vw, 0.95rem);
    --s2: 0.55rem;
    --s3: 0.82rem;
    --s4: 1.15rem;
    --frame: clamp(0.75rem, 1.8vw, 1.25rem);
  }
}
