:root {
  color-scheme: dark;
  --sky-top: #0b152d;
  --sky-mid: #122341;
  --sky-bottom: #1d2f51;
  --text: #e8eef6;
  --secondary: #9aabc0;
  --faint: #6d7c90;
  --link: #b7cbe4;
  --border: #2a3342;
  --surface: #141a22;
  --pill: #d5deea;
  --accent: #ffb15a;
  --night: 1;
  --shadow: 0.14;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --spring: cubic-bezier(0.16, 1.12, 0.3, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --dock-offset: calc(1rem + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: clip; }
html {
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 46%, var(--sky-bottom) 78%);
}
body {
  position: relative;
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.011em;
  color: var(--text);
  background: transparent;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  overflow: clip;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 75%, transparent);
  outline-offset: 3px;
  border-radius: 10px;
}
.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;
}

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.view {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease);
}
.view.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.view-home {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(0.75rem, 3vh) 1.25rem 0.25rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 7.25rem), transparent calc(100% - 3.1rem));
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 7.25rem), transparent calc(100% - 3.1rem));
}
.stage-wrap {
  position: relative;
  flex: 0 1 auto;
  width: min(640px, 96vw);
  height: min(420px, 46vh);
  min-height: 140px;
}
.hero {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 16px;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.hero img.is-out {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

.copy {
  width: min(38rem, 100%);
  text-align: center;
  margin-top: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bio {
  margin: 0;
  flex: 0 0 auto;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}
.bio.is-swap { animation: rise 0.45s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.text-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  font: inherit;
  border-radius: 6px;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.sample {
  color: var(--faint);
  font-size: 0.75rem;
  margin-left: 0.3rem;
  letter-spacing: 0.01em;
}
.work {
  margin-top: 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.work-label {
  margin: 0 0 0.7rem;
  flex: 0 0 auto;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--faint);
}
.work-label a {
  color: inherit;
  text-decoration: none;
}
.work-label a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.work-list {
  list-style: none;
  margin: 0;
  padding: 0.9rem 0 3rem;
  text-align: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.35rem, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 1.35rem, #000 100%);
}
.work-list::-webkit-scrollbar { display: none; }
.work-list li { margin: 0.28rem 0; font-size: 1.2rem; }
.job-title { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
.job-title .year { font-weight: 500; color: var(--secondary); }
.address {
  display: block;
  margin-top: 0.55rem;
  color: var(--secondary);
  font-size: 1.0625rem;
}
.foot {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: var(--dock-offset);
  transform: translateX(-50%);
  margin: 0;
  color: var(--secondary);
  font-size: 0.9375rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  white-space: nowrap;
}
.foot a { color: var(--secondary); }
.foot a:hover { color: var(--link); }
.dot { color: var(--faint); }

.view-timeline {
  display: flex;
  align-items: center;
  overflow: hidden;
}
.strip {
  --card-w: 280px;
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
  width: 100%;
  height: 100%;
  overflow-x: auto;
  padding: 0 max(8vw, calc(50% - var(--card-w) / 2)) calc(var(--dock-offset) + 3.5rem);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.strip::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 var(--card-w);
  scroll-snap-align: center;
  border: 0;
  background: none;
  padding: 0.4rem 0;
  text-align: center;
  border-radius: 16px;
}
.poster {
  display: block;
  width: var(--card-w);
  aspect-ratio: 1;
  margin: 0 auto;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.45s var(--ease);
}
.card:hover img, .card.is-current img { transform: translateY(-4px); }
.when {
  color: var(--link);
  font-size: 1.0625rem;
  margin: 0 0 0.85rem;
}
.name { margin: 0.55rem 0 0; font-size: 1.25rem; font-weight: 500; color: var(--text); }
.meta { margin: 0.2rem 0 0; color: var(--secondary); font-size: 1.0625rem; }
.card .with { margin: 0.12rem 0 0; color: var(--faint); font-size: 0.9375rem; }
.empty {
  margin: auto;
  color: var(--secondary);
  text-align: center;
  width: 100%;
}

.scrubber {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(var(--dock-offset) + 3.35rem);
  transform: translateX(-50%);
  width: min(420px, 70vw);
  height: 40px;
  touch-action: none;
  cursor: ew-resize;
  display: none;
}
body[data-mode="timeline"] .scrubber { display: block; }
.tick {
  position: absolute;
  bottom: 10px;
  width: 1px;
  height: 8px;
  background: color-mix(in srgb, var(--text) 32%, transparent);
  border-radius: 1px;
}
.tick.month {
  height: 16px;
  bottom: 6px;
  background: color-mix(in srgb, var(--text) 58%, transparent);
}
.tick.has { background: color-mix(in srgb, var(--text) 70%, transparent); }
.playhead {
  position: absolute;
  bottom: 4px;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  background: var(--text);
  border-radius: 1px;
  pointer-events: none;
}
.scrub-label {
  position: absolute;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--pill);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
.ring {
  position: fixed;
  z-index: 8;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  display: none;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--text) 40%, transparent);
  place-items: center;
  font-size: 0.72rem;
  text-align: center;
  padding: 0.4rem;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.ring:not([hidden]) { display: grid; }

.view-map { background: var(--sky-bottom); }
#map { position: absolute; inset: 0; }
.map-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--secondary);
  z-index: 1;
  margin: 0;
}
.map-note[hidden] { display: none; }
.maplibregl-ctrl-bottom-right {
  bottom: calc(var(--dock-offset) + 2.4rem) !important;
  right: 0.75rem !important;
}
.maplibregl-ctrl-attrib {
  background: transparent !important;
  font-size: 10px;
}
.maplibregl-ctrl-attrib a { color: var(--secondary) !important; }
.map-compass, .map-proj {
  position: absolute;
  z-index: 3;
  top: max(0.85rem, env(safe-area-inset-top));
}
.map-compass { left: 0.9rem; }
.map-proj { right: 0.9rem; display: flex; gap: 0.4rem; align-items: flex-start; }
.compass-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--pill);
  display: grid;
  place-items: center;
}
.compass-btn svg { width: 22px; height: 22px; }
.minimap {
  width: 150px;
  height: 108px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  border: 2px solid color-mix(in srgb, white 65%, transparent);
}
.minimap.maplibregl-map { position: relative; }
.range {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--dock-offset) + 3.15rem);
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(12px);
}
.range button {
  width: 22px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 28%, transparent);
}
.range button.is-on {
  width: 48px;
  background: #ff9500;
}
.pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
.pin img {
  width: 54px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(3, 20, 40, 0.18)) brightness(calc(1 - var(--night) * 0.35));
  pointer-events: none;
}
.pin span, .city-pill {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pill);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--text) 10%, transparent);
}
.city-pill { font-size: 13px; padding: 0.28rem 0.65rem; }

