/* =========================================================
   SUMER — lanseres snart
   Matcher referansen 1:1 · blå standard
   Skjult funksjon: trykk på nedtellingstallene for å bytte farge.
   Tema styres av  html[data-theme="…"]  (blaa · gul · terrakotta · gronn · natt)
   ========================================================= */

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --maxw: 30rem;

  --field-bg: #ffffff;
  --field-fg: #241a06;
  --field-line: rgba(36, 26, 6, 0.3);
}

/* ---- fargeversjoner ------------------------------------- */
html[data-theme="blaa"] {
  --bg: #2438dc;  --fg: #eef0ff;  --muted: rgba(238, 240, 255, 0.78);
  --accent: #f6cb16;
  --band-bg: #f4ecde;  --band-fg: #20309c;  --band-muted: rgba(32, 48, 156, 0.78);
  --btn-bg: #1b2470;  --btn-fg: #f4ecde;
}
html[data-theme="gul"] {
  --bg: #f6cb16;  --fg: #241a06;  --muted: rgba(36, 26, 6, 0.72);
  --accent: #b23a1e;
  --band-bg: #241a06;  --band-fg: #f6cb16;  --band-muted: rgba(246, 203, 22, 0.8);
  --btn-bg: #b23a1e;  --btn-fg: #fff7e6;
}
html[data-theme="terrakotta"] {
  --bg: #7b3523;  --fg: #f4ecde;  --muted: rgba(244, 236, 222, 0.74);
  --accent: #f6cb16;
  --band-bg: #f4ecde;  --band-fg: #7b3523;  --band-muted: rgba(123, 53, 35, 0.78);
  --btn-bg: #7b3523;  --btn-fg: #f4ecde;
}
html[data-theme="gronn"] {
  --bg: #1f5e3a;  --fg: #eef6ec;  --muted: rgba(238, 246, 236, 0.76);
  --accent: #f6cb16;
  --band-bg: #eef6ec;  --band-fg: #1f5e3a;  --band-muted: rgba(31, 94, 58, 0.78);
  --btn-bg: #173f28;  --btn-fg: #eef6ec;
}
html[data-theme="natt"] {
  --bg: #111111;  --fg: #f4ecde;  --muted: rgba(244, 236, 222, 0.72);
  --accent: #f6cb16;
  --band-bg: #f4ecde;  --band-fg: #111111;  --band-muted: rgba(17, 17, 17, 0.74);
  --btn-bg: #111111;  --btn-fg: #f4ecde;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---- nav ------------------------------------------------ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding:
    calc(env(safe-area-inset-top) + 1.1rem)
    calc(env(safe-area-inset-right) + clamp(1.2rem, 5vw, 2.6rem))
    1rem
    calc(env(safe-area-inset-left) + clamp(1.2rem, 5vw, 2.6rem));
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  letter-spacing: 0.06em;
  color: var(--fg);
  text-decoration: none;
}
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 4vw, 2rem); }
.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.85;
}
.nav__links a:hover { opacity: 1; }

/* ---- hovedflyt ------------------------------------------ */
main { flex: 1 0 auto; display: flex; flex-direction: column; }

/* ---- hero (blått felt, sentrert) ------------------------ */
.hero {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.4rem);
  padding: clamp(1rem, 4vw, 2rem) clamp(1.35rem, 6vw, 2rem) clamp(2.4rem, 7vw, 3.6rem);
}

/* dekor: stjerner og romber som følger fargetema */
.deco { position: absolute; inset: -2% 0 0; z-index: 0; pointer-events: none; }
.deco svg { position: absolute; transform: translate(-50%, -50%); }
.deco__s { fill: var(--fg); opacity: 0.85; }
.deco__d { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 2 3; opacity: 0.7; }
.deco__g.deco__s { fill: var(--accent); }
.deco__g.deco__d { stroke: var(--accent); }

.hero > :not(.deco) { position: relative; z-index: 1; }

