/* ===== Trondheimsnatta ===== */
:root {
  --bg: #05080f;
  --bg-2: #0a101f;
  --panel: #0d1424;
  --ink: #eaeef7;
  --muted: #93a0b8;
  --reflex: #f2e63a;
  --reflex-dim: rgba(242, 230, 58, 0.14);
  --amber: #ffb85c;
  --line: rgba(147, 160, 184, 0.16);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Unbounded", sans-serif; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.3rem); font-weight: 700; margin-bottom: 1.5rem; }
h2 em { color: var(--reflex); font-style: normal; }

/* Striped display style, echoing the lettering on the arena map. Used on a handful of headers only. */
.stencil {
  --stripe: 5px;
  --gap: 2px;
  color: transparent;
  background-image: repeating-linear-gradient(to bottom, var(--reflex) 0 var(--stripe), transparent var(--stripe) calc(var(--stripe) + var(--gap)));
  -webkit-background-clip: text;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
a { color: var(--reflex); }
p { color: var(--muted); }
strong { color: var(--ink); }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-cta {
  background: var(--reflex);
  color: #0a0e05;
  padding: 0.7rem 1.5rem;
  font-size: 0.85rem;
  box-shadow: 0 0 18px rgba(242, 230, 58, 0.35), 0 0 60px rgba(242, 230, 58, 0.12);
}
.btn-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 28px rgba(242, 230, 58, 0.55), 0 0 90px rgba(242, 230, 58, 0.2);
}
.btn-lg { padding: 1rem 2.4rem; font-size: 1rem; }
.btn-ghost {
  border: 1px solid rgba(242, 230, 58, 0.5);
  color: var(--reflex);
  padding: 0.65rem 1.3rem;
  font-size: 0.8rem;
}
.btn-ghost:hover { background: var(--reflex-dim); transform: translateY(-2px); }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: "Unbounded", sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo span { color: var(--reflex); }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--reflex); }
.nav-cta { flex-shrink: 0; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

/* ===== Language switching =====
   Every text block exists twice, as sibling elements with lang="nb" and lang="en".
   Norwegian is default; <html data-lang="en"> flips to English. */
html:not([data-lang="en"]) body [lang="en"],
html[data-lang="en"] body [lang="nb"] { display: none !important; }

.lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: rgba(13, 20, 36, 0.8);
}
.lang-toggle button {
  font-family: "Unbounded", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button[aria-pressed="true"] { background: var(--reflex); color: #0a0e05; }
@media (max-width: 720px) {
  .lang-toggle { margin-left: auto; }
  .nav-cta { margin-left: 0; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}
.hero-media { position: absolute; inset: 0; }
.hero-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none; /* enabled via JS on mobile */
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(242, 230, 58, 0.07), transparent 60%),
    linear-gradient(to bottom, rgba(5,8,15,0.5) 0%, rgba(5,8,15,0.18) 40%, rgba(5,8,15,0.45) 75%, rgba(5,8,15,0.95) 100%);
}

/* Desktop hero scene: canvas with the headlamp train (see hero-scene.js) */
.hero-scene { position: absolute; inset: 0; background: var(--bg); }
.hero-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero-kicker {
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.2rem;
}
.hero-title {
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(16, 26, 51, 0.9);
}
.hero-title span {
  color: var(--reflex);
  text-shadow: 0 0 30px rgba(242, 230, 58, 0.4), 0 0 120px rgba(242, 230, 58, 0.25);
}
.hero-title span.stencil {
  --stripe: 0.085em;
  --gap: 0.035em;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  filter: drop-shadow(0 0 22px rgba(242, 230, 58, 0.45));
}
.hero-meta { margin-top: 1.6rem; font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--ink); }
.hero-sub { margin-top: 0.6rem; font-size: clamp(0.95rem, 2vw, 1.1rem); max-width: 560px; margin-inline: auto; }
.hero-actions { margin-top: 2.2rem; }
.hero-price { margin-top: 0.9rem; font-size: 0.9rem; color: var(--reflex); }
.hero-results {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  background: rgba(13, 20, 36, 0.6);
}
.hero-results:hover { border-color: var(--reflex); color: var(--reflex); }
.hero-scroll {
  position: absolute;
  bottom: 1.4rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

/* Mobile: video hero */
@media (max-width: 820px) {
  .hero-media video.playing { display: block; }
  .hero-media video.playing ~ .hero-scene { display: none; }
}

/* ===== Sections ===== */
.section {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  position: relative;
}
.section::before {
  content: "";
  position: absolute;
  top: -2px; left: clamp(1.25rem, 4vw, 2.5rem);
  width: 62px; height: 3px;
  background: repeating-linear-gradient(to right, var(--reflex) 0 10px, transparent 10px 16px);
  filter: drop-shadow(0 0 5px rgba(242, 230, 58, 0.55));
}
.overline {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--reflex);
  margin-bottom: 0.7rem;
}
.prose p + p { margin-top: 1rem; }
.prose.two-col { columns: 2; column-gap: 3rem; max-width: 100%; }
.prose.two-col p { break-inside: avoid; }
@media (max-width: 820px) { .prose.two-col { columns: 1; } }
.promise {
  border-left: 3px solid var(--reflex);
  padding-left: 1rem;
  color: var(--ink);
  font-weight: 500;
}

