/* ------------------------------------------------------------------
   Tatvam Dadheech — personal site
   Warm, quiet, type-first. One accent colour, used sparingly.
   ------------------------------------------------------------------ */

:root {
  --bg: #faf9f5;
  --ink: #1c1b18;
  --muted: #7a766c;
  --faint: #a8a49a;
  --line: #e7e4db;
  --card: #ffffff;
  --accent: #b0492c;
  --accent-soft: #b0492c22;
  --ocean: #6a777b;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Dark palette twice: once for system preference (unless light is pinned),
   once for the explicit toggle. Keep the two blocks in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --ink: #eae7de;
    --muted: #97938a;
    --faint: #6b675f;
    --line: #292722;
    --card: #1b1a15;
    --accent: #d97757;
    --accent-soft: #d9775726;
    --ocean: #8f9da1;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f;
  --ink: #eae7de;
  --muted: #97938a;
  --faint: #6b675f;
  --line: #292722;
  --card: #1b1a15;
  --accent: #d97757;
  --accent-soft: #d9775726;
  --ocean: #8f9da1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 44rem; margin: 0 auto; padding: 0 1.5rem; }
.container.wide { max-width: 60rem; }

a { color: inherit; }

::selection { background: var(--accent-soft); }

/* ---- type helpers ---- */

.kicker {
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }

.link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.link:hover { color: var(--accent); border-color: var(--accent); }
.link .ext { font-size: 0.8em; color: var(--muted); }
.link:hover .ext { color: var(--accent); }

/* ---- header ---- */

.top { padding: 1.4rem 0; }
.top-inner { display: flex; align-items: baseline; justify-content: space-between; }
.wordmark {
  font: 600 1rem var(--serif);
  text-decoration: none;
  color: var(--ink);
}
.top-right { display: flex; align-items: center; gap: 1.3rem; }
.top-nav { display: flex; gap: 1.4rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem; height: 1.9rem;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--line); }
.theme-toggle:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* moon in light mode (click → dark), sun in dark mode (click → light) */
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.top-nav a {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.top-nav a:hover { color: var(--accent); }
.top-nav a[aria-current="page"] { color: var(--ink); }

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

.hero { padding: 5.5rem 0 6.5rem; }
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 3.6rem);
  line-height: 1.08;
  margin-bottom: 1.4rem;
}
.hero-lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 42rem;
}
.hero-lede + .hero-lede { margin-top: 0.9rem; }
.hero-lede strong { color: var(--ink); font-weight: 500; }

.currently {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}
.currently-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.currently dt {
  font: 500 0.7rem/1.6 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.currently dd { font-size: 0.95rem; }
.currently dd .aside { color: var(--muted); }

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

.section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { font-size: 1.9rem; line-height: 1.2; margin-bottom: 0.6rem; }
.section-head .section-sub { color: var(--muted); max-width: 34rem; font-size: 0.98rem; }

/* ---- pixel art ---- */

.pixel-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}
.pixel-frame {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 18rem;
}
.pixel-frame img {
  max-width: 100%;
  image-rendering: pixelated;
  display: block;
}
.pixel-caption {
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--faint);
}
.pixel-placeholder { text-align: center; color: var(--faint); }
.pixel-placeholder .px-grid {
  display: inline-grid;
  grid-template-columns: repeat(4, 14px);
  gap: 4px;
  margin-bottom: 1rem;
}
.pixel-placeholder .px-grid i {
  width: 14px; height: 14px;
  background: var(--line);
  animation: px-breathe 2.4s ease-in-out infinite;
}
.pixel-placeholder .px-grid i:nth-child(3n) { background: var(--accent-soft); }
.pixel-placeholder .px-grid i:nth-child(2) { animation-delay: 0.3s; }
.pixel-placeholder .px-grid i:nth-child(7) { animation-delay: 0.6s; }
.pixel-placeholder .px-grid i:nth-child(10) { animation-delay: 0.9s; }
.pixel-placeholder .px-grid i:nth-child(15) { animation-delay: 1.2s; }
@keyframes px-breathe { 50% { opacity: 0.35; } }
.pixel-placeholder p { font: 500 0.78rem/1.7 var(--mono); letter-spacing: 0.04em; }

/* ---- travel map ---- */

.map-wrap { position: relative; }
.map-svg { display: block; width: 100%; height: auto; }

.map-land { fill: var(--line); stroke: none; }
.map-route {
  fill: none;
  stroke: var(--faint);
  stroke-width: 0.8;
  stroke-dasharray: 3 4;
  stroke-linecap: round;
  opacity: 0.75;
}
.map-point { fill: var(--ink); transition: fill 0.15s ease; cursor: pointer; }
.map-point-hit { fill: transparent; cursor: pointer; }
.map-point-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
  pointer-events: none;
}
.map-node.is-target .map-point,
.map-node:hover .map-point,
.map-node:focus .map-point { fill: var(--accent); }
.map-node:focus { outline: none; }
.map-node.is-here .map-point-ring { opacity: 0.9; animation: ring-pulse 2.2s ease-out infinite; }
@keyframes ring-pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.map-node .map-point-ring { transform-origin: center; transform-box: fill-box; }

