/* Fredagsklubben – nedtelling. Ingen byggesteg: rediger filen direkte. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  --field: #ff4f1f;
  --ink: #0b0b0b;
  --board: #101010;
  --tile-top: #242424;
  --tile-bottom: #191919;
  --cream: #f5f1e8;
  --amber: #ffb020;
  --muted: #a8a59c;
  --line: #2a2a2a;

  --font-display: "Archivo", "Arial Black", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */

.site-header {
  width: 100%;
  max-width: 1328px;
  margin: 0 auto;
  padding: 20px 24px;
}

.brand {
  display: inline-block;
  padding: 12px 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(16px, 5.5vw, 22px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

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

/* ---------- Main ---------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 1328px;
  margin: 0 auto;
  padding: 8px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.headline:empty,
.lede:empty {
  display: none;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(28px, 5.6vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 560px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.4;
}

/* ---------- Tavla ---------- */

.board {
  background: var(--board);
  color: var(--cream);
  border-radius: 10px;
  padding: clamp(16px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 36px);
}

.label,
.info-item dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.board-info {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.info-item {
  flex: 1 1 110px;
}

.info-item--wide {
  flex: 2 1 180px;
}

.info-item--status {
  flex: 2 1 200px;
}

.info-item dd {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--amber);
}

.status-mark {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--amber);
  animation: blink 1.4s steps(1) infinite;
}

.weather {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-icon {
  display: inline-flex;
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--amber);
}

.weather-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ---------- Fliser (felles) ---------- */

.tile {
  position: relative;
  display: block;
  background: linear-gradient(var(--tile-top) 50%, var(--tile-bottom) 50%);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.tile .ch {
  display: block;
  padding: 0.14em 0;
}

/* Skillelinjen midt på flisen */
.tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--board);
}

/* ---------- Flipp-tavle (destinasjon) ---------- */

.flap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px clamp(16px, 2.6vw, 44px);
  padding-bottom: clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}

.flap-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flap {
  display: flex;
  gap: clamp(2px, 0.4vw, 6px);
  font-size: clamp(20px, 5.2vw, 84px);
}

.flap .tile {
  flex: none;
  width: 0.78em;
  color: var(--amber);
}

/* Mens bokstaven roterer er den hvit, når den har landet lyser den ravgult */
.flap .tile.is-flipping {
  color: var(--cream);
}

/* ---------- Nedtelling ---------- */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 28px);
}

.unit {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.digits {
  display: flex;
  gap: clamp(3px, 0.5vw, 8px);
  font-size: clamp(40px, 8.4vw, 128px);
}

.digits .tile {
  flex: 1 1 0;
  min-width: 0;
  color: var(--cream);
}

.unit--seconds .tile {
  color: var(--amber);
}

/* ---------- Båndet nederst ---------- */

.band {
  overflow: hidden;
  white-space: nowrap;
  background: var(--ink);
  color: var(--field);
  padding: 18px 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.band-track {
  display: flex;
  width: max-content;
  animation: marquee 70s linear infinite;
}

.band-track span {
  flex: none;
  padding-right: 1em;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Diverse ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 600px) {
  /* Større bokstaver på mobil: reisemålet tar hele raden, koden havner under */
  .flap {
    font-size: 7vw;
  }

  .countdown .label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .band-track,
  .status-mark {
    animation: none;
  }
}
