/* ============================================
   TRAINING DAY: DARK / MONO THEME (Rawmix-inspired)
   Shared overrides for all pages. Loaded AFTER shared.css.
   ============================================ */

/* ============================================
   FONTS: Self-hosted
   --------------------------------------------
   Inter (variable) + IBM Plex Mono. Both live in /assets/ next to this file.
   ============================================ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('InterVariable.woff2') format('woff2-variations'),
       url('InterVariable.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('IBMPlexMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('IBMPlexMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('IBMPlexMono-SemiBold.woff2') format('woff2');
}

/* =====================================================
   TRAINING DAY: Brand tokens (v2, May 2026)
   Mountain #eff1f3 · Cave #172026 · Sea #469db4
   Rock #686772 · Sunrise #f8d878
   Sea is the locked primary accent and is never swapped.
   ===================================================== */
:root,
[data-theme="dark"] {
  --mountain: #eff1f3;
  --chalk:    #f7f5f2;    /* Warm light background (light theme --bg) */
  --cave:     #172026;
  --sea:      #469db4;
  --sea-deep: #2a7184;    /* Darker Sea: the only accent allowed to carry text or sit under light text on Chalk (5.1:1) */
  --rock:     #686772;
  --sunrise:  #f8d878;
  --moss:     #2a7452;    /* Success green (5.2:1 on Chalk) */

  --bg: #172026;          /* Cave */
  --surface: #1e282f;     /* Tinted secondary surface: fields, featured cards, callouts */
  --fg: #eff1f3;          /* Mountain */
  --fg-soft:  rgba(239,241,243,0.86);
  --fg-muted: rgba(239,241,243,0.66);
  --line:        rgba(239,241,243,0.14);
  --line-strong: rgba(239,241,243,0.28);
  --accent: #469db4;      /* Sea: locked, GRAPHIC accent only (borders, dots, fills under dark text) */
  --accent-deep: #7fc4d6; /* INTERACTIVE accent: hover fills under --bg text, accent-coloured text/icons (8.5:1 on Cave) */
  --accent-text: var(--fg); /* editorial TEXT accent: near-black on light / near-white on dark (AAA) */
  --ok: #7bc9a4;          /* Success states (text, borders) */
  --field-bg:       rgba(239,241,243,0.04);
  --field-bg-focus: rgba(239,241,243,0.07);

  --nav-h: 0px;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="light"] {
  --bg: var(--chalk);     /* #f7f5f2 */
  --surface: #efece7;
  --fg: #172026;          /* Cave */
  --fg-soft:  rgba(23,32,38,0.86);
  --fg-muted: rgba(23,32,38,0.74);
  --line:        rgba(23,32,38,0.12);
  --line-strong: rgba(23,32,38,0.24);
  --accent: #469db4;
  --accent-deep: var(--sea-deep);  /* #2a7184: 5.1:1 on Chalk, Chalk text on it 5.1:1 */
  --ok: var(--moss);
  --field-bg:       rgba(23,32,38,0.04);
  --field-bg-focus: rgba(23,32,38,0.06);
}

/* html must share body's ground, or iOS overscroll reveals shared.css's Mountain grey */
html { background: var(--bg); color-scheme: light dark; }
[data-theme="dark"] html, html[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] html, html[data-theme="light"] { color-scheme: light; }

/* Invert the white-fill hero emblem in light mode so it renders dark */
[data-theme="light"] .dark-hero__image img { filter: invert(1); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.025em;
  color: var(--fg);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { letter-spacing: -0.035em; font-weight: 600; }
h2 { letter-spacing: -0.03em; font-weight: 600; }

/* ============================
   Eyebrow + footnote bracket
   ============================ */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.fn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  transform: translateY(-2px);
}

.sec-head {
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 48px;
  margin-top: 0;
  display: block;
}

/* ============================
   NAVBAR overrides
   ============================ */
.nav {
  position: relative;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 960px) {
  .nav { border-bottom: 0; }
}
/* Mobile pages run to ~8000px. Below the desktop breakpoint the nav sticks so
   navigation and the CTA stay reachable. Anything else that sticks to the top
   must offset itself by var(--nav-h); the progress strips on bestilling.html
   and oppstart.html already do. */
