/* Dejan Dakic: by day, by night. One page, mobile first, no framework. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ink: #06080f;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.065);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --fg: #eef1f7;
  --fg-2: #cfd5e2;
  --muted: #98a2b8;

  /* by day, by night */
  --gold: #e2b857;
  --gold-2: #f3d27a;
  --night: #9db7ff;
  --night-2: #6d8cf0;
  --day-ink: #131a2c;

  /* status pills */
  --live: #6ee7a8;
  --building: #93c5fd;
  --research: #c4b5fd;
  --paused: #b7c2d6;

  /* Lanes' temperature scale: cooperative to open conflict */
  --temp: linear-gradient(90deg, #22c55e, #e2b857 50%, #ef4444);

  --radius: 20px;
  --radius-lg: 28px;
  --wrap: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --topbar: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background:
    radial-gradient(70rem 50rem at 50% 115%, rgba(99, 132, 255, 0.09), transparent 70%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(226, 184, 87, 0.35);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus {
  outline: none;
}

.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;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  color: #1a1405;
  font-weight: 700;
  text-decoration: none;
  background: var(--gold);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: none;
}

.icon {
  display: inline-grid;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}

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

.icon--external {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.6;
}

/* ---------- shared bits ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.eyebrow--gold {
  color: var(--gold);
}

.eyebrow--night {
  color: var(--night);
}

.eyebrow--day {
  color: #7a520a;
}

.label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: var(--panel);
  transition:
    transform 200ms var(--ease),
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: var(--panel-2);
}

.button .icon {
  width: 1.05em;
  height: 1.05em;
}

.button .icon--external {
  width: 0.85em;
  height: 0.85em;
}

.button--primary {
  border-color: transparent;
  color: #05070d;
  background: #f4f6fb;
  box-shadow: 0 10px 34px -12px rgba(255, 255, 255, 0.45);
}

.button--primary:hover {
  border-color: transparent;
  background: #fff;
}

.button--small {
  min-height: 2.35rem;
  padding: 0 0.95rem;
  font-size: 0.86rem;
}

.button--ghost {
  padding-inline: 0.5rem 0.9rem;
  border-color: transparent;
  color: var(--fg-2);
  background: transparent;
}

.button--ghost .icon {
  width: 2rem;
  height: 2rem;
  padding: 0.55rem;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(226, 184, 87, 0.14);
  transition: background 200ms ease, color 200ms ease;
}

.button--ghost:hover {
  border-color: transparent;
  color: var(--fg);
  background: transparent;
}

.button--ghost:hover .icon {
  color: #1a1405;
  background: var(--gold);
}

.button--gold {
  border-color: transparent;
  color: #1a1405;
  background: var(--gold);
  box-shadow: 0 12px 34px -14px rgba(226, 184, 87, 0.7);
}

.button--gold:hover {
  border-color: transparent;
  background: var(--gold-2);
}

.button--navy {
  border-color: transparent;
  color: #f6f0e3;
  background: var(--day-ink);
}

.button--navy:hover {
  border-color: transparent;
  background: #202a45;
}

.button--outline-dark {
  border-color: rgba(19, 26, 44, 0.25);
  color: var(--day-ink);
  background: transparent;
}

.button--outline-dark:hover {
  border-color: var(--day-ink);
  background: rgba(19, 26, 44, 0.05);
}

.pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  color: var(--paused);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
}

.pill--live {
  color: var(--live);
  background: rgba(110, 231, 168, 0.12);
}

.pill--live::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

.pill--building {
  color: var(--building);
  background: rgba(147, 197, 253, 0.12);
}

.pill--research {
  color: var(--research);
  background: rgba(196, 181, 253, 0.12);
}

.pill--closed {
  color: #aab2c3;
  background: rgba(255, 255, 255, 0.05);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.1rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(6, 8, 15, 0.45);
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.chip:hover {
  border-color: var(--accent, var(--gold));
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}

.chip .icon {
  width: 0.95em;
  height: 0.95em;
}

.chip .icon--external {
  width: 0.8em;
  height: 0.8em;
  opacity: 0.55;
}

.chip--note,
.chip--quiet {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 300ms ease, border-color 300ms ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(6, 8, 15, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: var(--topbar);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topnav {
  display: none;
  gap: 0.2rem;
  margin-left: auto;
}

.topnav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms ease, background 200ms ease;
}

.topnav a:hover,
.topnav a[aria-current] {
  color: var(--fg);
  background: var(--panel-2);
}

#topbar-action {
  margin-left: auto;
}

@media (min-width: 860px) {
  .topnav {
    display: flex;
  }

  #topbar-action {
    margin-left: 0.5rem;
  }
}

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

.hero {
  position: relative;
  isolation: isolate;
  /* The glows may spill up behind the top bar, never sideways off the page. */
  overflow-x: clip;
}

