/* ════════════════════════════════════════════════════════════
   GLOBAL: designsystem, variabler, gjenbrukbare klasser
   ════════════════════════════════════════════════════════════ */

:root {
  /* Palett: varm kveldssol med irsk grønt og vinrødt */
  --paper: #faf3e6;
  --paper-warm: #f5e8d3;
  --ink: #38291f;
  --ink-soft: #6b5747;
  --terracotta: #c9573a;
  --terracotta-deep: #a83f26;
  --gold: #d9a441;
  --gold-soft: #f0d9a8;
  --green: #2e5e4e;
  --green-deep: #1d4438;
  --wine: #722f42;
  --wine-deep: #511f2f;
  --night: #1b2335;
  --night-deep: #11182a;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", Verdana, sans-serif;
  --font-hand: "Caveat", cursive;

  --radius: 18px;
  --shadow-soft: 0 10px 30px rgba(56, 41, 31, 0.14);
  --shadow-pop: 0 16px 44px rgba(56, 41, 31, 0.22);
  --section-pad: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 5vw, 2.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Kornete papirtekstur over alt */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ── Typografi ─────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  line-height: 1.08;
  margin: 0 0 0.6em;
}

.kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 1rem;
}

.section-title {
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 650;
}

.section-sub {
  max-width: 38rem;
  margin: 0 auto 2.5rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.6vw, 1.15rem);
}

.handwritten {
  font-family: var(--font-hand);
  font-size: 1.5em;
  line-height: 1.35;
}

.caption {
  margin-top: 1.5rem;
  color: var(--ink-soft);
}

/* ── Layout ────────────────────────────────────────────────── */

.section {
  position: relative;
  padding: var(--section-pad);
  text-align: center;
  overflow: hidden;
}

.section > * { position: relative; z-index: 2; }

/* ── Knapper ───────────────────────────────────────────────── */

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.96); }

.btn--primary {
  background: var(--terracotta);
  color: var(--paper);
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: var(--terracotta-deep); transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: inherit;
  border: 2px solid currentColor;
  opacity: 0.7;
}
.btn--ghost:hover { opacity: 1; }

/* ── Scroll-avsløring ──────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Video-ramme ───────────────────────────────────────────── */

.video-frame {
  position: relative;
  width: min(100%, 640px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Nødutgang under hver video hvis innbyggingen nekter å spille */
.video-fallback {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: inherit;
  opacity: 0.65;
  text-decoration: underline;
}

.video-fallback:hover { opacity: 1; }

/* ── Modal ─────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 42, 0.85);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: min(92vw, 720px);
  animation: modal-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: -2.8rem;
  right: 0;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── Effekt-canvas (konfetti/hjerter) ──────────────────────── */

#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  /* Over kake-overlegget (2000) slik at konfettien alltid synes */
  z-index: 3000;
}
