/* foundation.css — design foundation shared by all three brands.
   Self-hosted fonts, colour tokens (light + dark), type scale, layout
   grid, and the base building blocks (header bar, buttons, chip, card,
   eyebrow line, footer, rule, focus ring). A brand only ever chooses
   --brand/--brand-deep via data-brand on <html>; everything else is
   shared. No external fonts, scripts or libraries; no build step. */

/* --- Fonts: Schibsted Grotesk 400/500/600/800 + Geist Mono 400/500,
   latin, woff2, self-hosted under /static/fonts/. ------------------- */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/schibsted-grotesk-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/schibsted-grotesk-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/schibsted-grotesk-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist-mono-latin-500-normal.woff2') format('woff2');
}

/* --- Tokens: light -------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #262E3D;
  --ink-2: #4A5466;
  --mute: #6A7282;             /* 4.5:1 on --bg, 4.8:1 on --surface */
  --line: #DDE2E8;
  --err: #C2410C;
  --err-bg: #FDEEE6;
  --warn: #8A5300;             /* "needs your input" - 5.6:1 on --warn-bg */
  --warn-bg: #FDF1D2;
  --code-bg: #262E3D;          /* secret and code boxes (ink) */
  --code-ink: #E9EDF3;
  --fk: #0FA05C;
  --fk-deep: #007840;
  --kz: #4D6FE3;
  --kz-deep: #3A58C3;
  /* flurklar terracotta + traffic lights - Owner-Freigabe: terracotta set by
     the owner 09.10.2026, exact values proposed (deep 5.3:1 on --bg, lights
     >= 3:1 as graphics; lights always carry a text label + icon) */
  --fl: #C8643C;
  --fl-deep: #A84B2A;
  /* flurklar mark (owner 15.10.2026: terracotta only, no family colours):
     the three cube faces top / left / right, light to deep */
  --fl-logo-top: #E08B64;
  --fl-logo-left: #C8643C;
  --fl-logo-right: #A84B2A;
  /* flurklar mark's outer hexagon frame (owner 16.10.2026: always the
     near-black ink on light backgrounds, near-white in dark mode, decoupled
     from currentColor so a terracotta link/text colour around the mark - the
     .fl a rule - can't tint the frame) */
  --fl-frame: #262E3D;
  --light-red: #B42318;
  --light-yellow: #B26B00;
  --light-green: #187A3C;
  --light-grey: #6B7280;
  --brand: var(--ink);
  --brand-deep: var(--ink);
  --on-brand: #FFFFFF;          /* text on --brand-deep fills */
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
}

/* --- Tokens: dark ---------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12161F;
    --surface: #1A1F2B;
    --ink: #E9EDF3;
    --ink-2: #B4BCCA;
    --mute: #7E889A;
    --line: #2A3140;
    --err: #FB923C;
    --err-bg: #3A2313;
    --warn: #F2C14E;
    --warn-bg: #3A2F12;
    --code-bg: #12161F;
    --code-ink: #E9EDF3;
    --fk: #2DBE78;
    --fk-deep: #52D192;
    --kz: #7390F2;
    --kz-deep: #93A9F7;
    /* flurklar - Owner-Freigabe (see light block) */
    --fl: #E07A50;
    --fl-deep: #F0A07E;
    --fl-logo-top: #F0A07E;
    --fl-logo-left: #E07A50;
    --fl-logo-right: #B95A33;
    --fl-frame: #E9EDF3;
    --light-red: #F87171;
    --light-yellow: #FBBF24;
    --light-green: #4ADE80;
    --light-grey: #9CA3AF;
    --on-brand: var(--bg);       /* deep tones are light here */
  }
}

/* --- Brand: data-brand on <html> picks --brand/--brand-deep --------- */
html[data-brand="klangzeile"] { --brand: var(--kz); --brand-deep: var(--kz-deep); }
html[data-brand="formkorrekt"] { --brand: var(--fk); --brand-deep: var(--fk-deep); }
html[data-brand="ndc"] { --brand: var(--ink); }
html[data-brand="flurklar"] { --brand: var(--fl); --brand-deep: var(--fl-deep); }
/* the lockup (brand_lockup(), _logo.html) is one wordmark everywhere,
   two colours (owner 18.10.2026, replacing the all-terracotta round 2 of
   17.10.): "flur" (<b>) in --brand-deep, "klar" in near-black ink (--ink:
   light ink in dark mode) - on every page the brand renders (data-brand is
   always on <html>), not only on an .fl-scoped page (landing, karte), where
   flurklar.css's `.fl a` rule would otherwise tint "klar" terracotta. Lives
   here, not in flurklar.css, so it also reaches error.html (404/410/500),
   which never loads flurklar.css. Two attributes+classes beat `.fl a`'s
   class+tag regardless of source order. */
