/* ==========================================================================
   tokens.css — shared design tokens + component library
   Single source of truth for primitives reused across all pages. See
   design.md §3 (palette) & §4 (type).

   ── COLOR TOKENS (--c-*) ───────────────────────────────────────────────
     --c-sage, --c-sage-light, --c-sage-tint, --c-sage-muted, --c-wash,
     --c-slate, --c-near-black, --c-sand, --c-text, --c-text-soft,
     --c-white, --c-off

   ── TYPE / LAYOUT TOKENS ────────────────────────────────────────────────
     --font-head ("Oswald"), --font-body ("Work Sans"), --maxw (1080px)

   ── COMPONENT KNOBS (override per focus; defaults below) ────────────────
     Button : --btn-bg --btn-fg --btn-bg-hover --btn-fg-hover --btn-radius
              --btn-pad --btn-size --btn-tracking --btn-weight
     Card   : --card-bg --card-fg --card-border --card-radius --card-pad
     Form   : --field-bg --field-fg --field-border --field-border-focus
              --field-radius --field-label --field-placeholder
     Nav    : --nav-bg --nav-fg --nav-border --nav-accent
     Footer : --foot-bg --foot-fg --foot-head --foot-link --foot-border

   ── SHARED COMPONENTS / CLASSES ─────────────────────────────────────────
     Layout   : .wrap, .section, .section-head
     Eyebrow  : .eyebrow, .kicker
     Buttons  : .btn, .btn.ghost
     Card     : .card
     Forms    : .form, .field, .form-row, label, input, select, textarea
                (controls inside .form/.field are token-driven)
     Nav/Foot : .site-nav (+children), .site-footer (+children), .back

   ── PER-FOCUS SCOPING ───────────────────────────────────────────────────
     Set the focus on <body> with one of: .focus-klinik | .focus-workout |
     .focus-pp. Each tunes the component knobs above to its tone. Pages then
     only need genuinely page-unique CSS in their inline <style>.
   ========================================================================== */
:root {
  /* Greens */
  --c-sage: #b8c0a6;        /* primary accent */
  --c-sage-light: #d6ddd5;
  --c-sage-tint: #c0c9b6;
  --c-sage-muted: #afb89b;
  --c-eyebrow: #656f57;     /* darkened sage for small label TEXT on light bg
                               (WCAG AA on white/wash; sage-muted alone fails) */
  --c-wash: #f0f3f0;        /* pale green wash */
  /* Darks */
  --c-slate: #2c3f46;       /* dark slate/teal */
  --c-near-black: #080d12;
  /* Warm */
  --c-sand: #e0ddd4;
  --c-gold: #b8924f;        /* afdæmpet messingguld — from the logo */
  /* Text & neutrals */
  --c-text: #434343;
  --c-text-soft: #515151;
  --c-white: #ffffff;
  --c-off: #f5f5f5;

  --font-head: "Oswald", system-ui, sans-serif;
  --font-body: "Work Sans", system-ui, sans-serif;

  --maxw: 1080px;
  --section-pad: 72px;

  /* Button knobs (neutral slate default; overridden per focus) */
  --btn-bg: var(--c-slate);
  --btn-fg: #fff;
  --btn-bg-hover: var(--c-near-black);
  --btn-fg-hover: #fff;
  --btn-radius: 999px;
  --btn-pad: 15px 34px;
  --btn-size: 14px;
  --btn-tracking: .12em;
  --btn-weight: 500;
  --btn-transition: background .2s, transform .15s;
  --btn-translate-hover: 0;

  /* Card knobs */
  --card-bg: #fff;
  --card-fg: var(--c-text);
  --card-border: var(--c-sage-light);
  --card-radius: 16px;
  --card-pad: 30px;

  /* Form / field knobs (neutral; each focus can tint) */
  --field-bg: #fff;
  --field-fg: var(--c-text);
  --field-border: var(--c-sage-light);
  --field-border-focus: var(--c-sage-muted);
  --field-radius: 10px;
  --field-pad: 12px 14px;
  --field-label: var(--c-slate);
  --field-placeholder: #9aa39c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt-and-braces against accidental horizontal scroll */
}
/* prevent long, unbroken strings (emails, headings) from forcing overflow */
h1, h2, h3, h4, p, a { overflow-wrap: break-word; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 .5em;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ==========================================================================
   GLOBAL KEYBOARD FOCUS (a11y, #18) — a clearly visible focus ring for
   keyboard users on every interactive element. :focus-visible keeps the ring
   off mouse clicks. Uses two outlines (slate + white offset) so it stays
   legible on both light and dark backgrounds across all three focuses.
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--c-slate);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9);
  border-radius: 3px;
}
/* On dark surfaces (Workout / P&P dark nav, hero, footer) flip the ring to a
   light sage so it reads against near-black/slate. */
