/* ===========================================================================
   foundation.css - tokens, reset, typography, form and button primitives.
   Nothing here knows about page layout. Layout lives in layout.css.

   THEMING CONTRACT
   Three colour roles - primary, secondary, accent - each with an EXPLICIT ink
   colour set by a black/white toggle in Settings rather than computed
   contrast. Computing it is fiddly and wrong at the edges; letting the
   operator pick is always right and takes thirty seconds.

   All three are redefined for dark mode further down. The display_mode
   setting (auto | light | dark) decides whether the dark block is reachable.

   The whole system must stay coherent in ANY hue, because JD Musik will not
   use Top Notch's colour. Never hard-code a hex outside the :root blocks.
   =========================================================================== */

:root {
  /* --- the three brand knobs. Overridden inline by the plugin. ----------- */
  --primary:           #0f7f86;   /* title bar, primary buttons, countdown  */
  --primary-ink:       #ffffff;   /* black or white, set in Settings        */
  --secondary:         #126f75;   /* secondary accents, outline buttons     */
  --secondary-ink:     #ffffff;
  --accent:            #17a67d;   /* focus rings, toggles, small highlights */
  --accent-ink:        #ffffff;

  /* derived, never set by hand */
  --primary-dark:      color-mix(in oklab, var(--primary) 78%, #000);
  --primary-veil:      color-mix(in oklab, var(--primary) 8%,  #fff);
  --accent-dark:       color-mix(in oklab, var(--accent) 78%, #000);
  --accent-light:      color-mix(in oklab, var(--accent) 22%, #fff);
  --accent-veil:       color-mix(in oklab, var(--accent) 8%,  #fff);

  /* --- neutral ramp ------------------------------------------------------ */
  --ink:               #16181c;
  --ink-2:             #3d434d;
  --ink-3:             #6b7280;
  --rule:              #e3e5e9;
  --surface:           #ffffff;
  --surface-2:         #f7f8f9;
  --surface-inverse:   #101216;

  /* --- night bands: hero, page heads, reviews. Dark in BOTH modes, so they
     are not redefined below. Text on them is always light. -------------- */
  --night:             #0b0c0f;
  --night-2:           #15171c;
  --on-night:          #ffffff;
  --on-night-2:        rgb(255 255 255 / 0.74);
  --on-night-rule:     rgb(255 255 255 / 0.16);
  --scrim:             rgb(8 9 11 / 0.62);

  /* single-colour logos on a role: filter matching that role's ink. The
     plugin reprints these from the same Settings toggle as the ink. */
  --primary-ink-filter:   brightness(0) invert(1);
  --secondary-ink-filter: brightness(0) invert(1);
  --accent-ink-filter:    brightness(0) invert(1);
  --ink-filter:           brightness(0);

  --font-heavy: var(--font-body);   /* big uppercase-weight headlines */

  /* --- status ------------------------------------------------------------ */
  --ok:                #1c7d4d;
  --warn:              #a86400;
  --err:               #b3261e;

  /* --- type -------------------------------------------------------------- */
  /* Poppins, self-hosted (assets/fonts/, declared at the bottom of this
     file). Display and body share the family; weight does the work. */
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.10rem);
  --step-1:  clamp(1.25rem, 1.16rem + 0.45vw, 1.50rem);
  --step-2:  clamp(1.56rem, 1.38rem + 0.90vw, 2.05rem);
  --step-3:  clamp(1.95rem, 1.62rem + 1.65vw, 2.80rem);
  --step-4:  clamp(2.44rem, 1.86rem + 2.90vw, 3.85rem);
  --step-5:  clamp(3.05rem, 2.05rem + 5.00vw, 5.25rem);

  --leading-tight:  1.08;
  --leading-snug:   1.30;
  --leading-body:   1.60;
  --tracking-tight: -0.02em;
  --tracking-wide:   0.08em;

  /* --- space (1.5 ratio) ------------------------------------------------- */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;   --s7: 3rem;    --s8: 4rem;
  --s9: 6rem;    --s10: 8rem;

  /* --- structure --------------------------------------------------------- */
  --measure: 68ch;
  --wrap: 1200px;
  --wrap-narrow: 760px;
  --radius: 2px;
  --radius-lg: 4px;
  --border: 1px solid var(--rule);
  --shadow: 0 1px 2px rgb(16 18 22 / 0.05), 0 8px 24px -12px rgb(16 18 22 / 0.12);
  --transition: 160ms cubic-bezier(0.2, 0, 0.2, 1);
  --header-h: 72px;
}

/* --- dark mode -------------------------------------------------------------
   Reached only when display_mode is auto or dark. The plugin prints
   :root[data-theme] and these two blocks resolve against it. Every role gets
   its own hex and its own ink toggle, exactly as in light mode.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:         #4fd1c5;
    --primary-ink:     #06201f;
    --secondary:       #7ee0d2;
    --secondary-ink:   #06201f;
    --accent:          #5eead4;
    --accent-ink:      #06201f;
    --primary-ink-filter: brightness(0);
    --secondary-ink-filter: brightness(0);
    --accent-ink-filter: brightness(0);
    --ink-filter:      brightness(0) invert(1);

    --ink:             #eef1f4;
    --ink-2:           #b9c0c9;
    --ink-3:           #8b939d;
    --rule:            #2a2f36;
    --surface:         #15181c;
    --surface-2:       #1c2026;
    --surface-inverse: #eef1f4;
  }
}
:root[data-theme="dark"] {
  --primary:           #4fd1c5;
  --primary-ink:       #06201f;
  --secondary:         #7ee0d2;
  --secondary-ink:     #06201f;
  --accent:            #5eead4;
  --accent-ink:        #06201f;
  --primary-ink-filter:   brightness(0);
  --secondary-ink-filter: brightness(0);
  --accent-ink-filter:    brightness(0);
  --ink-filter:           brightness(0) invert(1);

  --ink:               #eef1f4;
  --ink-2:             #b9c0c9;
  --ink-3:             #8b939d;
  --rule:              #2a2f36;
  --surface:           #15181c;
  --surface-2:         #1c2026;
  --surface-inverse:   #eef1f4;
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, li { overflow-wrap: break-word; }
:where(ul, ol)[class] { list-style: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* --- typography ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); }
p  { max-width: var(--measure); text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--accent);
}
.lede { font-size: var(--step-1); line-height: var(--leading-snug); color: var(--ink-2); }
.meta { font-size: var(--step--1); color: var(--ink-3); }

a { color: var(--accent-dark); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  padding: var(--s3) var(--s4); background: var(--ink); color: #fff;
}
.skip-link:focus { left: 0; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--primary); --btn-fg: var(--primary-ink); --btn-bd: var(--primary);
  --btn-py: var(--s3); --btn-px: var(--s5); --btn-h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--btn-py) var(--btn-px); min-height: var(--btn-h);
  font-size: var(--step-0); font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.22);
  transition: background var(--transition), border-color var(--transition), color var(--transition),
    transform 90ms ease-out, box-shadow 90ms ease-out, padding 90ms ease-out, margin 90ms ease-out, min-height 90ms ease-out;
}
.btn:hover { --btn-bg: var(--primary-dark); --btn-bd: var(--primary-dark); color: var(--primary-ink); }
/* Press on hover (Havok): drops 1px and comes in 1px on every side. The 1px
   margin hands back what the padding gives up, so nothing around it moves. */
.btn:hover:not([disabled]):not([aria-disabled="true"]) {
  transform: translateY(1px); box-shadow: 0 1px 0 rgb(0 0 0 / 0.22);
  padding: calc(var(--btn-py) - 1px) calc(var(--btn-px) - 1px); min-height: calc(var(--btn-h) - 2px); margin: 1px;
}
.btn:active:not([disabled]) { transform: translateY(2px); box-shadow: none; }
.btn--block:hover { width: calc(100% - 2px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: background var(--transition), border-color var(--transition), color var(--transition); } }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--secondary); --btn-bd: var(--secondary); }
.btn--ghost:hover { --btn-bg: var(--primary-veil); --btn-fg: var(--secondary); }
.btn--quiet { --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: var(--rule); }
.btn--quiet:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); --btn-bd: var(--ink-3); }
.btn--lg { --btn-py: var(--s4); --btn-px: var(--s6); --btn-h: 56px; font-size: var(--step-1); }
.btn--block { display: flex; width: 100%; }

