:root {
  --bg: #f5f1e8;
  --bg-elevated: #ece6d9;
  --surface: #fbf9f3;
  --ink: #17222d;
  --ink-soft: #48535e;
  --ink-muted: #6e7984;
  --border: rgba(23, 34, 45, 0.13);
  --border-strong: rgba(23, 34, 45, 0.25);
  --garnet: #8f342b;
  --garnet-soft: rgba(143, 52, 43, 0.1);
  --ochre: #b58237;
  --ochre-soft: rgba(181, 130, 55, 0.14);
  --cypress: #3e5649;
  --dark-bg: #17222d;
  --dark-surface: #202e3c;
  --dark-border: rgba(245, 241, 232, 0.14);
  --dark-text: #f5f1e8;
  --dark-muted: rgba(245, 241, 232, 0.74);
  --gold: #d2a455;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-soft: 0 22px 52px -24px rgba(23, 34, 45, 0.24);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.035;
  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");
}

.container {
  width: min(1200px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 241, 232, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 1rem;
}

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

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--garnet);
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-city {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.65rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--garnet);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-install-btn[hidden] {
  display: none;
}

.nav-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-install-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.lang-btn {
  border: none;
  background: none;
  padding: 0.14rem 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.18s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  color: var(--garnet);
  font-weight: 600;
}

.lang-sep {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--border-strong);
}

/* HERO */
.hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3.5rem, 6vw, 5.5rem);
  border-bottom: 1px solid var(--border);
}

.hero-editorial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 4vw, 3rem);
}

.hero-masthead {
  width: 100%;
  max-width: 1040px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 1.15rem;
  color: var(--garnet);
  font-size: 0.8rem;
  font-weight: 500;
}

.eyebrow .sep {
  color: var(--border-strong);
}

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  color: var(--ink);
}

.lineage-ribbon {
  width: 100%;
  max-width: 960px;
  margin: 1.45rem 0 1.35rem;
  padding: 0.95rem 0.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem 0.85rem;
}

.ribbon-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.ribbon-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.ribbon-value {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 1.8vw, 1.36rem);
  line-height: 1.2;
  text-decoration: none;
}

.ribbon-accent {
  color: var(--garnet);
  font-weight: 500;
  border-bottom: 1px dashed rgba(143, 52, 43, 0.42);
}

.ribbon-accent:hover {
  border-bottom-color: var(--garnet);
}

.ribbon-italic {
  font-style: italic;
  color: var(--ink);
}

.ribbon-sep {
  color: var(--ochre);
  font-size: 0.95rem;
}

.hero-lead {
  margin: 0 0 1.45rem;
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* CHRONICLE INTERACTIVE BOX */
.chronicle-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.15rem 0.45rem 0.5rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.95rem;
  max-width: 100%;
}

.chronicle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.46rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.chronicle-btn:hover {
  background: var(--garnet);
  border-color: var(--garnet);
  transform: translateY(-1px);
}

.chronicle-btn:active {
  transform: translateY(0);
}

.chronicle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.chronicle-output {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem 0.65rem;
  font-size: 0.86rem;
}

.chronicle-tag {
  color: var(--garnet);
  font-weight: 500;
  font-size: 0.7rem;
}

.chronicle-text {
  color: var(--ink-soft);
}

/* HERO PHOTO FRAME & ARCHIVAL PLATES */
.hero-frame {
  width: 100%;
  max-width: 980px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.photo-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #e6dfd1;
  aspect-ratio: 16 / 10;
}

.photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-stage img:hover {
  transform: scale(1.015);
}

.archival-plate {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.1rem, 2.6vw, 2rem);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.25s ease;
}

