:root {
  color-scheme: light;
  --background: #fbfaf7;
  --foreground: #0a0a0a;
  --muted: #74706a;
  --muted-panel: #f2f0eb;
  --border: #dedad2;
  --paper: #ffffff;
  --accent: #8c4d3f;
  --archive: #5d6f56;
  --amber: #9a6a34;
  --shadow: rgba(10, 10, 10, 0.08) 0 24px 80px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

img {
  max-width: 100%;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  display: flex;
  width: min(94vw, 860px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transform: translateX(-50%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  background: rgb(10 10 10 / 74%);
  padding: 9px 10px 9px 22px;
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-header nav a {
  border-radius: 999px;
  padding: 9px 14px;
  color: rgb(255 255 255 / 68%);
  font-size: 0.88rem;
}

.site-header nav a:hover {
  background: rgb(255 255 255 / 12%);
  color: white;
}

main {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px 16px 0;
}

.family-hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px 16px 0;
}

.research-hero {
  min-height: 86vh;
  padding: 16px 16px 0;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: calc(100vh - 16px);
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgb(10 10 10 / 18%), rgb(10 10 10 / 78%)),
    url("/record/marriage-page") center / cover;
  color: white;
  padding: clamp(92px, 9vw, 118px) clamp(34px, 5vw, 70px) clamp(34px, 5vw, 62px);
}

.family-hero-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: calc(100vh - 16px);
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgb(10 10 10 / 10%), rgb(10 10 10 / 76%)),
    url("/record/anna-twins-page") center / cover;
  color: white;
  padding: clamp(34px, 6vw, 78px);
}

.research-hero-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: calc(86vh - 16px);
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgb(10 10 10 / 8%), rgb(10 10 10 / 78%)),
    url("/record/jakub-death") center / cover;
  color: white;
  padding: clamp(34px, 6vw, 78px);
}

.document-hero .research-hero-copy {
  background:
    linear-gradient(180deg, rgb(10 10 10 / 8%), rgb(10 10 10 / 78%)),
    url("/record/ship-manifest") center / cover;
}

.letters-hero {
  min-height: 86vh;
  padding: 16px 16px 0;
}

.letters-hero .research-hero-copy {
  background:
    linear-gradient(180deg, rgb(10 10 10 / 8%), rgb(10 10 10 / 78%)),
    url("/record/family-tree-note-web") center / cover;
}

.letters-hero h1 {
  max-width: 860px;
  font-size: clamp(4rem, 10vw, 10rem);
  line-height: 0.86;
}

.lineage-hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px 16px 0;
}

.lineage-hero h1 {
  max-width: 720px;
  font-size: clamp(3.6rem, 7.6vw, 7.6rem);
  line-height: 0.88;
}

.login-body {
  min-height: 100vh;
  background: #16130f;
}

.login-main {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.login-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  overflow: hidden;
  padding: clamp(104px, 11vw, 132px) clamp(18px, 6vw, 88px) clamp(28px, 5vw, 72px);
  color: white;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgb(12 10 8 / 92%) 0%, rgb(12 10 8 / 62%) 46%, rgb(12 10 8 / 28%) 100%),
    url("/record/anna-twins-page") center / cover;
}

.login-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, transparent 0%, rgb(12 10 8 / 48%) 100%),
    radial-gradient(circle at 78% 18%, rgb(255 255 255 / 16%), transparent 34%);
}

.login-copy {
  max-width: 680px;
  align-self: end;
  padding-bottom: clamp(12px, 5vw, 84px);
}

.login-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(4.2rem, 9vw, 9rem);
  line-height: 0.86;
}

.login-copy p:not(.eyebrow) {
  max-width: 520px;
  margin: 26px 0 0;
  color: rgb(255 255 255 / 78%);
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  line-height: 1.55;
}

.login-panel {
  display: grid;
  gap: 12px;
  width: 100%;
  align-self: center;
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: 8px;
  background: rgb(255 255 255 / 92%);
  color: var(--foreground);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: rgb(0 0 0 / 24%) 0 24px 90px;
  backdrop-filter: blur(16px);
}