.dock {
  position: fixed;
  z-index: 10;
  bottom: var(--dock-offset);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dock-left { left: 1rem; }
.dock-right { right: 1rem; }
.pill {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(16px) saturate(1.45);
  -webkit-backdrop-filter: blur(16px) saturate(1.45);
  box-shadow:
    inset 0 0 0 0.5px color-mix(in srgb, var(--text) 12%, transparent),
    0 8px 28px rgba(3, 20, 40, 0.08);
}
.pill button, .icon-btn {
  border: 0;
  background: transparent;
  color: var(--pill);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.2;
}
.pill button:hover, .icon-btn:hover { color: var(--text); }
.pill button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.split {
  width: 1px;
  align-self: stretch;
  margin: 0.4rem 0.05rem;
  background: color-mix(in srgb, var(--text) 14%, transparent);
}
.clock-readout {
  font-variant-numeric: tabular-nums;
  min-width: 4.6rem;
  display: inline-block;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: var(--pill);
}
.clock-readout.is-preview { color: var(--accent); }
#search {
  border: 0;
  background: transparent;
  width: 0;
  padding: 0;
  outline: none;
  color: var(--text);
  transition: width 0.35s var(--ease), padding 0.35s var(--ease);
}
#search.is-open { width: min(11rem, 42vw); padding: 0 0.7rem 0 0.35rem; }

body[data-mode="home"] .map-compass,
body[data-mode="home"] .map-proj,
body[data-mode="home"] .range,
body[data-mode="timeline"] .map-compass,
body[data-mode="timeline"] .map-proj,
body[data-mode="timeline"] .range { display: none; }

.noscript {
  position: fixed;
  inset: auto 1rem 5rem;
  text-align: center;
  color: var(--text);
}

@media (max-width: 720px) {
  .view-home {
    padding: 0.2rem 0 0.2rem;
  }
  .stage-wrap {
    width: 100%;
    height: clamp(180px, 38vh, 420px);
    min-height: 140px;
  }
  .copy { padding-inline: 1.15rem; }
  .foot {
    left: 0.75rem;
    right: 7.6rem;
    width: auto;
    transform: none;
    justify-content: flex-start;
  }
  .copy { width: 100%; }
  .bio { font-size: 1.5rem; line-height: 1.45; }
  .address { font-size: 1.125rem; }
  .work { margin-top: 1.65rem; }
  .work-label { font-size: 1.25rem; }
  .work-list li { font-size: 1.25rem; margin: 0.35rem 0; }
  .strip { --card-w: min(92vw, 420px); gap: 1.75rem; }
  .when { font-size: 1.125rem; }
  .name { font-size: 1.375rem; }
  .meta { font-size: 1.125rem; }
  .card .with { font-size: 1rem; }
  .dock { gap: 0.28rem; }
  .dock-left { left: 0.4rem; }
  .dock-right { right: 0.4rem; }
  .pill { padding: 0.12rem; }
  .pill button { padding: 0.34rem 0.52rem; font-size: 0.78rem; }
  .icon-btn { width: 34px; height: 34px; }
  .clock-readout { min-width: 0; font-size: 0.75rem; padding-inline: 0.42rem; }
  #lang-btn { padding-inline: 0.42rem; }
  .minimap { width: 104px; height: 78px; }
  .scrubber { width: min(420px, 78vw); bottom: calc(var(--dock-offset) + 3.1rem); }
  .map-proj { flex-direction: column; align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .view { transform: none; }
}
