/* =============================================================================
   HOWEA Provisions — Concept 05 "The Working Edit" — design tokens
   (a revision of Concept 02 "After Service": same room, same lamp)
   -----------------------------------------------------------------------------
   The site lives in the hour after the last ticket: bottle-glass dark, one lamp
   over the steel pass. Commercial sections (and the Light theme) cut to
   working daylight. Every colour below is contrast-checked against the ground
   it is used on (ratios in comments, WCAG 2.2).
   ========================================================================== */

/* ---- Fonts (OFL, self-hosted, subset to Latin + Turkish + punctuation) ---- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 440 640;          /* variable: wght 440–640, opsz 24–72 */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Albert Sans";
  src: url("/assets/fonts/albert-sans-var.woff2") format("woff2");
  font-weight: 400 700;          /* variable: wght 400–700 */
  font-style: normal;
  font-display: swap;
}
/* Typography B (?type=b): a light, large humanist sans for display. Loaded only
   when html[data-type="b"] is set (the head script preloads it then; otherwise no
   rule references the family and the browser never downloads it). */
@font-face {
  font-family: "Ysabeau Office";
  src: url("/assets/fonts/ysabeau-office-light.woff2") format("woff2");
  font-weight: 250 500;          /* variable: wght 250–500 */
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks keep layout shift near zero while fonts load. */
@font-face {
  font-family: "Ysabeau fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica");
  size-adjust: 93%;
  ascent-override: 113.3%;
  descent-override: 31.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
  size-adjust: 106.5%;
  ascent-override: 69%;
  descent-override: 24.9%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Albert Sans fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica");
  size-adjust: 103.9%;
  ascent-override: 91.4%;
  descent-override: 24.1%;
  line-gap-override: 0%;
}

:root {
  /* ---- Raw palette -------------------------------------------------------- */
  --glass:        #0E1511;   /* bottle-glass ground (never pure black)        */
  --glass-raised: #17201A;   /* raised surfaces on glass                      */
  --steel:        #2A332C;   /* the pass (counter line), rules on glass       */
  --lamp:         #F3DDB0;   /* lamp core — used at low alpha inside pools    */
  --lamp-rgb:     243 221 176;
  --bone:         #EEE7D7;   /* text on glass            15.0 : 1             */
  --smoke:        #A9A99A;   /* secondary text on glass   7.8 : 1             */
  --smoke-2:      #8E8F81;   /* tertiary text on glass    5.6 : 1             */
  --smoke-lit:    #D2CFC0;   /* secondary text that sits inside a lamp pool:
                                ≥ 4.5 : 1 against the brightest pool pixel  */
  --unlit:        #6F766C;   /* large type the lamp does not reach  3.9 : 1  */
  --numeral-off:  #3A423B;   /* a numeral before the lamp lands on it        */
  --oil:          #C8BE4E;   /* new-oil green-gold — THE one accent: the primary
                                CTA fill, the focus ring on glass and the lit
                                key numerals only           9.6 : 1 on glass   */
  --daylight:     #F6F4EF;   /* lights-up ground                             */
  --daylight-2:   #EBE8DF;   /* blocks on daylight                            */
  --ink:          #171A17;   /* text on daylight         16.0 : 1 (on oil 9.1) */
  --ink-2:        #4A4F49;   /* secondary on daylight     7.6 : 1             */
  --oil-ink:      #5F5B12;   /* oil-coloured text on daylight 6.4 : 1          */

  /* ---- Type ---------------------------------------------------------------- */
  --serif: "Newsreader", "Newsreader fallback", "Times New Roman", serif;   /* display (A) */
  --sans:  "Albert Sans", "Albert Sans fallback", Arial, sans-serif;
  --w-d:   560;      /* display weight (A: Newsreader); B: light */
  --w-d2:  500;      /* lighter display weight for long lists */
  --tk:    1;        /* display tracking multiplier (B tracks looser) */
  --fig-h: 0.735em;  /* figure ascent: a numeral's box ends on its baseline */
  --fig-p: 73.5%;

  /* Fluid scale (rem-based so browser text zoom still works) */
  --t-small: clamp(0.9375rem, 0.9rem + 0.12vw, 1rem);        /* 15–16  */
  --t-body:  clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);     /* 17–19  */
  --t-lead:  clamp(1.1875rem, 1.05rem + 0.55vw, 1.4375rem);  /* 19–23  */
  --t-h3:    clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);        /* 24–34  */
  --t-h2:    min(clamp(2.125rem, 1.4rem + 2.9vw, 4.25rem), 10.8vw);       /* 34–68  */
  --t-h1:    min(clamp(2.5rem, 1.55rem + 3.7vw, 5.375rem), 12.6vw);       /* 40–86  */
  --t-name:  clamp(3.75rem, 1.2rem + 10.4vw, 12rem);         /* 60–192 */
  --t-giant: clamp(17rem, 9rem + 30vw, 40rem);               /* the lit numeral */

  --lh-tight: 0.96;
  --lh-head: 1.04;
  --lh-body: 1.58;
  --track-display: -0.022em;

  /* ---- Space --------------------------------------------------------------- */
  --gutter: clamp(1.25rem, 0.6rem + 3.2vw, 3.5rem);
  --max: 90rem;
  --s-1: 0.5rem;
  --s-2: 0.75rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 2rem;
  --s-6: 3rem;
  --s-7: clamp(3rem, 2rem + 4vw, 5.5rem);
  --s-8: clamp(4.5rem, 2.5rem + 7vw, 9rem);

  --radius: 0;                    /* square: steel, paper, glass — no soft UI */
  --logo-height: 1.125rem;        /* the one logotype; header 18 → 22 px, footer 2× */
  --header-h: 4rem;
  --bar-h: 5.5rem;

  /* ---- Motion -------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --warm-up: 900ms;
  --hover: 150ms;
}

/* ---- Typography B: same layout, a modern light sans display ---------------- */
:root[data-type="b"] {
  --serif: "Ysabeau Office", "Ysabeau fallback", Arial, sans-serif;
  --w-d: 330;
  --w-d2: 330;
  --tk: 0.2;
  --fig-h: 0.8825em;   /* Ysabeau Office: ascent 1.054, descent 0.289 */
  --fig-p: 88.25%;
}

