:root {
  --bg-top: #f8fafd;
  --bg-bottom: #eef2f7;
  --surface: rgba(255, 255, 255, 0.82);
  --card: #ffffff;
  --text: #0f1728;
  --muted: #4a576d;
  --line: #d7dfeb;
  --line-strong: #c3cede;
  --accent: #103f97;
  --accent-strong: #0a2f73;
  --accent-soft: rgba(16, 63, 151, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 30px rgba(15, 23, 40, 0.08);
  --shadow-lift: 0 16px 38px rgba(15, 23, 40, 0.12);
  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--text);
  font-family: "Public Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at 8% 0%, rgba(16, 63, 151, 0.13), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(9, 120, 94, 0.07), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

a {
  color: inherit;
}

button {
  font: inherit;
}

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

/* ── Shell ── */

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  transition: opacity 200ms var(--easing);
}

.site-header.header-hidden {
  opacity: 0;
  pointer-events: none;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(140deg, #0f3a8f 0%, #1f62d0 100%);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 0.92rem;
}

.brand-copy small {
  font-size: 0.74rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 14px;
}

.ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: color 160ms var(--easing);
}

.ghost-link:hover,
.ghost-link:focus-visible {
  color: var(--accent-strong);
}

/* ── Main layout ── */

main {
  display: grid;
  gap: 24px;
}

/* ── Hero ── */

.hero-intro {
  padding: 28px 0 4px;
}

.hero-intro h1 {
  margin: 0 0 8px;
  font-family: "Merriweather", Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 3.4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ── People row ── */

.people-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
  max-width: 100%;
}

.people-row::-webkit-scrollbar {
  display: none;
}

.person-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 180ms var(--easing), box-shadow 180ms var(--easing), background 180ms var(--easing);
}

.person-chip:hover,
.person-chip:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.person-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(16, 63, 151, 0.3);
}

.person-chip-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
}

.person-chip-avatar-photo {
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #ffffff;
}

.person-chip-avatar-initials {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.person-chip.active .person-chip-avatar-initials {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.person-chip-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.person-chip-count {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.6;
}

/* ── Chronology ── */

.chronology-section {
  min-height: 120px;
}

.chronology-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chronology-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.chronology-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.timeline-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
}

.timeline-empty p {
  margin: 0;
  line-height: 1.6;
}

/* ── Timeline ── */

.timeline-list {
  position: relative;
  display: grid;
  gap: 0;
  min-width: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 0;
  padding-bottom: 12px;
  min-width: 0;
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 420ms var(--easing) forwards;
  animation-delay: calc(min(var(--item-index, 0), 12) * 30ms);
}

/* Vertical connector line */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 99px;
  width: 2px;
  background: var(--line);
}

.timeline-item:first-child::before {
  top: 18px;
}

.timeline-item:last-child::before {
  bottom: 50%;
}

.timeline-age {
  position: sticky;
  top: 64px;
  z-index: 3;
  align-self: start;
  display: grid;
  justify-items: end;
  gap: 0;
  padding-top: 6px;
  padding-right: 20px;
  text-align: right;
}

.age-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 1px;
}

.timeline-item.scroll-active .age-label {
  color: var(--accent);
}

/* Node dot — real element so it inherits sticky from .timeline-age */
.timeline-dot {
  position: absolute;
  right: -7px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line-strong);
  transition: border-color 200ms var(--easing), background 200ms var(--easing), transform 200ms var(--easing);
}

.timeline-item.scroll-active .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.25);
}

