/* Rabbits and Holes — clean light gray. */

:root {
  --bg-0: #e9e9ec;
  --bg-1: #e3e3e7;
  --bg-2: #dedee3;
  --card: #f3f3f5;
  --card-border: rgba(26, 39, 68, 0.16);
  --text: #1a2744;
  --muted: #5c6475;
  --soft: #2c3548;
  --gold: #6b5420;
  --gold-dim: #7a6740;
  --glow: rgba(26, 39, 68, 0.12);
  --line: rgba(26, 39, 68, 0.38);
  --font-display: Inter, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-body: "Outfit", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --bg-card: #f3f3f5;
  --max: 46rem;
  --radius: 1.15rem;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  min-height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* Flat light gray; no night sky */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg-0);
}

.sky::before,
.sky::after {
  display: none;
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
}

/* Small stars */
.sky::before {
  background-image:
    radial-gradient(1px 1px at 8% 12%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 22% 28%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 31% 8%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 44% 18%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 58% 6%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 71% 22%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 83% 11%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 91% 31%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 14% 42%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 27% 61%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 39% 74%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 52% 53%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 66% 68%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 78% 47%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 89% 72%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 6% 81%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 18% 93%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 47% 88%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 63% 91%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 95% 86%, rgba(255, 255, 255, 0.5), transparent);
  animation: twinkle 9s ease-in-out infinite alternate;
  opacity: 0.85;
}

