/* ATHENODE landing page.
   The base styles are a plain, readable dark page (no JavaScript, reduced motion, no WebGL).
   html.fx turns it into the 3D experience: one living strand with glass cards around it
   (spine.js), with the HUD and the "Læs mere" sheet on top. */

@font-face {
  font-family: "ATHENODE Grotesk";
  src: url("./assets/fonts/SchibstedGrotesk-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0e0f;
  --ink: #f3f1ea;
  --mist: #b5b8b5;
  --ash: #8b908e;
  --line: rgba(243, 241, 234, 0.16);
  --line-strong: rgba(243, 241, 234, 0.38);
  --blue: #2f6bff;
  --blue-soft: #7da2ff;
  --glass: rgba(14, 17, 19, 0.62);
  --sans: "ATHENODE Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --edge: clamp(18px, 3.2vw, 44px);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.sr-only,
.fx .stop-eyebrow,
.fx .stop-title,
.fx .stop-line {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(12, 14, 15, 0.55);
  color: var(--ink);
  font: 650 0.95rem/1 var(--sans);
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 180ms var(--ease), background-color 180ms, border-color 180ms;
}

.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #141617; }
.btn-accent { background: var(--blue); border-color: var(--blue); color: #fff; }

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

/* ---------- top bar ---------- */
.hud { z-index: 3; }

.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 2.4vw, 26px) var(--edge);
  padding-top: max(clamp(14px, 2.4vw, 26px), env(safe-area-inset-top));
  pointer-events: none;
}

.hud-top > * { pointer-events: auto; }

/* On the plain page the top bar scrolls away with the page instead of covering the text. */
html:not(.fx) .hud-top { position: absolute; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.86rem;
  text-decoration: none;
}

.brand img { width: 30px; height: auto; display: block; }

.hud-actions { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill a { text-decoration: none; color: var(--mist); transition: color 160ms; }
.pill a:hover { color: var(--ink); }
.pill-line { width: 26px; height: 1px; background: var(--line-strong); }

.language-picker { position: relative; }

.language-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--mist);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.language-picker-trigger:hover { color: var(--ink); }

.language-picker-chevron {
  display: block;
  width: 10px;
  height: 7px;
  overflow: visible;
  transition: transform 180ms var(--ease);
}

.language-picker-chevron path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
}

.language-picker.is-open .language-picker-chevron { transform: rotate(180deg); }

.language-picker-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 50;
  display: none;
  min-width: 164px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121517;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.language-picker.is-open .language-picker-menu { display: grid; gap: 2px; }

.language-picker-menu button {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 600 0.9rem/1 var(--sans);
  text-align: left;
  cursor: pointer;
}

.language-picker-menu button span { color: var(--ash); font: 500 0.72rem/1 var(--mono); }
.language-picker-menu button:hover,
.language-picker-menu button.is-active { background: rgba(47, 107, 255, 0.18); }

/* ---------- hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px var(--edge) 6vh;
  text-align: center;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: clamp(0.82rem, 1.25vw, 1.05rem);
  font-weight: 750;
  letter-spacing: 0.2em;
  line-height: 1.45;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.9rem, 9.6vw, 7.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(26px, 4vh, 44px);
}

/* ---------- sections, as a plain page ---------- */
.stop {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) var(--edge);
  border-top: 1px solid var(--line);
}

.stop-eyebrow,
.sheet-eyebrow {
  margin: 0 0 10px;
  color: var(--blue-soft);
  font: 500 0.7rem/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stop-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.stop-line { margin: 0 0 24px; color: var(--mist); font-size: 1.05rem; }

.stop-open { display: none; }

.stop-poster img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* content blocks shared by the plain page and the sheet */
.detail,
.sheet-body { color: var(--mist); font-size: 0.98rem; line-height: 1.55; }
.lead { margin: 0 0 18px; color: var(--ink); font-size: 1.05rem; }
.note { margin: 18px 0 0; font-size: 0.88rem; color: var(--ash); }
.note-lead { margin: 0; color: var(--ink); }

.rows,
.steps { list-style: none; margin: 0; padding: 0; }

.rows li,
.steps li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.rows strong,
.steps strong { color: var(--ink); font-weight: 680; }
.rows li > span,
.steps li > span { grid-column: 1; }
.rows a { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--blue-soft); font-weight: 600; text-decoration: none; white-space: nowrap; }
.rows a::after { content: " →"; }
.rows a:hover { color: var(--ink); }