.archival-plate-hero {
  background:
    radial-gradient(circle at 50% 44%, rgba(181, 130, 55, 0.14), transparent 58%),
    linear-gradient(155deg, #ede6d8 0%, #e4dccb 100%);
  color: var(--ink);
}

.archival-plate-dark {
  background:
    radial-gradient(circle at 50% 45%, rgba(210, 164, 85, 0.14), transparent 60%),
    linear-gradient(155deg, #1b2733 0%, #131c25 100%);
  color: var(--dark-text);
  min-height: 290px;
}

.plate-corners span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(23, 34, 45, 0.24);
  border-style: solid;
}

.plate-corners span:nth-child(1) {
  top: 14px;
  left: 14px;
  border-width: 1px 0 0 1px;
}

.plate-corners span:nth-child(2) {
  top: 14px;
  right: 14px;
  border-width: 1px 1px 0 0;
}

.plate-corners span:nth-child(3) {
  bottom: 14px;
  left: 14px;
  border-width: 0 0 1px 1px;
}

.plate-corners span:nth-child(4) {
  bottom: 14px;
  right: 14px;
  border-width: 0 1px 1px 0;
}

.plate-meta-top,
.plate-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.68rem;
  opacity: 0.75;
}

.plate-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.plate-status-dot em {
  font-style: normal;
}

.plate-status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ochre);
  display: inline-block;
}

.archival-plate-dark .plate-status-dot i {
  background: var(--gold);
}

.plate-center {
  text-align: center;
  max-width: 44ch;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 0;
}

.plate-crest {
  color: var(--ink);
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.plate-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.95rem);
  font-weight: 400;
  line-height: 1.15;
}

.plate-monogram-big {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1;
}

.plate-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.archival-plate-dark .plate-sub {
  color: var(--dark-muted);
}

.expand-chip {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 249, 243, 0.35);
  background: rgba(23, 34, 45, 0.78);
  color: #fbf9f3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.expand-chip:hover {
  background: var(--garnet);
  transform: translateY(-1px);
}

.family-caption {
  padding: 1rem 0.35rem 0.35rem;
}

.caption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.caption-tag {
  color: var(--garnet);
}

.caption-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.roster-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.roster-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.roster-pill span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-muted);
}

.roster-pill.is-dragon {
  border-color: rgba(181, 130, 55, 0.42);
  background: rgba(181, 130, 55, 0.08);
}

.roster-pill:hover,
.roster-pill.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.roster-pill:hover span,
.roster-pill.is-active span {
  color: var(--gold);
}

.roster-note {
  margin: 0.85rem 0 0;
  font-size: 0.89rem;
  color: var(--ink-soft);
  min-height: 1.5em;
}

/* SHARED SECTIONS */
.section {
  padding: clamp(4rem, 7vw, 6.5rem) 0;
}

.section-head {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-index {
  margin: 0 0 0.85rem;
  color: var(--garnet);
}

.section-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: end;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.section-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 48ch;
}

/* CHAPTER 01: INTERACTIVE FAMILY TREE */
.tree-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

.genealogy-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  box-shadow: var(--shadow-soft);
}

.gen-tier-1 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tier-label,
.branch-header {
  color: var(--garnet);
  margin-bottom: 0.9rem;
  text-align: center;
  font-size: 0.7rem;
}

.couple-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.couple-amp {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ochre);
  user-select: none;
}

.member-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 142px;
  min-height: 106px;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.member-monogram {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 500;
  color: var(--ochre);
}

.member-name {
  margin-top: 0.45rem;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
}

.member-alias {
  font-size: 0.63rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}

.member-card-gen3 {
  min-width: 126px;
  min-height: 98px;
}

.member-card-dragon {
  min-width: 196px;
  background: linear-gradient(150deg, #f6f0e2 0%, #efe4cc 100%);
  border-color: rgba(181, 130, 55, 0.38);
}

.member-card.is-related {
  border-color: var(--ochre);
  background: var(--ochre-soft);
}

.member-card.is-active {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 14px 30px -16px rgba(23, 34, 45, 0.6);
  transform: translateY(-3px);
}

.member-card.is-active .member-monogram {
  color: var(--gold);
}

.member-card.is-active .member-name {
  color: var(--bg);
}

.member-card.is-active .member-alias {
  color: rgba(245, 241, 232, 0.68);
}

/* ARCHITECTURAL CONNECTORS */
.tree-connector-main {
  position: relative;
  height: 52px;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}

.tree-connector-main .conn-stem {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 26px;
  background: var(--border-strong);
}

.tree-connector-main .conn-bar {
  position: absolute;
  left: 22%;
  right: 22%;
  top: 26px;
  height: 1px;
  background: var(--border-strong);
}

.tree-connector-main .conn-drop {
  position: absolute;
  top: 26px;
  width: 1px;
  height: 26px;
  background: var(--border-strong);
}

.tree-connector-main .conn-drop-left {
  left: 22%;
}

.tree-connector-main .conn-drop-right {
  right: 22%;
}

.branches-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.92fr);
  gap: 2rem;
  align-items: start;
}