.focus-workout :focus-visible,
.focus-pp :focus-visible,
.site-footer :focus-visible,
.cookie-banner :focus-visible {
  outline-color: var(--c-sage);
  box-shadow: 0 0 0 4px rgba(8, 13, 18, .55);
}
/* Form fields already show a focus box-shadow; don't double up the ring on
   them when focused via keyboard — keep just the outline. */
.field :focus-visible, .form :focus-visible { box-shadow: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   LAYOUT — section + section heading
   ========================================================================== */
.section { padding: var(--section-pad) 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { margin-top: 10px; }

/* ==========================================================================
   EYEBROW / KICKER — small uppercase labels above headings
   .eyebrow: quiet, letter-spaced label (Klinik / P&P).
   .kicker:  badge-style accent label (Workout).
   ========================================================================== */
.eyebrow {
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .3em; font-size: 13px; color: var(--c-eyebrow);
  margin-bottom: 18px;
}
.kicker {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em; font-size: 13px;
  color: var(--c-near-black); background: var(--c-sage);
  padding: 6px 14px; border-radius: 4px; margin-bottom: 22px;
}

/* ==========================================================================
   BUTTONS — .btn (solid) and .btn.ghost (outline). Token-driven; each focus
   overrides the --btn-* knobs (see per-focus scoping below).
   ========================================================================== */
.btn {
  display: inline-block; font-family: var(--font-head); font-weight: var(--btn-weight);
  text-transform: uppercase; letter-spacing: var(--btn-tracking);
  font-size: var(--btn-size); text-decoration: none; cursor: pointer;
  padding: var(--btn-pad); border: 0; border-radius: var(--btn-radius);
  background: var(--btn-bg); color: var(--btn-fg);
  transition: var(--btn-transition);
}
.btn:hover {
  background: var(--btn-bg-hover); color: var(--btn-fg-hover);
  transform: translateY(var(--btn-translate-hover));
}
.btn.ghost {
  background: transparent; color: var(--btn-bg);
  border: 1px solid var(--btn-bg);
}
.btn.ghost:hover { background: var(--btn-bg); color: var(--btn-fg); }

/* ==========================================================================
   CARD — generic content card; token-driven so each focus can tint it.
   ========================================================================== */
.card {
  background: var(--card-bg); color: var(--card-fg);
  border: 1px solid var(--card-border); border-radius: var(--card-radius);
  padding: var(--card-pad);
}

/* ==========================================================================
   FORMS — primitives shared by the mock booking / signup / contact UIs.
   Markup pattern:
     <form class="form">
       <div class="form-row">                 (multi-column row; stacks <=560px)
         <div class="field">
           <label for="name">Navn</label>
           <input id="name" type="text" placeholder="…">
         </div>
         <div class="field"> … </div>
       </div>
       <div class="field"> <label>…</label> <textarea></textarea> </div>
       <button class="btn" type="submit">Send</button>
     </form>
   All controls read the --field-* knobs, so a focus tints them by overriding
   those (e.g. dark fields on Workout). Visually neutral by default.
   ========================================================================== */
.form { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label,
.form label {
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .1em; font-size: 12px; color: var(--field-label);
}
.form-row {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.field input,
.field select,
.field textarea,
.form input,
.form select,
.form textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  color: var(--field-fg); background: var(--field-bg);
  border: 1px solid var(--field-border); border-radius: var(--field-radius);
  padding: var(--field-pad); transition: border-color .2s, box-shadow .2s;
}
.field textarea, .form textarea { min-height: 130px; resize: vertical; }
.field select, .form select { appearance: none; cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none; border-color: var(--field-border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--field-border-focus) 30%, transparent);
}
.field input::placeholder,
.field textarea::placeholder,
.form input::placeholder,
.form textarea::placeholder { color: var(--field-placeholder); }

/* ==========================================================================
   PER-FOCUS SCOPING — set one of these on <body>. Only the component knobs
   that differ from the neutral defaults are overridden here.
   ========================================================================== */
/* Klinik — calm slate pill button, airy fields */
.focus-klinik {
  --section-pad: 72px;
  --btn-bg: var(--c-slate); --btn-fg: #fff;
  --btn-bg-hover: var(--c-near-black); --btn-fg-hover: #fff;
  --btn-radius: 999px; --btn-pad: 15px 34px; --btn-size: 14px;
}

/* Workout — bold sage button on dark, dark fields */
.focus-workout {
  --section-pad: 80px;
  --btn-bg: var(--c-sage); --btn-fg: var(--c-near-black);
  --btn-bg-hover: #c8d0b6; --btn-fg-hover: var(--c-near-black);
  --btn-radius: 4px; --btn-pad: 17px 40px; --btn-size: 15px;
  --btn-tracking: .14em; --btn-weight: 600; --btn-translate-hover: -2px;
  --card-bg: #11181f; --card-fg: #c3c9bd; --card-border: #2c3f46;
  --card-radius: 8px; --card-pad: 26px;
  --field-bg: #11181f; --field-fg: #e9ece6; --field-border: #2c3f46;
  --field-border-focus: var(--c-sage); --field-label: var(--c-sage);
  --field-placeholder: #6f776c;
}

/* People & Performance — premium sand button, refined fields */
.focus-pp {
  --section-pad: 84px;
  --btn-bg: var(--c-sand); --btn-fg: var(--c-slate);
  --btn-bg-hover: #efece3; --btn-fg-hover: var(--c-slate);
  --btn-radius: 6px; --btn-pad: 16px 36px; --btn-size: 14px;
  --btn-translate-hover: -2px;
}

/* shared "back to hub" pill (legacy / optional) */
.back {
  position: fixed; top: 18px; left: 18px; z-index: 50;
  font-family: var(--font-head); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.85); color: var(--c-slate);
  backdrop-filter: blur(6px); border: 1px solid rgba(0,0,0,.08);
}
.back:hover { background: #fff; }

/* ==========================================================================
   SHARED TOP-NAV (sub-sites only) — canonical markup, see HTML comment in each
   sub-site page. Structure/classes are identical across pages; per-page tone
   is set with the --nav-* / --foot-* custom properties below, scoped in each
   page's <style>.
   ========================================================================== */
:root {
  /* Header/nav tone knobs (overridden per page) */
  --nav-bg: rgba(255,255,255,.92);
  --nav-fg: var(--c-slate);
  --nav-border: rgba(0,0,0,.08);
  --nav-accent: var(--c-sage-muted);

  /* Footer tone knobs (overridden per page) */
  --foot-bg: var(--c-slate);
  --foot-fg: #cdd4cf;
  --foot-head: #ffffff;
  --foot-link: #ffffff;
  --foot-border: rgba(255,255,255,.12);
}

.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px clamp(18px, 4vw, 40px);
  background: var(--nav-bg); color: var(--nav-fg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(8px);
}
.site-nav .brand { display: flex; align-items: center; text-decoration: none; }
.site-nav .brand img { height: 30px; width: auto; }
/* The brand wordmark (logolight.png) renders as DARK text on transparent, so it
   reads as-is on the light Klinik nav. On the dark Workout / People&Performance
   navs it would be invisible, so knock it out to white. */
.focus-workout .site-nav .brand img,
.focus-pp .site-nav .brand img { filter: brightness(0) invert(1); }
.site-nav .nav-links {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 30px);
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .1em; font-size: 13px;
}
.site-nav .nav-links a {
  color: var(--nav-fg); text-decoration: none; opacity: .85;
  padding: 4px 0; border-bottom: 2px solid transparent; transition: opacity .2s, border-color .2s;
}
.site-nav .nav-links a:hover { opacity: 1; border-bottom-color: var(--nav-accent); }
.site-nav .nav-links a.is-current { opacity: 1; border-bottom-color: var(--nav-accent); }

/* Hamburger toggle — hidden on desktop, shown on small screens (see media query) */
.site-nav .nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0; margin: 0;
  background: transparent; border: 0; cursor: pointer;
  color: var(--nav-fg); align-items: center; justify-content: center;
}
.site-nav .nav-toggle .bars,
.site-nav .nav-toggle .bars::before,
.site-nav .nav-toggle .bars::after {
  content: ""; display: block; width: 22px; height: 2px;
  background: currentColor; transition: transform .25s ease, opacity .2s ease;
}
.site-nav .nav-toggle .bars { position: relative; }
.site-nav .nav-toggle .bars::before { position: absolute; top: -7px; left: 0; }
.site-nav .nav-toggle .bars::after  { position: absolute; top:  7px; left: 0; }
/* animate to an X when open */
.site-nav .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.site-nav .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.site-nav .nav-toggle[aria-expanded="true"] .bars::after  { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav (<= 760px): stacked panel toggled by the hamburger ───────── */
@media (max-width: 760px) {
  .site-nav { flex-wrap: wrap; }
  .site-nav .nav-toggle { display: inline-flex; }
  .site-nav .nav-links {
    display: none; flex-basis: 100%; order: 3;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 8px -4px 4px;
  }
  .site-nav .nav-links.is-open { display: flex; }
  .site-nav .nav-links a {
    padding: 13px 4px; opacity: 1; border-bottom: 1px solid var(--nav-border);
    min-height: 44px; display: flex; align-items: center;
  }
  .site-nav .nav-links a:last-child { border-bottom: 0; }
  .site-nav .nav-links a:hover,
  .site-nav .nav-links a.is-current { border-bottom-color: var(--nav-border); color: var(--nav-accent); }
}

/* ==========================================================================
   SHARED FOOTER — canonical markup, identical across all four pages.
   Full contact block (phone, email, clinic address, CVR) + social links.
   ========================================================================== */
.site-footer {
  background: var(--foot-bg); color: var(--foot-fg);
  padding: 56px clamp(24px, 5vw, 48px) 40px;
}
.site-footer a { color: var(--foot-link); }
.site-footer .foot-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 36px; grid-template-columns: 1.4fr 1fr 1fr;
}
.site-footer .foot-brand {
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .14em; font-size: 15px; color: var(--foot-head); margin: 0 0 10px;
}
.site-footer h4 {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em;
  font-size: 12px; color: var(--foot-head); opacity: .9; margin: 0 0 12px;
}
.site-footer p { margin: 0 0 6px; font-size: 14px; line-height: 1.7; }
.site-footer .social { display: flex; flex-direction: column; gap: 8px; }
.site-footer .social a {
  font-size: 14px; text-decoration: none; opacity: .9;
}
.site-footer .social a:hover { opacity: 1; text-decoration: underline; }
.site-footer .foot-base {
  max-width: var(--maxw); margin: 36px auto 0; padding-top: 22px;
  border-top: 1px solid var(--foot-border);
  font-size: 12px; letter-spacing: .04em; opacity: .8;
}
@media (max-width: 720px) {
  .site-footer .foot-inner { grid-template-columns: 1fr; gap: 28px; }
}
/* Footer legal links (privacy + cookie policy, #16) */
.site-footer .foot-legal { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.site-footer .foot-legal a { font-size: 14px; text-decoration: none; opacity: .9; }
.site-footer .foot-legal a:hover { opacity: 1; text-decoration: underline; }

/* Build credit ("Bygget af 12F") — its own line under the copyright in .foot-base.
   Sets no type or opacity of its own, so it inherits .foot-base exactly like the
   copyright line above it; the link follows the same convention as .foot-legal a
   and .social a (no underline until hover). */
.site-footer .foot-credit { display: block; margin-top: 8px; }
.site-footer .foot-credit a { text-decoration: none; opacity: .9; }
.site-footer .foot-credit a:hover { opacity: 1; text-decoration: underline; }

/* ==========================================================================
   COOKIE CONSENT BANNER (#16) — shared, dismissible, visual-only.
   Markup is injected/toggled by assets/js/cookie.js. The banner is hidden
   by default and only revealed (.is-visible) when consent hasn't been
   stored yet, so it never flashes on pages a visitor has already accepted.
   ========================================================================== */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: none;
  background: var(--c-slate); color: #e6eae6;
  padding: 18px clamp(20px, 5vw, 40px);
  box-shadow: 0 -12px 30px -18px rgba(0,0,0,.55);
}
.cookie-banner.is-visible { display: block; }
.cookie-banner .cookie-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 22px 28px; flex-wrap: wrap;
}
.cookie-banner .cookie-text { flex: 1 1 320px; font-size: 14px; line-height: 1.6; margin: 0; }
.cookie-banner .cookie-text a { color: var(--c-sage); text-decoration: underline; }
.cookie-banner .cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-banner .cookie-btn {
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .1em; font-size: 13px; font-weight: 500;
  border: 1px solid var(--c-sage); border-radius: 999px;
  padding: 11px 26px; cursor: pointer; background: transparent; color: #fff;
  transition: background .2s, color .2s;
}
.cookie-banner .cookie-btn:hover { background: var(--c-sage); color: var(--c-near-black); }
.cookie-banner .cookie-btn.accept { background: var(--c-sage); color: var(--c-near-black); }
.cookie-banner .cookie-btn.accept:hover { background: #fff; border-color: #fff; }
@media (max-width: 560px) {
  .cookie-banner .cookie-actions { width: 100%; }
  .cookie-banner .cookie-btn { flex: 1 1 auto; text-align: center; }
}

/* ==========================================================================
   LEGAL / POLICY PAGES (#16) — privatlivspolitik & cookie-politik.
   Simple, readable, light-background article layout.
   ========================================================================== */
.legal-header {
  background: var(--c-slate); color: #fff;
  padding: 64px clamp(24px, 5vw, 48px) 48px; text-align: center;
}
.legal-header .eyebrow-line {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .3em;
  font-size: 12px; color: var(--c-sage); margin-bottom: 16px;
}
.legal-header h1 { font-size: clamp(28px, 4.5vw, 42px); font-weight: 500; margin: 0; }
.legal-main { background: #fff; }
.legal-main .legal-inner { max-width: 760px; margin: 0 auto; padding: 56px 24px 72px; }
.legal-main .updated { color: var(--c-text-soft); font-size: 14px; margin: 0 0 36px; }
.legal-main h2 {
  color: var(--c-slate); font-size: 22px; margin: 40px 0 12px;
  padding-top: 8px;
}
.legal-main h2:first-of-type { margin-top: 0; }
.legal-main p, .legal-main li { color: var(--c-text); font-size: 16px; line-height: 1.75; }
.legal-main ul { padding-left: 22px; margin: 0 0 16px; }
.legal-main li { margin-bottom: 8px; }
.legal-main a { color: var(--c-slate); text-decoration: underline; }
.legal-main .legal-contact {
  margin-top: 40px; padding: 24px 26px; background: var(--c-wash);
  border-radius: 14px; border: 1px solid var(--c-sage-light);
}
.legal-main .legal-contact p { margin: 0 0 4px; }
.legal-main .legal-back {
  display: inline-block; margin-top: 36px; font-family: var(--font-head);
  text-transform: uppercase; letter-spacing: .12em; font-size: 13px;
  text-decoration: none; color: var(--c-slate);
}
.legal-main .legal-back:hover { text-decoration: underline; }

/* ==========================================================================
   GLOBAL SMALL-SCREEN PASS (#4) — tighten generous section padding and keep
   tap targets comfortable on phones, without touching desktop layouts.
   ========================================================================== */
@media (max-width: 600px) {
  :root, .focus-klinik, .focus-workout, .focus-pp { --section-pad: 48px; }
  .wrap { padding: 0 20px; }
  /* comfortable tap targets for the primary buttons on mobile */
  .btn { display: inline-block; min-height: 44px; line-height: 1.4; }
}

/* ==========================================================================
   SCROLL REVEAL (#23) — subtle staggered entrance for content as it scrolls
   into view. Progressive enhancement: the hidden start-state is scoped to
   html.js (a class set by a tiny inline script before paint), so if JS is
   disabled or fails, every .reveal stays fully visible — nothing is gated
   behind the IntersectionObserver in assets/js/reveal.js.
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.16, .8, .3, 1);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   REDUCED MOTION (#23) — honour the OS "reduce motion" preference. Kills the
   global smooth scroll, every transition/animation (hover scale, tile lift,
   calendar fades), and forces reveal content to its final, visible state so
   nothing stays hidden. The near-zero (not 0) durations keep transitionend /
   animationend listeners firing.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