.login-panel-heading {
  margin-bottom: 10px;
}

.login-panel-heading .eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
}

.login-panel h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  line-height: 1;
}

.field-label {
  margin-top: 4px;
  color: #433d36;
  font-size: 0.82rem;
  font-weight: 800;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0c9bd;
  border-radius: 6px;
  background: #fffdf8;
  padding: 0 13px;
  color: var(--foreground);
  font: inherit;
}

.login-panel input[type="text"]:focus,
.login-panel input[type="password"]:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(140 77 63 / 18%);
}

.login-error {
  margin: 0;
  border: 1px solid rgb(140 77 63 / 28%);
  border-radius: 6px;
  background: rgb(140 77 63 / 10%);
  padding: 10px 12px;
  color: #74372c;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 8px;
  color: #5d574f;
  font-size: 0.88rem;
}

.remember-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.remember-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.login-row a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.login-panel button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: #0f0d0b;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.login-panel button:hover {
  background: #31251f;
}

.login-footnote {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(10 10 10 / 18%), transparent 55%);
  pointer-events: none;
}

.hero-copy > *,
.family-hero-copy > *,
.research-hero-copy > * {
  position: relative;
  z-index: 1;
}

.grain-overlay::before {
  content: "";
  position: absolute;
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.055;
  pointer-events: none;
}

.eyebrow,
.kind,
.years,
.place,
.fact-strip p,
footer {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.eyebrow {
  margin: 0 0 18px;
  color: color-mix(in srgb, var(--accent) 64%, white);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
li,
span,
strong {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5.25rem, 16vw, 16rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.76;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(4.6rem, 10.5vw, 10.6rem);
  line-height: 0.82;
}

.family-hero h1 {
  max-width: 820px;
  font-size: clamp(4rem, 10vw, 9.5rem);
  line-height: 0.82;
}

.research-hero h1 {
  max-width: 900px;
  font-size: clamp(4rem, 10vw, 9.5rem);
  line-height: 0.82;
}

.lede {
  max-width: 700px;
  margin: 30px 0 0;
  color: rgb(255 255 255 / 78%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.16rem, 2vw, 1.8rem);
  line-height: 1.28;
}

.hero-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-height: calc(100vh - 16px);
}

figure {
  margin: 0;
}

.hero-images figure {
  position: relative;
  overflow: hidden;
  background: #151515;
}

.hero-images img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.hero-images figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  background: rgb(255 255 255 / 88%);
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.family-hero-image {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 16px);
  min-height: calc(100vh - 16px);
  background: var(--muted-panel);
}

.family-hero-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.family-hero-image figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  background: rgb(255 255 255 / 88%);
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.fact-strip div {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  padding: 28px clamp(18px, 3vw, 42px);
}

.fact-strip div:last-child {
  border-right: 0;
}

.fact-strip p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fact-strip strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.person {
  min-height: 430px;
  padding: clamp(28px, 5vw, 74px);
  border-right: 1px solid var(--border);
  background: var(--background);
}

.person:last-child {
  border-right: 0;
}

.person h2,
.section-heading h2,
.notes h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.8vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

.years {
  margin: 18px 0 24px;
  color: var(--archive);
  font-weight: 800;
}

.person p:not(.years) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.62;
}

.person ul {
  max-width: 660px;
  margin: 28px 0 0;
  padding-left: 20px;
  color: var(--foreground);
  line-height: 1.62;
}

.timeline-section,
.records,
.notes,
.family-section,
.letter-section,
.document-index,
.sibling-section,
.letter-queue {
  padding: clamp(50px, 8vw, 110px) clamp(16px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.section-heading .eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
}

.family-heading {
  align-items: start;
}

.family-heading > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.65rem);
  line-height: 1.32;
}

.kin-grid,
.letter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kin-card,
.letter-grid article {
  min-height: 360px;
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 24px;
}

.kin-card h3,
.letter-grid h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.kin-card p:not(.kind),
.letter-grid p {
  color: var(--muted);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag-row span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--archive);
  font-size: 0.76rem;
  font-weight: 800;
}