.map-label {
  font: 500 8.5px var(--mono);
  letter-spacing: 0.06em;
  fill: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  text-transform: lowercase;
}
.map-node:hover .map-label,
.map-node:focus .map-label,
.map-node.is-target .map-label { opacity: 1; }

.plane { fill: var(--accent); pointer-events: none; }

.map-popup {
  position: absolute;
  min-width: 11rem;
  max-width: 15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem 0.95rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.07);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 2;
}
.map-popup.is-open { opacity: 1; transform: translateY(0); }
.map-popup h3 { font: 600 1.05rem var(--serif); margin-bottom: 0.15rem; }
.map-popup .popup-years { font: 500 0.72rem/1.6 var(--mono); color: var(--accent); letter-spacing: 0.04em; }
.map-popup .popup-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.55; }

.map-footnote {
  margin-top: 1.5rem;
  font: 500 0.75rem/1.8 var(--mono);
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ---- travel map: zoomed country view ---- */

.world-layer, .country-layer { transition: opacity 0.55s ease; }
.country-layer { opacity: 0; }
.map-wrap.is-zoomed .world-layer { opacity: 0; pointer-events: none; }
.map-wrap.is-zoomed .country-layer { opacity: 1; }
.country-layer .map-label { opacity: 0.95; }   /* names always on, one level down */

.map-route--ferry { stroke: var(--muted); opacity: 0.9; }

.map-back {
  position: absolute;
  top: 0.6rem; left: 0.6rem;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;   /* keeps the hidden button out of the tab order */
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.15s ease,
              border-color 0.15s ease, visibility 0s linear 0.3s;
}
.map-wrap.is-zoomed .map-back {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.map-back:hover { color: var(--accent); border-color: var(--accent); }
.map-back:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.map-title {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease 0.25s, transform 0.3s ease 0.25s;
}
.map-wrap.is-zoomed .map-title { opacity: 1; transform: none; }
.map-title-name { display: block; font: 600 1.15rem var(--serif); }
.map-title-years {
  display: block;
  font: 500 0.68rem/1.6 var(--mono);
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ---- photographs: the film camera ---- */

.camera {
  max-width: 52rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.05);
}

/* top plate */
.camera-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.cam-dial {
  width: 30px; height: 30px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  position: relative;
  background: repeating-conic-gradient(var(--line) 0 12deg, transparent 12deg 24deg);
}
.cam-dial::after {   /* notch — makes the winding rotation visible */
  content: "";
  position: absolute;
  left: 50%; top: 3px;
  width: 2px; height: 10px;
  transform: translateX(-50%);
  background: var(--muted);
  border-radius: 1px;
}
.cam-dial--small { width: 20px; height: 20px; }
.cam-dial--small::after { height: 6px; top: 2px; }
.cam-vf {
  width: 44px; height: 26px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 4px;
  background: linear-gradient(135deg, var(--line), transparent 60%);
}
.cam-brand {
  margin-left: auto;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.cam-shutter {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.cam-shutter:hover { background: var(--accent); }
.cam-shutter:active { transform: translateY(1.5px) scale(0.96); }
.cam-shutter:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* body: prev | film gate | next */
.camera-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem;
}
.cam-side {
  width: 2rem; height: 4.5rem;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  color: var(--muted);
  font: 500 1.2rem/1 var(--sans);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.cam-side:hover { color: var(--accent); border-color: var(--accent); }
.cam-side:active { transform: scale(0.94); }
.cam-side:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* the film gate — film stays film-dark in both themes */
.cam-gate {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #211e18;
  border: 1px solid var(--line);
}
.film-strip {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.25, 0.9, 0.3, 1);
  will-change: transform;
}
.film-frame {
  flex: 0 0 100%;
  padding: 20px 14px;
  /* sprocket holes, top and bottom — periodic, so the moving strip reads
     as one continuous film */
  background-image:
    repeating-linear-gradient(90deg, transparent 0 12px, rgb(250 249 245 / 0.8) 12px 21px, transparent 21px 34px),
    repeating-linear-gradient(90deg, transparent 0 12px, rgb(250 249 245 / 0.8) 12px 21px, transparent 21px 34px);
  background-size: 100% 9px, 100% 9px;
  background-position: 7px 6px, 7px calc(100% - 6px);
  background-repeat: no-repeat, no-repeat;
}
.film-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
}
.film-blank {
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px dashed #4c473c;
  border-radius: 3px;
  padding: 1rem;
  text-align: center;
  color: #938c7c;
}
.film-blank p { font: 500 0.72rem/1.7 var(--mono); letter-spacing: 0.05em; }
.film-blank-num { font: 600 1.5rem var(--serif); color: #5c564a; }

/* shutter flash */
.cam-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.cam-flash.is-snap { animation: cam-snap 0.32s ease-out; }
@keyframes cam-snap { from { opacity: 0.8; } to { opacity: 0; } }

/* dials spin while the film winds */
.camera.is-advancing .cam-dial { animation: dial-spin 0.65s cubic-bezier(0.25, 0.9, 0.3, 1); }
.camera.is-advancing .cam-dial--small { animation-direction: reverse; }
@keyframes dial-spin { to { transform: rotate(200deg); } }

.cam-counter {
  margin-top: 1rem;
  text-align: center;
  font: 500 0.75rem/1.8 var(--mono);
  color: var(--faint);
  letter-spacing: 0.06em;
}

@media (max-width: 600px) {
  .camera-body { padding: 0.8rem; gap: 0.5rem; }
  .cam-side { width: 1.7rem; height: 3.6rem; }
  .cam-brand { display: none; }
}

/* ---- lately (live Spotify + Steam lists — js/live.js fills these) ---- */

/* two full-width bands, Spotify above Steam */
.lately-grid {
  display: grid;
  gap: 3rem;
}

.lately-label {
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

.lately-loading {
  font: 500 0.78rem/1.8 var(--mono);
  color: var(--faint);
  padding: 0.8rem 0;
}

.track-now {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.track-now-label {
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.25; } }
.track-now-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.45rem 0 0.6rem;
  font-size: 0.95rem;
}
.track-now-art {
  width: 2rem; height: 2rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.track-rank {
  font: 500 0.72rem/1.9 var(--mono);
  color: var(--faint);
}
.track-artist {
  font-size: 0.78rem;
  color: var(--muted);
}

/* spotify band: a row of album cards */
.track-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1.2rem;
}
.track-card { min-width: 0; }
.track-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 0.55rem;
}
.track-card-title {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.88rem;
  line-height: 1.4;
}
.track-card .track-artist { margin-top: 0.15rem; }

/* steam band: a row of capsule cards */
.steam-list {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 1.2rem;
}
.steam-card { min-width: 0; }
.game-art {
  width: 100%;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 0.55rem;
}
.steam-card-title {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.88rem;
  line-height: 1.4;
}
.steam-hours {
  font: 500 0.75rem/1.9 var(--mono);
  color: var(--accent);
  white-space: nowrap;
}

/* Artwork sits back into the paper — muted and slightly warm, waking to
   full colour on hover, like everything else on the site. */
.track-art, .game-art, .track-now-art {
  filter: saturate(0.6) contrast(0.94) sepia(0.08);
  opacity: 0.88;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.track-card:hover .track-art,
.steam-card:hover .game-art,
.track-now-title:hover .track-now-art {
  filter: none;
  opacity: 1;
}

/* thumbnail that failed to load → serif monogram in the same frame */
.art-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  font: 500 1.6rem var(--serif);
  color: var(--faint);
}

/* ---- games ---- */

.fav-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 1.8rem 2rem;
  margin-bottom: 3rem;
}
.fav-card .fav-tag {
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.fav-card h3 {
  font: 600 clamp(1.6rem, 4vw, 2.1rem) var(--serif);
  margin: 0.55rem 0 0.3rem;
}
.fav-card .fav-meta { color: var(--muted); font-size: 0.92rem; }
.fav-mentions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  align-items: baseline;
}
.fav-mentions .mention-label {
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* live "recently played" strip (js/live.js — only when /api/steam answers) */
.recent-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  align-items: baseline;
  margin: -1.6rem 0 3rem;    /* tucks under the favourite card */
  padding: 0 0.2rem;
  font-size: 0.9rem;
}
.recent-strip .mention-label {
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.recent-hours {
  font: 500 0.68rem/1 var(--mono);
  color: var(--faint);
  letter-spacing: 0.05em;
  white-space: nowrap;   /* long game NAMES may wrap; the hours don't */
}

.timeline { position: relative; }

/* ---- timeline page: thread tabs ---- */

.tl-tabs {
  display: flex;
  gap: 1.7rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
}
.tl-tab {
  display: inline-flex;
  gap: 0.45rem;
  align-items: baseline;
  padding: 0 0 0.8rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tl-tab:hover { color: var(--accent); }
.tl-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tl-tab:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.tl-soon-tag {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.tl-panel { position: relative; }
.tl-soon {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--faint);
  font: 500 0.78rem/1.8 var(--mono);
  letter-spacing: 0.05em;
}

/* the timeline's little companion — walks an invisible track down the
   games thread; a single dot marks each decade heading */
.timeline-rail {
  position: absolute;
  left: -1.1rem;
  top: 0.4rem; bottom: 4.6rem;   /* heading top → just above the footnote */
  width: 2px;                    /* invisible — just the sprite's track */
}
.timeline-dot {
  position: absolute;
  left: calc(-1.1rem - 1px);
  width: 6px; height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.7;
  transition: opacity 0.25s ease;
}
.timeline-dot.is-near { opacity: 0; }   /* steps aside for the sprite */
.timeline-sprite {
  position: absolute;
  top: 0;
  left: -1px;
  width: 32px; height: 32px;
  transform: translateX(-50%);
  background: var(--muted);
  -webkit-mask: url("assets/pixel-art/timeline-walker.png") 0 0 no-repeat;
  mask: url("assets/pixel-art/timeline-walker.png") 0 0 no-repeat;
}
@media (max-width: 66rem) {
  .timeline-rail, .timeline-dot { display: none; }   /* no margin room */
}
.timeline-era { margin: 0 0 0.4rem; }
.timeline-era + .timeline-era { margin-top: 2.6rem; }
.era-label {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.era-label .era-count { letter-spacing: 0.05em; font-weight: 500; }

.game-row {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1.2rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.game-year {
  font: 500 0.78rem/1.9 var(--mono);
  color: var(--faint);
}
.game-main { min-width: 0; }
.game-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  align-items: baseline;
}
.game-name { font-weight: 500; font-size: 0.95rem; }
a.game-name {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a.game-name:hover { color: var(--accent); border-color: var(--accent); }
a.game-name .ext { font-size: 0.75em; color: var(--faint); }
a.game-name:hover .ext { color: var(--accent); }
.game-genre {
  font: 500 0.68rem/1.6 var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: lowercase;
}
.game-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.55; }

.games-footnote {
  margin-top: 2rem;
  font: 500 0.75rem/1.8 var(--mono);
  color: var(--faint);
  letter-spacing: 0.04em;
}
.games-footnote a { color: var(--muted); }
.games-footnote a:hover { color: var(--accent); }

/* ---- ocean backdrop (js/ocean.js) ---- */

.ocean {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  color: var(--ocean);
  opacity: 0.18;   /* watermark-quiet in daylight… */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ocean { opacity: 0.28; }   /* …deeper water at night */
}
:root[data-theme="dark"] .ocean { opacity: 0.28; }

/* creatures ride sinuous motion paths and pitch along them */
.ocean .o-mover {
  position: absolute;
  top: 0; left: 0;
  offset-rotate: auto;
  offset-distance: var(--rest, 40%);   /* the reduced-motion pose */
  animation: o-travel var(--dur) linear infinite;
  animation-delay: var(--delay);
}
.ocean .o-mover.upright { offset-rotate: 0deg; }   /* jellyfish, crab */
.ocean .o-mover.alt { animation-direction: alternate; animation-timing-function: ease-in-out; }
@keyframes o-travel {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}

.ocean svg { display: block; height: auto; }
.ocean .o-school { position: relative; }
.ocean .o-school span { display: block; }

/* secondary body motion, layered inside the travel animation */
.ocean .o-anim { display: inline-block; transform-origin: 50% 50%; }
.ocean .o-pitch { animation: o-pitch var(--wdur, 3s) ease-in-out infinite alternate; }
@keyframes o-pitch {
  from { transform: rotate(calc(-1 * var(--amp, 5deg))); }
  to   { transform: rotate(var(--amp, 5deg)); }
}
.ocean .o-flap { animation: o-flap var(--wdur, 4s) ease-in-out infinite alternate; }
@keyframes o-flap {
  from { transform: scaleY(0.85); }
  to   { transform: scaleY(1.08); }
}
.ocean .o-pulse { animation: o-pulse var(--wdur, 3.4s) ease-in-out infinite; }
@keyframes o-pulse {
  0%   { transform: scale(1, 1); }
  35%  { transform: scale(1.08, 0.9) translateY(2px); }
  70%  { transform: scale(0.94, 1.07) translateY(-2px); }
  100% { transform: scale(1, 1); }
}


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

.footer { border-top: 1px solid var(--line); padding: 2.2rem 0 3rem; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-note { font: 500 0.72rem/1.9 var(--mono); color: var(--faint); }

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

@media (max-width: 600px) {
  .top-inner { flex-wrap: wrap; gap: 0.4rem 1rem; }
  .top-right { gap: 0.9rem; }
  .top-nav { gap: 0.9rem; flex-wrap: wrap; }
  .hero { padding: 3.5rem 0 4.5rem; }
  .section { padding: 3.2rem 0; }
  .currently-row { grid-template-columns: 6rem 1fr; }
  .fav-card { padding: 1.4rem 1.4rem; }
  .game-row { grid-template-columns: 2.9rem 1fr; gap: 0.9rem; }
}
