/* ==========================================================================
   Norðvegr: The Quiet North — stylesheet
   Mobile-first. No frameworks, no external fonts, no build step.
   ========================================================================== */

:root {
  /* Palette: dark navy / coksgrå / tåkegrå / dempet isblå, warm light accent */
  --color-bg: #0a141c;
  --color-bg-alt: #0e1922;
  --color-surface: #142330;
  --color-surface-border: rgba(255, 255, 255, 0.08);

  --color-text: #eef2f4;
  --color-text-muted: #a8b6bd;
  --color-fog: #7e8d95;

  --color-ice: #9fc3d2;
  --color-ice-dim: #6f8894;

  --color-warm: #e0a458;
  --color-warm-dim: #b9803c;
  --color-danger: #e2837c;

  --header-height: 4rem;

  --container-max: 74rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  --section-pad: clamp(2.75rem, 6vw, 4rem);
  --section-pad-tight: clamp(2rem, 4vw, 2.75rem);

  --radius: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  /* Very subtle, fixed directional glow — cool upper-left, warm lower-right —
     for a touch of depth. No blur/filter involved, so it can't recreate the
     fixed-positioning containing-block bug that backdrop-filter caused earlier. */
  background:
    radial-gradient(ellipse 60% 40% at 12% 0%, rgba(159, 195, 210, 0.05), transparent 60%),
    radial-gradient(ellipse 55% 40% at 100% 100%, rgba(224, 164, 88, 0.035), transparent 60%),
    var(--color-bg);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

html {
  scroll-padding-top: calc(var(--header-height) + 0.5rem);
  scrollbar-gutter: stable;
}
body.no-scroll {
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Language toggling ----------
   Every bilingual node exists twice, tagged lang="nb" / lang="en".
   html[data-lang] decides which copy of each pair is visible. */
html[data-lang="nb"] [lang="en"] { display: none; }
html[data-lang="en"] [lang="nb"] { display: none; }

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

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-2);
  background: var(--color-warm);
  color: #1a1206;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: var(--space-2);
}

:focus-visible {
  outline: 3px solid var(--color-warm);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--color-surface-border);
}
.section-alt { background: var(--color-bg-alt); }
.section-tight { padding-block: var(--section-pad-tight); }

.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-3);
}

