:root {
  --green: #1e4a38;
  --green-2: #245640;
  --green-3: #2c6b4f;
  --cream: #f3e0b5;
  --cream-2: #fbf3e2;
  --sand: #d4b57d;
  --ink: #2b1a10;
  --brown: #7a4a2a;
  --red: #c8423b;
  --white: #ffffff;
  --radius: 18px;
  --display: "Lilita One", "Arial Black", sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream-2);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* Toppen */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: var(--green);
  border-bottom: 4px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.5px;
  min-width: 0;
}
.brand span { white-space: nowrap; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 800;
  padding: 8px 2px;
}
.topbar nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }

/* Forsiden: fjellnatt i lag (lerretet «nettsidens toppfelt», forslag F).
   Lagene flyttes av scene.js: etter musa på PC, etter rullingen på telefon. */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 16px clamp(150px, 22vw, 230px);
  background: linear-gradient(180deg, #0c231b 0%, #143a2c 55%, var(--green) 100%);
  color: var(--cream);
  --mx: 0;
  --my: 0;
  --sy: 0;
}
.scene { position: absolute; inset: 0; pointer-events: none; }
.layer {
  position: absolute;
  left: -4%;
  top: 0;
  width: 108%;
  height: 100%;
  /* Mus: de nærmeste lagene flytter seg mest. Rulling: de fjerneste henger igjen, så landskapet får dybde. */
  transform: translate3d(calc(var(--mx) * var(--d) * -1px), calc(var(--my) * var(--d) * -0.35px + var(--sy) * (64 - var(--d)) * 0.006px), 0);
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
/* Rulling på telefon skal følge fingeren, ikke ligge etter. */
@media (hover: none) { .layer { transition: none; } }
.layer[data-depth="6"] { --d: 6; }
.layer[data-depth="8"] { --d: 8; }
.layer[data-depth="14"] { --d: 14; }
.layer[data-depth="26"] { --d: 26; }
.layer[data-depth="40"] { --d: 40; }
.layer[data-depth="64"] { --d: 64; }
.stars { height: 55%; fill: var(--cream); }
.tw { animation: twinkle 4s ease-in-out infinite; }
.tw1 { animation-delay: -1.3s; animation-duration: 5s; }
.tw2 { animation-delay: -2.6s; animation-duration: 3.4s; }
@keyframes twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.moon {
  position: absolute;
  right: 14%;
  top: 9%;
  width: clamp(44px, 5.4vw, 74px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e4cd99 0 9%, transparent 10%), radial-gradient(circle at 62% 66%, #e4cd99 0 7%, transparent 8%), var(--cream);
  box-shadow: 0 0 40px 12px rgba(243, 224, 181, 0.28), 0 0 120px 40px rgba(243, 224, 181, 0.10);
}
.cloud {
  position: absolute;
  left: 0;
  height: 34px;
  border-radius: 40px;
  background: rgba(243, 224, 181, 0.07);
  filter: blur(8px);
  animation: cloud linear infinite;
}
.cloud.c1 { top: 24%; width: 300px; animation-duration: 90s; animation-delay: -30s; }
.cloud.c2 { top: 36%; width: 220px; height: 26px; animation-duration: 120s; animation-delay: -80s; }
@keyframes cloud { from { transform: translateX(-320px); } to { transform: translateX(100vw); } }
.m-far { fill: var(--green-3); }
.snow { fill: var(--cream); opacity: 0.85; }
.m-mid { fill: var(--green-2); }
.t-far { fill: #1d4a37; }
.t-mid { fill: #163d2d; }
.ground { fill: #12321f; }
.t-near { fill: #0b2018; }
.fly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f6e7a0;
  box-shadow: 0 0 10px 4px rgba(246, 231, 160, 0.55);
  opacity: 0;
  animation: drift ease-in-out infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0); opacity: 0; }
  20%, 80% { opacity: 1; }
  50% { transform: translate(26px, -30px); }
  100% { transform: translate(-14px, -64px); opacity: 0; }
}
.hero > *:not(.scene) { position: relative; }
.hero-logo {
  width: min(340px, 74vw);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4));
  animation: pop 0.7s cubic-bezier(.2, 1.4, .4, 1) both, float 6s ease-in-out 0.7s infinite;
}
@keyframes pop { from { transform: scale(0.7) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tagline {
  max-width: 520px;
  margin: 20px 0 22px;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .hero-logo, .tw, .cloud, .fly { animation: none; }
  .fly { display: none; }
  .layer { transform: none; transition: none; }
}

.button {
  display: inline-block;
  padding: 12px 26px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.button.small { font-size: 17px; padding: 8px 20px; }

/* Seksjonene. Avstanden over hindrer at toppmenyen dekker overskriften når man hopper fra menyen. */
section[id] { scroll-margin-top: 72px; }
section h2 {
  margin: 0 0 24px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.15;
  color: var(--green);
}
.games, .about, .contact {
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 16px 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px;
}
.card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--sand);
}
.icon {
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 24px;
  border: 3px solid var(--ink);
}
.card-body { min-width: 0; }
.card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
}
.kicker {
  margin: 2px 0 10px;
  color: var(--red);
  font-weight: 800;
}
.card p { margin-top: 0; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 14px; }
.text-link { font-weight: 800; color: var(--green); }

.about p { max-width: 680px; font-size: 19px; }

.contact { padding-bottom: 72px; }
.mail {
  display: inline-block;
  margin: 4px 0 12px;
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--green);
  word-break: break-word;
}
.small { font-size: 15px; color: #5c4a3c; }

.footer {
  padding: 28px 16px;
  text-align: center;
  background: var(--ink);
  color: var(--cream);
  font-size: 15px;
}
.footer p { margin: 4px 0; }
.legal { opacity: 0.75; }

@media (max-width: 560px) {
  .topbar { padding: 10px 16px; }
  .topbar nav { gap: 12px; }
  .topbar nav a { font-size: 15px; }
  .brand span { display: none; }
  .card { flex-direction: column; }
  .icon { width: 88px; height: 88px; }
}