.letter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.letter-grid article {
  min-height: 260px;
}

.letter-feature {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(42px, 7vw, 90px) clamp(16px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
}

.letter-feature figure {
  position: sticky;
  top: 88px;
  border: 1px solid var(--border);
  background: var(--paper);
}

.letter-feature img {
  width: 100%;
  display: block;
}

.letter-feature article {
  min-width: 0;
}

.letter-feature h2 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.letter-feature article > p:not(.kind) {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1.35;
}

.letters-pair {
  margin-top: 28px;
}

.letters-pair h3 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.letter-queue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.letter-queue-card {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  min-height: 560px;
  border: 1px solid var(--border);
  background: var(--paper);
}

.letter-queue-card img {
  width: 100%;
  height: 280px;
  display: block;
  border-bottom: 1px solid var(--border);
  object-fit: cover;
  object-position: center;
}

.letter-queue-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.letter-queue-card > .letter-page-stack {
  flex: none;
  padding: 0;
}

.letter-page-stack {
  display: grid;
  max-height: 980px;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: #eee9df;
}

.letter-page-stack a {
  display: block;
}

.letter-page-stack img {
  height: auto;
  border-right: 0;
  object-fit: contain;
}

.letter-meta {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.letter-meta div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
}

.letter-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.letter-meta dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.35;
}

.letter-queue-card .translation-pair {
  margin-top: 18px;
}

.letter-queue-card .translation-pair > section {
  min-height: 0;
}

.letter-queue-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.letter-queue-card p:not(.kind) {
  color: var(--muted);
  line-height: 1.55;
}

.letter-queue-card strong {
  margin-top: 8px;
  color: var(--archive);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.parent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.sibling-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 20px;
}

.sibling-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 2.7vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.sibling-card p:not(.kind):not(.years) {
  color: var(--muted);
  line-height: 1.55;
}

