/* Lichtpuntje: the JustBee look (paper, ink, yellow; Fredoka and Nunito Sans, as on justbee.nl)
   with a night-blue header. */
:root {
  --paper: #faf7ee;
  --panel: #fffdf6;
  --ink: #1f1f1f;
  --muted: #6a665d;
  --line: #e8dfc9;
  --yellow: #ffc629;
  --yellow-soft: #fff0b7;
  --gold: #b38b10;
  --night: #16213e;
  --night-2: #1f2d55;
  --twilight: #5f78b8;
  --blue: #3a5a9c;
  --on-night: #f6f1e2;
  --on-night-muted: #b9bfd6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-decoration-color: #d5a400;
  text-underline-offset: 4px;
}

button,
select,
input {
  font: inherit;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .17em;
  font-weight: 800;
  text-transform: uppercase;
  color: #73654c;
}

/* ---------- JustBee return bar (as on the other subdomains) */

.justbee-return {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 8px max(24px, calc((100vw - 1180px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font: 800 14px 'Nunito Sans', sans-serif;
}

.justbee-return a {
  color: var(--ink);
  text-decoration: none;
}

.justbee-return .brand {
  display: block;
  width: 156px;
  line-height: 0;
}

.justbee-return .brand img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- hero */

.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 198, 41, .16), transparent 42%),
    linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
  color: var(--on-night);
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.hero .eyebrow {
  color: var(--yellow);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 74px);
  color: #fff;
}

.subline {
  margin: 14px 0 0;
  font-size: 20px;
  color: var(--on-night);
  max-width: 34ch;
}

.treat {
  margin: 10px 0 0;
  color: var(--yellow);
  font-weight: 700;
  min-height: 1em;
}

.treat:empty {
  display: none;
}

.today-card {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  max-width: 520px;
}

.today-label {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 13px;
  color: var(--on-night-muted);
  text-transform: capitalize;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.today-grid dt {
  font-size: 13px;
  color: var(--on-night-muted);
}

.today-grid dd {
  margin: 2px 0 0;
  font: 600 clamp(22px, 3vw, 30px) 'Fredoka', sans-serif;
  color: #fff;
}

.today-delta {
  margin: 12px 0 0;
  font-weight: 700;
}

.today-delta.is-up {
  color: var(--yellow);
}

.today-delta.is-down {
  color: #a9b7e6;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 24px;
}

.control {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-night-muted);
}

.control select,
.control input {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 700;
  color-scheme: dark;
}

.control select option {
  color: var(--ink);
  background: #fff;
}

button.ghost {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  font-weight: 800;
  cursor: pointer;
}

button.ghost:hover,
button.ghost:focus-visible {
  background: var(--yellow);
  color: var(--ink);
}

button.ghost:disabled {
  opacity: .6;
  cursor: wait;
}

button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--yellow);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.time-travel {
  margin: 14px 0 0;
  color: var(--on-night-muted);
}

.time-travel[hidden] {
  display: none;
}

/* ---------- 24-hour dial */

.dial-wrap {
  margin: 0;
  text-align: center;
}

.dial {
  width: min(100%, 420px);
  height: auto;
  filter: drop-shadow(0 0 40px rgba(255, 198, 41, .18));
}

.dial-wrap figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--on-night-muted);
  max-width: 36ch;
  margin-inline: auto;
}