@media (max-width: 959px) {
  :root { --nav-h: 89px; } /* 88px bar + 1px border-bottom */
  .nav { position: sticky; top: 0; }
  /* Every in-page anchor target on the site is a <section id>. Keep them clear
     of the sticky bar when a link jumps to them. */
  section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }
  .nav__mobile { max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
}
.nav.scrolled { box-shadow: 0 1px 0 var(--line); }
.nav__inner { border-bottom: 0; }
.nav__logo {
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fg);
}
.nav__logo--emblem {
  color: var(--fg);
  display: inline-flex;
  align-items: center;
}
.nav__logo--emblem svg { display: block; }
.nav__logo .td-logo {
  /* logo.js handles font itself; theme only ensures colors flow */
  color: var(--fg);
}
.nav__logo .td-logo > span:first-child { color: var(--accent-text) !important; }
.nav__logo .td-logo > span:last-child { color: var(--fg) !important; }
.nav__links a {
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.005em;
  font-size: 16px;
}
.nav__links a:hover { color: var(--accent-text); }
.nav__links a.active::after { background: var(--fg); }
.nav__hamburger { background: var(--fg); color: var(--bg); }
.nav__hamburger span,
.nav__hamburger span::before,
.nav__hamburger span::after { background: var(--bg); }
.nav__mobile { background: var(--bg); border-color: var(--line); }
.nav__mobile a { color: var(--fg); border-color: var(--line); font-family: var(--mono); }

@media (min-width: 960px) {
  .nav .nav__cta-desktop {
    align-self: center;
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--fg);
    border-left: 1px solid var(--fg);
    font-family: var(--sans);
    font-weight: 500;
    font-size: 15px;
    text-transform: none;
    letter-spacing: -0.005em;
    padding: 12px 22px;
    margin-left: 16px;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  }
  .nav .nav__cta-desktop:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
  }
}

/* ============================
   BUTTONS: outlined, mono
   ============================ */
.obtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  text-transform: none;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  border-radius: 0;
}
.obtn:hover { background: var(--fg); color: var(--bg); }
.obtn--soft { border-color: var(--line-strong); color: var(--fg-soft); }
.obtn--soft:hover { border-color: var(--fg); background: transparent; color: var(--fg); }
.obtn--accent { border-color: var(--accent); color: var(--accent-text); }
.obtn--accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }

/* --primary: filled by default. Use once per view for the single most
   important action on the page (per the Sep 2026 audit's CTA hierarchy). */
.obtn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.obtn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }

.dark-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: border-color 160ms ease, color 160ms ease;
}
.dark-link:hover { border-bottom-color: var(--fg); color: var(--accent-text); }
.dark-link svg { transition: transform 220ms ease; }
.dark-link:hover svg { transform: translateX(3px); }

/* ============================
   PAGE HERO (shared across pages)
   Two-column on desktop: text left, emblem image right.
   ============================ */
.dark-hero {
  position: relative;
  padding: 48px 0 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.dark-hero__container {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "foot"
    "photo";
  gap: 24px;
  align-items: center;
}
.dark-hero__content { display: contents; }
.dark-hero__display { grid-area: title; min-width: 0; }
.dark-hero__photo { grid-area: photo; }
.dark-hero__foot { grid-area: foot; margin-top: 0; }
.dark-hero__image {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.dark-hero__image img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
}

/* Photo variant that replaces emblem with editorial portrait */
.dark-hero__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
  margin-top: 4px;
}
.dark-hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  filter: grayscale(1) contrast(1.04);
  display: block;
}
.dark-hero__photo .caption {
  position: absolute;
  left: 16px; bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  background: rgba(23,32,38,0.6);
  padding: 6px 10px;
  backdrop-filter: blur(4px);
}
[data-theme="light"] .dark-hero__photo .caption {
  background: rgba(239,241,243,0.7);
  color: var(--cave);
}
.dark-hero__display {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.04em;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.98;
  color: var(--fg);
  margin: 0;
  max-width: 14ch;
  overflow-wrap: anywhere;
  hyphens: auto;
}
/* Tighter sizing on photo-variant heroes so display stays in its column */
.dark-hero--photo .dark-hero__display {
  font-size: clamp(36px, 5.8vw, 80px);
  max-width: 11ch;
}
.dark-hero__display span { display: block; }
.dark-hero__display .quiet { color: var(--fg-muted); }
.dark-hero__foot {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 56ch;
}
.dark-hero__sub {
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  max-width: 52ch;
  font-family: var(--sans);
  font-weight: 400;
}
.dark-hero__cta { justify-self: stretch; width: 100%; min-height: 56px; }
@media (min-width: 600px) {
  .dark-hero__cta { justify-self: start; width: auto; min-height: 0; }
}

