@font-face {
  font-family: "Editorial";
  src: local("Baskerville"), local("Baskerville Old Face"), local("Georgia");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #171916;
  --paper: #eeeae0;
  --muted: #9b9d91;
  --accent: #d6aa77;
  --line: #ffffff1c;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Editorial", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(ellipse at 20% 30%, #25291d48, transparent 55%), var(--background);
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button[hidden] { display: none; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
::selection { color: var(--background); background: var(--accent); }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--background);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell {
  width: min(100% - 112px, 1500px);
  min-height: 100svh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 15px; }
.brand-mark { font-family: var(--serif); font-size: 45px; line-height: 1; letter-spacing: -5px; padding-right: 5px; }
.brand-mark > span { color: var(--accent); }
.brand-name { text-transform: uppercase; font-size: 10px; font-weight: 500; line-height: 1.6; letter-spacing: 2.3px; }
.header-chapter { margin-left: -42px; text-transform: uppercase; letter-spacing: 2px; font-size: 9px; color: var(--muted); }
.header-chapter > span { margin-right: 13px; color: var(--accent); }

.animation-control, .text-link {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  justify-content: flex-end;
  min-width: 110px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #c6c7bb;
  font-size: 11px;
  letter-spacing: .3px;
  cursor: pointer;
}

svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.2; }
.animation-control svg { width: 17px; height: 17px; }
.animation-control:hover, .text-link:hover { color: var(--accent); }

.opening {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 7%;
  padding-block: clamp(18px, 2.6svh, 32px);
}

.opening-copy { position: relative; z-index: 1; padding-bottom: 5px; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 2.5px; font-size: 9px; line-height: 1.5; }
.small-rule { width: 27px; height: 1px; background: var(--accent); }

.introduction {
  margin-block: clamp(16px, 2.6svh, 28px) clamp(18px, 3svh, 30px);
  max-width: 100%;
  font-family: var(--serif);
  font-size: clamp(29px, 4.2svh, 42px);
  line-height: 1.15;
  letter-spacing: -.2px;
  color: #bfc0b2;
}

.intro-line { position: relative; margin: 0 0 .2em; }
.intro-line:last-child { margin-bottom: 0; }
.intro-typed { display: none; position: absolute; inset: 0; }
.is-animating .intro-full { opacity: 0; }
.is-animating .intro-typed { display: block; }
.typing-current::after { content: ""; display: inline-block; width: 1px; height: .85em; margin-left: 3px; background: var(--accent); animation: cursor-blink .8s steps(1) infinite; }

