/* =========================================================================
   ADELE VAN DER NEST — DESIGN TOKENS
   Two systems, one surface:
   1. Material Design 3 (colour roles, typescale, shape, elevation, motion)
   2. A composition layer on top (ground, rules, folios, stamps)

   Typeface pairing rule for this site:
     Nohemi            — display, headlines, titles, body copy 16px and up
     Montserrat        — labels, captions, folios, nav, meta: 14px and below
   ========================================================================= */

/* ---------- 1. Typefaces (self-hosted, subset) --------------------------- */

@font-face {
  font-family: "Nohemi";
  src: url("../fonts/Nohemi-VF.woff2") format("woff2-variations"),
       url("../fonts/Nohemi-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  font-named-instance: "Regular";
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {   /* accented names (Ł, ő, ș …), loaded only when a page needs them */
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-VF-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-display: "Nohemi", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-small: "Montserrat", "Inter", system-ui, sans-serif;

  /* ---------- 2. Palette: the only colours on the site ----------------
     Nine colours (eight + the alert red, Nov 2026). Everything else is a mix of these (color-mix), never a new
     hex. Each theme colour has two working twins (below).                  */
  --dark:        #141314;   /* the ground and the bar; text on light */
  --surface:     #1c1a1c;   /* dark containers on the ground: the face, chapters, fields */
  --light:       #f2e6eb;   /* light containers, and text on dark */
  --primary:     #4a66d9;   /* the site's own UI (Get in touch, buttons): never themed */
  --aqua:        #99f0cd;   --aqua-deep:   #53ddae;   --aqua-ink:   #096d50;
  --lime:        #cfff94;   --lime-deep:   #ade857;   --lime-ink:   #476a01;   /* Lime Cream */
  --periwinkle:  #bbbdf6;   --periwinkle-deep: #9f9ff3;   --periwinkle-ink: #5a589e;
  --caramel:     #fcc083;   --caramel-deep: #f19f41;  --caramel-ink: #8a5200;
  --red:         #ff6971;   --red-deep:    #ee4a55;   --red-ink:    #b3262f;   /* the one semantic colour: NDA, errors */
  /* -deep: a richer fill of the same hue (cards, chips, bars on light).
     -ink:  the same hue dark enough for text on --light — each ≥ 4.6:1 even
            on a light container's cards (--paper-deep). Re-check if --light moves.
     --primary takes white text (5.0:1); as text itself it is too dim on dark. */

  /* ---------- containers: the page is a set of rounded cards ------------ */
  --card-gap:    clamp(8px, 1.1vw, 16px);     /* margins at the sides and between cards */
  --card-radius: clamp(16px, 2vw, 28px);

  /* ---------- 3. Shape scale ------------------------------------------- */
  --md-sys-shape-corner-xs: 4px;
  --md-sys-shape-corner-sm: 8px;
  --md-sys-shape-corner-md: 12px;
  --md-sys-shape-corner-lg: 16px;
  --md-sys-shape-corner-full: 999px;

  /* ---------- 4. Motion ------------------------------------------------ */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-sys-motion-easing-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long2: 500ms;

  /* State layer opacities (M3) */
  --md-sys-state-hover-opacity: 0.08;
  --md-sys-state-pressed-opacity: 0.10;

  /* ---------- 5. Layout ----------------------------------------------- */
  --page-max: 1680px;
  --gutter: clamp(20px, 3.4vw, 52px);
  --appbar-h: 60px;   /* = the mobile top bar; 0 once the rail takes over */
  --navbar-h: 80px;
  --grid-gap: clamp(12px, 1.6vw, 24px);
  --measure: 34rem;      /* comfortable reading column */
  --section-space: clamp(64px, 9vw, 148px);
}

/* ---------- 6. Roles ----------------------------------------------------
   What the CSS actually asks for. On the dark ground (the default) and on a
   light section (.on-light), the same names flip to the other side. */
:root {
  color-scheme: dark;

  /* ground, four steps */
  --paper-low:   color-mix(in oklab, var(--dark) 72%, black);
  --paper:       var(--dark);
  --paper-deep:  color-mix(in oklab, var(--light) 6%, var(--dark));
  --paper-high:  color-mix(in oklab, var(--light) 11%, var(--dark));

  /* text, three strengths — --ink-faint still passes 4.5:1 on --paper-deep */
  --ink:         var(--light);
  --ink-soft:    color-mix(in oklab, var(--light) 80%, var(--dark));
  --ink-faint:   color-mix(in oklab, var(--light) 70%, var(--dark));
  --rule:        color-mix(in oklab, var(--light) 22%, transparent);
  --rule-strong: color-mix(in oklab, var(--light) 55%, transparent);

  /* the theme: an accent and its small second accent (set per theme below) */
  --accent-soft:    color-mix(in oklab, var(--accent) 24%, var(--paper));
  --on-accent:      var(--dark);
  --on-accent-soft: var(--ink);
  --alert:          var(--red);             /* NDA, errors: red in every theme (no theme is red) */
  --on-primary:     white;
}

/* ---------- 7. Four site themes -------------------------------------------
   Each theme is one colour, with its opposite on the wheel as the small
   second accent, so the second one is never lost against the first. */
:root, [data-site-theme="1"] {   /* Aqua */
  --accent-base: var(--aqua);   /* the theme colour itself, unshifted */
  --accent: var(--aqua);        --accent-deep: var(--aqua-deep);       --accent-ink: var(--aqua-ink);
  --accent-2: var(--caramel);   --accent-2-deep: var(--caramel-deep);  --accent-2-ink: var(--caramel-ink);
}
[data-site-theme="2"] {          /* Lime Cream */
  --accent-base: var(--lime);   /* the theme colour itself, unshifted */
  --accent: var(--lime);        --accent-deep: var(--lime-deep);       --accent-ink: var(--lime-ink);
  --accent-2: var(--periwinkle); --accent-2-deep: var(--periwinkle-deep); --accent-2-ink: var(--periwinkle-ink);
}
[data-site-theme="3"] {          /* Periwinkle */
  --accent-base: var(--periwinkle);   /* the theme colour itself, unshifted */
  --accent: var(--periwinkle);  --accent-deep: var(--periwinkle-deep); --accent-ink: var(--periwinkle-ink);
  --accent-2: var(--lime);      --accent-2-deep: var(--lime-deep);     --accent-2-ink: var(--lime-ink);
}
[data-site-theme="4"] {          /* Caramel */
  --accent-base: var(--caramel);   /* the theme colour itself, unshifted */
  --accent: var(--caramel);     --accent-deep: var(--caramel-deep);    --accent-ink: var(--caramel-ink);
  --accent-2: var(--aqua);      --accent-2-deep: var(--aqua-deep);     --accent-2-ink: var(--aqua-ink);
}

/* A dark container (.surface): the same dark roles, one step up from the
   ground, so cards inside it still stand out. */
.surface {
  --paper-low:   var(--dark);
  --paper:       var(--surface);
  --paper-deep:  color-mix(in oklab, var(--light) 6%, var(--surface));
  --paper-high:  color-mix(in oklab, var(--light) 11%, var(--surface));
  --accent-soft: color-mix(in oklab, var(--accent) 24%, var(--surface));
}

/* A light section: add class="on-light" to any section. Every role flips.
   The accent (text, solid buttons) becomes the theme's -ink twin, so it stays
   legible; soft fills use the -deep twin. */
.on-light {
  color-scheme: light;
  --paper-low:   color-mix(in oklab, var(--light) 50%, white);
  --paper:       var(--light);
  --paper-deep:  color-mix(in oklab, var(--dark) 6%, var(--light));
  --paper-high:  color-mix(in oklab, var(--dark) 11%, var(--light));
  --ink:         var(--dark);
  --ink-soft:    color-mix(in oklab, var(--dark) 80%, var(--light));
  --ink-faint:   color-mix(in oklab, var(--dark) 72%, var(--light));
  --rule:        color-mix(in oklab, var(--dark) 22%, transparent);
  --rule-strong: color-mix(in oklab, var(--dark) 55%, transparent);
  --accent:      var(--accent-ink);
  --accent-2:    var(--accent-2-ink);
  --accent-soft: var(--accent-base);   /* soft fills: the theme colour itself (her call), not the brighter -deep */
  --on-accent:   var(--light);
  --on-accent-soft: var(--dark);
  --alert:       var(--red-ink);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 8. Type scale (M3 roles, tuned for the product) ----------- */
:root {
  /* Display — Nohemi, tight and large */
  --md-sys-typescale-display-large-size: clamp(2.9rem, 9.1vw, 9rem);
  --md-sys-typescale-display-large-line: 0.88;
  --md-sys-typescale-display-large-track: -0.035em;

  --md-sys-typescale-display-medium-size: clamp(2.3rem, 5.6vw, 4.4rem);
  --md-sys-typescale-display-medium-line: 0.94;
  --md-sys-typescale-display-medium-track: -0.032em;

  --md-sys-typescale-display-small-size: clamp(2.1rem, 4.6vw, 3.4rem);
  --md-sys-typescale-display-small-line: 1.0;
  --md-sys-typescale-display-small-track: -0.028em;

  /* Headline */
  --md-sys-typescale-headline-large-size: clamp(1.7rem, 2.9vw, 2.5rem);
  --md-sys-typescale-headline-large-line: 1.06;
  --md-sys-typescale-headline-large-track: -0.022em;

  --md-sys-typescale-headline-medium-size: clamp(1.45rem, 2.2vw, 1.95rem);
  --md-sys-typescale-headline-medium-line: 1.12;
  --md-sys-typescale-headline-medium-track: -0.018em;

  --md-sys-typescale-headline-small-size: 1.25rem;
  --md-sys-typescale-headline-small-line: 1.2;
  --md-sys-typescale-headline-small-track: -0.014em;

  /* Title */
  --md-sys-typescale-title-large-size: 1.375rem;
  --md-sys-typescale-title-large-line: 1.28;
  --md-sys-typescale-title-large-track: -0.014em;

  --md-sys-typescale-title-medium-size: 1.0625rem;
  --md-sys-typescale-title-medium-line: 1.4;
  --md-sys-typescale-title-medium-track: -0.008em;

  /* Body — Nohemi at 17–19px */
  --md-sys-typescale-body-large-size: clamp(1.0625rem, 1.05vw + 0.72rem, 1.1875rem);
  --md-sys-typescale-body-large-line: 1.62;
  --md-sys-typescale-body-large-weight: 380;
  --md-sys-typescale-body-large-track: -0.004em;

  --md-sys-typescale-body-medium-size: 1rem;
  --md-sys-typescale-body-medium-line: 1.62;

  /* Label — Montserrat, 14px and below only */
  --md-sys-typescale-label-large-size: 0.8125rem;   /* 13px */
  --md-sys-typescale-label-large-line: 1.2;
  --md-sys-typescale-label-large-track: 0.01em;

  --md-sys-typescale-label-medium-size: 0.75rem;    /* 12px */
  --md-sys-typescale-label-medium-line: 1.25;
  --md-sys-typescale-label-medium-track: 0.02em;

  --md-sys-typescale-label-small-size: 0.6875rem;   /* 11px */
  --md-sys-typescale-label-small-line: 1.3;
  --md-sys-typescale-label-small-track: 0.14em;

  /* ---------- 9. Elevation (M3 levels 0–5) ---------------------------- */
  --md-sys-elevation-1: 0 1px 2px 0 rgb(0 0 0 / 0.14), 0 1px 3px 1px rgb(0 0 0 / 0.06);
  --md-sys-elevation-2: 0 1px 2px 0 rgb(0 0 0 / 0.14), 0 2px 6px 2px rgb(0 0 0 / 0.08);
  --md-sys-elevation-3: 0 4px 8px 3px rgb(0 0 0 / 0.10), 0 1px 3px 0 rgb(0 0 0 / 0.16);
}