@media (min-width: 900px) {
  .dark-hero { padding: 88px 0 104px; min-height: 70vh; display: flex; align-items: center; }
  .dark-hero__container {
    grid-template-columns: 1.5fr 1fr;
    grid-template-areas: "content photo";
    gap: 80px;
    width: 100%;
    align-items: start;
  }
  .dark-hero__content {
    display: flex; flex-direction: column;
    grid-area: content;
  }
  .dark-hero__display { grid-area: unset; }
  .dark-hero__foot { grid-area: unset; margin-top: 44px; }
  .dark-hero__image { display: flex; }
  .dark-hero__image img { max-width: 360px; }
  .dark-hero__photo { display: block; margin-top: 0; }
  .dark-hero--photo .dark-hero__container { grid-template-columns: 1.1fr 1fr; gap: 80px; }
}

/* ============================
   PILLAR LIST (left-rule list)
   ============================ */
.pillar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 720px;
}
.pillar-list > li {
  border-left: 1px solid var(--line);
  padding: 22px 0 22px 24px;
  margin-bottom: 8px;
  transition: border-color 160ms ease;
}
.pillar-list > li:hover { border-left-color: var(--accent); }
.pillar-list h3 {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: none;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 10px;
  line-height: 1.25;
  display: flex; align-items: baseline; gap: 10px;
}
.pillar-list p {
  color: var(--fg-soft);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  max-width: 56ch;
}

/* ============================
   CONTACT overrides
   ============================ */