/* A warm glow on the left (day), a cool one on the right (night), stars on the night side. */
.hero__sky {
  position: absolute;
  inset: calc(-1 * var(--topbar)) 0 -8rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42rem 28rem at 8% 6%, rgba(226, 184, 87, 0.2), transparent 70%),
    radial-gradient(48rem 32rem at 96% 0%, rgba(99, 132, 255, 0.24), transparent 70%),
    radial-gradient(36rem 22rem at 62% 88%, rgba(99, 132, 255, 0.07), transparent 70%);
}

.hero__sky::before {
  content: "";
  position: absolute;
  inset: 0 0 30% 48%;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 28% 58%, #cfd9ff, transparent),
    radial-gradient(1.4px 1.4px at 44% 14%, #fff, transparent),
    radial-gradient(1px 1px at 57% 41%, #cfd9ff, transparent),
    radial-gradient(1.6px 1.6px at 71% 20%, #fff, transparent),
    radial-gradient(1px 1px at 83% 62%, #cfd9ff, transparent),
    radial-gradient(1.2px 1.2px at 92% 33%, #fff, transparent),
    radial-gradient(1px 1px at 36% 80%, #cfd9ff, transparent),
    radial-gradient(1.3px 1.3px at 66% 74%, #fff, transparent),
    radial-gradient(1px 1px at 20% 90%, #cfd9ff, transparent);
  opacity: 0.75;
  animation: twinkle 7s ease-in-out infinite alternate;
}

/* The horizon: day fading into night under the hero. */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 184, 87, 0.55), rgba(157, 183, 255, 0.55), transparent);
  transform: translateX(-50%);
}

.hero__inner {
  display: grid;
  gap: 1.75rem;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding: clamp(1rem, 4vw, 4rem) 0 clamp(3rem, 8vw, 6rem);
}

.hero__text {
  display: grid;
  justify-items: start;
}

.announcement {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  margin-bottom: 1.4rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border: 1px solid rgba(226, 184, 87, 0.35);
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  background: rgba(226, 184, 87, 0.08);
  transition: border-color 200ms ease, background 200ms ease;
}

.announcement:hover {
  border-color: rgba(226, 184, 87, 0.65);
  background: rgba(226, 184, 87, 0.13);
}

.announcement__label {
  flex-shrink: 0;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  color: #1a1405;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gold);
}

.announcement__arrow {
  width: 1em;
  height: 1em;
  color: var(--gold);
  transition: transform 200ms var(--ease);
}

.announcement:hover .announcement__arrow {
  transform: translateX(3px);
}

.hero h1 {
  font-size: clamp(2.9rem, 10.5vw, 5.4rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.hero__handle {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.hero__handle-link {
  color: var(--gold);
  text-decoration: none;
}

.hero__handle-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.hero__headline {
  max-width: 24ch;
  margin-top: 1.35rem;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.55rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.accent {
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
}

.accent--1 {
  color: var(--gold);
  text-shadow: 0 0 28px rgba(226, 184, 87, 0.35);
}

.accent--2 {
  color: var(--night);
  text-shadow: 0 0 28px rgba(157, 183, 255, 0.5);
}

.hero__intro {
  max-width: 56ch;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.9rem;
}

.hero__portrait {
  position: relative;
  order: -1;
  justify-self: start;
}

.avatar {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: clamp(92px, 26vw, 116px);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #1a1405;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(140deg, var(--gold), var(--night));
}

/* The ring turns from day to night. */
.avatar--photo::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--gold), var(--gold-2) 22%, var(--night) 52%, var(--night-2) 74%, var(--gold));
  animation: spin 22s linear infinite;
}

.avatar--photo::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(157, 183, 255, 0.28), rgba(226, 184, 87, 0.08) 60%, transparent);
}

.avatar__image {
  width: 100%;
  height: 100%;
  border: 4px solid var(--ink);
  border-radius: 50%;
  object-fit: cover;
}

.orbit {
  display: none;
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
  }

  .hero__portrait {
    order: 0;
    justify-self: center;
  }

  .avatar {
    width: clamp(230px, 24vw, 300px);
  }

  .avatar--photo::before {
    inset: -7px;
  }

  .avatar__image {
    border-width: 7px;
  }

  .orbit {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--fg-2);
    font-size: 0.84rem;
    white-space: nowrap;
    text-decoration: none;
    background: rgba(10, 14, 25, 0.78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.7);
    animation: float 7s ease-in-out infinite;
  }

  .orbit b {
    color: var(--fg);
    font-weight: 600;
  }

  .orbit--day {
    top: 6%;
    left: -14%;
  }

  .orbit--night {
    right: -16%;
    bottom: 8%;
    animation-delay: -3.5s;
  }

  .orbit__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
  }

  .orbit--day .orbit__dot {
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
  }

  .orbit--night .orbit__dot {
    background: var(--night);
    box-shadow: 0 0 10px var(--night);
  }
}

/* ---------- sections ---------- */

main {
  display: grid;
  gap: clamp(4.5rem, 11vw, 8rem);
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(4.5rem, 11vw, 8rem);
}

.section,
.feature,
.day {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.section__head {
  display: grid;
  justify-items: start;
  gap: 0.7rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.4rem);
}

.section__head h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  font-size: clamp(2rem, 5.5vw, 3rem);
  letter-spacing: -0.03em;
}

