/* CaseReplay i differ-drakt: reconstructed.news-oppsett med pikselmotoren fra differ-test.
   Tokens først, så seksjonene i rekkefølge. */

/* Handjet (OFL, Google Fonts): fri pikselfont i stedet for den kommersielle newPixel. */
@font-face {
  font-family: "Handjet";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/handjet-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format("woff2");
}

:root {
  /* Opptaksrødt, med pikseltoner som går mot okeren i kanalbanneret. */
  --k-accent: #f2301f;
  --k-accent-deep: #c41d10;
  --k-accent-soft: #fff0ee;
  --k-accent-soft-deep: #ffd5ce;
  --k-ink: #141414;
  --k-night: #0c0c0c;
  --k-night-2: #181818;
  --k-night-line: #262626;
  --k-surface: #ffffff;
  --k-border: #e8e8e8;
  --k-muted: #6e6e6e;
  --k-faint: #a6a6a6;
  --k-key-face: #141414;
  --k-ok: #17a45c;
  --tones: #f2301f, #f2301f, #f2301f, #ff5a2e, #ff8a3d, #e8a64a;
  --font-display: "Handjet", "Arial Narrow", sans-serif;
  --font-sans: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --nav-h: 44px;
  --ease-pop: cubic-bezier(0.22, 0.98, 0.3, 1.2);
  --ease-out: cubic-bezier(0.2, 0.9, 0.25, 1);
  color-scheme: light;
}
@media (min-width: 680px) {
  :root { --nav-h: 56px; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--k-night);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  color: var(--k-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--k-ink); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 3px; }

/* Pikselikoner fylles inn av main.js */
.px { display: inline-flex; width: 14px; height: 14px; flex: none; color: currentColor; }
.px svg { width: 100%; height: 100%; fill: currentColor; shape-rendering: crispEdges; }

