:root {
  --color-bg: #F1E3E4;
  --color-text: #534156;
  --color-muted: #666;
  --color-border: #534156;
  --color-surface: #F1E3E4;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);
  --max-width: 720px;
  --space: 1.5rem;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.hero,
.section,
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--space) * 3) var(--space);
}

/* Hero */
.hero {
  padding-top: calc(var(--space) * 5);
  padding-bottom: calc(var(--space) * 3);
  border-bottom: 2px solid var(--color-border);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--color-muted);
}

/* Sections */
.section {
  border-bottom: 1px solid var(--color-border);
}

.section h2 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: calc(var(--space) * 1.5);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--color-muted);
  padding-top: 0.15rem;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
}

.timeline-content p {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.timeline-location {
  font-size: 0.85rem;
  font-style: italic;
}

.timeline-subtitle {
  font-style: italic;
}

.timeline-subrole {
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-surface);
}

.timeline-subrole:first-of-type {
  border-top: none;
  padding-top: 0.25rem;
}

.subrole-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.subrole-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.subrole-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.subrole-date {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.timeline-content ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.timeline-content li {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space);
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--color-surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--color-border);
  transition: opacity 0.15s;
}

.card:hover .card-image {
  opacity: 0.7;
}

.card h3 {
  margin-top: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.card p {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Overlay (checkbox hack) */
.overlay-toggle {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}

.overlay-toggle:checked ~ .overlay {
  visibility: visible;
  opacity: 1;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.overlay-panel {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
}

.overlay-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--color-surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.overlay-body {
  padding: var(--space);
}

.overlay-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.overlay-body p {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.overlay-body p:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  border-bottom: none;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

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

  .overlay-panel {
    width: 95%;
  }
}