.prose { max-width: 42rem; }
.prose p { margin-bottom: var(--space-3); color: var(--color-text-muted); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--color-text); }

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-3);
}
.about-meta li {
  padding: 0.35rem 0.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(10, 20, 28, 0.96);
  border-bottom: 1px solid var(--color-surface-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}
.logo-sub {
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 0.4em;
  font-size: 0.85em;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  margin-inline: 7px;
  background: var(--color-text);
  border-radius: 2px;
}

.primary-nav {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--color-bg);
  padding: var(--space-4) var(--space-3);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  overflow-y: auto;
}
.primary-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.primary-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.primary-nav a {
  display: block;
  padding: var(--space-2) 0;
  text-decoration: none;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--color-surface-border);
}
.primary-nav a:hover { color: var(--color-ice); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.lang-option { color: var(--color-text-muted); }
html[data-lang="nb"] .lang-option[data-lang-option="nb"],
html[data-lang="en"] .lang-option[data-lang-option="en"] {
  color: var(--color-ice);
  font-weight: 600;
}
.lang-divider { color: var(--color-text-muted); }

@media (min-width: 56rem) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    inset: auto;
    background: transparent;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    overflow: visible;
  }
  .primary-nav ul {
    flex-direction: row;
    gap: var(--space-4);
    margin-bottom: 0;
  }
  .primary-nav a {
    padding: 0;
    border-bottom: none;
    font-size: 0.95rem;
    color: var(--color-text-muted);
  }
  .primary-nav a:hover { color: var(--color-text); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-warm);
  color: #1a1206;
}
.btn-primary:hover { background: #eab36c; }

.btn-disabled {
  background: transparent;
  border-color: var(--color-surface-border);
  color: var(--color-fog);
  cursor: not-allowed;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(28rem, 66vh, 38rem);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  /*
    Layered front-to-back — the gradients sit ON TOP of the photo so
    .hero-content stays legible; the photo itself is the second-to-last
    layer, with a plain gradient as the very last layer in case the photo
    file is ever missing:
    1. left-to-right readability tint over the text column
    2. a soft warm glow standing in for a distant window/sunset light
    3. a faint horizon line suggesting sea/sky
    4. a bottom fade into the page background
    5. assets/images/hero-coast.jpg — the real photo
    6. base dusk-coast gradient, visible only if the photo fails to load
  */
  background-image:
    linear-gradient(90deg, rgba(10, 20, 28, 0.92) 0%, rgba(10, 20, 28, 0.62) 42%, rgba(10, 20, 28, 0.22) 72%, rgba(10, 20, 28, 0.4) 100%),
    radial-gradient(ellipse 34rem 22rem at 76% 62%, rgba(224, 164, 88, 0.16), transparent 60%),
    linear-gradient(180deg, transparent 0%, transparent 57%, rgba(159, 195, 210, 0.06) 58%, transparent 60%),
    linear-gradient(180deg, rgba(10, 20, 28, 0) 60%, var(--color-bg) 100%),
    url("assets/images/hero-coast.jpg"),
    linear-gradient(120deg, #0c1b26 0%, #16303d 45%, #1c2a33 75%, #0a141c 100%);
  background-size: cover;
  /* Keeps the harbor/village on the right in frame on tall mobile crops,
     without losing the mountain and sky on wider crops. */
  background-position: 62% 55%;
}

.hero-inner {
  padding-block: var(--space-5);
  width: 100%;
}

.hero-content {
  max-width: 34rem;
}

.eyebrow {
  display: inline-block;
  color: var(--color-warm);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.hero-title-sub {
  display: block;
  font-size: 0.4em;
  font-weight: 400;
  color: var(--color-ice);
  margin-top: 0.5rem;
  letter-spacing: 0.06em;
}

.hero-lede {
  max-width: 34rem;
  margin-top: var(--space-3);
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ---------- Gameplay loop diagram ----------
   A quiet stepper: numbered badges connected by a rail, with the final step
   (the extraction-or-loss branch) picked out in the warm accent to read as
   the outcome rather than just a fifth identical box. */
.loop-diagram {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: loop-step;
}
.loop-diagram::before {
  content: "";
  position: absolute;
  left: 1.125rem;
  top: 1.125rem;
  bottom: 1.125rem;
  width: 1px;
  background: var(--color-surface-border);
  z-index: 0;
}
.loop-diagram li {
  counter-increment: loop-step;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}
.loop-diagram li::before {
  content: counter(loop-step);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-ice-dim);
  color: var(--color-ice);
  font-size: 0.9rem;
  font-weight: 700;
}
.loop-diagram li:last-child::before {
  border-color: var(--color-warm-dim);
  color: var(--color-warm);
}
.loop-diagram li:last-child { color: var(--color-warm); }

@media (min-width: 48rem) {
  .loop-diagram {
    flex-direction: row;
    gap: var(--space-3);
  }
  .loop-diagram::before {
    left: 1.125rem;
    right: 1.125rem;
    top: 1.125rem;
    bottom: auto;
    height: 1px;
    width: auto;
  }
  .loop-diagram li {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    text-align: left;
  }
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  counter-reset: feature-index;
}
.feature-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-top: 2px solid var(--feature-accent, var(--color-ice-dim));
  border-radius: var(--radius);
  padding: var(--space-3);
  counter-increment: feature-index;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.feature-card::after {
  content: counter(feature-index, decimal-leading-zero);
  position: absolute;
  top: 0.1em;
  right: 0.7rem;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(159, 195, 210, 0.08);
  pointer-events: none;
}
.feature-card:nth-child(3n+2) { --feature-accent: var(--color-warm-dim); }
.feature-card:nth-child(3n+3) { --feature-accent: var(--color-fog); }
.feature-card h3 {
  position: relative;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--color-ice);
}
.feature-card p { position: relative; color: var(--color-text-muted); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-surface-border);
    border-top-color: var(--feature-accent, var(--color-ice-dim));
    background-color: #172735;
  }
}
@media (prefers-reduced-motion: reduce) {
  .feature-card { transition: border-color 0.18s ease, background-color 0.18s ease; }
}

@media (min-width: 40rem) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Media gallery ----------
   Each frame keeps a gradient base + a discreet text label at all times.
   The <img> sits on top and, once it loads, simply covers the label —
   no JS needed for the success path. If the file 404s, script.js hides the
   <img> on its error event so only the gradient + label remain, never a
   broken-image icon. */