.contact-section {
  background: var(--bg);
  padding-top: var(--section-y);
  border-top: 1px solid var(--line);
}
.contact-section h2 {
  font-family: var(--sans) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  color: var(--fg) !important;
  letter-spacing: -0.03em !important;
  font-size: clamp(32px, 5vw, 56px) !important;
  line-height: 1.05 !important;
}
.form-field {
  background: var(--field-bg);
  border: 1px solid var(--line);
  padding: 8px 18px;
  gap: 4px;
  transition: border-color 140ms ease, background 140ms ease;
}
.form-field:focus-within {
  border-color: var(--fg);
  background: var(--field-bg-focus);
}
.form-field label {
  color: var(--accent-text) !important;
  font-family: var(--mono) !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  font-weight: 500 !important;
}
.form-field input,
.form-field textarea {
  border: 0 !important;
  background: transparent !important;
  color: var(--fg) !important;
  font-family: var(--sans) !important;
  font-size: 16px !important;
  padding: 2px 0 !important;
  /* The control's own hit area was 24px inside a 77px box. Match bestilling.html. */
  min-height: 44px;
}
/* Keep shared.css's taller message box; the 44px floor above would otherwise
   win on load order and shrink it to a two-line field. */
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--fg-muted); }
.form-field input:focus,
.form-field textarea:focus { box-shadow: none; }
.checkbox-row {
  color: var(--fg-soft);
  font-family: var(--mono);
  font-size: 12px;
}
.checkbox-row input[type="checkbox"] { accent-color: var(--fg); }
.contact-info__label {
  color: var(--accent-text) !important;
  font-family: var(--mono);
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.contact-info__value {
  color: var(--fg) !important;
  font-family: var(--mono);
  font-size: 15px !important;
}
.link, a.link { color: var(--accent-text); border-bottom: 1px solid transparent; }
.link:hover { border-bottom-color: var(--accent); }

/* shared.js now emits .obtn.obtn--primary directly; the old .btn override is gone. */

/* ============================
   FOOTER overrides
   ============================ */
.footer { background: var(--bg); border-top-color: var(--line); padding: 0 0 32px; }

/* === NEWSLETTER === */
.footer__newsletter {
  display: grid; grid-template-columns: 1fr; gap: 28px;
  padding: 56px 0 64px;
}
@media (min-width: 800px) {
  .footer__newsletter {
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
    padding: 72px 0 80px;
    align-items: center;
  }
}
.footer__newsletter-label {
  font-family: var(--mono); font-size: 12px; color: var(--accent-text);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px;
}
.footer__newsletter-title {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(15px, 1.3vw, 17px); line-height: 1.45;
  letter-spacing: -0.005em; margin: 0; max-width: 36ch;
  color: var(--fg-soft);
}
.footer__newsletter-form {
  display: flex; flex-direction: column; gap: 14px;
}
.footer__newsletter-row {
  display: grid; grid-template-columns: 1fr auto;
  border: 1px solid var(--line-strong);
  transition: border-color 140ms;
}
.footer__newsletter-row:focus-within { border-color: var(--fg); }
.footer__newsletter-row input {
  background: transparent; border: 0; outline: 0;
  color: var(--fg);
  font-family: var(--sans); font-size: 16px;
  padding: 16px 18px;
  width: 100%;
}
.footer__newsletter-row input::placeholder { color: var(--fg-muted); }
.footer__newsletter-row button {
  background: var(--fg); color: var(--bg);
  border: 0;
  font-family: var(--sans); font-weight: 500; font-size: 15px;
  padding: 0 22px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: background 140ms, color 140ms;
}
.footer__newsletter-row button:hover { background: var(--accent-deep); }
.footer__newsletter-row button:disabled { opacity: 0.6; cursor: default; }
.footer__newsletter-consent {
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  align-items: start; cursor: pointer;
}
.footer__newsletter-consent input {
  width: 16px; height: 16px; margin-top: 1px; accent-color: var(--accent);
}
.footer__newsletter-consent span {
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  letter-spacing: 0.04em; line-height: 1.5;
}
.footer__newsletter-status {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.04em; line-height: 1.5;
}
.footer__newsletter-status.is-success,
.footer__newsletter-status.is-error {
  color: var(--accent-text);
  border-left: 2px solid var(--ok);
  padding-left: 12px;
}
.footer__newsletter-status.is-error { border-left-color: var(--sunrise); }
.footer__newsletter-status.is-pending { color: var(--fg-muted); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.footer .td-logo {
  font-family: var(--mono) !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  font-size: 15px !important;
  color: var(--fg) !important;
}
.footer .td-logo svg { display: none; }
.footer__brand .tagline {
  color: var(--fg-soft);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
}
.footer__links a {
  color: var(--fg-soft);
  font-family: var(--mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer__links a:hover { color: var(--fg); }
.footer__bottom {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top-color: var(--line);
}

/* ============================
   Accessibility: focus visible
   ============================ */
:focus-visible {
  outline: 2px solid var(--fg) !important;
  outline-offset: 3px !important;
}

/* ============================
   THEME TOGGLE BUTTON (footer)
   ============================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--fg-soft);
  cursor: pointer;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 160ms ease, border-color 160ms ease;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg); }
.theme-toggle svg { display: block; flex-shrink: 0; }
.theme-toggle__moon,
.theme-toggle__label-moon { display: none; }
[data-theme="light"] .theme-toggle__moon,
[data-theme="light"] .theme-toggle__label-moon { display: inline-block; }
[data-theme="light"] .theme-toggle__sun,
[data-theme="light"] .theme-toggle__label-sun { display: none; }


/* ===========================================================
   v1.18: Legibility & contrast pass (light-default era)
   - Sea (#469db4) retired as a TEXT color (fails AA on light); now a
     GRAPHIC accent only (borders, dots, radio/checkbox fills, badges).
   - Editorial text accents now use --accent-text (near-black / near-white) → AAA.
   - Muted tier strengthened; utility type +1px; body 17px; bolder eyebrows.
   =========================================================== */
.eyebrow, .sec-head { font-weight: 600; }

/* "Mest valgt" badge: dark ink on Sea reads on both themes */
.b-plan__badge { color: var(--cave) !important; }

/* Mobile (incl. iPhone 15 Pro Max @ 430px): comfortable taps + a little more width */
@media (max-width: 480px) {
  /* Eyebrow closer to heading, so it reads as a label pair rather than a floating element */
  .sec-head { margin-bottom: 20px; }
  .obtn, .obtn--soft, .obtn--accent, .obtn--primary,
  .b-summary__cta, .kf__btn, .b-submit { min-height: 52px; }
  .kf__field, .b-field { min-height: 46px; }
  .container { padding-left: 20px; padding-right: 20px; }
}