.format-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.format-tags span { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--ink); font-size: 0.78rem; font-weight: 650; }

.steps { counter-reset: step; }
.steps li { grid-template-columns: auto 1fr; }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); grid-row: 1 / span 2; color: var(--blue-soft); font: 500 0.72rem/1.9 var(--mono); }
.steps li > span { grid-column: 2; }

.ask-example {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  color: var(--ink);
  font-weight: 600;
}

blockquote {
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 2px solid var(--blue);
  color: var(--ink);
  font-size: 1.05rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chips span { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--ink); font-size: 0.85rem; font-weight: 600; }

.price { display: grid; gap: 2px; margin: 0 0 16px; }
.price strong { color: var(--ink); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; color: var(--ink); font-weight: 650; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ash); font-family: var(--mono); }
details[open] summary::after { content: "-"; }
details p { margin: 0 0 16px; }

/* ---------- end of page ---------- */
.hud-land {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 56px var(--edge) max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}

.land-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.land-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin: 0;
  color: var(--ash);
  font-size: 0.78rem;
  line-height: 1.6;
}

.land-legal a { text-decoration: none; }
.land-legal a:hover { color: var(--ink); }

/* Phones and tablets cannot run the desktop app: no installers, a short note instead. */
.handheld-note { display: none; margin: 0; color: var(--mist); font-size: 0.92rem; }
.is-handheld [data-smart-download],
.is-handheld .download-actions,
.is-handheld .pill a[href="#hent"],
.is-handheld .pill-line { display: none; }
.is-handheld .handheld-note { display: block; }

/* the 3D-only pieces are hidden on the plain page */
#stage,
.hud-index,
.hud-focus,
.hud-hint,
.sheet { display: none; }

/* ======================================================================
   html.fx: the 3D experience
   ====================================================================== */
.fx { scroll-snap-type: y proximity; }

.fx #stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* the page is one screen per card; the 3D takes the clicks, only real controls opt back in */
.fx main {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.fx .hero {
  scroll-snap-align: start;
  will-change: opacity, transform;
}

.fx .hero-actions { pointer-events: auto; }
.fx .detour .hero-actions { pointer-events: none; }

.fx .stop {
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  border: 0;
  scroll-snap-align: start;
}

.fx .stop-poster { display: none; }

/* The long text lives in the sheet in 3D; it stays in the page for search engines. */
.fx .stop .detail {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Keyboard users get one "Læs mere" per card: invisible until it is focused. */
.fx .stop-open {
  display: block;
  position: fixed;
  right: var(--edge);
  bottom: clamp(18px, 4vh, 40px);
  z-index: 4;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.fx .stop-open:focus-visible { opacity: 1; pointer-events: auto; }

.fx .hud-index,
.fx .hud-focus,
.fx .hud-hint { display: block; position: fixed; }

.hud-index {
  left: var(--edge);
  bottom: clamp(18px, 4vh, 40px);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms var(--ease), visibility 0s linear 400ms;
}

.past-hero .hud-index,
.hud-index:focus-within { opacity: 1; visibility: visible; transition-delay: 0s; }

.hud-index p { margin: 0 0 12px; color: var(--ink); }
.hud-index ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }

.hud-index a {
  display: inline-flex;
  gap: 8px;
  color: var(--ash);
  text-decoration: none;
  transition: color 160ms, transform 220ms var(--ease);
}

.hud-index a::before { content: "->"; color: var(--blue-soft); opacity: 0.7; }
.hud-index a:hover { color: var(--ink); transform: translateX(3px); }
.hud-index a[aria-current="true"] { color: var(--ink); }
.hud-index a[aria-current="true"]::before { opacity: 1; }

.fx .hud-focus { display: flex; }

.hud-focus {
  right: var(--edge);
  bottom: clamp(18px, 4vh, 40px);
  align-items: center;
  gap: 16px;
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease), visibility 0s linear 300ms;
}

.card-focused .hud-focus { opacity: 1; visibility: visible; transition-delay: 0s; }
.at-land .hud-focus { opacity: 0; visibility: hidden; }

.focus-count { color: var(--ash); font-variant-numeric: tabular-nums; }

.focus-open {
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 160ms, transform 180ms var(--ease);
}

.focus-open:hover { border-color: var(--ink); }
.focus-open:active { transform: scale(0.97); }

.hud-hint {
  left: 50%;
  bottom: clamp(18px, 4vh, 40px);
  margin: 0;
  transform: translateX(-50%);
  color: var(--ash);
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: opacity 400ms var(--ease);
}

.hud-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 26px;
  margin: 10px auto 0;
  background: linear-gradient(var(--ash), transparent);
}