.media-gallery {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.media-figure {
  margin: 0;
}
.media-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-surface-border);
  background-image:
    linear-gradient(160deg, rgba(159, 195, 210, 0.12) 0%, rgba(10, 20, 28, 0) 60%),
    linear-gradient(200deg, #0e1922 0%, #1b2b35 50%, #0a141c 100%);
  background-size: cover;
  background-position: center;
}
.media-image-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(238, 242, 244, 0.32);
}
.media-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-figure figcaption {
  margin-top: var(--space-1);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

@media (min-width: 40rem) {
  .media-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; gap: var(--space-3); }
.news-entry {
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius);
}
.news-date {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-ice-dim);
  margin-bottom: 0.4rem;
}
.news-entry h3 { margin-bottom: 0.5rem; }
.news-entry p { color: var(--color-text-muted); }

/* ---------- Press ---------- */
.press-item {
  position: relative; /* containing block for the stretched-link ::after below */
  max-width: 56rem;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius);
  display: grid;
  gap: var(--space-3);
  transition: border-color 0.18s ease;
}
.press-outlet {
  color: var(--color-warm);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.press-date {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.press-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.press-item p { color: var(--color-text-muted); margin-bottom: var(--space-2); }
.press-body .btn { margin-top: var(--space-1); }
/* Stretched link: extends the one real "Les saken hos Bodø Nu" anchor's
   clickable area to the full card. Nothing else in .press-item is
   interactive, so there's no other link/control for this to swallow. */
.press-body .btn::after {
  content: "";
  position: absolute;
  inset: 0;
}

@media (min-width: 40rem) {
  .press-item {
    grid-template-columns: 12rem 1fr;
    padding: var(--space-4) var(--space-5);
  }
  .press-meta { border-right: 1px solid var(--color-surface-border); padding-right: var(--space-4); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .press-item:hover {
    border-color: var(--color-ice-dim);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-surface-border);
  padding-block: var(--space-5);
  background: var(--color-bg-alt);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.footer-brand .logo { display: block; margin-bottom: 0.5rem; }
.footer-brand a { color: var(--color-ice-dim); text-decoration: none; }
.footer-copy { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.social-placeholder {
  color: var(--color-fog);
  cursor: not-allowed;
}
.footer-links a {
  color: var(--color-ice-dim);
  text-decoration: none;
}
.footer-links a:hover { color: var(--color-ice); text-decoration: underline; }

@media (min-width: 40rem) {
  .footer-inner { flex-direction: row; justify-content: space-between; }
  .footer-links { flex-direction: row; gap: var(--space-4); }
}

/* ---------- Newsletter modal ----------
   .confirm-overlay / .confirm-panel / .confirm-close (the signup-confirmed
   dialog, see near the bottom of this file) deliberately reuse these same
   rules via the extra selector on each — same declarations applied to a
   second class, so nothing about how .newsletter-* itself renders changes. */
.newsletter-overlay, .confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: rgba(6, 12, 17, 0.78);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.newsletter-overlay.is-open, .confirm-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .newsletter-overlay, .confirm-overlay {
    transition: opacity 0.18s ease, visibility 0.18s;
  }
  .newsletter-panel, .confirm-panel {
    transition: transform 0.18s ease;
    transform: translateY(6px) scale(0.98);
  }
  .newsletter-overlay.is-open .newsletter-panel,
  .confirm-overlay.is-open .confirm-panel {
    transform: translateY(0) scale(1);
  }
}

.newsletter-panel, .confirm-panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  max-height: min(90vh, 42rem);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: calc(var(--radius) + 4px);
  padding: var(--space-4);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
}

.newsletter-close, .confirm-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-surface-border);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.newsletter-close:hover, .confirm-close:hover { color: var(--color-text); border-color: var(--color-ice-dim); }

.newsletter-panel h2 {
  padding-right: var(--space-5);
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}
.newsletter-panel h2:focus-visible { outline: none; }
#newsletter-description {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* Brevo requires the sib-form-message-panel class + default-hidden state
   for main.js to correctly reveal #error-message / #success-message after
   a submission — copied verbatim from Brevo's own snippet so however
   main.js reveals them (inline style or class) is guaranteed to win over
   this zero-specificity rule. Colors/spacing below are ours, not Brevo's;
   their stylesheet is intentionally not loaded. */
:where(.sib-form-message-panel) {
  display: none;
}
#error-message,
#success-message {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-align: center;
}
#error-message {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: rgba(226, 131, 124, 0.08);
}
#success-message {
  color: var(--color-ice);
  border-color: var(--color-ice-dim);
  background: rgba(159, 195, 210, 0.08);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.form-field input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
}
.form-field input[type="email"]:focus-visible {
  outline: 3px solid var(--color-warm);
  outline-offset: 1px;
}
.form-field input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.form-field-checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 0.6rem;
  align-items: start;
}
.form-field-checkbox input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-warm);
}
.form-field-checkbox label {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 0;
}
.form-field-checkbox .form-error { grid-column: 2; }