/* A few slightly larger, warmer stars */
.sky::after {
  background-image:
    radial-gradient(2px 2px at 12% 20%, rgba(215, 195, 146, 0.9), transparent),
    radial-gradient(2px 2px at 76% 14%, rgba(200, 220, 255, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 48% 36%, rgba(215, 195, 146, 0.7), transparent),
    radial-gradient(2px 2px at 33% 82%, rgba(200, 220, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 88% 58%, rgba(215, 195, 146, 0.8), transparent);
  animation: twinkle 13s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky::before,
  .sky::after { animation: none; }
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #3a4d7a;
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
a:hover { color: #3a4d7a; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.wrap.wide { width: min(calc(100% - 1.5rem), 74rem); }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 24rem;
}
header { padding: 3rem 0 1rem; text-align: center; }
.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;
}
h1.brand {
  margin: 0 auto 1rem;
  position: relative;
  display: flex;
  justify-content: center;
}
h1.brand picture,
h1.brand img {
  display: block;
  width: min(78vw, 15.5rem);
  height: auto;
}
.lede { margin: 0 auto; max-width: 34rem; color: var(--soft); font-weight: 300; font-size: 1.04rem; }
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.4rem; }
.jump a {
  font-size: 0.88rem; text-decoration: none; color: var(--text);
  padding: 0.42rem 0.95rem; border: 1px solid var(--card-border); border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}
.jump a:hover { border-color: var(--gold); color: var(--gold); background: #fff; }

/* faded pencil-sketch portraits behind/around the logo, same placement as production.
   Heads share one size and one eye line. The two in the middle (and any neighbour they
   would cover) are shifted outward in hero-portraits.js so no head sits under the rabbit. */
.hero-sketch { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-portraits {
  position: absolute; left: 50%;
  top: calc(3rem + min(78vw, 15.5rem) * 0.5175 - 5.625rem);
  width: min(100%, 70rem);
  height: 11.25rem;
  transform: translateX(-50%);
  opacity: 0.34;
  -webkit-mask-image: radial-gradient(ellipse 96% 88% at 50% 50%, #000 42%, transparent 86%);
  mask-image: radial-gradient(ellipse 96% 88% at 50% 50%, #000 42%, transparent 86%);
}
.hero-portraits i {
  position: absolute;
  display: block;
  top: 50%;
  left: calc(var(--i) * 6.25%);
  width: 6.25%;
  aspect-ratio: 360 / 538;
  transform: translateY(-50%);
  background: url("/images/hero-faces-16.webp") no-repeat;
  background-size: 1600% 100%;
  background-position: calc(var(--i) * 100% / 15) 0;
}
@media (min-width: 900px) {
  .hero { min-height: 32rem; }
  .hero-portraits {
    width: min(100%, 96rem);
    height: 16.5rem;
    top: calc(3rem + min(56vw, 22.5rem) * 0.5175 - 8.25rem);
  }
  h1.brand picture,
  h1.brand img {
    width: min(56vw, 22.5rem);
  }
}

/* ---------- topics ---------- */
main { padding-bottom: 2rem; }
.topic {
  padding: 2.4rem 0 1.8rem;
  scroll-margin-top: 0.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
}
.topic > * { min-width: 0; }
.topic + .topic { border-top: 1px solid rgba(26, 39, 68, 0.1); }
.topic-head { display: flex; align-items: center; gap: 1rem; }
.topic-art { flex: 0 0 auto; width: 4.9rem; filter: drop-shadow(0 4px 10px rgba(26, 39, 68, 0.12)); }
.topic-art svg, .topic-art img { width: 100%; height: auto; display: block; }
.topic-art picture { display: block; }
.topic-label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  line-height: 1.05;
  color: var(--text);
  overflow-wrap: break-word;
}
.topic-count { margin: 0.35rem 0 0; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); }
.topic-intro { max-width: 42rem; margin-top: 0.4rem; }
.topic-intro p { margin: 0 0 0.4rem; color: var(--soft); font-weight: 300; }
.topic-intro .topic-note { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }

@media (min-width: 900px) {
  .topic { grid-template-columns: 11.5rem minmax(0, 1fr); column-gap: 1.4rem; align-items: center; padding: 3rem 0 2.4rem; }
  .topic-head { grid-column: 1; grid-row: 1 / span 2; flex-direction: column; text-align: center; gap: 1.1rem; }
  .topic-art { width: 8.6rem; }
  .topic-intro { grid-column: 2; grid-row: 1; align-self: end; }
  .track-wrap { grid-column: 2; grid-row: 2; min-width: 0; }
}

/* ---------- the timeline ---------- */
.track-wrap { position: relative; margin: 0.2rem -0.75rem 0; }
@media (min-width: 900px) { .track-wrap { margin: 0; } }
.track-scroll {
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(26, 39, 68, 0.25) transparent;
  overscroll-behavior-x: contain;
}
.track-wrap.has-more .track-scroll {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
}
.scroll-hint { display: none; margin: 0.1rem 0.75rem 0; font-size: 0.78rem; color: var(--muted); text-align: right; }
.track-wrap.scrollable .scroll-hint { display: block; }
.track-wrap.scrollable:not(.has-more) .scroll-hint { visibility: hidden; }

.track { position: relative; }
.line-layer { position: absolute; inset: 0; pointer-events: none; }
.seg {
  position: absolute; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, rgba(26,39,68,.08), var(--line) 6%, rgba(26,39,68,.5) 50%, var(--line) 94%, rgba(26,39,68,.08));
  box-shadow: none;
  border-radius: 2px;
}
.gap-mark { position: absolute; transform: translate(-50%, -62%); color: var(--gold-dim); letter-spacing: 0.2em; font-size: 1.1rem; }
.dots { list-style: none; margin: 0; padding: 0; }
.stop { position: absolute; width: 0; height: 0; color: var(--gold); }
.dot-btn {
  position: absolute; left: -3.1rem; top: 0;
  width: 6.2rem; height: 8.35rem; padding: 0; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@media (min-width: 720px) { .dot-btn { left: -3.6rem; width: 7.2rem; } }
.mk {
  position: absolute; left: 50%; top: 0; margin-left: 0;
  width: 60px; height: 40px; overflow: visible;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  transition: transform 0.18s ease, filter 0.18s ease;
  filter: none;
}
.dot-btn:hover .mk, .dot-btn:focus-visible .mk { transform: translate(-50%, -50%) scale(1.18); }
.dot-btn.active .mk { transform: translate(-50%, -50%) scale(1.3); }
.stop:has(.dot-btn.active) { color: #3e2f10; }
.mk-alien { color: #2c3548; }
.future .mk { opacity: 0.85; }
.future .mk * { stroke-dasharray: 3 2.4; }
.dot-btn:focus-visible { outline: none; }
.dot-btn:focus-visible .stop-label { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.stop-label { position: absolute; left: 0; right: 0; top: 1.75rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
 .stop-year { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--gold); line-height: 1.15; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .topic-pyramiderna .stop-year { font-size: 0.86rem; max-width: 5.6rem; }
}
.stop-title {
  margin-top: 0.15rem; font-size: 0.74rem; line-height: 1.25; color: var(--soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-width: 0; max-width: 100%;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; word-break: break-word;
}
.dot-btn.active .stop-title, .dot-btn:hover .stop-title { color: var(--text); }

/* Labels may sit above the line when neighbours would otherwise overlap */
.stop.above .dot-btn { top: -8.35rem; }
.stop.above .mk {
  top: auto;
  bottom: 0;
  transform: translate(-50%, 50%);
}
.stop.above .dot-btn:hover .mk,
.stop.above .dot-btn:focus-visible .mk { transform: translate(-50%, 50%) scale(1.18); }
.stop.above .dot-btn.active .mk { transform: translate(-50%, 50%) scale(1.3); }
.stop.above .stop-label { top: auto; bottom: 1.75rem; }
.stop.above .mk-gap { top: auto; bottom: 0; transform: translate(-50%, 50%); }

/* Knockout behind each icon so the timeline line does not touch the marker */
.mk-gap {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.55rem;
  height: 1.15rem;
  transform: translate(-50%, -50%);
  background: var(--bg-0);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.mk { z-index: 1; }


/* ---------- card ---------- */
dialog.card {
  padding: 0; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text);
  width: min(40rem, calc(100% - 2rem)); max-height: min(86vh, 52rem);
  box-shadow: 0 16px 50px rgba(26, 39, 68, 0.18); overflow: hidden;
}
dialog.card::backdrop { background: rgba(40, 44, 54, 0.4); backdrop-filter: blur(3px); }
.card-inner { position: relative; max-height: inherit; overflow-y: auto; padding: 1.4rem 1.35rem 1rem; -webkit-overflow-scrolling: touch; }
@media (max-width: 719px) {
  dialog.card { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 1.2rem 1.2rem 0 0; border-bottom: 0; max-height: 88vh; max-height: 88dvh; }
  .card-inner { padding: 1.2rem 1.1rem calc(0.9rem + env(safe-area-inset-bottom)); }
  .card-inner::before { content: ""; display: block; width: 2.6rem; height: 4px; margin: -0.4rem auto 0.8rem; border-radius: 2px; background: rgba(26, 39, 68, 0.25); }
}
.close {
  position: sticky; top: 0; float: right; margin: -0.35rem -0.35rem 0 0.5rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--bg-card); color: var(--text);
  font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2;
}
.card-topic { margin: 0 0 0.3rem; font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-dim); }
dialog.card h2 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 0.85rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.meta { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.92rem; }
.meta time { color: var(--gold-dim); }
.meta .sep { margin: 0 0.4em; opacity: 0.5; }
.photo { margin: 0 0 1rem; }
.photo img { width: 100%; height: auto; max-height: 20rem; object-fit: cover; border-radius: 0.7rem; display: block; background: var(--bg-1); }
.photo figcaption { margin-top: 0.35rem; font-size: 0.72rem; color: var(--muted); }
.text { color: var(--soft); }
.text p { margin: 0 0 0.7em; }
.lead { margin: 0 0 1.05rem; color: var(--text); font-size: 1.02rem; line-height: 1.5; }
.text-deep { margin-top: 0.35rem; }
.text-deep h3 { margin: 1.1rem 0 0.45rem; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); font-weight: 500; }
.refs .src-type { display: inline-block; margin-left: 0.45em; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.refs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.15em; }
.refs li a { flex: 1 1 auto; }
.refs h3, .videos h3 { margin: 1.1rem 0 0.45rem; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); font-weight: 500; }
.refs ul, .videos ul { list-style: none; margin: 0; padding: 0; }
.refs li { font-size: 0.88rem; margin-bottom: 0.3rem; word-break: break-word; }
.videos li { margin-bottom: 0.45rem; }
a.video { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0.7rem; border: 1px solid var(--card-border); border-radius: 0.7rem; text-decoration: none; background: #fff; }
a.video:hover { border-color: var(--gold-dim); }
.play { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; color: #f3f3f5; background: var(--gold); margin-top: 0.05rem; }
.vtxt { display: flex; flex-direction: column; min-width: 0; }
.vtitle { color: var(--text); font-size: 0.88rem; line-height: 1.35; }
.vch { color: var(--muted); font-size: 0.76rem; }
.card-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid var(--card-border); font-size: 0.8rem; color: var(--muted); }
.card-nav button { font: inherit; font-size: 0.88rem; color: var(--gold); background: none; border: 1px solid var(--card-border); border-radius: 999px; padding: 0.5rem 0.9rem; cursor: pointer; }
.card-nav button:disabled { opacity: 0.3; cursor: default; }

footer { padding: 3rem 0 4rem; color: var(--muted); font-size: 0.88rem; text-align: center; border-top: 1px solid rgba(26, 39, 68, 0.1); margin-top: 1rem; }
footer p { margin: 0 auto 0.7rem; max-width: 38rem; }
footer .credit { margin-top: 1.35rem; font-size: 0.75rem; color: var(--muted); }
footer .site { margin-bottom: 0.85rem; font-family: var(--font-hand); font-size: 1.6rem; color: var(--text); }
.note { color: var(--muted); }
.wrap { width: min(calc(100% - 2rem), 52rem); margin: 0 auto; }
.wrap.wide { width: min(calc(100% - 1.5rem), 74rem); }

/* status labels on event cards */
.status-line { margin: -0.35rem 0 0.8rem; }
.status-badge { display: inline-block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; padding: 0.22rem 0.65rem; border-radius: 999px; border: 1px solid var(--card-border); background: #fff; color: var(--text); }
.st-bekräftad, .st-bekräftad-som-förslag { color: #1f5a3a; border-color: rgba(31, 90, 58, 0.45); background: rgba(31, 90, 58, 0.08); }
.st-delvis-dokumenterad { color: #7a5a12; border-color: rgba(122, 90, 18, 0.45); background: rgba(122, 90, 18, 0.09); }
.st-påstående { color: #8a3a1c; border-color: rgba(138, 58, 28, 0.45); background: rgba(138, 58, 28, 0.08); }
.st-teori { color: #5a2f7a; border-color: rgba(90, 47, 122, 0.45); background: rgba(90, 47, 122, 0.08); }

/* badge centred above the section heading and intro (CIA-ops) */


/* Language switcher */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
}
.lang-switch a, .lang-switch span {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text);
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}
.lang-switch a:hover { border-color: var(--gold); color: var(--gold); background: #fff; }
.lang-switch [aria-current="page"] {
  background: #fff;
  border-color: var(--gold);
  color: var(--text);
  font-weight: 600;
  cursor: default;
}
.header-row { display: flex; flex-direction: column; align-items: center; }
.page-title {
  margin: 0 auto 0.8rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 4vw, 1.7rem);
  line-height: 1.15;
  color: var(--text);
}
.brand-link { display: inline-block; }
.topic-page .hero { min-height: 0; }
.topic-page .lede { margin-bottom: 0.4rem; }
.static-index { margin: 2.5rem auto 0; max-width: 42rem; }
.static-index h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.static-index ol { margin: 0; padding: 0 0 0 1.2rem; }
.static-index li { margin: 0 0 0.55rem; color: var(--soft); }
.static-index li a { color: var(--text); text-decoration: none; }
.static-index li a:hover { color: var(--gold); }
.static-index .ev-year { font-weight: 600; color: var(--gold); margin-right: 0.35rem; }
.catalog { margin: 2.2rem auto 0; max-width: 42rem; }
.catalog h2 {
  margin: 0 0 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.catalog article { margin: 0 0 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(26, 39, 68, 0.1); }
.catalog h3 { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: 1.02rem; }
.catalog h3 a { color: var(--text); text-decoration: none; }
.catalog h3 a:hover { color: var(--gold); }
.catalog p { margin: 0; color: var(--soft); font-weight: 300; }
.more-timelines { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin: 1rem 0 0; }
.more-timelines a {
  font-size: 0.82rem; text-decoration: none; color: var(--text);
  padding: 0.35rem 0.8rem; border: 1px solid var(--card-border); border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}
.more-timelines a:hover { border-color: var(--gold); color: var(--gold); }
.more-timelines a[aria-current="page"] { border-color: var(--gold); background: #fff; font-weight: 600; }

.topic-label a, .topic-label-link { color: inherit; text-decoration: none; }
.topic-label a:hover, .topic-label-link:hover { color: var(--gold); }