/* Typografi ------------------------------------------------------------- */
.title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 50px;
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}
.title--minor { font-size: 40px; line-height: 1.04; letter-spacing: -0.01em; }
@media (min-width: 680px) {
  .title { font-size: clamp(72px, 8.5vw, 132px); }
  .title--minor { font-size: clamp(48px, 4.2vw, 64px); }
}
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--k-ink);
}
.link-arrow::after { content: "→"; transition: transform 0.2s var(--ease-out); }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow--light { color: #fff; }

/* Navigasjon ------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 16px;
  color: var(--k-ink);
  transition: color 0.25s ease;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav.is-dark { color: #fff; }
@media (min-width: 680px) { .nav { padding: 0 16px 0 20px; } }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 15px; height: 15px; background: currentColor;
  -webkit-mask: url(../img/mark.svg) center / contain no-repeat;
  mask: url(../img/mark.svg) center / contain no-repeat;
}
.brand-word {
  font-family: var(--font-display); font-weight: 600;
  font-size: 25px; line-height: 1; letter-spacing: 0; transform: translateY(-1px);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease;
}
.nav-links a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.nav-links a .px { width: 12px; height: 12px; }
.nav-links .arrow { transition: transform 0.2s var(--ease-out); }
.nav-links a:hover .arrow { transform: translateX(3px); }
@media (max-width: 479.98px) { .nav-links a:not(.nav-out) { display: none; } }

/* Knappene («keys») ------------------------------------------------------ */
.key {
  --key-face: var(--k-key-face);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--key-face); color: #fff;
  font: 600 14px/16px var(--font-sans);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.key:active { transform: scale(0.97); }
.key > span { position: relative; }
.key-pixels { position: absolute; z-index: -1; pointer-events: none; }
.key--accent { --key-face: var(--k-accent); color: #fff; }
.key--white { --key-face: #fff; color: var(--k-ink); }
.key--small { height: 42px; }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center;
  min-height: 78svh;
  padding-top: var(--nav-h);
  overflow-x: clip;
  background: #fff;
}
.hero-ground { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #fff; }
.hero-ground canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  --pixel-tones: var(--tones);
}
.hero-main { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-inner {
  width: 100%; max-width: 1160px;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 16px 56px;
}
@media (min-width: 680px) { .hero-inner { padding: 64px 32px 72px; } }
.hero-title { font-size: 52px; }
.hero-title .l { display: block; }
.hero-title .w { display: inline-block; opacity: 0; animation: word-in 0.7s var(--ease-out) forwards; }
.hero-title .w:nth-child(2) { animation-delay: 0.06s; }
.hero-title .w:nth-child(3) { animation-delay: 0.12s; }
.hero-title .w:nth-child(4) { animation-delay: 0.18s; }
@media (min-width: 680px) {
  .hero-title { font-size: clamp(72px, 9vw, 140px); }
}
@keyframes word-in { from { opacity: 0; transform: translateY(0.38em); } to { opacity: 1; transform: none; } }
.hero-sub {
  margin-top: 16px; max-width: 34ch; text-align: center;
  font-size: 15px; line-height: 22px; color: var(--k-ink); text-wrap: pretty;
}
@media (min-width: 680px) { .hero-sub { margin-top: 22px; max-width: 560px; font-size: 18px; line-height: 27px; text-wrap: balance; } }

.rise { opacity: 0; animation: rise-in 0.4s var(--ease-pop) forwards; animation-delay: var(--d, 0s); }
@keyframes rise-in { from { opacity: 0; transform: translateY(13px) scale(0.975); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce), (max-width: 679.98px) {
  .hero-title .w, .rise { opacity: 1; animation: none; transform: none; }
}

.door { margin-top: 30px; width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; }
@media (min-width: 680px) { .door { margin-top: 36px; } }
.door-field {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px;
  border: 2px solid var(--k-accent); border-radius: 16px; background: var(--k-surface);
  box-shadow: 0 0 0 6px var(--k-accent-soft);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.door-field:focus-within { box-shadow: 0 0 0 6px var(--k-accent-soft-deep); }
@media (min-width: 680px) { .door-field { gap: 12px; padding: 8px 8px 8px 22px; } }
.door-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 17px/1.3 var(--font-sans); color: var(--k-ink);
}
.door-field input::placeholder { color: var(--k-faint); }
@media (min-width: 680px) { .door-field input { font-size: 19px; } }
.door-field input:focus-visible { outline: 0; }
.key--door { height: 48px; border-radius: 11px; padding: 0 16px; }
.key--door span { font-size: 15px; line-height: 1.3; font-weight: 600; }
@media (min-width: 680px) {
  .key--door { height: 56px; border-radius: 12px; padding: 0 24px; }
  .key--door span { font-size: 17px; }
}
@media (max-width: 419.98px) {
  .door-field { flex-direction: column; align-items: stretch; padding: 6px; }
  .door-field input { padding: 10px 10px 6px; }
}
.door.is-sent .door-field { border-color: var(--k-ok); box-shadow: 0 0 0 6px #e3f5ea; }
.door-note { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--k-muted); text-align: center; }
.door-note a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.door.is-busy .key--door { opacity: 0.7; pointer-events: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.channel {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border: 1px solid var(--k-border); border-radius: 999px; background: #fff;
  font-size: 13px; line-height: 18px; color: var(--k-muted);
}
.channel b { font-weight: 600; color: var(--k-ink); }
.channel a { color: var(--k-ink); text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
.channel-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--k-accent); box-shadow: 0 0 0 0 var(--k-accent); animation: rec 1.8s ease-out infinite; }
@keyframes rec { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--k-accent) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .channel-dot { animation: none; } }

/* Filmene som dukker opp rundt heroen */
.cast { position: absolute; inset: 0; pointer-events: none; }
@media (max-width: 1179.98px) { .cast { display: none; } }
.actor { position: absolute; transform: translate(-50%, -50%); }
.actor-in { position: relative; display: block; animation: crowd-in 0.42s var(--ease-pop) both; }
.actor.is-out .actor-in { animation: crowd-out 0.3s cubic-bezier(0.4, 0, 1, 1) both; }
.actor-tile {
  position: relative; display: block;
  width: 112px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: clip;
  background: #111; box-shadow: 0 6px 16px rgba(120, 20, 10, 0.16), 0 0 0 3px #fff;
}
.actor-tile img { width: 100%; height: 100%; object-fit: cover; }
.actor-time {
  position: absolute; right: 5px; bottom: 5px; padding: 1px 4px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.78); color: #fff; font: 600 10px/13px var(--font-sans);
}
.actor-ping { position: absolute; inset: 0; border-radius: 10px; border: 2px solid var(--k-accent); opacity: 0; }
.actor.is-posted .actor-ping { animation: ping 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.actor-chip {
  position: absolute; bottom: 100%; left: 50%; margin-bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; white-space: nowrap;
  border: 1px solid var(--k-border); border-radius: 999px; background: #fff;
  font-size: 13px; line-height: 16px; color: var(--k-muted);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  opacity: 0; transform: translateX(-50%);
}
.actor-chip i { width: 6px; height: 6px; border-radius: 999px; background: var(--k-accent); }
.actor-chip b { font-weight: 600; color: var(--k-ink); }
.actor.is-posted .actor-chip { animation: chip 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes crowd-in { from { opacity: 0; transform: translateY(8px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes crowd-out { to { opacity: 0; transform: translateY(-6px) scale(0.85); } }
@keyframes ping { from { opacity: 0.6; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes chip {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.85); }
  12% { opacity: 1; transform: translateX(-50%); }
  80% { opacity: 1; transform: translateX(-50%); }
  to { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

/* Sømmen ------------------------------------------------------------------ */
.seam { position: relative; width: 100%; pointer-events: none; }
.seam canvas { display: block; width: 100%; height: 200px; --pixel-tones: var(--tones); }
@media (min-width: 680px) { .seam canvas { height: 260px; } }
.seam--top { margin-bottom: -1px; background: #fff; }
.seam-ground { position: absolute; inset-inline: 0; bottom: 0; height: 30%; }

/* Filmene ----------------------------------------------------------------- */
.films { position: relative; background: var(--k-night); color: #fff; padding: 8px 16px 72px; display: flex; justify-content: center; }
@media (min-width: 680px) { .films { padding: 16px 32px 104px; } }
.wrap { width: 100%; max-width: 1160px; }
.films-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; }
.films-head .title { text-align: left; }
.film-grid { margin-top: 32px; display: grid; gap: 28px 20px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .film-grid { margin-top: 44px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 1024px) { .film-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.film a { display: block; text-decoration: none; color: inherit; }
.film-thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: clip; background: var(--k-night-2);
  box-shadow: 0 0 0 1px var(--k-night-line);
  transition: box-shadow 0.25s ease;
}
.film-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.film a:hover .film-thumb { box-shadow: 0 0 0 2px var(--k-accent); }
.film a:hover .film-thumb img { transform: scale(1.035); }
.film-time {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.8); font: 600 12px/16px var(--font-sans);
}
.film-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: grid; place-items: center; border-radius: 999px; background: var(--k-accent); color: #fff;
  opacity: 0; transform: scale(0.8); transition: opacity 0.2s ease, transform 0.3s var(--ease-pop);
}
.film-play .px { width: 22px; height: 22px; margin-left: 3px; }
.film a:hover .film-play, .film a:focus-visible .film-play { opacity: 1; transform: none; }
.film-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.film-meta h3 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.film-meta span { font-size: 13px; line-height: 18px; color: #8f8f8f; }
@media (min-width: 680px) { .film-meta h3 { font-size: 20px; line-height: 26px; } }
.films-more { margin-top: 56px; text-align: center; font-size: 14px; color: #9a9a9a; }
.films-more a { color: #fff; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }

.reveal { opacity: 0; transform: translateY(24px) scale(0.985); transition: opacity 0.6s ease, transform 0.7s var(--ease-pop); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Bunnen ------------------------------------------------------------------- */
.foot { background: var(--k-night); color: #fff; border-top: 1px solid var(--k-night-line); padding: 32px 16px 28px; }
@media (min-width: 680px) { .foot { padding: 36px 32px 32px; } }
.foot-row { max-width: 1160px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.foot-row .brand-word { font-size: 22px; }
.foot-tag { flex: 1; min-width: 200px; font-size: 14px; color: #9a9a9a; }
.foot-note { max-width: 1160px; margin: 24px auto 0; font-size: 12px; color: #6a6a6a; }
.foot-note a { color: inherit; text-underline-offset: 3px; }

/* Undersidene (bekreftet, personvern) ------------------------------------------ */
.page { min-height: 100svh; display: flex; flex-direction: column; background: #fff; }
.page-main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: calc(var(--nav-h) + 56px) 16px 72px; }
@media (min-width: 680px) { .page-main { padding: calc(var(--nav-h) + 88px) 32px 104px; } }
.page-main .title { text-align: left; }
.page-main--center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.page-main--center .title { text-align: center; }
.page-lead { margin-top: 18px; font-size: 18px; line-height: 28px; color: var(--k-ink); text-wrap: pretty; }
.page-main--center .page-lead { max-width: 30ch; }
.page-main .key { margin-top: 32px; }
.prose { margin-top: 32px; font-size: 16px; line-height: 26px; color: #333; }
.prose h2 { margin-top: 36px; font-size: 18px; line-height: 24px; font-weight: 600; color: var(--k-ink); }
.prose p, .prose ul { margin-top: 10px; }
.prose ul { padding-left: 20px; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--k-ink); text-underline-offset: 3px; }
.prose .muted { color: var(--k-muted); font-size: 14px; }
