/* /tog/tilbakeblikk — the same night-train palette /tog and /tog/land use. The
   token VALUES are identical to tog/index.html and tog/land/land.css on purpose:
   the three pages are one section and must not drift apart, which is why
   test/contrast.test.js compares every file that defines them rather than a
   pair. Every text pair here clears WCAG 2.2 AAA (7:1) against --tg-bg or
   --tg-surface; the heatmap fills are non-text meaning-bearers, carry their
   value in an aria-label, and are never the only way to read a number. */
:root {
  --tg-bg: #0B1412;        /* outside the window */
  --tg-surface: #132420;   /* cards */
  --tg-raised: #1B322C;    /* inner panels, table stripes, empty heatmap cells */
  --tg-hair: #2E4A42;      /* decorative rules only, never text */
  --tg-text: #F1FBF4;      /* body, 16.9:1 on bg */
  --tg-muted: #A9C9B7;     /* secondary, 9.6:1 on bg */
  --tg-accent: #D8FF4F;    /* the site lime — numbers, bars, 15.9:1 */
  --tg-accent-2: #7DE8B0;  /* links, 11.4:1 */
  --tg-warn: #FFB870;      /* night trains, 10.6:1 */
  --tg-pred: #B8A9E8;      /* anything this site computed rather than measured, 8.4:1 */

  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-disp: 'Barlow Condensed', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0; background: var(--tg-bg); color: var(--tg-text);
  font-family: var(--font-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed; left: 0.75rem; top: -100%; z-index: 2000;
  background: #04170c; color: #f4ffe8; border: 2px solid var(--tg-accent);
  padding: 0.6rem 1rem; border-radius: 0.6rem; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.1rem 4rem; }

.hero { margin-bottom: 2rem; }
.eyebrow {
  font-family: var(--font-disp); text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--tg-accent); margin: 0 0 0.3rem; font-size: 0.95rem;
}
.eyebrow a { color: var(--tg-accent); }
h1 {
  font-family: var(--font-disp); font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.05; margin: 0 0 0.7rem; font-weight: 700;
}
.lede { color: var(--tg-muted); max-width: 62ch; margin: 0 0 1rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.hero-links a, a { color: var(--tg-accent-2); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--tg-accent); outline-offset: 2px; border-radius: 4px;
}

.card {
  background: var(--tg-surface); border: 1px solid var(--tg-hair);
  border-radius: 1rem; padding: 1.3rem 1.2rem; margin-bottom: 1.6rem;
}
h2 {
  font-family: var(--font-disp); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 1.15rem; margin: 0 0 0.9rem; color: var(--tg-text);
}
h3 { font-family: var(--font-disp); font-size: 1rem; letter-spacing: 0.08em;
     text-transform: uppercase; color: var(--tg-muted); margin: 1.2rem 0 0.5rem; }