html[data-brand="flurklar"] .f-lock { color: var(--ink); }
html[data-brand="flurklar"] .f-lock b { color: var(--brand-deep); }

/* --- Base -------------------------------------------------------------- */
* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  margin: 0;
}
a { color: var(--brand-deep); }

/* --- Layout -------------------------------------------------------------- */
.f-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}

.f-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

/* Header navigation, shared by every landing page. */
.f-bar nav {
  display: flex;
  align-items: center;
  gap: 4px 20px;
  font-size: 14px;
}
.f-bar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}
.f-bar nav a:hover,
.f-bar nav a:focus-visible {
  color: var(--ink);
}
.f-bar nav a.f-btn {
  color: var(--on-brand);
  padding: 0 16px;
  font-size: 14px;
  margin-left: 4px;
}

.f-bar > nav { margin-left: auto; }

/* --- Mobile menu --------------------------------------------------------
   A <details>: opens and closes without JS, and <summary> reports its
   expanded state natively. islands/menu.js adds Escape (focus back on the
   button), click-outside and close-after-link. Shown <= 880 px; the
   --narrow variant (company site, three short links) only <= 560 px. */
.f-menu { display: none; position: relative; margin-left: 8px; }
.f-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  list-style: none;
  cursor: pointer;
}
.f-menu > summary::-webkit-details-marker { display: none; }
.f-menu__bars,
.f-menu__bars::before,
.f-menu__bars::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.f-menu__bars { position: relative; }
.f-menu__bars::before,
.f-menu__bars::after { content: ""; position: absolute; left: 0; }
.f-menu__bars::before { top: -5px; }
.f-menu__bars::after { top: 5px; }
.f-menu[open] .f-menu__bars { background: transparent; }
.f-menu[open] .f-menu__bars::before { top: 0; transform: rotate(45deg); }
.f-menu[open] .f-menu__bars::after { top: 0; transform: rotate(-45deg); }
.f-bar .f-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: max-content;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px -20px rgb(38 46 61 / .35);
}
.f-bar .f-menu__panel a {
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
}
.f-bar .f-menu__panel a:hover { background: var(--bg); }
@media (max-width: 880px) {
  .f-menu { display: block; }
  .f-menu--narrow { display: none; }
}
@media (max-width: 560px) {
  .f-menu--narrow { display: block; }
}

.f-lock {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 800 17px/1 var(--sans);
  letter-spacing: -0.02em;
}

/* --- Buttons ------------------------------------------------------------- */
.f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand-deep);
  color: var(--on-brand);
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.9,.2,1), opacity .2s cubic-bezier(.2,.9,.2,1);
}
.f-btn:hover { opacity: .92; }
.f-btn:active { transform: scale(.98); }

.f-btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.f-btn--ghost:hover { border-color: var(--brand-deep); color: var(--brand-deep); }

/* --- Chip ------------------------------------------------------------- */
.f-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.f-chip.is-on {
  border-color: var(--brand-deep);
  color: var(--brand-deep);
  background: var(--brand-deep);
  background: color-mix(in srgb, var(--brand-deep) 12%, var(--surface));
}

/* --- Card ------------------------------------------------------------- */
.f-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

/* --- Type scale ------------------------------------------------------- */
.f-eyebrow {
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--mute);
}

.f-h1 {
  font: 800 56px/1.0 var(--sans);
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0;
}
@media (max-width: 640px) {
  .f-h1 { font-size: 38px; }
}

.f-lead {
  font: 400 17px/1.5 var(--sans);
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0;
}

.f-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font: 500 12px/1.5 var(--mono);
  color: var(--mute);
  padding: 24px 0;
}
.f-foot nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.f-foot a,
.f-foot span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.f-foot a {
  color: var(--mute);
  text-decoration: none;
}
.f-foot a:hover,
.f-foot a:focus-visible {
  color: var(--ink);
}

.f-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

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

/* --- Focus ring --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
}

/* --- Reduced motion: end states apply immediately, everything stays
   fully usable. ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
  .f-btn:active { transform: none; }
}