.sibling-meta {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.sibling-meta span,
.sibling-meta a,
.document-rail a,
.related-documents a {
  border: 1px solid var(--border);
  background: var(--muted-panel);
  padding: 10px 12px;
  color: var(--foreground);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.sibling-meta a:hover,
.document-rail a:hover,
.related-documents a:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.timeline li {
  display: grid;
  grid-template-columns: minmax(118px, 0.2fr) minmax(0, 1fr);
  min-height: 176px;
  border-bottom: 1px solid var(--border);
}

.timeline li::before {
  content: none;
}

.date {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  color: var(--foreground);
  font-size: clamp(1.45rem, 3vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.event {
  padding: 28px clamp(22px, 4vw, 58px);
}

.event h3,
.record-body h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.place {
  margin: 10px 0 16px;
  color: var(--archive);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event p:last-child,
.record-body p:last-child,
.notes p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.62;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.family-record-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-card {
  overflow: hidden;
  display: flex;
  min-height: 520px;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--paper);
}

.record-card a {
  display: block;
  height: 330px;
  background: var(--muted-panel);
  border-bottom: 1px solid var(--border);
}

.record-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.record-card a:hover img {
  transform: scale(1.035);
}

.record-body {
  padding: 20px;
}

.kind {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notes {
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
}

.markdown-page {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 92px) 16px clamp(64px, 9vw, 120px);
}

.markdown-page h1 {
  margin: 0 0 28px;
  color: var(--foreground);
  font-size: clamp(3rem, 8vw, 7rem);
}

.markdown-page h2 {
  margin: 64px 0 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.markdown-page h3 {
  margin: 34px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.markdown-page p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.markdown-page ul {
  margin: 14px 0 28px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.markdown-page li {
  position: relative;
  margin: 0;
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  line-height: 1.58;
}

.markdown-page li::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--archive);
}

.markdown-page code {
  border: 1px solid var(--border);
  background: var(--muted-panel);
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.document-main {
  width: min(100%, 1440px);
}

.document-title-block {
  padding: clamp(96px, 13vw, 170px) clamp(16px, 5vw, 80px) clamp(34px, 5vw, 70px);
  border-bottom: 1px solid var(--border);
}

.document-title-block h1 {
  max-width: 1100px;
  color: var(--foreground);
  font-size: clamp(3.4rem, 9vw, 9rem);
  line-height: 0.88;
}

.dark-lede {
  color: var(--muted);
}

.document-reader {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(24px, 4vw, 60px) clamp(16px, 5vw, 80px) clamp(60px, 8vw, 120px);
}

.document-scan {
  position: sticky;
  top: 88px;
  border: 1px solid var(--border);
  background: var(--paper);
}

.document-scan a {
  display: block;
  max-height: calc(100vh - 150px);
  overflow: auto;
  background: #171717;
}

.document-scan img {
  width: 100%;
  display: block;
}

.document-scan p {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.document-text {
  display: grid;
  gap: 20px;
}

.document-text section,
.document-status,
.translation-pair > section,
.related-documents {
  border: 1px solid var(--border);
  background: var(--paper);
  padding: clamp(18px, 3vw, 30px);
}

.document-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  background: var(--muted-panel);
}

.document-status span {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: normal;
}

.document-status strong {
  color: var(--archive);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.document-text h2,
.related-documents h2,
.document-rail h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.translation-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.translation-pair > section {
  min-height: 360px;
}

.original-block {
  background:
    linear-gradient(180deg, rgb(242 240 235 / 88%), rgb(255 255 255 / 96%)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(10 10 10 / 4%) 31px 32px);
}

.original-block li {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
}

.english-block {
  background: var(--paper);
}

.document-text p,
.document-text li {
  color: var(--muted);
  line-height: 1.65;
}

.transcript-block ul {
  margin: 0;
  padding-left: 20px;
}

.transcript-block li + li {
  margin-top: 10px;
}

.related-documents div,
.document-rail div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-group + .document-group {
  margin-top: clamp(54px, 7vw, 94px);
}

.document-list {
  display: grid;
  gap: 10px;
}

.document-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

.document-row:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.document-row > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 16px 18px 16px 0;
}

.document-row strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.document-row em {
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.document-row small {
  margin-top: 10px;
  color: var(--archive);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-thumb {
  min-height: 150px;
  border-right: 1px solid var(--border);
  background: var(--muted-panel);
}

.document-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.document-rail {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: clamp(50px, 8vw, 110px) clamp(16px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
}

footer {
  padding: 34px clamp(16px, 5vw, 80px) 52px;
  color: var(--muted);
  font-size: 0.86rem;
}

footer p {
  margin: 0 0 12px;
  color: var(--foreground);
  font-weight: 800;
}

footer ul {
  columns: 2;
  column-gap: 42px;
  margin: 0;
  padding-left: 18px;
}

footer li {
  break-inside: avoid;
  margin: 8px 0;
}

footer span {
  color: #8c887f;
}

@media (max-width: 980px) {
  .hero,
  .family-hero,
  .lineage-hero {
    grid-template-columns: 1fr;
  }

  .letter-feature {
    grid-template-columns: 1fr;
  }

  .letter-feature figure {
    position: static;
  }

  .hero-copy,
  .family-hero-copy,
  .research-hero-copy {
    min-height: 72vh;
  }

  .family-hero-image {
    height: 540px;
    min-height: 0;
  }

  .hero-images {
    min-height: 420px;
  }

  .fact-strip,
  .profiles,
  .notes {
    grid-template-columns: 1fr 1fr;
  }

  .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kin-grid,
  .letter-grid,
  .family-record-grid,
  .sibling-ledger,
  .letter-queue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-reader,
  .document-rail,
  .translation-pair {
    grid-template-columns: 1fr;
  }

  .document-scan {
    position: static;
  }

  .person:nth-child(2n),
  .fact-strip div:nth-child(2n) {
    border-right: 0;
  }

  .fact-strip div {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 680px) {
  .site-header {
    top: 10px;
    left: 10px;
    right: auto;
    width: calc(100dvw - 20px);
    gap: 8px;
    transform: none;
    padding: 8px 8px 8px 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-header::-webkit-scrollbar {
    display: none;
  }

  .brand {
    flex: 0 0 auto;
    max-width: 82px;
    font-size: 0.8rem;
  }

  .site-header nav {
    min-width: max-content;
    gap: 0;
  }

  .site-header nav a {
    padding: 8px 5px;
    font-size: 0.66rem;
  }

  .hero,
  .family-hero {
    gap: 10px;
    padding: 10px 10px 0;
  }

  .hero-copy,
  .family-hero-copy,
  .research-hero-copy {
    min-height: 76vh;
    padding: 88px 20px 26px;
  }

  .login-shell {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    align-items: end;
    gap: 22px;
    padding: 96px 14px 18px;
  }

  .login-backdrop {
    background:
      linear-gradient(180deg, rgb(12 10 8 / 58%) 0%, rgb(12 10 8 / 92%) 58%, rgb(12 10 8 / 96%) 100%),
      url("/record/anna-twins-page") center / cover;
  }

  .login-copy {
    align-self: end;
    padding: 0;
  }

  .login-copy h1 {
    max-width: 360px;
    font-size: clamp(3.45rem, 17vw, 5.4rem);
  }

  .login-copy p:not(.eyebrow) {
    max-width: 340px;
    margin-top: 16px;
    font-size: 0.98rem;
  }

  .login-panel {
    padding: 20px;
  }

  .login-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  h1 {
    font-size: clamp(4.55rem, 24vw, 7.2rem);
  }

  .hero h1 {
    font-size: clamp(4rem, 19vw, 6.4rem);
    line-height: 0.86;
  }

  .family-hero h1 {
    font-size: clamp(3.45rem, 17vw, 5.4rem);
    line-height: 0.86;
  }

  .research-hero h1 {
    font-size: clamp(3.45rem, 17vw, 5.4rem);
    line-height: 0.86;
  }

  .letters-hero h1 {
    font-size: clamp(3.2rem, 15vw, 5.4rem);
    line-height: 0.88;
  }

  .lineage-hero h1 {
    font-size: clamp(2.85rem, 13vw, 4.9rem);
    line-height: 0.9;
  }

  .lede {
    font-size: 1.22rem;
  }

  .hero-images {
    min-height: 360px;
    gap: 10px;
  }

  .family-hero-image {
    height: 480px;
    min-height: 0;
  }

  .fact-strip,
  .profiles,
  .notes,
  .record-grid,
  .kin-grid,
  .letter-grid,
  .family-record-grid,
  .sibling-ledger,
  .document-status {
    grid-template-columns: 1fr;
  }

  .fact-strip div,
  .person {
    border-right: 0;
  }

  .fact-strip div {
    min-height: 120px;
  }

  .person {
    min-height: 0;
    border-bottom: 1px solid var(--border);
    padding: 34px 22px;
  }

  .section-heading {
    display: block;
  }

  .timeline-section,
  .records,
  .notes,
  .family-section,
  .letter-section,
  .document-index,
  .sibling-section,
  .document-rail,
  .letter-queue,
  .letter-feature {
    padding: 42px 16px;
  }

  .family-heading > p {
    margin-top: 22px;
  }

  .kin-card,
  .letter-grid article,
  .letter-queue-card {
    min-height: 0;
    padding: 20px;
  }

  .letter-queue-card {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .letter-page-stack {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

  .date {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 22px 0 12px;
  }

  .event {
    padding: 20px 0 28px;
  }

  .record-card {
    min-height: 0;
  }

  .record-card a {
    height: 340px;
  }

  .document-title-block {
    padding: 100px 16px 34px;
  }

  .document-title-block h1 {
    font-size: clamp(3.2rem, 16vw, 5.8rem);
  }

  .document-reader {
    padding: 18px 16px 54px;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .document-row > span:last-child {
    padding: 0 16px 18px;
  }

  .document-thumb {
    height: 230px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .letter-feature h2 {
    font-size: clamp(2.6rem, 13vw, 5rem);
  }

  .letter-queue-grid {
    grid-template-columns: 1fr;
  }

  footer ul {
    columns: 1;
  }
}