/* Facts */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.fact {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.fact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--amber);
}
.fact-value { font-size: 0.95rem; color: var(--ink); }

/* ===== Course ===== */
.course-effort { margin: -0.8rem 0 1.8rem; font-size: 0.95rem; }
.course-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } }
.course-timeline { list-style: none; position: relative; padding-left: 1.6rem; }
.course-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 10px; bottom: 10px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--reflex) 0 8px, transparent 8px 15px);
  opacity: 0.5;
}
.course-timeline li { position: relative; padding: 0.7rem 0; display: flex; gap: 1.1rem; align-items: baseline; }
.course-timeline li::before {
  content: "";
  position: absolute;
  left: -1.6rem; top: 1.25rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--reflex);
  box-shadow: 0 0 10px rgba(242, 230, 58, 0.6);
}
.course-timeline .km {
  font-family: "Unbounded", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--reflex);
  white-space: nowrap;
  min-width: 84px;
}
.course-timeline strong { display: block; }
.course-timeline p { font-size: 0.9rem; }
.course-video video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
}
.course-video .caption { font-size: 0.85rem; margin-top: 0.6rem; text-align: center; }
.course-alt {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  margin-top: 2.5rem;
  padding: 1.2rem 1.4rem;
  background: var(--reflex-dim);
  border: 1px solid rgba(242, 230, 58, 0.35);
  border-radius: var(--radius);
}
.course-alt > div > strong { display: block; margin-bottom: 0.2rem; }
.course-alt p { font-size: 0.92rem; }
.badge-new {
  flex-shrink: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--reflex);
  color: #0a0e05;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.winner-times {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.6rem;
}
.winner-times .overline { margin: 0; }
.winner-times strong {
  font-family: "Unbounded", sans-serif;
  font-size: 1.4rem;
  color: var(--reflex);
  margin-right: 0.5rem;
}
.winner-times div { color: var(--muted); font-size: 0.9rem; }

/* ===== Schedule ===== */
.schedule { list-style: none; max-width: 640px; }
.schedule li {
  display: flex;
  gap: 1.6rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  align-items: baseline;
}
.schedule li.highlight {
  background: var(--reflex-dim);
  border: 1px solid rgba(242, 230, 58, 0.35);
}
.schedule .time {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--reflex);
  min-width: 110px;
  white-space: nowrap;
}
.schedule p { font-size: 0.92rem; }