.reveal { opacity: 1; }
.is-animating .reveal { opacity: 0; }
.reveal h1 { margin: 0; font-weight: 400; }
.statement-line { display: block; font-size: clamp(38px, 6.35svh, 65px); line-height: .98; letter-spacing: -2.5px; }
.person-name { display: block; width: max-content; max-width: 100%; margin-top: .09em; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(42px, 7.6svh, 79px); line-height: 1.05; letter-spacing: -2.8px; color: var(--accent); }
.connecting-line { display: block; margin-top: clamp(10px, 1.8svh, 18px); font-family: var(--serif); font-size: clamp(17px, 2.5svh, 25px); line-height: 1.2; color: #bfc0b2; }
.second-name { margin-top: .04em; font-size: clamp(36px, 6svh, 65px); letter-spacing: -2px; }

.landscape { width: 100%; align-self: stretch; display: flex; flex-direction: column; margin: 0; min-height: 0; }
.landscape-image { position: relative; flex: 1; overflow: hidden; min-height: 380px; background: #454839; isolation: isolate; }
.landscape-image::after { position: absolute; inset: 0; z-index: 1; content: ""; pointer-events: none; background: linear-gradient(180deg, #13191124, transparent 30%, #10181012 55%, #13180ee0); box-shadow: inset 0 0 70px #13180b40; }
.landscape img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 49% 50%; filter: saturate(.55); }
.opening .landscape img { object-position: 49% top; }
.image-topline { position: absolute; z-index: 2; top: 24px; left: 25px; right: 25px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #f0efe1a8; text-transform: uppercase; font-size: 8px; letter-spacing: 2px; }
.image-topline svg { width: 23px; height: 23px; stroke-width: .8; opacity: .75; }
.image-caption { position: absolute; z-index: 2; left: 32px; right: 24px; bottom: 48px; display: flex; flex-direction: column; gap: 23px; color: #eeeededb; font-family: var(--serif); font-size: clamp(36px, 4vw, 58px); line-height: 1; letter-spacing: -1.5px; }
.opening .image-caption { font-size: clamp(54px, 6vw, 87px); }
.caption-rule { width: 31px; height: 1px; background: #e8e9cc82; }
.image-caption em { font-weight: 400; }
.image-caption-subtitle { font-size: clamp(38.25px, 3.825vw, 51.75px); line-height: 1.3; letter-spacing: 0; }
.image-index { position: absolute; z-index: 2; right: 26px; bottom: 26px; font-size: 9px; letter-spacing: 2px; color: #e1e7c17a; }
.landscape figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; color: #999e8980; }

.site-footer { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.chapter-progress { display: flex; align-items: center; gap: 9px; }
.chapter-number { margin-right: 14px; font-size: 11px; letter-spacing: 1.3px; color: var(--paper); white-space: nowrap; }
.chapter-number > span { color: #858a7b; font-size: 9px; }
.progress-segment { display: block; width: 30px; height: 2px; background: #5e63504d; }
.progress-segment.active { background: var(--accent); }
.progress-label { margin-left: 13px; font-size: 9px; color: var(--muted); letter-spacing: .4px; }
.next-chapter { display: flex; align-items: center; gap: 24px; }
.next-hint { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 15px; }
.next-button { display: flex; align-items: center; justify-content: space-between; gap: 38px; min-height: 46px; padding: 0 21px; color: #202219; background: var(--accent); font-size: 12px; font-weight: 500; transition: background .2s; }
.next-button svg { transition: transform .2s; }
.next-button:hover { background: #e8be8d; }
.next-button:hover svg { transform: translateX(4px); }
.footer-wordmark { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; }

.family-page { min-width: 0; padding-block: 36px; align-content: center; }
.family-heading { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 34px; text-align: center; }
.family-heading .eyebrow { justify-content: center; }
.family-heading h1 { margin: 16px 0 0; font-family: var(--serif); font-size: clamp(42px, 4.5vw, 67px); line-height: 1.1; letter-spacing: -2px; font-weight: 400; }
.family-heading > p { margin: 0; font-family: var(--serif); font-size: 34px; line-height: 1.5; color: var(--muted); }
.tree-scroll { overflow-x: auto; padding: 3px 3px 15px; scrollbar-color: var(--accent) #282d23; scrollbar-width: thin; }
.tree-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.tree-scroll-hint { display: none; margin: 0 0 15px; font-size: 11px; line-height: 1.5; color: var(--accent); }
.family-tree { --tree-line: #d6aa7766; --branch-gap: 24px; min-width: 840px; }
.tree-root { position: relative; padding-bottom: 54px; }
.tree-root::after { content: ""; position: absolute; left: 50%; bottom: 27px; height: 27px; border-left: 1px solid var(--tree-line); }
.couple-card { width: 360px; margin-inline: auto; padding: 17px 25px 21px; text-align: center; border: 1px solid #d6aa7770; background: linear-gradient(120deg, #d6aa7712, #d6aa7705); }
.generation-caption { display: block; font-size: 9px; line-height: 1.5; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.couple-card .generation-caption { color: var(--accent); }
.ancestor-names { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 10px 0 0; font-family: var(--serif); font-size: 40px; line-height: 1; font-weight: 400; }
.couple-join { font-style: italic; font-size: 26px; color: var(--accent); }
.family-branches { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--branch-gap); padding: 0; margin: 0; list-style: none; }
.family-branches::before { content: ""; position: absolute; top: -27px; left: calc((100% - 3 * var(--branch-gap)) / 8); right: calc((100% - 3 * var(--branch-gap)) / 8); border-top: 1px solid var(--tree-line); }
.family-branch { position: relative; min-width: 0; }
.family-branch::before { content: ""; position: absolute; left: 50%; top: -27px; height: 27px; border-left: 1px solid var(--tree-line); }
.member-card { min-height: 99px; padding: 19px 12px; border: 1px solid #d6aa7740; background: #22261e; text-align: center; }
.member-card h3 { margin: 12px 0 0; font-family: var(--serif); font-size: 28px; line-height: 1.15; font-weight: 400; }
.nickname { font-size: 21px; color: var(--accent); }
.descendant-level { position: relative; list-style: none; padding: 32px 0 0; margin: 0; }
.descendant-level::before { content: ""; position: absolute; top: 0; left: 50%; height: 32px; border-left: 1px dashed var(--tree-line); }
.descendant-card { padding: 17px 10px; min-height: 77px; border: 1px dashed #ffffff26; text-align: center; background: #ffffff02; }
.descendant-card .generation-caption { font-size: 8px; letter-spacing: 1px; }
.descendant-card p { margin: 10px 0 0; font-family: var(--serif); font-size: 17px; font-style: italic; color: #a1a592; }
.tree-note { display: flex; align-items: baseline; gap: 10px; margin: 13px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.tree-note > span { flex: 0 0 17px; border-top: 1px dashed var(--accent); }

@keyframes cursor-blink { 50% { opacity: 0; } }

@media (min-width: 1600px) {
  .site-shell { width: min(100% - 160px, 1500px); }
  .opening { gap: 12%; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .site-header { min-height: 76px; }
  .site-footer { min-height: 72px; }
  .opening { padding-block: 22px; }
  .introduction { margin-block: 15px 18px; }
  .landscape-image { min-height: 340px; }
  .opening .image-caption { bottom: 24px; gap: 12px; }
}

@media (max-width: 1100px) {
  .site-shell { width: calc(100% - 72px); }
  .opening { grid-template-columns: 1.25fr 1fr; gap: 5%; }
  .person-name { font-size: clamp(39px, 5.8vw, 64px); }
  .second-name { font-size: clamp(34px, 5vw, 55px); }
  .image-topline { left: 20px; right: 20px; letter-spacing: 1.2px; }
  .image-caption { left: 24px; }
}

@media (max-width: 920px) {
  .tree-scroll-hint { display: block; }
}

@media (max-width: 760px) {
  .site-shell { width: calc(100% - 44px); }
  .site-header { min-height: 76px; gap: 12px; }
  .brand { gap: 11px; }
  .brand-mark { font-size: 39px; }
  .brand-name { font-size: 8px; letter-spacing: 1.7px; }
  .header-chapter { display: none; }
  .animation-control, .text-link { font-size: 10px; gap: 9px; }
  .opening { position: relative; display: block; align-content: center; padding-block: 22px; }
  .opening-copy { padding: 0; }
  .eyebrow { font-size: 8px; letter-spacing: 2px; }
  .introduction { max-width: 440px; font-size: clamp(26px, 3.85svh, 32px); margin-block: clamp(16px, 2.5svh, 22px); color: #c8c9bb; }
  .statement-line { font-size: clamp(37px, 6.2svh, 55px); letter-spacing: -2px; }
  .person-name { font-size: clamp(39px, 9.8vw, 69px); letter-spacing: -2px; }
  .connecting-line { font-size: 19px; margin-top: 12px; }
  .second-name { font-size: clamp(35px, 8.7vw, 58px); letter-spacing: -1.7px; }
  .opening .landscape { position: absolute; top: 0; right: -22px; bottom: 0; width: 76%; opacity: .4; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 70%); }
  .opening .landscape-image { min-height: 0; background: transparent; }
  .opening .landscape-image::after { background: linear-gradient(180deg, #17191650, #17191620 40%, #171916bd); }
  .opening .image-topline, .opening .image-caption, .opening .image-index, .opening figcaption { display: none; }
  .site-footer { min-height: 80px; gap: 16px; }
  .chapter-number { margin-right: 6px; }
  .progress-segment { width: 21px; }
  .progress-label, .next-hint { display: none; }
  .next-button { min-height: 44px; padding: 0 17px; gap: 28px; }
  .family-page { padding-block: 28px; }
  .family-heading { margin-bottom: 23px; }
  .family-heading h1 { font-size: clamp(40px, 7vw, 52px); letter-spacing: -1.5px; }
  .family-heading > p { font-size: 32px; }
  .footer-wordmark { font-size: 14px; }
}

@media (max-height: 700px) and (max-width: 760px) {
  .site-header { min-height: 62px; }
  .site-footer { min-height: 64px; }
  .opening { padding-block: 12px; }
  .introduction { font-size: 24px; margin-block: 10px; line-height: 1.1; }
  .statement-line { font-size: 36px; }
  .person-name { font-size: clamp(37px, 9.8vw, 49px); }
  .second-name { font-size: clamp(34px, 8.7vw, 43px); }
  .connecting-line { margin-top: 9px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