.form-error {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-danger);
}

.newsletter-privacy-link {
  font-size: 0.8rem;
  margin-top: -0.5rem;
}
.newsletter-privacy-link a {
  color: var(--color-ice-dim);
}

.newsletter-submit {
  width: 100%;
}
.newsletter-submit[aria-busy="true"] {
  cursor: wait;
  opacity: 0.75;
}

/* Required by Brevo: main.js reveals this (style.display="inline-block")
   in place of the submit button while a request is in flight — see the
   HTML comment above .sib-loader in index.html. Hidden by default so it
   never appears outside of that main.js-driven moment. */
.sib-loader {
  display: none;
  align-self: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--color-surface-border);
  border-top-color: var(--color-warm);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .sib-loader {
    animation: sib-loader-spin 0.8s linear infinite;
  }
}
@keyframes sib-loader-spin {
  to { transform: rotate(360deg); }
}

.newsletter-reassurance {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

.newsletter-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  text-align: center;
}
.newsletter-status[data-state="pending"] { color: var(--color-text-muted); }
.newsletter-status[data-state="error"] { color: var(--color-danger); }

.newsletter-captcha {
  display: flex;
  justify-content: center;
}

/* Anti-spam honeypot required by Brevo: must be genuinely invisible to
   everyone — sighted users, screen readers (paired with aria-hidden in the
   HTML) and keyboard tab order — while still submitting its (empty) value.
   Not display:none, since some bots specifically skip display:none fields.
   Clip-based (not off-screen positioning) so it can never affect the
   modal's own overflow/scroll area. */
.newsletter-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Signup confirmed dialog ----------
   Reuses the newsletter modal's overlay/panel/close rules above (each
   selector below was extended with .confirm-* — same declarations, so
   .newsletter-* rendering is unchanged) instead of duplicating them. Only
   the handful of things that actually differ get their own rule. */
.confirm-overlay {
  /* Anchored to the top instead of vertically centered like the newsletter
     modal — this dialog can open on a page scrolled far down, so it needs
     to land somewhere the visitor is already looking, not mid-viewport
     relative to wherever they'd scrolled to. Can't share align-items/
     padding with .newsletter-overlay above for that reason.
     top/right/bottom/left are also stated explicitly here, in addition to
     the shared rule's "inset: 0" — belt-and-braces: if inset ever isn't
     understood by some older mobile browser, position:fixed with no
     resolved offsets falls back to the element's *static* position, i.e.
     wherever the markup happens to sit in the page — which reads exactly
     like plain in-flow content at the bottom of the document. Explicit
     longhand offsets can't have that failure mode. */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top)) 16px 16px;
}
.confirm-panel {
  padding-top: 3.5rem; /* clears the close button — .confirm-panel text is centered, so it can't lean on padding-right like .newsletter-panel does */
  text-align: center;
}
.confirm-panel h2 {
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}
.confirm-panel h2:focus-visible { outline: none; }
.confirm-panel p { color: var(--color-text-muted); }

/* ---------- Legal / privacy page ---------- */
.legal-page {
  padding-block: var(--section-pad);
}
.legal-page .container { max-width: 42rem; }
.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-3);
}
.legal-page h2 {
  font-size: 1.15rem;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--color-ice);
}
.legal-page p { color: var(--color-text-muted); margin-bottom: var(--space-2); }
.legal-page code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--color-warm);
}
.legal-page a { color: var(--color-ice-dim); }
.legal-back {
  display: inline-block;
  margin-top: var(--space-4);
}

/* ---------- 404 page ---------- */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
}
.error-page .container { max-width: 32rem; }
.error-code {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  color: var(--color-ice-dim);
  line-height: 1;
}
.error-page h1 { font-size: 1.5rem; margin-top: var(--space-2); }
.error-page p { color: var(--color-text-muted); margin-top: var(--space-2); }
.error-page .btn { margin-top: var(--space-4); }