.branch-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(23, 34, 45, 0.14);
  background: rgba(245, 241, 232, 0.45);
}

.branch-connector {
  position: relative;
  width: 100%;
  height: 36px;
}

.branch-connector .conn-stem {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--border-strong);
}

.branch-connector-3 .conn-stem {
  height: 18px;
}

.branch-connector-3 .conn-bar {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 18px;
  height: 18px;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
}

.branch-connector-3::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 18px;
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.children-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

/* MEMBER DETAIL BAR */
.member-detail {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem 2rem;
}

.detail-badge {
  color: var(--garnet);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--garnet-soft);
  white-space: nowrap;
}

.detail-name {
  margin: 0 0 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
}

.detail-role {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.detail-link {
  color: var(--garnet);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed rgba(143, 52, 43, 0.45);
  margin-left: 0.35rem;
  white-space: nowrap;
}

.detail-link:hover {
  border-bottom-color: var(--garnet);
}

.detail-nav {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* CHAPTER 02: DARK BRANCHES BAND */
.branches-section {
  background: var(--dark-bg);
  color: var(--dark-text);
}

.branches-section .section-index {
  color: var(--gold);
}

.branches-section .section-desc {
  color: var(--dark-muted);
}

.branches-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.branch-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.branch-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  align-items: stretch;
}

.branch-media {
  position: relative;
  overflow: hidden;
  background: #121a23;
}

.branch-feature .branch-media {
  aspect-ratio: 16 / 10;
}

.branch-portrait {
  aspect-ratio: 4 / 3;
}

.branch-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.branch-card:hover .branch-media img {
  transform: scale(1.025);
}

.branch-info {
  padding: clamp(1.35rem, 2.5vw, 2.15rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.branch-tag {
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.branch-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  line-height: 1.12;
  color: var(--dark-text);
}

.branch-text {
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.96rem;
}

.branch-actions {
  margin-top: 1.25rem;
}

.branch-link-pill,
.dragon-meter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--dark-border);
  background: rgba(245, 241, 232, 0.06);
  color: var(--dark-text);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.branch-link-pill:hover,
.dragon-meter-btn:hover {
  background: rgba(210, 164, 85, 0.16);
  border-color: var(--gold);
}

.pill-dot-gold,
.dragon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.dragon-dot {
  background: #67b084;
}

/* CHAPTER 03: FACTS & ALBUM */
.facts-section {
  background: var(--bg);
}

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

.fact-item {
  padding: 2rem 1.5rem 2rem 0;
  border-right: 1px solid var(--border);
}

.fact-item:not(:first-child) {
  padding-left: 1.5rem;
}

.fact-item:last-child {
  border-right: none;
  padding-right: 0;
}

.fact-num {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  font-weight: 400;
  line-height: 1;
  color: var(--garnet);
  margin-bottom: 0.9rem;
}

.fact-label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fact-label strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.fact-label span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ALBUM STRIP */
.album-strip {
  margin-top: 3.5rem;
}

.album-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  color: var(--ink-muted);
}

.text-link-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--garnet);
  cursor: pointer;
}

.text-link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.thumb-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.thumb-btn:hover {
  transform: translateY(-2px);
  border-color: var(--garnet);
}

.thumb-btn img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.thumb-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, #ede6d8 0%, #e1d8c6 100%);
  border: 1px dashed rgba(23, 34, 45, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--ink);
}