.count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
}

.section__lede {
  color: var(--muted);
}

.section__note {
  margin-top: 1.1rem;
}

/* ---------- featured: Lanes ---------- */

.feature {
  --pad: clamp(1.1rem, 4vw, 3rem);

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-areas:
    "head"
    "player"
    "facts"
    "topics";
  gap: clamp(1.75rem, 4vw, 2.5rem);
  overflow: clip;
  padding: var(--pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 26, 43, 0.8), rgba(10, 14, 25, 0.6));
  box-shadow:
    0 40px 120px -40px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* The Lanes arc: green to gold to red, across the top of the panel. */
.feature::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--temp);
}

.feature__glow {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 32rem;
  pointer-events: none;
  background:
    radial-gradient(26rem 14rem at 12% 0%, rgba(34, 197, 94, 0.1), transparent 70%),
    radial-gradient(30rem 16rem at 50% 0%, rgba(226, 184, 87, 0.12), transparent 70%),
    radial-gradient(26rem 14rem at 88% 0%, rgba(239, 68, 68, 0.1), transparent 70%);
}

.feature__head {
  grid-area: head;
}

.feature__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin-top: 1rem;
}

.feature__logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line-2), 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}

.feature h2 {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  letter-spacing: -0.035em;
}

.feature__tagline {
  margin-top: 1.1rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.feature__description {
  max-width: 62ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
}

.feature__facts {
  grid-area: facts;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}

.stat__label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feature__promise {
  margin-top: 1rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feature__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.feature__topics {
  grid-area: topics;
  display: grid;
  gap: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.topic::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--temp);
}

.topic .icon--external {
  width: 0.78em;
  height: 0.78em;
  opacity: 0.45;
}

.topic:hover {
  border-color: rgba(226, 184, 87, 0.55);
  color: var(--fg);
  background: rgba(226, 184, 87, 0.06);
}

@media (min-width: 540px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .feature {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    grid-template-areas:
      "head facts"
      "player player"
      "topics topics";
    align-items: end;
    column-gap: 3.5rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- the explainer player ---------- */

.player {
  grid-area: player;
  display: grid;
  grid-template-areas:
    "head"
    "video"
    "chapters"
    "now"
    "transcript";
  gap: 1rem;
}

.player__head {
  grid-area: head;
  display: grid;
  gap: 0.15rem;
}

.player__label {
  font-weight: 600;
}

.player__note {
  color: var(--muted);
  font-size: 0.86rem;
}

.player__frame {
  position: relative;
  grid-area: video;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  background: #05070d;
  box-shadow:
    0 0 0 1px var(--line-2),
    0 30px 80px -30px rgba(0, 0, 0, 0.95),
    0 0 90px -30px rgba(226, 184, 87, 0.35);
}

.player[data-shape="tall"] .player__frame {
  aspect-ratio: 4 / 5;
}

/* A scrim so the controls read over any frame. */
.player__frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 32%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
}

.player__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.player__frame:fullscreen {
  border-radius: 0;
  background: #000;
}

.player__frame:fullscreen .player__video {
  object-fit: contain;
}

.player__controls {
  position: absolute;
  right: 0.8rem;
  bottom: 1rem;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
}

.player__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(6, 8, 15, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 200ms ease, transform 200ms var(--ease);
}

.player__btn:hover {
  background: rgba(6, 8, 15, 0.88);
  transform: scale(1.06);
}

.player__btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* While it plays muted, say once where the sound is. */
.player[data-state="playing"][data-sound="off"] .player__btn--sound::after {
  content: "Tap for sound";
  position: absolute;
  right: calc(100% + 0.5rem);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(6, 8, 15, 0.72);
  pointer-events: none;
  animation: hint 6s ease forwards;
}

.player__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  gap: 3px;
  height: 4px;
}

.player__segment {
  position: relative;
  flex-basis: 0;
  background: rgba(255, 255, 255, 0.22);
}

.player__segment i,
.chapter__bar i {
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(var(--fill, 0));
  transform-origin: left;
}

.player__big-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 0;
  color: #fff;
  font-weight: 600;
  background: rgba(6, 8, 15, 0.35);
  cursor: pointer;
}

