/* ==========================================================================
   Tweedsmuir Jam Nights: design tokens
   Built from the Jam Nights logo (Constellation note). A night sky, lamplight
   and moonlight, with heather from the Borders hills. Deliberately separate
   from the Tweedsmuir Community Company brand.
   All text pairings below meet WCAG 2.2 AA (4.5:1 or better).
   ========================================================================== */

:root {
  /* ---- Palette: from the logo ----------------------------------------- */
  --jn-night:   #1B3440;  /* the night sky in the badge */
  --jn-dusk:    #2F5D6B;  /* the far hill */
  --jn-deep:    #132630;  /* the near hill */
  --jn-heather: #7A5A80;  /* Borders heather, the accent */
  --jn-lamp:    #E9B44C;  /* lamplight, the gold stars */
  --jn-moon:    #F4E9D4;  /* moonlight, the cream stars and moon */

  /* ---- Palette: light tints for daytime sections ---------------------- */
  /* Light and airy, like the Tweedsmuir village website: white and pale
     grey, with a sand-coloured map band. */
  --jn-paper:         #F7F7F7;  /* pale grey page background */
  --jn-sand:          #EFE4D0;  /* old-map paper, for the contour band */
  --jn-sand-line:     #DCCBAB;  /* contour lines on sand */
  --jn-ink:           #3D4A50;  /* headings: 8.5:1 on paper */
  --jn-stone:         #56636A;  /* body text: 5.8:1 on paper, 4.9:1 on sand */
  --jn-white:         #FFFFFF;
  --jn-mist:          #E4ECEE;  /* dusk, lightened */
  --jn-heather-light: #EFE8F0;
  --jn-lamp-light:    #FBF0D9;

  /* ---- Palette: text helpers ------------------------------------------ */
  --jn-slate:    #5E6B70;  /* muted text: 5.1:1 on paper */
  --jn-frost:    #C9D6DA;  /* muted text on night: 8.8:1 */
  --jn-brick:    #A3412F;  /* errors: 5.9:1 on paper */

  /* ---- Semantic roles: daytime (default) ------------------------------- */
  --color-bg:          var(--jn-paper);
  --color-surface:     var(--jn-white);
  --color-text:        var(--jn-stone);
  --color-text-muted:  var(--jn-slate);
  --color-heading:     var(--jn-ink);
  --color-link:        var(--jn-dusk);     /* 6.8:1 on paper */
  --color-accent:      var(--jn-heather);  /* 5.5:1 on paper, also for small text */
  --color-border:      #DADFE1;
  --color-border-strong: var(--jn-dusk);
  --color-focus:       var(--jn-heather);

  --color-action:       var(--jn-dusk);
  --color-action-hover: var(--jn-night);
  --color-on-action:    var(--jn-white);

  --color-error:       var(--jn-brick);
  --color-error-bg:    #F8E9E4;
  --color-success:     var(--jn-dusk);
  --color-success-bg:  var(--jn-mist);

  /* ---- Typography ------------------------------------------------------ */
  /* Headings: Marcellus, a flared, open face close in spirit to Granville,
     the typeface of the Tweedsmuir village website. Body: Lora, a warm,
     readable book face. The logo wordmark keeps Jost, which is part of the
     Jam Nights identity. All free (SIL Open Font Licence). */
  --font-display: "Marcellus", "Optima", "Candara", Georgia, serif;
  --font-body:    "Lora", Georgia, "Times New Roman", serif;
  --font-logo:    "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    700;

  /* Fluid type scale: 360px to 1200px viewports */
  --text-xs:   0.8125rem;                                    /* 13 labels */
  --text-sm:   clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);      /* 15-16 */
  --text-base: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem); /* 17-19 body */
  --text-lg:   clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);     /* 20-24 lead */
  --text-xl:   clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);      /* 24-34 h3 */
  --text-2xl:  clamp(2rem, 1.55rem + 2vw, 3.25rem);          /* 32-52 h2 */
  --text-3xl:  clamp(3rem, 1.9rem + 4.6vw, 5.75rem);         /* 48-92 h1 */

  --leading-tight: 1.12;
  --leading-snug:  1.25;
  --leading-body:  1.6;

  --tracking-display: 0.02em;   /* bold caps in the logo */
  --tracking-caps:    0.12em;   /* buttons and nav in Marcellus capitals */
  --tracking-label:   0.28em;   /* the spaced TWEEDSMUIR line in the logo */

  --measure: 64ch;

  /* ---- Spacing (4px base) ---------------------------------------------- */
  --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:  4rem;
  --space-9:  6rem;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  /* ---- Layout ---------------------------------------------------------- */
  --width-content: 72rem;
  --width-narrow:  42rem;
  --gutter:        clamp(1.25rem, 4vw, 2.5rem);

  /* ---- Shape ----------------------------------------------------------- */
  /* Quiet and squared-off, like the village website. Circles are kept for
     the badge, date moons and icon badges. */
  --radius-sm:   3px;
  --radius-md:   4px;
  --radius-lg:   6px;
  --radius-pill: 999px;

  --shadow-card:  0 1px 2px rgb(27 52 64 / 0.04), 0 6px 20px rgb(27 52 64 / 0.06);
  --shadow-raise: 0 2px 4px rgb(27 52 64 / 0.08), 0 16px 40px rgb(27 52 64 / 0.14);
  --glow-lamp:    0 0 0 6px rgb(233 180 76 / 0.18);

  /* ---- Motion ---------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration-base: 0ms; }
}