/* Highlight strip */
.tal { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .tal { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .tal { grid-template-columns: repeat(4, 1fr); } }
.tal .boks { background: var(--tg-raised); border-radius: 0.7rem; padding: 0.9rem 1rem; }
.tal .n { font-family: var(--font-disp); font-size: 1.9rem; line-height: 1.1;
          color: var(--tg-accent); display: block; }
.tal .m { color: var(--tg-muted); font-size: 0.88rem; }

/* Table */
.tabellramme { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; }
caption { text-align: left; color: var(--tg-muted); font-size: 0.9rem;
          padding-bottom: 0.6rem; }
th, td { padding: 0.5rem 0.6rem; text-align: left; border-bottom: 1px solid var(--tg-hair); }
th { font-family: var(--font-disp); text-transform: uppercase; letter-spacing: 0.08em;
     font-size: 0.85rem; color: var(--tg-muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
/* A date and a duration are single tokens; broken over two lines they read as
   two values. The table already scrolls sideways inside .tabellramme. */
#etappar td:first-child, #etappar td:last-child { white-space: nowrap; }
tbody tr:nth-child(odd) { background: rgba(27, 50, 44, 0.4); }
.stolpe { display: block; height: 0.5rem; background: var(--tg-accent);
          border-radius: 999px; min-width: 2px; }
.kolonne-stolpe { width: 7rem; }
.merke { font-size: 0.78rem; color: var(--tg-warn); border: 1px solid var(--tg-warn);
         border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap; }
.merke.rekna-merke { color: var(--tg-pred); border-color: var(--tg-pred); }

/* Chip row — which quantity the rankings and the heatmap are read by. */
.val { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0;
        list-style: none; }
.val button {
  font: inherit; font-family: var(--font-disp); text-transform: uppercase;
  letter-spacing: 0.08em; background: var(--tg-raised); color: var(--tg-muted);
  border: 1px solid var(--tg-hair); border-radius: 999px;
  padding: 0.3rem 0.9rem; cursor: pointer;
}
.val button[aria-pressed="true"] {
  background: var(--tg-accent); color: #0B1412; border-color: var(--tg-accent);
}

/* The heatmap: one row per year, twelve cells. A grid of links, not a measured
   chart — nothing here reads the DOM, so the smoke test's no-op getBBox() cannot
   ship it blank. */
.heat { display: grid; gap: 0.5rem; margin: 0; }
.heat-rad {
  display: grid; grid-template-columns: 3.2rem repeat(12, 1fr);
  gap: 0.2rem; align-items: center;
}
.heat-aar {
  font-family: var(--font-disp); color: var(--tg-muted); font-size: 0.9rem;
  letter-spacing: 0.06em;
}
.heat-hovud { color: var(--tg-muted); font-size: 0.72rem; text-align: center; }
.rute {
  display: block; aspect-ratio: 1 / 1; border-radius: 0.28rem;
  background: var(--tg-raised); text-decoration: none;
  border: 1px solid transparent;
}
/* Intensity rides in on --i (0..1), set per cell by app.js. A month with any
   travel at all never falls below a visible floor. */
a.rute { background: rgba(216, 255, 79, var(--i, 0.1)); }
a.rute:hover, a.rute:focus-visible { border-color: var(--tg-accent); }
/* ADR 0021: the running month is not finished, so it is drawn as hatched rather
   than as a low number, the way /tuben hatches its export gaps. It cannot be
   compared by area, and it is not in any ranking. */
.rute.open {
  background:
    repeating-linear-gradient(135deg,
      rgba(184, 169, 232, 0.55) 0 3px, rgba(27, 50, 44, 0.9) 3px 6px);
  border-color: var(--tg-pred);
}
.skala { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.9rem;
         color: var(--tg-muted); font-size: 0.82rem; flex-wrap: wrap; }
.skala i { width: 1.4rem; height: 0.7rem; border-radius: 2px; display: inline-block;
           background: var(--tg-raised); }

/* Comparison bars on a month page */
.mot { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.mot li { display: grid; grid-template-columns: 1fr; gap: 0.2rem; }
.mot .rad { display: flex; justify-content: space-between; gap: 1rem; }
.mot .rad b { font-weight: 600; }
.mot .rad span { color: var(--tg-muted); font-variant-numeric: tabular-nums; }
.mot .spor { background: var(--tg-raised); border-radius: 999px; height: 0.5rem; }
.mot .spor i { display: block; height: 100%; border-radius: 999px;
               background: var(--tg-accent); min-width: 2px; }
.mot li.dus .spor i { background: var(--tg-hair); }

/* Photo strip */
.bilete { display: grid; gap: 0.7rem; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 0; list-style: none; }
@media (min-width: 620px) { .bilete { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 940px) { .bilete { grid-template-columns: repeat(4, 1fr); } }
.bilete img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 0.6rem; background: var(--tg-raised); display: block;
}

/* Posts written aboard */
.innlegg { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.innlegg li { background: var(--tg-raised); border-radius: 0.7rem; padding: 0.8rem 0.9rem; }
.innlegg .kva { color: var(--tg-muted); font-size: 0.82rem; margin: 0 0 0.3rem; }
.innlegg p { margin: 0.2rem 0; }

/* Notes */
.note { color: var(--tg-muted); font-size: 0.9rem; }
.rekna {
  border-left: 3px solid var(--tg-pred); padding-left: 0.8rem;
  color: var(--tg-muted); font-size: 0.9rem;
}
.rekna b { color: var(--tg-pred); font-weight: 600; }
ul.rein { list-style: none; padding: 0; margin: 0; }
ul.rein li { padding: 0.35rem 0; border-bottom: 1px solid var(--tg-hair); }
.par { display: flex; justify-content: space-between; gap: 1rem; }
.par span:last-child { color: var(--tg-muted); font-variant-numeric: tabular-nums; }

/* Prev/next month */
.blad { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
        margin-top: 1.4rem; }
.blad a { font-family: var(--font-disp); letter-spacing: 0.06em; }

footer { margin-top: 2rem; color: var(--tg-muted); font-size: 0.88rem; }
footer a { color: var(--tg-accent-2); }