.player__big-play .icon {
  width: 4rem;
  height: 4rem;
  padding: 1.2rem 1.1rem 1.2rem 1.3rem;
  border-radius: 50%;
  color: #1a1405;
  background: var(--gold);
  box-shadow: 0 0 0 10px rgba(226, 184, 87, 0.22), 0 20px 40px -10px rgba(0, 0, 0, 0.8);
  transition: transform 200ms var(--ease);
}

.player__big-play:hover .icon {
  transform: scale(1.06);
}

.player__fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
}

.player__now {
  grid-area: now;
  display: grid;
}

.player__caption {
  grid-area: 1 / 1;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}

.player__caption.is-current {
  visibility: visible;
  opacity: 1;
  transition: opacity 400ms ease;
}

.player__caption-meta {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.player__caption-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.player__caption-text {
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Chapters: a sideways strip on phones, a list beside the video on wide screens. */
.chapters {
  position: relative;
  grid-area: chapters;
  display: grid;
  grid-auto-columns: 9.5rem;
  grid-auto-flow: column;
  gap: 0.5rem;
  margin-inline: calc(-1 * var(--pad, 1rem));
  padding: 0 var(--pad, 1rem) 0.35rem;
  overflow-x: auto;
  scroll-padding-inline: var(--pad, 1rem);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.chapters::-webkit-scrollbar {
  display: none;
}

.chapters__item {
  scroll-snap-align: start;
}

.chapter {
  position: relative;
  display: grid;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 0.4rem 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.chapter:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chapter[aria-current] {
  border-color: rgba(226, 184, 87, 0.35);
  background: rgba(226, 184, 87, 0.08);
}

.chapter__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  object-fit: cover;
  opacity: 0.72;
  transition: opacity 200ms ease;
}

.chapter:hover .chapter__thumb,
.chapter[aria-current] .chapter__thumb {
  opacity: 1;
}

.chapter__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-inline: 0.2rem;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter__time {
  color: var(--gold);
}

.chapter__title {
  display: none;
}

.chapter__bar {
  position: relative;
  align-self: end;
  height: 3px;
  margin-inline: 0.2rem;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.transcript {
  grid-area: transcript;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.transcript summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-2);
  font-size: 0.92rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.transcript summary::-webkit-details-marker {
  display: none;
}

.transcript summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
}

.transcript[open] summary::before {
  content: "−";
}

.transcript__list {
  display: grid;
  gap: 1rem;
  max-width: 72ch;
  margin-top: 1.1rem;
}

.transcript__list li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 0.75rem;
}

.transcript__time {
  grid-row: span 2;
  padding-top: 0.15rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.transcript__text {
  color: var(--muted);
  font-size: 0.93rem;
}

/* Phones: the video runs edge to edge of the panel. */
@media (max-width: 719px) {
  .player__frame {
    margin-inline: calc(-1 * var(--pad, 1rem));
    border-radius: 0;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  }
}

@media (min-width: 960px) {
  .player {
    grid-template-columns: minmax(0, 1fr) 19.5rem;
    grid-template-areas:
      "video head"
      "video chapters"
      "now chapters"
      "transcript transcript";
    grid-template-rows: auto 1fr auto auto;
    column-gap: 1.5rem;
    row-gap: 1.1rem;
  }

  .player__head {
    align-self: end;
  }

  .chapters {
    grid-auto-columns: auto;
    grid-auto-flow: row;
    align-content: start;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .chapter {
    grid-template-columns: 6.25rem minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 0.8rem;
    row-gap: 0.2rem;
    padding: 0.45rem;
  }

  .chapter__thumb {
    grid-row: 1 / span 3;
    align-self: center;
  }

  .chapter__meta {
    padding: 0;
  }

  .chapter__title {
    display: block;
    color: var(--fg-2);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .chapter__bar {
    margin: 0.2rem 0 0;
  }
}

/* ---------- by night: products ---------- */

.products {
  display: grid;
  gap: 1.1rem;
}

.product {
  --accent: var(--night);

  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  transition:
    transform 350ms var(--ease),
    border-color 350ms ease,
    box-shadow 350ms ease;
}

.product:hover,
.product:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow:
    0 30px 70px -34px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.product__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b0f1a;
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

.product:hover .product__media img {
  transform: scale(1.045);
}

.product__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 11, 20, 0.6));
}

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.2rem 1.25rem 1.3rem;
}

.product__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product__title {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.product__link {
  text-decoration: none;
}

/* Makes the whole card open the first link without nesting anchors. */
.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.product__summary {
  color: var(--fg);
  font-weight: 600;
  line-height: 1.45;
}

.product__description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Clicks on the host label fall through to the card link; the chips stay clickable. */
.product__foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
  pointer-events: none;
}

.product__foot .chip {
  pointer-events: auto;
}

.product__host {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: auto;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (min-width: 720px) {
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- by night: the lab ---------- */

.lab {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.lab__item {
  display: grid;
  gap: 0.4rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.lab__item:last-child {
  border-bottom: 0;
}

.lab__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.lab__title {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lab__summary {
  color: var(--muted);
  font-size: 0.92rem;
}

.lab__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (min-width: 900px) {
  .lab__item {
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    align-items: baseline;
    column-gap: 2.5rem;
    padding: 1.35rem 1.6rem;
  }

  .lab__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lab__links {
    grid-column: 2;
  }
}

/* ---------- by day: daylight ---------- */

.day__card {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 1.6rem;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3.25rem);
  border-radius: var(--radius-lg);
  color: var(--day-ink);
  background: linear-gradient(135deg, #fbf7ec 0%, #f4ead4 55%, #ecdcb9 100%);
  box-shadow:
    0 30px 80px -44px rgba(226, 184, 87, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.day__card :focus-visible {
  outline-color: var(--day-ink);
}

.day__sun {
  position: absolute;
  top: -9rem;
  right: -7rem;
  z-index: -1;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 110, 0.95), rgba(255, 196, 84, 0.35) 42%, transparent 70%);
}

.day__main {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.day h2 {
  color: var(--day-ink);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -0.035em;
}

.day__role {
  color: #5a4618;
  font-weight: 600;
}

.day__summary {
  max-width: 58ch;
  color: #2c3448;
  font-size: 1.05rem;
  line-height: 1.7;
}

.day__aside {
  display: grid;
  gap: 1.1rem;
}

.day__places {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.day__places li {
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(19, 26, 44, 0.14);
  border-radius: 999px;
  color: var(--day-ink);
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.6);
}

.day__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (min-width: 900px) {
  .day__card {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: end;
    column-gap: 3rem;
  }
}

/* ---------- archive ---------- */

.section--quiet .section__head h2 {
  color: var(--fg-2);
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.archive {
  display: grid;
  gap: 0.6rem;
}

.archive__item {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line-2);
  border-radius: 16px;
}

.archive__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.archive__title {
  color: var(--fg-2);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.archive__summary {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- footer ---------- */

.footer {
  display: grid;
  gap: 2rem;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

.closing {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  overflow: hidden;
  padding: clamp(2.25rem, 7vw, 4.5rem) 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  background:
    radial-gradient(32rem 16rem at 50% 0%, rgba(99, 132, 255, 0.18), transparent 70%),
    rgba(255, 255, 255, 0.02);
}

.closing h2 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  letter-spacing: -0.035em;
}

.closing__text {
  max-width: 52ch;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 200ms var(--ease), border-color 200ms ease, background 200ms ease;
}

.social:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.links--quiet {
  justify-content: flex-start;
}

.error {
  padding: 2rem var(--gutter);
  color: var(--muted);
}

.noscript {
  display: grid;
  gap: 1rem;
  width: min(100% - 2rem, 640px);
  margin: 3rem auto;
}

.noscript a {
  color: var(--gold);
}

/* ---------- motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 22px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@keyframes twinkle {
  from {
    opacity: 0.45;
  }

  to {
    opacity: 0.9;
  }
}

@keyframes hint {
  0%,
  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__text > *,
  .hero__portrait {
    animation: rise 900ms var(--ease) both;
  }

  .hero__portrait {
    animation-delay: 120ms;
  }

  .hero__text > :nth-child(2) {
    animation-delay: 60ms;
  }

  .hero__text > :nth-child(3) {
    animation-delay: 120ms;
  }

  .hero__text > :nth-child(4) {
    animation-delay: 200ms;
  }

  .hero__text > :nth-child(5) {
    animation-delay: 280ms;
  }

  .hero__text > :nth-child(6) {
    animation-delay: 360ms;
  }

  /* Sections rise in as they scroll into view (assets/script.js adds the classes). */
  .reveal-ready .reveal {
    opacity: 0;
  }

  .reveal-ready .reveal.is-in {
    animation: rise 800ms var(--ease) var(--delay, 0ms) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

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

@media (max-width: 480px) {
  .hero__actions .button--primary {
    flex: 1 1 100%;
  }

  .feature__actions .button {
    flex: 1 1 auto;
  }

  .day__actions .button {
    flex: 1 1 auto;
  }
}