.thumb-placeholder span {
  font-size: 0.64rem;
  color: var(--ink-muted);
}

.thumb-placeholder strong {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--garnet);
}

.thumb-btn > span {
  color: var(--ink-soft);
  padding: 0 0.2rem 0.15rem;
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.footer-sub {
  margin: 0;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-pill:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cypress);
}

.pill-dot-ochre {
  background: var(--ochre);
}

.footer-domain {
  color: var(--ink-muted);
}

/* LIGHTBOX */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 29, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  color: var(--dark-text);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-counter {
  color: var(--gold);
}

.lightbox-close {
  border: 1px solid var(--dark-border);
  background: rgba(245, 241, 232, 0.08);
  color: var(--dark-text);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.84rem;
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--garnet);
  border-color: var(--garnet);
}

.lightbox-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 0;
}

.lightbox-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.lightbox-media-wrap img[hidden],
.lightbox-plate[hidden] {
  display: none;
}

.lightbox-stage img {
  max-height: 68vh;
  max-width: 100%;
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-plate {
  width: min(680px, 100%);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-border);
  background:
    radial-gradient(circle at 50% 45%, rgba(210, 164, 85, 0.14), transparent 62%),
    linear-gradient(155deg, #1e2b38 0%, #141e28 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem;
  text-align: center;
}

.lightbox-plate-code {
  color: var(--gold);
}

.lightbox-plate-mono {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--dark-text);
  line-height: 1;
}

.lightbox-plate-hint {
  margin: 0;
  max-width: 40ch;
  color: var(--dark-muted);
  font-size: 0.92rem;
}

.lightbox-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--dark-border);
  background: rgba(245, 241, 232, 0.08);
  color: var(--dark-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.lightbox-arrow:hover {
  background: var(--garnet);
  border-color: var(--garnet);
}

.lightbox-caption {
  text-align: center;
  max-width: 60ch;
  margin-inline: auto;
}

.lightbox-caption h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.35rem;
}

.lightbox-caption p {
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.92rem;
}

/* IOS INSTALL MODAL */
.ios-modal[hidden] {
  display: none;
}

.ios-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.ios-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 29, 0.72);
  backdrop-filter: blur(6px);
}

.ios-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.ios-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ios-modal-tag {
  color: var(--garnet);
}

.ios-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ios-modal-card h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.4rem;
}

.ios-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .section-head-grid,
  .branch-feature,
  .branches-grid {
    grid-template-columns: 1fr;
  }

  .tree-connector-main {
    display: none;
  }

  .branches-grid {
    margin-top: 1.5rem;
    gap: 1.25rem;
  }

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

  .fact-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
  }

  .fact-item:not(:first-child) {
    padding-left: 0;
  }

  .fact-item:nth-child(odd) {
    padding-right: 1.5rem;
    border-right: 1px solid var(--border);
  }

  .fact-item:nth-child(even) {
    padding-left: 1.5rem;
  }

  .fact-item:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .member-detail {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .detail-badge {
    width: fit-content;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1200px, calc(100% - 1.5rem));
  }

  .hero-title {
    font-size: clamp(2rem, 8.6vw, 2.75rem);
  }

  .ribbon-sep {
    display: none;
  }

  .chronicle-box {
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
  }

  .brand-city {
    display: none;
  }

  .site-nav {
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-nav a {
    font-size: 0.82rem;
  }

  .couple-group {
    flex-wrap: wrap;
  }

  .member-card {
    min-width: 120px;
    flex: 1 1 120px;
  }

  .branch-connector-3 .conn-bar {
    display: none;
  }

  .branches-spread,
  .thumb-row,
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .fact-item:nth-child(odd),
  .fact-item:nth-child(even) {
    padding: 1.4rem 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .fact-item:last-child {
    border-bottom: none;
  }

  .lightbox-stage {
    grid-template-columns: 1fr;
  }

  .lightbox-arrow {
    position: fixed;
    bottom: 1.25rem;
  }

  #lightboxPrev {
    left: 1.25rem;
  }

  #lightboxNext {
    right: 1.25rem;
  }
}