.past-hero .hud-hint { opacity: 0; }

.fx .hud-land {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 var(--edge) max(clamp(18px, 4vh, 40px), env(safe-area-inset-bottom));
  border: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease), visibility 0s linear 400ms;
}

.at-land .hud-land { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.at-land .hud-index { opacity: 0; visibility: hidden; }

/* ---------- read more ---------- */
.fx .sheet {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  align-items: center;
  justify-items: end;
  padding: clamp(14px, 4vw, 56px);
}

.fx .sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  /* clear over the opened card, dark around it */
  background: radial-gradient(75% 110% at 27% 50%, rgba(12, 14, 15, 0) 0%, rgba(12, 14, 15, 0) 46%, rgba(12, 14, 15, 0.8) 100%);
  opacity: 0;
  transition: opacity 380ms var(--ease);
}

.sheet-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  opacity: 0;
  transform: translate3d(28px, 0, 0) scale(0.98);
  transition: opacity 320ms var(--ease), transform 420ms var(--ease);
}

.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet.is-open .sheet-panel { opacity: 1; transform: none; }

.sheet-close {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mist);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.sheet-close:hover { color: var(--ink); }

.sheet-panel h2 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.sheet-clip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 18px;
}

.sheet-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0b0d;
}

/* "Se igen": quiet, like "Lav nyt svar" in the app */
.clip-replay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 14, 15, 0.72);
  color: var(--mist);
  font: 500 0.82rem/1 var(--sans);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: replay-in 360ms var(--ease) both;
  transition: color 160ms, border-color 160ms, transform 180ms var(--ease);
}
.clip-replay[hidden] { display: none; }
.clip-replay svg { width: 15px; height: 15px; flex: none; }
.clip-replay:hover { color: var(--ink); border-color: var(--line-strong); }
.clip-replay:active { transform: scale(0.97); }
.clip-replay:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 3px; }
/* under the clip; its row is kept while hidden so nothing jumps when it appears */
.sheet-clip .clip-replay[hidden] { display: inline-flex; visibility: hidden; animation: none; }
.clip-replay--card { position: absolute; top: 0; left: 0; z-index: 2; animation-name: replay-in-card; }
@keyframes replay-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes replay-in-card { from { opacity: 0; } }

.sheet-body .handheld-note { margin-top: 12px; }
.sheet-lock { overflow: hidden; }