/* ---- Scheme: semantic tokens ------------------------------------------------
   .night = a dark room (default), .day = working daylight. The whole site can
   be switched to daylight with the Light theme control (html[data-lights="up"]),
   and is daylight automatically for prefers-contrast: more. */
:root,
.night {
  --bg: var(--glass);
  --bg-raised: var(--glass-raised);
  --fg: var(--bone);
  --fg-2: var(--smoke);
  --fg-3: var(--smoke-2);
  --fg-lit: var(--smoke-lit);    /* secondary text standing in a pool */
  --fg-unlit: var(--unlit);
  --glyph-off: var(--numeral-off);
  --rule: var(--steel);
  --accent: var(--oil);
  --accent-text: var(--oil);
  --on-accent: var(--ink);
  --focus: var(--oil);
  --lit: 1;                      /* pools on */
  /* Text the lamp lands on (lit numerals, names on the pass): warm on glass,
     plain ink whenever the room is in daylight. */
  --lamp-text: #F1DFB9;
  --lamp-from: #BDB5A2;          /* the far side of a lit word  9.1 : 1 */
  --lamp-to:   #F4E5C4;          /* the side nearest the lamp  14.9 : 1 */
  --lamp-fill: linear-gradient(#F7EBD0 8%, #EBD4A6 60%, #F2DCB0 100%);
  color-scheme: dark;
}
.day,
:root[data-lights="up"],
:root[data-lights="up"] .night,
.night[data-zone="day"] {        /* the header and the bar, over a daylight section */
  --bg: var(--daylight);
  --bg-raised: var(--daylight-2);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-2);
  --fg-lit: var(--ink-2);
  --fg-unlit: var(--ink-2);
  --glyph-off: var(--ink);
  --rule: #D9D5CA;
  --accent: var(--oil);
  --accent-text: var(--oil-ink);
  --on-accent: var(--ink);
  --focus: var(--ink);
  --lit: 0;                      /* pools off: the room is lit evenly */
  --lamp-text: var(--ink);
  --lamp-from: var(--ink);
  --lamp-to:   var(--ink);
  --lamp-fill: linear-gradient(var(--ink), var(--ink));
  color-scheme: light;
}
@media (prefers-contrast: more) {
  :root,
  .night {
    --bg: var(--daylight);
    --bg-raised: var(--daylight-2);
    --fg: var(--ink);
    --fg-2: var(--ink);
    --fg-3: var(--ink-2);
    --fg-lit: var(--ink);
    --fg-unlit: var(--ink-2);
    --glyph-off: var(--ink);
    --rule: var(--ink-2);
    --accent-text: var(--oil-ink);
    --focus: var(--ink);
    --lit: 0;
    --lamp-text: var(--ink);
    --lamp-from: var(--ink);
    --lamp-to:   var(--ink);
    --lamp-fill: linear-gradient(var(--ink), var(--ink));
    color-scheme: light;
  }
}