.dial-night { fill: #0d1530; }
.dial-twilight { fill: var(--twilight); }
.dial-day { fill: var(--yellow); }
.dial-hole { fill: var(--night); }
.dial-tick { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.dial-label { fill: var(--on-night-muted); font: 700 9px 'Nunito Sans', sans-serif; }
.dial-now { stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.dial-now-dot { fill: #fff; }
.dial-center { fill: #fff; font: 600 20px 'Fredoka', sans-serif; }
.dial-center-small { fill: var(--on-night-muted); font: 700 9px 'Nunito Sans', sans-serif; }

/* ---------- page */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  min-width: 0;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2,
.explain h2 {
  font-size: clamp(26px, 3vw, 34px);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.fact-card {
  background: var(--yellow-soft);
  border-color: #f2d77c;
}

.fact {
  margin: 0;
  font: 500 clamp(20px, 2.4vw, 26px) 'Fredoka', sans-serif;
  line-height: 1.35;
  max-width: 60ch;
}

/* ---------- timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 4px 2px 14px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.event {
  scroll-snap-align: start;
  position: relative;
  padding: 18px 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.event::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 5px;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}

.event--up::before,
.event--turn::before {
  background: var(--yellow);
}

.event.is-past {
  opacity: .55;
}

.event.is-next {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.event-when {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.event-date {
  color: var(--muted);
  white-space: nowrap;
}

.event-rel {
  color: var(--gold);
  white-space: nowrap;
}

.event.is-past .event-rel {
  color: var(--muted);
}

.event-title {
  margin-top: 8px;
  font-size: 21px;
}

.event-detail {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- year chart */

.chart-wrap {
  position: relative;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
  cursor: crosshair;
}

.chart-night { fill: var(--night); }
.chart-twilight { fill: var(--twilight); }
.chart-day { fill: var(--yellow); }
.chart-grid { stroke: rgba(31, 31, 31, .12); stroke-width: 1; }
.chart-grid--strong { stroke: rgba(31, 31, 31, .25); }
.chart-label { fill: var(--muted); font: 700 13px 'Nunito Sans', sans-serif; }
.chart-today line { stroke: #e0301e; stroke-width: 2.5; }
.chart-hover { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 4 3; }

.chart-tip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  font-size: 14px;
  pointer-events: none;
  display: grid;
  text-align: center;
  white-space: nowrap;
}

.chart-tip[hidden] {
  display: none;
}

.legend {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
  color: var(--muted);
}

.key {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.key-day { background: var(--yellow); }
.key-twilight { background: var(--twilight); margin-left: 8px; }
.key-night { background: var(--night); margin-left: 8px; }

/* ---------- north against south */

.country {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.country-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 110px 100px;
  gap: 12px;
  align-items: center;
  font-size: 15px;
}

.country-name {
  border: 0;
  background: none;
  padding: 4px 0;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}

.country-name:hover,
.country-name:focus-visible {
  text-decoration: underline;
  text-decoration-color: #d5a400;
  text-underline-offset: 4px;
}

.country-bar {
  height: 14px;
  border-radius: 999px;
  background: #efe8d4;
  overflow: hidden;
}

.country-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #e8c45a;
}

.country-row.is-current .country-fill {
  background: var(--yellow);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.country-row.is-current .country-name::after {
  content: ' ●';
  color: var(--gold);
}

.country-value {
  font-weight: 800;
  text-align: right;
}

.country-times {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.country-facts {
  margin: 18px 0 0;
  color: var(--muted);
}

/* ---------- text */

.explain p {
  max-width: 70ch;
}

.small-print {
  font-size: 15px;
  color: var(--muted);
}

.small-print p {
  max-width: 80ch;
}

.small-print p:first-child {
  margin-top: 0;
}

.small-print p:last-child {
  margin-bottom: 0;
}

/* ---------- small screens */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 32px;
  }

  .dial {
    width: min(100%, 320px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .justbee-return {
    padding-inline: 16px;
  }

  .justbee-return .brand {
    width: 126px;
  }

  .justbee-return > a:last-child {
    font-size: 12px;
  }

  .hero-inner,
  .page {
    padding-inline: 16px;
  }

  .card {
    padding: 22px 18px;
  }

  .subline {
    font-size: 18px;
  }

  .today-card {
    padding: 14px;
  }

  .country-row {
    grid-template-columns: 96px minmax(0, 1fr) 88px;
    gap: 8px;
    font-size: 14px;
  }

  .country-times {
    display: none;
  }

  .chart-label {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