.age-primary {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.age-secondary {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.timeline-entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-left: 14px;
  min-width: 0;
  transition: border-color 200ms var(--easing), box-shadow 200ms var(--easing);
}

.timeline-entry:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

/* Active entry highlight */
.timeline-item.scroll-active .timeline-entry {
  border-color: rgba(16, 63, 151, 0.35);
  box-shadow: 0 8px 24px rgba(16, 63, 151, 0.12);
}

.timeline-item.scroll-active .age-primary {
  color: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(74, 87, 109, 0.7);
}

.timeline-title {
  margin: 7px 0 6px;
  font-size: 1.08rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.co-guests {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-summary {
  margin: 0 0 10px;
  max-width: 74ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.link-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.topic-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15, 23, 40, 0.06);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.link-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 150ms var(--easing), border-color 150ms var(--easing), transform 150ms var(--easing);
}

.link-button:hover,
.link-button:focus-visible {
  transform: translateY(-1px);
}

.link-watch {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.link-watch:hover,
.link-watch:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.link-read {
  color: var(--text);
}

.link-read:hover,
.link-read:focus-visible {
  color: var(--accent-strong);
  border-color: rgba(16, 63, 151, 0.36);
}

/* ── About ── */

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

.about-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.about-card h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ── Footer ── */

.site-footer {
  padding: 8px 2px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
  line-height: 1.55;
}

/* ── Scroll context bar ── */

.scroll-context-bar {
  position: fixed;
  top: 12px;
  left: 20px;
  right: 20px;
  max-width: 1120px;
  margin: 0 auto;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 40, 0.18);
  background: rgba(15, 23, 40, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--easing);
}

.scroll-context-bar.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-context-person {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

.scroll-context-sep {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.scroll-context-detail {
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .timeline-item {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .person-chip,
  .link-button,
  .timeline-entry,
  .timeline-dot,
  .ghost-link,
  .scroll-context-bar,
  .site-header {
    transition: none;
  }
}

@media (max-width: 980px) {
  .timeline-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .timeline-item::before {
    left: 55px;
  }

  .timeline-item:first-child::before {
    top: 18px;
  }

  .timeline-age {
    padding-right: 12px;
  }

  .timeline-dot {
    right: -7px;
  }

  .age-secondary {
    display: none;
  }

  .timeline-entry {
    margin-left: 12px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 10px 12px 48px;
  }

  .site-header {
    top: 6px;
    border-radius: 16px;
    padding: 8px 12px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.68rem;
  }

  .brand-copy strong {
    font-size: 0.8rem;
  }

  .brand-copy small {
    display: none;
  }

  .scroll-context-bar {
    top: 6px;
    left: 12px;
    right: 12px;
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 0.76rem;
  }

  .header-actions {
    display: none;
  }

  main {
    gap: 14px;
  }

  .hero-intro {
    padding: 12px 0 0;
  }

  .hero-intro h1 {
    font-size: 1.35rem;
    max-width: none;
  }

  .hero-text {
    font-size: 0.82rem;
  }

  .person-chip {
    padding: 6px 12px 6px 6px;
    gap: 8px;
  }

  .person-chip-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .person-chip-name {
    font-size: 0.8rem;
  }

  .person-chip-count {
    font-size: 0.72rem;
  }

  .chronology-header h2 {
    font-size: 1.1rem;
  }

  .chronology-summary {
    font-size: 0.78rem;
  }

  .chronology-header {
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
  }

  .timeline-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .timeline-item::before {
    left: 43px;
  }

  .timeline-item:first-child::before {
    top: 16px;
  }

  .timeline-age {
    top: 48px;
    padding-right: 8px;
  }

  .timeline-dot {
    right: -7px;
    width: 10px;
    height: 10px;
  }

  .age-label {
    font-size: 0.5rem;
  }

  .age-primary {
    font-size: 0.72rem;
  }

  .age-secondary {
    display: none;
  }

  .timeline-entry {
    margin-left: 10px;
    padding: 12px;
  }

  .timeline-title {
    font-size: 0.92rem;
    margin: 5px 0 4px;
  }

  .timeline-meta {
    font-size: 0.7rem;
    gap: 4px;
  }

  .timeline-summary {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }

  .co-guests {
    font-size: 0.76rem;
  }

  .topic-chip {
    font-size: 0.68rem;
    min-height: 22px;
    padding: 0 7px;
  }

  .topic-row,
  .link-row {
    gap: 5px;
  }

  .link-button {
    font-size: 0.76rem;
    min-height: 30px;
    padding: 0 9px;
  }

  .about-card {
    padding: 14px;
  }

  .about-card h3 {
    font-size: 0.85rem;
  }

  .about-card p {
    font-size: 0.8rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    font-size: 0.78rem;
  }
}