/* ===== Arena ===== */
.arena-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 900px) { .arena-layout { grid-template-columns: 1fr; } }
.arena-info h3 {
  font-size: 0.95rem;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
}
.arena-info .btn-ghost { margin-top: 1.2rem; }
.arena-note { font-size: 0.85rem; margin-bottom: 0.8rem; }
.transport { list-style: none; }
.transport li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.transport-icon { font-size: 1.3rem; line-height: 1.3; flex-shrink: 0; }
.transport strong { display: block; }
.transport p { font-size: 0.9rem; }
.facilities { list-style: none; }
.facilities li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.arena-map { margin: 0; position: sticky; top: 5rem; }
.arena-map a { display: block; }
.arena-map img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
}
.arena-map figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; text-align: center; }

/* ===== Sponsor ===== */
.classes-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 820px) { .classes-layout { grid-template-columns: 1fr; } }
.prize-note { margin-top: 1.2rem; font-size: 0.9rem; }
.sponsor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  text-align: center;
}
.sponsor .overline { margin-bottom: 1.2rem; }
.sponsor-logo {
  width: min(220px, 70%);
  height: auto;
  display: block;
  margin: 0 auto 1.2rem;
  filter: invert(1) drop-shadow(0 0 18px rgba(234, 238, 247, 0.25));
}
.sponsor p { font-size: 0.9rem; }

/* ===== Prices ===== */
.countdown {
  font-family: "Unbounded", sans-serif;
  font-size: 0.9rem;
  color: var(--amber);
  margin-bottom: 1.8rem;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
}
.price-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  transition: opacity 0.2s;
}
.price-card h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.price-card .period { font-size: 0.82rem; margin-bottom: 1.1rem; }
.price-rows div {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.price-rows span { color: var(--muted); }
.price-rows strong { font-family: "Unbounded", sans-serif; }
.price-card .badge {
  position: absolute;
  top: -0.7rem; right: 1rem;
  font-family: "Unbounded", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  display: none;
}
.price-card.active { border-color: var(--reflex); box-shadow: 0 0 24px rgba(242, 230, 58, 0.12); }
.price-card.active .badge { display: inline-block; background: var(--reflex); color: #0a0e05; }
.price-card.past { opacity: 0.45; }
.price-card.past .badge { display: inline-block; background: var(--line); color: var(--muted); }
.price-note { margin-top: 1.4rem; font-size: 0.85rem; }
.center { text-align: center; margin-top: 2.2rem; }

/* ===== Classes & checklist ===== */
.prize-list { list-style: none; margin-top: 1.2rem; }
.prize-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.checklist { list-style: none; max-width: 560px; }
.checklist li {
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.checklist li.essential {
  background: var(--reflex-dim);
  border-color: rgba(242, 230, 58, 0.4);
  color: var(--ink);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: clamp(3.5rem, 8vw, 5.5rem) 1.5rem 7rem;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 50% 120%, rgba(242, 230, 58, 0.06), transparent 65%),
    var(--bg-2);
}
.footer-cta h2 { margin-bottom: 0.6rem; }
.footer-cta p { margin-bottom: 1.8rem; }
.footer-meta { margin-top: 3.5rem; font-size: 0.85rem; }
.footer-meta p + p { margin-top: 0.6rem; }
.footer-sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.2rem !important;
  margin-bottom: 1.6rem;
}
.footer-sponsor img { width: 56px; height: auto; filter: invert(1); opacity: 0.85; }
.disclaimer { font-size: 0.75rem; opacity: 0.7; max-width: 560px; margin-inline: auto; }

/* ===== Sticky mobile CTA ===== */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  text-align: center;
  transform: translateY(110%);
  transition: transform 0.3s ease;
  display: none;
}
.sticky-cta .btn { display: block; }
.sticky-cta.visible { transform: translateY(0); }
@media (max-width: 820px) { .sticky-cta { display: block; } }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-scroll { animation: none; }
}