/* --- forms ---------------------------------------------------------------- */
.field { display: grid; gap: var(--s2); margin-block-end: var(--s5); }
.field > label { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.field .hint  { font-size: var(--step--1); color: var(--ink-3); }
.field .error { font-size: var(--step--1); color: var(--err); font-weight: 600; }
.req::after { content: "*"; color: var(--err); margin-inline-start: 0.2em; }

.input, .select, .textarea {
  width: 100%; padding: var(--s3) var(--s4); min-height: 48px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-veil); outline: none;
}
.input[aria-invalid="true"] { border-color: var(--err); }
.textarea { min-height: 8rem; resize: vertical; line-height: var(--leading-body); }
.select {
  appearance: none; padding-inline-end: var(--s7);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: right var(--s5) center, right calc(var(--s5) - 5px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* choice rows double as the package radio cards */
.choice {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s4); cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.choice:hover { border-color: var(--ink-3); }
.choice input { margin-block-start: 0.2em; accent-color: var(--accent); width: 1.15em; height: 1.15em; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-veil); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* honeypot - never display:none, bots skip those */
.hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }

/* --- small primitives ------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 0.2em 0.7em; font-size: var(--step--1); font-weight: 600;
  border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--rule);
}
.pill--ok   { color: var(--ok);   border-color: color-mix(in oklab, var(--ok) 30%, #fff);   background: color-mix(in oklab, var(--ok) 8%, #fff); }
.pill--warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 30%, #fff); background: color-mix(in oklab, var(--warn) 8%, #fff); }
.pill--err  { color: var(--err);  border-color: color-mix(in oklab, var(--err) 30%, #fff);  background: color-mix(in oklab, var(--err) 8%, #fff); }

.card { padding: var(--s5); background: var(--surface); border: var(--border); border-radius: var(--radius-lg); }
.card--raised { box-shadow: var(--shadow); border-color: transparent; }

.notice { padding: var(--s4) var(--s5); border-inline-start: 3px solid var(--accent); background: var(--accent-veil); border-radius: var(--radius); }
.notice--ok  { border-color: var(--ok);  background: color-mix(in oklab, var(--ok) 6%, #fff); }
.notice--err { border-color: var(--err); background: color-mix(in oklab, var(--err) 6%, #fff); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- fonts ----------------------------------------------------------------
   Poppins (SIL OFL 1.1, assets/fonts/OFL-Poppins.txt), Latin subset, static
   weights 400-800 + 400 italic. Self-hosted: never a Google Fonts request.
   functions.php preloads the two weights the hero paints first (400, 800).
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
  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 {
  font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-500.woff2") format("woff2");
  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 {
  font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
  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 {
  font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
  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 {
  font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/poppins-800.woff2") format("woff2");
  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 {
  font-family: "Poppins"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-400-italic.woff2") format("woff2");
  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;
}
