:root {
  --paper:      #f7f7f5;
  --ink:        #16181c;
  --muted:      #6e7278;
  --hairline:   #dcddd8;
  --qualifier:  #464b52;
  --accent:     #1c4f4a;
  --plate-bg:   #eceeea;
  --shroud:     rgba(22, 24, 28, .93);

  --rail-x: 15.5rem;      /* distance from grid start to the rule */
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #101418;
    --ink:      #e8e6e1;
    --muted:    #8d9298;
    --hairline: #262c33;
    --qualifier: #b6bbc1;
    --accent:   #78bfb6;
    --plate-bg: #1a2027;
    --shroud:   rgba(6, 9, 12, .95);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- masthead ---------- */

.masthead {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(4rem, 14vh, 9rem) 1.5rem clamp(3.5rem, 9vh, 6rem);
}

.eyebrow {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.masthead h1 {
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.75rem);
  line-height: .92;
  letter-spacing: -.035em;
  margin: 0;
}

.h1-sub {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: -.025em;
}

.span-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.25rem 0 2rem;
  max-width: 22rem;
}

.span-year {
  font-family: "Archivo", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: .9375rem;
  letter-spacing: .04em;
  color: var(--accent);
}

.span-rule {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.dek {
  max-width: var(--measure);
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- timeline ---------- */

.timeline {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem clamp(5rem, 12vh, 9rem);
}

/* the rule, and the accent that fills it as you read */
.rail {
  position: absolute;
  left: calc(1.5rem + var(--rail-x));
  top: 0;
  bottom: clamp(5rem, 12vh, 9rem);
  width: 1px;
  background: var(--hairline);
}

.rail-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  background: var(--accent);
  opacity: .55;
}

.entry {
  display: grid;
  grid-template-columns: var(--rail-x) 1fr;
  column-gap: 3.25rem;
  padding-block: clamp(2.5rem, 5vh, 3.75rem);
  position: relative;
}

.entry:first-child { padding-top: 0; }

/* elapsed-time markers in the gutter — the silences are part of the record */
.entry[data-gap]::before {
  content: attr(data-gap) " years";
  position: absolute;
  left: calc(var(--rail-x) + .875rem);
  top: 0;
  transform: translateY(-50%);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .55;
  background: var(--paper);
  padding: .25rem .5rem .25rem .25rem;
  white-space: nowrap;
}

/* the diamond where a year meets the rule */
.year-col::after {
  content: "";
  position: absolute;
  left: var(--rail-x);
  top: calc(clamp(2.5rem, 5vh, 3.75rem) + .78em);
  width: 7px;
  height: 7px;
  margin-left: -3px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--paper);
  border: 1px solid var(--muted);
  transition: background-color .45s ease, border-color .45s ease;
}

.entry:first-child .year-col::after { top: .78em; }

.entry.is-passed .year-col::after {
  background: var(--accent);
  border-color: var(--accent);
}

.year-col {
  text-align: right;
  padding-right: 1.75rem;
}

.year {
  font-family: "Archivo", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.75rem, 3.1vw, 2.5rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
}

.qualifier {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--qualifier);
  margin: .625rem 0 0;
}

.body-col { max-width: var(--measure); padding-top: .1rem; }

.body-col p {
  margin: 0 0 1rem;
}

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

/* ---------- plates ---------- */

.plates {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-top: 1.75rem;
}

.plate {
  padding: 0;
  border: 0;
  background: var(--plate-bg);
  cursor: pointer;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}

.plate img {
  width: auto;
  height: 11rem;
  max-width: 15rem;
  object-fit: cover;
  transition: opacity .35s ease;
}

.plate:hover, .plate:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.45);
}

.plate:hover img { opacity: .88; }

/* ---------- more family genealogy ---------- */

.more {
  display: grid;
  grid-template-columns: var(--rail-x) 1fr;
  column-gap: 3.25rem;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 7vh, 5rem);
}

.more-heading {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--qualifier);
  text-align: right;
  padding-right: 1.75rem;
  margin: 0;
  padding-top: 1.375rem;
}

.docs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.doc {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.125rem 0;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  color: var(--ink);
  transition: color .25s ease;
}

.docs li:last-child .doc { border-bottom: 1px solid var(--hairline); }

.doc-name { font-size: 1.125rem; }

.doc-kind {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--muted);
  flex: none;
  transition: color .25s ease;
}

.doc:hover, .doc:focus-visible { color: var(--accent); }
.doc:hover .doc-kind, .doc:focus-visible .doc-kind { color: var(--accent); }

/* ---------- colophon ---------- */

.colophon {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  border-top: 1px solid var(--hairline);
}

.colophon p {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--shroud);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 3.5rem);
  animation: fade .2s ease;
}

.lightbox[hidden] { display: none; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.lightbox-figure {
  margin: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-figure figcaption {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #b9bec4;
  text-align: center;
}

.lightbox-figure figcaption:empty { display: none; }

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .625rem 1.125rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.lightbox-close:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); }

html.is-locked, body.is-locked { overflow: hidden; }

/* ---------- mobile ---------- */

@media (max-width: 46rem) {
  .rail { display: none; }

  .entry {
    display: block;
    padding-block: 2.5rem;
  }

  .entry[data-gap]::before,
  .year-col::after { display: none; }

  .year-col {
    text-align: left;
    margin-bottom: 1rem;
  }

  .year { font-size: 2.125rem; }

  .qualifier { margin-top: .375rem; }

  .plate img { height: 8.5rem; max-width: 11rem; }

  .plates { gap: .625rem; }

  .more { display: block; }

  .more-heading {
    text-align: left;
    padding: 0 0 .5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