.hero__emblem {
  display: block;
  width: clamp(190px, 56vw, 288px);
  aspect-ratio: 1;
  margin-top: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}
.hero__emblem img { width: 100%; height: 100%; display: block; }

.hero__title {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: clamp(2.6rem, 13vw, 3.6rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.hero__lede {
  margin: 0;
  max-width: 26rem;
  font-size: clamp(0.98rem, 4vw, 1.08rem);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}

/* ---- nedtelling ----------------------------------------- */
.count__label {
  position: relative;
  z-index: 1;
  margin: 0.6rem 0 0.2rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}
.count {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.3rem, 2vw, 0.8rem);
}
.count__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.count__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 11vw, 2.9rem);
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.count__unit {
  font-size: clamp(0.5rem, 2.2vw, 0.62rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.count__sep {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 9vw, 2.4rem);
  line-height: 1;
  color: var(--accent);
  margin-top: 0.1rem;
}

/* ---- bli med (lyst kontrastfelt) ------------------------ */
.join {
  width: 100%;
  background-color: var(--band-bg);
  color: var(--band-fg);
  padding: clamp(2.2rem, 7vw, 3.4rem) 0;
}
.join__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 clamp(1.35rem, 5vw, 2.2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.5rem, 5vw, 3rem);
}
.join__text { flex: 1 1 auto; max-width: 34rem; }
.join__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--band-fg);
}
.join__sub {
  margin: 0.45rem 0 1.1rem;
  font-size: clamp(0.92rem, 3vw, 1.02rem);
  font-weight: 500;
  color: var(--band-muted);
}
.join__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 30rem;
}
.join__form input {
  width: 100%;
  height: 3.25rem;
  padding: 0 1.1rem;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--field-fg);
  background: var(--field-bg);
  border: 1.5px solid var(--field-line);
  border-radius: 0.55rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.join__form input::placeholder { color: rgba(36, 26, 6, 0.45); }
.join__form input:focus { border-color: var(--btn-bg); }
.join__form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
  padding: 0 1.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: none;
  border-radius: 0.55rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.join__msg {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--band-muted);
}
.join__msg.is-success { color: #1f6b2a; }
.join__msg.is-error { color: #a8331c; }

.join__emblem { flex: 0 0 auto; display: none; }
.join__emblem img { width: clamp(120px, 16vw, 170px); height: auto; display: block; }

/* ---- bunntekst ------------------------------------------ */
.foot {
  flex-shrink: 0;
  background: var(--bg);
  color: var(--fg);
  padding:
    1.6rem
    calc(env(safe-area-inset-right) + clamp(1.2rem, 5vw, 2.6rem))
    calc(env(safe-area-inset-bottom) + 1.4rem)
    calc(env(safe-area-inset-left) + clamp(1.2rem, 5vw, 2.6rem));
}
.foot__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 8vw, 3.5rem);
}
.foot__social a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.85;
}
.foot__social a:hover { opacity: 1; }
.foot__stars {
  height: 14px;
  margin-top: 1.1rem;
  opacity: 0.7;
  background-repeat: repeat-x;
  background-position: center;
  background-size: 26px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='14' viewBox='0 0 26 14'%3E%3Cpath fill='%23eef0ff' d='M13 1c.6 5 1.5 5.4 6 6-4.5.6-5.4 1-6 6-.6-5-1.5-5.4-6-6 4.5-.6 5.4-1 6-6Z'/%3E%3C/svg%3E");
}

/* ---- responsiv ------------------------------------------ */
@media (max-width: 599px) {
  .nav__links { gap: 1rem; font-size: 0.82rem; }
  .nav__links a { font-size: 0.82rem; }
}
@media (min-width: 600px) {
  .join__form { flex-direction: row; }
  .join__form input { flex: 1; }
  .join__form button { flex: 0 0 auto; }
}
@media (min-width: 820px) {
  .join__emblem { display: block; }
}

/* ---- universell utforming ------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