/* ---------- legal pages, at the comet's destination ---------- */
.legal { display: none; }
.fx .legal {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: clamp(10px, 4vw, 48px);
}
.fx .legal[hidden] { display: none; }
.detour .hud-land,
.detour .hud-index,
.detour .hud-focus { opacity: 0; visibility: hidden; pointer-events: none; }
.legal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 15, 0.35);
  opacity: 0;
  transition: opacity 380ms var(--ease);
}
.legal-panel {
  position: relative;
  width: min(820px, 100%);
  max-height: 86vh;
  max-height: 86dvh;
  overflow: hidden auto; /* up and down only: with classic scrollbars the edge-to-edge guide tabs are a few px too wide */
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  --pad: clamp(22px, 4vw, 48px);
  padding: var(--pad);
  container-type: inline-size; /* lets the guide tabs break out of the narrow text column */
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  opacity: 0;
  transform: scale(0.6);
  transform-origin: center;
  transition: opacity 320ms var(--ease), transform 480ms var(--ease);
}
.legal.is-open .legal-panel { opacity: 1; transform: none; }
.legal.is-open .legal-backdrop { opacity: 1; }
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -10px 0 18px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--mist);
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.legal-back:hover { color: var(--ink); }
.legal-body {
  max-width: 68ch;
  margin: auto;
  color: var(--mist);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  transition: opacity 160ms var(--ease);
}
.legal-body.is-changing { opacity: 0; }
.legal-panel .eyebrow,
.legal-panel .legal-step {
  margin: 0 0 12px;
  color: var(--blue-soft);
  font: 500 0.7rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.legal-panel h1 { margin: 0 0 22px; color: var(--ink); font-size: clamp(2rem, 4vw, 3rem); font-weight: 780; line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance; }
.legal-panel .hero-lead { font-size: 1.1rem; }
.legal-panel h2 { margin: 32px 0 12px; color: var(--ink); font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.02em; }
.legal-panel p { margin: 0 0 18px; }
.legal-panel a { color: var(--blue-soft); text-underline-offset: 3px; }
.legal-panel a:hover { color: var(--ink); }
.legal-panel ol.legal-list { list-style: none; padding: 0; margin: 30px 0 0; }
.legal-panel .legal-list li { padding: 20px 0 4px; border-top: 1px solid var(--line); }
.legal-panel .legal-list strong { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 680; }
.legal-panel dl.legal-details { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 12px 24px; margin: 28px 0; }
.legal-panel dt { color: var(--ink); font-weight: 650; }
.legal-panel dd { margin: 0; }
.legal-panel label { display: grid; gap: 8px; margin-bottom: 20px; color: var(--ink); font-weight: 600; }
.legal-panel input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: #0c0e0f; color: var(--ink); font: 400 1rem/1.4 var(--sans); caret-color: var(--blue-soft); }
.legal-panel input:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 3px; }
.legal-panel small { color: var(--mist); font-size: 0.85rem; line-height: 1.5; font-weight: 400; }
.legal-panel .withdrawal-form { margin-top: 32px; }
.legal-panel .legal-step + h2 { margin-top: 8px; }
.legal-panel .withdrawal-review { padding: 18px 0; margin-bottom: 20px; border-block: 1px solid var(--line); color: var(--ink); }
.legal-panel .withdrawal-status:not(:empty) { margin-top: 24px; color: var(--ink); }
.legal-panel .button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-panel .primary-button,
.legal-panel .ghost-button { min-height: 46px; padding: 12px 20px; border: 1px solid var(--line-strong); border-radius: 4px; background: rgba(12, 14, 15, 0.55); color: var(--ink); font: 650 0.95rem/1.3 var(--sans); cursor: pointer; }
.legal-panel .primary-button { background: var(--ink); border-color: var(--ink); color: #141617; }
.legal-panel button:hover { border-color: var(--ink); }
.legal-panel button:disabled { opacity: 0.55; cursor: wait; }
.legal-panel .is-hidden { display: none !important; }
/* Guides share the page panel, with a small persistent reading index. */
/* The sticky bar runs edge to edge of the panel, so text scrolls under glass, not under a box. */
.legal-panel.has-guides { --guide-header: 32px; }
.has-guides .legal-back {
  position: sticky;
  top: -10px; /* sticks on the same spot it starts at, as on the other pages */
  z-index: 3;
  display: flex;
  width: fit-content;
  margin: -10px 0 0;
}
/* A dark cap pinned to the top of the panel, edge to edge, behind the back button. It is the
   panel's own first child, so it covers the text scrolling under it; the button stays its normal
   44px size, so its focus ring hugs the text. */
.legal-panel.has-guides::before {
  content: "";
  position: sticky;
  top: calc(-1 * var(--pad));
  z-index: 2;
  display: block;
  height: calc(var(--pad) + 40px);
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) -40px; /* takes no room in the layout */
  /* fully opaque: a translucent layer here is blended against the panel's glass, not the text */
  background: rgb(17, 20, 22);
}
.guide-tabs {
  position: sticky;
  top: 34px; /* right under the back button, which sticks at -10px and is 44px tall */
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* edge to edge of the panel, buttons still lined up with the text column */
  /* --guide-gap (set by spine.js) is the panel's inner edge to the text column; container units
     would count a classic scrollbar too and make the row a few px too wide */
  margin: 0 calc(-1 * var(--guide-gap, calc((100cqw - 100%) / 2 + var(--pad)))) 18px;
  padding: 6px var(--guide-gap, calc((100cqw - 100%) / 2 + var(--pad))) 14px;
  background: linear-gradient(rgb(17, 20, 22) 86%, rgba(17, 20, 22, 0));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  -webkit-mask-image: linear-gradient(#000 86%, transparent);
  mask-image: linear-gradient(#000 86%, transparent);
}
.guide-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--mist);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-tabs button[aria-current="true"] { color: var(--blue-soft); border-color: var(--blue-soft); }
.legal-panel .guide-block { padding: 32px 0 16px; border-top: 1px solid var(--line); }
.legal-panel .guide-block h2 { margin-top: 0; }
.guide-block.is-highlighted h2 { animation: guide-highlight 1.2s ease-out; }
@keyframes guide-highlight {
  from { text-decoration: underline; text-decoration-color: var(--blue-soft); text-underline-offset: 6px; text-shadow: 0 0 14px var(--blue-soft); }
  to { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-shadow: 0 0 14px transparent; }
}
.legal-panel .guide-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.legal-panel .guide-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(12, 14, 15, 0.55);
  color: var(--ink);
  font: 650 0.95rem/1.3 var(--sans);
  text-decoration: none;
}
.legal-panel .guide-actions .button-primary { background: var(--ink); border-color: var(--ink); color: #141617; }
.legal-panel .guide-actions .button:hover { border-color: var(--blue-soft); }
.is-handheld .legal-panel .guide-actions { display: none; }

@media (max-width: 760px) {
  .fx .legal { padding: 10px; }
  .legal-panel { padding: 22px; }
  .legal-panel dl.legal-details { gap: 12px; }
}

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .pill { padding: 0 14px; gap: 9px; }
  /* one link fits: Guides on phones, "Hent appen" in a narrow window on a computer */
  .pill-line,
  html:not(.is-handheld) .pill a[href="./guides.html"] { display: none; }
  .hero { padding-bottom: 14vh; }
  .fx .hud-index { display: none; }
  .hud-focus { left: var(--edge); right: var(--edge); justify-content: space-between; }
  .fx .sheet { align-items: end; justify-items: stretch; padding: 10px; }
  .sheet-panel { width: 100%; max-height: 76vh; border-radius: 16px; transform: translate3d(0, 28px, 0); }
}

/* ---------- tablets in portrait: the sheet comes up from the bottom, the card sits above it ---------- */
@media (orientation: portrait) and (min-width: 700px) and (max-width: 1100px) {
  .fx .sheet { align-items: end; justify-items: center; padding: 16px; }
  .sheet-panel { width: min(680px, 100%); max-height: 62vh; transform: translate3d(0, 28px, 0); }
  .sheet-backdrop { background: linear-gradient(to bottom, rgba(12, 14, 15, 0) 0%, rgba(12, 14, 15, 0) 34%, rgba(12, 14, 15, 0.82) 100%); }
  .sheet-clip { width: min(100%, calc(40vh * 0.8)); margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 1ms !important; }
}
