/* Our LGCY demo preview. One shared stylesheet, no build step, no external assets.
   Palette (Sofia): collard green, sorghum gold, iron skillet, warm paper.
   Flat color only. No gradients, no glass, no shadows doing decoration. */

:root {
  --paper: #faf6ec;
  --paper-deep: #f1e9d6;
  --ink: #1d2320;
  --ink-soft: #454e47;
  --pine: #1e3a2b;
  --pine-deep: #142a1f;
  --pine-soft: #2c5240;
  --gold: #b9872c;
  --gold-deep: #7d5a13;
  --rust: #a84c16;
  --oxblood: #7c2d26;
  --line: #d9cfb8;
  --line-dark: #3c5a49;
  --card: #fffdf7;
  --radius: 10px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3, .display {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  line-height: 1.15;
  color: var(--pine-deep);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.22rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--pine-soft); text-underline-offset: 3px; }
a:hover { color: var(--oxblood); }

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pine-deep);
  color: #fff;
  padding: 12px 18px;
  z-index: 60;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* ---------- Header ---------- */

.site-header {
  background: var(--pine-deep);
  color: #f4efe2;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 4px solid var(--gold);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.wordmark {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.wordmark span { color: var(--gold); }
.wordmark:hover { color: #fff; }
.main-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: block;
  color: #e9e2cf;
  text-decoration: none;
  padding: 12px 13px;
  font-size: 0.98rem;
  border-radius: 6px;
}
.main-nav a:hover { background: var(--pine-soft); color: #fff; }
.main-nav a[aria-current="page"] {
  background: var(--pine-soft);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}
.nav-toggle {
  display: none;
  background: var(--pine-soft);
  color: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  min-height: 46px;
  min-width: 46px;
  padding: 10px 16px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- Demo banner ---------- */

.demo-banner {
  background: var(--oxblood);
  color: #fdf3ec;
  font-size: 0.97rem;
}
.demo-banner .wrap {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding-top: 10px;
  padding-bottom: 10px;
}
.demo-banner strong { letter-spacing: 0.02em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  font-size: 1rem;
  cursor: pointer;
}
.btn-pine { background: var(--pine); color: #fff; }
.btn-pine:hover { background: var(--pine-soft); color: #fff; }

/* ---------- Home v3: the scroll journey (styles at the end) ---------- */

/* ---------- Branch collection panel ---------- */

.collection-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: min(560px, calc(100vw - 32px));
  max-height: 72vh;
  overflow: auto;
  background: var(--card);
  border: 2px solid var(--pine);
  border-radius: 12px;
  padding: 22px 24px;
  z-index: 80;
  color: var(--ink);
}
.collection-panel[hidden] { display: none; }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cp-head h2 { font-size: 1.35rem; margin: 0; }
.cp-close {
  min-height: 46px;
  min-width: 46px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--pine);
  background: var(--pine);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cp-close:hover { background: var(--pine-soft); }
.cp-count { color: var(--ink-soft); margin: 8px 0 4px; }
.cp-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cp-list li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}
.cp-list .meta { color: var(--ink-soft); font-size: 0.92rem; text-align: right; }

/* ---------- Sections ---------- */

.section { padding: 58px 0; }
.section.alt { background: var(--paper-deep); }
.section-head { max-width: 46em; margin-bottom: 30px; }
.eyebrow {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 10px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
/* ---------- Source chips ---------- */

.src {
  display: inline-block;
  border: 1.5px solid var(--gold-deep);
  color: var(--gold-deep);
  background: #fbf3dd;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: baseline;
  white-space: nowrap;
}
.src.record { border-color: var(--pine-soft); color: var(--pine); background: #e9f0e8; }
.src.family { border-color: var(--oxblood); color: var(--oxblood); background: #f9ece8; }

/* ---------- Person page ---------- */

.page-head { padding: 46px 0 8px; }
.page-head .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46em; }
.person-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 38px 0 6px;
}
.portrait {
  width: 148px;
  height: 178px;
  border-radius: 8px;
  background: var(--pine);
  color: #efe7d0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border: 3px solid var(--gold);
}
.portrait .initials {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
}
.portrait .note { font-size: 0.72rem; margin-top: 10px; color: #cfc5a4; }
.person-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 10px; }
.person-meta div { min-width: 150px; }
.person-meta dt { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); }
.person-meta dd { margin: 2px 0 0; }

.layout-rail {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 44px;
  align-items: start;
}
.rail-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.rail-box h3 { margin-bottom: 10px; }
.rail-box ul { margin: 0; padding-left: 20px; }
.rail-box li { margin-bottom: 7px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 92px 22px 1fr;
  gap: 0 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.timeline li:first-child { border-top: none; }
.timeline .yr { font-weight: 700; color: var(--pine); text-align: right; }
.timeline .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--pine);
  margin: 7px auto 0;
}
.timeline .what p { margin: 0 0 4px; }
.timeline .what .src { margin-top: 2px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.99rem;
}
table.data caption { text-align: left; font-weight: 700; padding-bottom: 8px; color: var(--pine-deep); }
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th { border-top: none; border-bottom: 2px solid var(--pine); color: var(--pine-deep); font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; }
.table-scroll { overflow-x: auto; }

/* ---------- Connection case ---------- */

.state-tag {
  display: inline-block;
  border: 2px solid var(--gold-deep);
  color: var(--gold-deep);
  background: #fbf3dd;
  border-radius: 4px;
  padding: 4px 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}
.record-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 6px solid var(--pine);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.record-card.native { border-top-color: var(--oxblood); }
.record-card h3 { margin-bottom: 2px; }
.record-card .sub { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 14px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 11px 0 11px 34px; position: relative; border-top: 1px solid var(--line); }
.check-list li:first-child { border-top: none; }
.check-list .mark {
  position: absolute; left: 2px; top: 11px;
  font-weight: 700; color: var(--pine-soft);
}
.check-list .mark.warn { color: var(--oxblood); }
.signal-num {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 2rem; color: var(--pine-deep);
}

/* ---------- Forms and upload ---------- */

.dropzone {
  border: 3px dashed var(--pine-soft);
  border-radius: var(--radius);
  background: var(--card);
  padding: 42px 26px;
  text-align: center;
  cursor: pointer;
}
.dropzone.drag { background: #eef2e4; border-color: var(--gold-deep); }
.dropzone p { margin-bottom: 6px; }
.dropzone .big {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.5rem; color: var(--pine-deep);
}
.file-list { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; }
.file-list li {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.97rem;
}
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  padding: 18px 0 18px 62px;
  position: relative;
  border-top: 1px solid var(--line);
}
.steps li:first-child { border-top: none; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-soft); }

form.claim {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1.5px solid #a99e80;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 48px;
}
.field textarea { min-height: 110px; }
.form-note {
  display: none;
  border: 2px solid var(--pine-soft);
  background: #e9f0e8;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 20px;
}
.form-note.show { display: block; }

/* ---------- Family landing (TW-1153) ---------- */

.family-hero {
  height: clamp(200px, 32vw, 320px);
  background: url("assets/oak-tree.jpg") center 32% / cover no-repeat;
}
.field .field-error {
  display: none;
  color: var(--oxblood);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 6px 0 0;
}
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--oxblood); }
.form-note.error { border-color: var(--oxblood); background: #f7e9e4; }
.privacy-line { font-size: 0.95rem; color: var(--ink-soft); margin: 14px 0 0; }

/* ---------- Footer ---------- */

/* The tree's one demo-data note (TW-1275): sits at the bottom of
   the tree, under the base section, in the footer's own voice. */
.demo-note {
  position: relative; z-index: 2;
  max-width: 44em; margin: 0 auto; padding: 10px 24px 54px;
  text-align: center; font-size: 0.88rem; color: #e8e0c8;
  text-shadow: 0 1px 2px rgba(20, 14, 4, 0.55);
}

.site-footer {
  background: var(--pine-deep);
  color: #d9d2ba;
  padding: 40px 0 46px;
  margin-top: 0;
  font-size: 0.97rem;
}
.site-footer .fine { color: #a79d7e; font-size: 0.88rem; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 0 0 18px; }
.site-footer a { color: #efe8d2; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .two-col, .layout-rail, .case-grid { grid-template-columns: 1fr; }
  .person-head { grid-template-columns: 1fr; }
  .portrait { width: 128px; height: 154px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .header-inner { flex-wrap: wrap; padding: 10px 0 14px; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 13px 12px; }
  .section { padding: 42px 0; }
  .collection-panel {
    bottom: 0;
    width: 100vw;
    max-height: 78vh;
    border-radius: 12px 12px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .timeline li { grid-template-columns: 64px 18px 1fr; }
  .steps li { padding-left: 56px; }
  form.claim { padding: 20px 16px; }
  .demo-banner .wrap { flex-direction: column; gap: 2px; }
}

/* ================================================================
   HOME V3: INFINITE SCROLL THROUGH THE TREE (TW-1010)
   Futuristic without the AI glow: hairlines, frosted cards, exact
   spacing, motion and parallax. Palette from the oak itself.
   ================================================================ */

:root { --line-warm: #fffaf0; --card: rgba(255, 253, 247, 0.87); --bark: #22180e; }

html, body.home { overflow-x: hidden; overflow-x: clip; }
body.home { background: var(--bark); }
body.home .site-footer { position: relative; z-index: 2; }

.oak-bg {
  position: fixed;
  left: 0; right: 0; top: -16vh;
  height: 132vh;
  background: url("assets/oak-tree.jpg") center top / cover no-repeat;
  z-index: 0;
  will-change: transform;
}

/* Light header (furniture only, as in the reference photo) */
.site-header.light {
  background: rgba(250, 246, 236, 0.94);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border-bottom: 1px solid rgba(70, 54, 28, 0.28);
}
.site-header.light .wordmark { color: var(--pine-deep); }
.site-header.light .wordmark span { color: var(--gold-deep); }
.site-header.light .main-nav a { color: #33413a; }
.site-header.light .main-nav a:hover { background: rgba(20, 42, 31, 0.08); }
.site-header.light .main-nav a[aria-current="page"] {
  background: transparent;
  color: var(--pine-deep);
  box-shadow: inset 0 -3px 0 var(--rust);
}
.main-nav.always { display: block; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: none; border: none; cursor: pointer;
  min-width: 46px; min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); border-radius: 50%; padding: 0;
}
.icon-btn:hover { background: rgba(20, 42, 31, 0.08); }
.icon-btn svg { width: 22px; height: 22px; }
.member-medal {
  width: 40px; height: 40px; border-radius: 50%;
  background: #d9c193; border: 2px solid #a97e2f; color: #4a3517;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

/* Era rail: the scroll progress spine on the left edge */
.era-rail {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  height: min(74vh, 660px); width: 58px; z-index: 40;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-left: 17px; pointer-events: none;
}
.rail-line {
  position: absolute; left: 22px; top: 8px; bottom: 8px; width: 1.5px;
  background: rgba(255, 250, 240, 0.38);
}
.rail-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: var(--gold); display: block;
  transform: scaleY(0); transform-origin: center top;
}
.rail-mark {
  position: relative; font-size: 10.5px; letter-spacing: 0.12em; font-weight: 600;
  color: rgba(255, 250, 240, 0.78); padding-left: 13px; line-height: 1;
  text-shadow: 0 1px 2px rgba(20, 14, 4, 0.6);
}
.rail-mark::before {
  content: ""; position: absolute; left: 1.5px; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #cdc39f;
}
.rail-mark.active { color: #f3d98b; }
.rail-mark.active::before { background: var(--gold); width: 9px; height: 9px; margin-top: -4.5px; left: 0.5px; }

/* Journey sections */
.journey { position: relative; z-index: 1; }
.gen { position: relative; padding: 9vh 24px 7vh 84px; }
.gen .fan, .gen .couple { max-width: 1560px; margin-left: auto; margin-right: auto; }

.opening { min-height: 94vh; padding-top: 4.5vh; }
.headline { position: relative; z-index: 2; margin-left: 10px; }
.headline h1 {
  color: #f8f3e3; font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; font-weight: 800;
  line-height: 1.02; letter-spacing: -0.01em; margin: 0;
  text-shadow: 0 1px 3px rgba(20, 14, 4, 0.5);
}
.subline {
  color: rgba(248, 243, 227, 0.88); font-size: clamp(1rem, 1.6vw, 1.2rem);
  margin: 12px 0 0; font-weight: 500; text-shadow: 0 1px 3px rgba(20, 14, 4, 0.5);
}

.root-plaque {
  display: block; margin: 11vh auto 0; width: min(430px, 86%);
  padding: 20px 26px; text-align: center; cursor: pointer;
  background: rgba(28, 20, 10, 0.88); backdrop-filter: blur(4px);
  border: 1px solid rgba(201, 164, 92, 0.75); border-radius: 12px;
  color: #f2e7c8; font: inherit;
}
.root-plaque:hover { border-color: #e9c979; }
.rp-name { display: block; font-size: 1.28rem; letter-spacing: 0.18em; font-weight: 700; color: #e9c979; }
.rp-sub { display: block; margin-top: 4px; font-size: 0.98rem; color: #efe7d0; }
.rp-tag { display: block; margin-top: 6px; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: #b8a888; }

.gen-drop {
  display: block; width: 1.5px; height: 12vh; min-height: 54px;
  margin: 20px auto 0; background: var(--line-warm); position: relative;
  filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.45));
}
.gen-drop::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bark); border: 1.5px solid var(--line-warm);
}

.era-tag {
  max-width: 1560px; margin: 0 auto 4px; display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.22em; font-weight: 700; color: #f5efdd;
  text-shadow: 0 1px 2px rgba(20, 14, 4, 0.55);
}
.era-tag::after { content: ""; flex: 1; height: 1px; background: rgba(255, 250, 240, 0.35); }

/* Fan connectors: a drop from the parent generation, a bus, drops
   into each branch cluster, and a spine behind each cluster's cards. */
.fan { position: relative; padding-top: 44px; }
.fan::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 1.5px; height: 44px;
  background: var(--line-warm); filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.45));
}
.fan::before {
  content: ""; position: absolute; top: 44px; left: 12.5%; right: 12.5%; height: 1.5px;
  background: var(--line-warm); filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.45));
}
.clusters { display: flex; gap: 20px; flex-wrap: wrap; }
.cluster { flex: 1 1 204px; position: relative; padding-top: 34px; }
.cluster::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 1.5px; height: 34px;
  background: var(--line-warm); filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.45));
}
.cluster::after {
  content: ""; position: absolute; top: 66px; bottom: 24px; left: 50%; width: 1.5px;
  background: rgba(255, 250, 240, 0.5);
}
.cluster-name {
  margin: 0 0 8px; text-align: center; font-size: 11.5px; letter-spacing: 0.2em;
  font-weight: 700; text-transform: uppercase; color: #f5efdd;
  text-shadow: 0 1px 2px rgba(20, 14, 4, 0.55); position: relative; z-index: 1;
}
body.js .fan::before { transform: scaleX(0); transform-origin: left center; transition: transform 1s ease 0.15s, opacity 0.5s ease; }
body.js .fan::after, body.js .cluster::before { transform: scaleY(0); transform-origin: center top; transition: transform 0.7s ease, opacity 0.5s ease; }
body.js .gen.in .fan::before { transform: scaleX(1); }
body.js .gen.in .fan::after, body.js .gen.in .cluster::before { transform: scaleY(1); }

.couple { display: flex; justify-content: center; align-items: center; position: relative; }
.couple-link { width: 64px; height: 1.5px; background: var(--line-warm); flex: 0 0 auto; filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.45)); }
.couple .pcard { margin: 0; }

/* Person cards on the bark */
.pcard {
  position: relative; z-index: 1; display: flex; gap: 13px; align-items: center;
  width: 100%; max-width: 330px; margin-left: auto; margin-right: auto;
  background: var(--card); backdrop-filter: blur(7px) saturate(0.92);
  border: 1px solid rgba(70, 54, 28, 0.38); border-radius: 14px;
  padding: 11px 15px 11px 11px; color: var(--ink);
  box-shadow: 0 1px 3px rgba(26, 18, 7, 0.2); cursor: pointer;
}
.cluster-name + .pcard { margin-top: 2px; }
.pcard + .pcard { margin-top: 16px; }
body.js .gen .pcard {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s ease var(--d, 0s), transform 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s), border-color 0.3s ease, box-shadow 0.3s ease, filter 0.4s ease;
}
body.js .gen.in .pcard { opacity: 1; transform: none; }
.medal {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  background: #d9c193; border: 2px solid #a97e2f; color: #4a3517;
  display: flex; align-items: center; justify-content: center;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 700; font-size: 1.05rem;
}
.pcard-body { min-width: 0; }
.pname { display: block; font-weight: 700; font-size: 1.06rem; line-height: 1.2; color: #1d2320; }
.pmeta { display: block; color: #5d5540; font-size: 0.9rem; margin-top: 1px; }
.relatives {
  display: inline-flex; align-items: flex-start; min-height: 46px;
  background: none; border: none; padding: 2px 0 0; margin: 0; font: inherit;
  font-size: 0.88rem; color: var(--gold-deep); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(125, 90, 19, 0.5);
}
.relatives:hover { color: var(--oxblood); }
#gen-4 .medal { width: 47px; height: 47px; }
#gen-5 .medal { width: 45px; height: 45px; font-size: 0.98rem; }
#gen-6 .medal { width: 41px; height: 41px; font-size: 0.9rem; }
#gen-6 .pcard { padding: 9px 12px 9px 9px; }
#gen-6 .pname { font-size: 0.97rem; }
.pcard.focus {
  border: 2px solid #1d2320; background: rgba(255, 253, 247, 0.95); cursor: default;
  box-shadow: 0 0 0 1px rgba(185, 135, 44, 0.55), 0 1px 3px rgba(26, 18, 7, 0.2);
}
.pcard.focus .medal { width: 58px; height: 58px; font-size: 1.15rem; }
.view-story { color: var(--rust); font-weight: 600; font-size: 0.95rem; }

/* Follow my line mode */
.journey.line-on .pcard:not(.in-line) { opacity: 0.3; filter: saturate(0.5); }
.journey.line-on .fan::before, .journey.line-on .fan::after,
.journey.line-on .cluster::before, .journey.line-on .cluster::after,
.journey.line-on .couple-link, .journey.line-on .gen-drop { opacity: 0.25; }
.pcard.in-line { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(185, 135, 44, 0.55), 0 1px 3px rgba(26, 18, 7, 0.2); }

/* Follow pill, bottom center */
.follow-pill {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 253, 247, 0.93); backdrop-filter: blur(8px);
  border: 1px solid rgba(70, 54, 28, 0.4); border-radius: 999px;
  padding: 6px 8px 6px 14px; box-shadow: 0 2px 10px rgba(26, 18, 7, 0.22);
  max-width: calc(100vw - 20px);
}
.follow-btn {
  background: none; border: none; font: inherit; font-weight: 600;
  color: var(--rust); cursor: pointer; min-height: 46px; padding: 8px 10px; white-space: nowrap;
}
.follow-btn[aria-pressed="true"] { color: var(--pine-deep); text-decoration: underline; text-underline-offset: 4px; }
.pill-div { width: 1px; height: 26px; background: rgba(70, 54, 28, 0.35); }

/* Critters: photographic insets feathered into the oak */
.critter {
  position: absolute; z-index: 3; background: none; border: none; padding: 0;
  cursor: pointer; border-radius: 46% 54% 52% 48% / 44% 46% 54% 56%;
}
.critter img {
  display: block; width: 100%; height: auto; border-radius: inherit;
  -webkit-mask-image: radial-gradient(ellipse 74% 74% at 50% 50%, #000 56%, transparent 78%);
  mask-image: radial-gradient(ellipse 74% 74% at 50% 50%, #000 56%, transparent 78%);
  filter: sepia(0.28) saturate(0.62) brightness(0.94) contrast(0.96);
}
.critter:focus-visible, .acorns:focus-visible, .relatives:focus-visible,
.follow-btn:focus-visible, .icon-btn:focus-visible, .root-plaque:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}
.critter-jay { width: 128px; top: 6%; right: 5%; --fly-x: -250px; --fly-y: 30px; }
.critter-woodpecker { width: 118px; top: 16px; right: 3%; }
.critter-owl { width: 118px; top: 22px; left: 3%; }
.critter-squirrel { width: 150px; top: 20px; right: 3%; --run-x: -185px; transition: transform 1s cubic-bezier(0.3, 0.7, 0.3, 1); }
.critter-squirrel.at-b { transform: translateX(var(--run-x)); }
/* Perch bands: clearings above the fan where the animals live */
#gen-2 .fan { margin-top: 92px; }
#gen-3 .fan { margin-top: 140px; }
#gen-4 .fan { margin-top: 126px; }

/* TW-1209 habitats: each animal keeps a small feathered stage in
   its own section (gl/scatter.js), laid over the spot where its
   photograph sits. The canvas melts into the oak with the same
   radial feather as the photographs; the photograph hands over
   (fades out, button stays as the interaction layer) only once
   the habitat has rendered its first frame. Without a habitat,
   nothing here applies and the photographs stand as before. */
.habitat {
  position: absolute; z-index: 2; pointer-events: none;
}
.habitat-canvas {
  display: block; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.9s ease;
  -webkit-mask-image: radial-gradient(ellipse 74% 74% at 50% 50%, #000 56%, transparent 79%);
  mask-image: radial-gradient(ellipse 74% 74% at 50% 50%, #000 56%, transparent 79%);
}
.habitat.on .habitat-canvas { opacity: 1; }
.critter img { transition: opacity 0.9s ease; }
.gen.habitat-live .critter img { opacity: 0; }
.habitat-jay { width: 300px; height: 250px; top: 0; right: 1.5%; }
.habitat-woodpecker { width: 290px; height: 260px; top: 0; right: 0.5%; }
.habitat-owl { width: 300px; height: 270px; top: 4px; left: 0.5%; }
.habitat-squirrel { width: 310px; height: 250px; top: 2px; right: 0.5%; }
@media (max-width: 720px) {
  .habitat-jay { width: 205px; height: 175px; top: 27%; right: 0; }
  .habitat-woodpecker { width: 195px; height: 180px; top: 0; right: 0; }
  .habitat-owl { width: 200px; height: 185px; top: 6px; left: 0; }
  .habitat-squirrel { width: 210px; height: 175px; top: 4px; right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .habitat-canvas, .critter img { transition: none; }
}

/* Animal performances (transforms on the photograph; no glow) */
.critter-owl.hooting img { animation: owl-turn 1.6s ease-in-out; transform-origin: 50% 88%; }
@keyframes owl-turn {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4.5deg); }
  60% { transform: rotate(3deg); }
}
.critter-woodpecker.pecking img { animation: peck 0.16s ease-in-out 6 alternate; transform-origin: 30% 92%; }
@keyframes peck { from { transform: rotate(0deg); } to { transform: rotate(-5deg) translateY(1px); } }
.critter-squirrel.running img { animation: scamper 0.16s linear 6 alternate; }
@keyframes scamper { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-4px) rotate(1.5deg); } }
.critter-jay.flying img { animation: flutter 0.15s ease-in-out 8 alternate; }
@keyframes flutter { from { transform: scaleY(1) rotate(0deg); } to { transform: scaleY(0.93) rotate(-2.5deg); } }
/* Acorn clusters and falling acorns */
.acorns {
  position: absolute; z-index: 3; background: none; border: none; padding: 8px;
  cursor: pointer; display: flex; gap: 2px; min-width: 46px; min-height: 46px;
  align-items: flex-start; justify-content: center;
}
.acorns svg { width: 21px; height: 25px; filter: drop-shadow(0 1px 1px rgba(30, 20, 8, 0.4)); }
.acorns svg:nth-child(2) { transform: translateY(5px) rotate(14deg); }
.acorns svg:nth-child(3) { transform: translateY(2px) rotate(-10deg); }
.acorns-a { top: 12%; left: 53%; }
.acorns-b { top: 18px; left: 6%; }
.acorns-c { top: 30px; right: 8%; }
.acorns-d { top: 16px; left: 34%; }
.acorn-fall { position: fixed; z-index: 90; pointer-events: none; width: 19px; height: 23px; }
.acorn-fall svg { width: 100%; height: 100%; display: block; }

/* Base: upload panel, room for the pill */
.base { padding-bottom: 17vh; }
.dropzone.home-drop {
  max-width: 620px; margin: 5vh auto 0; position: relative; z-index: 2;
  background: rgba(255, 253, 247, 0.91); backdrop-filter: blur(7px);
  border-color: rgba(70, 54, 28, 0.55); color: var(--ink);
}
.dropzone.home-drop .big { color: var(--pine-deep); }
.dropzone.home-drop p { color: var(--ink-soft); }
.dropzone.home-drop.drag { background: #f3ecd9; }
.dropzone.home-drop .file-list li { background: var(--paper); color: var(--ink); }

/* ---------- Journey responsive ---------- */
@media (max-width: 1100px) {
  .critter-owl { left: 0.5%; }
}
@media (max-width: 900px) {
  .critter-jay { width: 108px; --fly-x: -165px; --fly-y: 20px; }
  .critter-squirrel { width: 142px; --run-x: -120px; }
  .critter-owl { width: 118px; }
  .critter-woodpecker { width: 100px; }
  .acorns-a { left: auto; right: 32%; }
}
@media (max-width: 720px) {
  .main-nav.always ul { flex-direction: row; gap: 2px; }
  .gen { padding: 8vh 14px 6vh 56px; }
  .era-rail { width: 44px; padding-left: 11px; }
  .rail-line { left: 15.5px; }
  .rail-mark { font-size: 9.5px; padding-left: 11px; }
  .cluster { flex-basis: 100%; }
  .fan::before { left: 50%; right: auto; width: 0; }
  .headline { margin-left: 2px; }
  .root-plaque { margin-top: 8vh; }
  .pcard { padding: 9px 12px 9px 9px; gap: 10px; }
  .medal { width: 45px; height: 45px; font-size: 0.95rem; }
  .follow-pill { bottom: 12px; padding-left: 10px; }
  .critter-owl { top: 10%; }
  .dropzone.home-drop { margin-top: 3vh; }
}

/* Reduced motion: still the animals, the reveals, and the parallax */
@media (prefers-reduced-motion: reduce) {
  body.js .gen .pcard { opacity: 1; transform: none; transition: none; }
  body.js .fan::before, body.js .fan::after, body.js .cluster::before { transform: none; transition: none; }
  .critter, .critter img, .acorns svg { animation: none !important; transition: none !important; }
  .follow-pill, .pcard { transition: none; }
}

/* The dragonfly: a rare crossing, drawn not photographed, untouchable */
.dragonfly {
  position: fixed; left: 0; z-index: 35; width: 74px; height: 48px;
  pointer-events: none; opacity: 0;
}
.dragonfly svg { width: 100%; height: 100%; display: block; }
.root-plaque.in-line { border-color: #e9c979; box-shadow: 0 0 0 2px rgba(185, 135, 44, 0.55); }
.journey.line-on .root-plaque:not(.in-line) { opacity: 0.35; }

/* Gate fix (Impeccable, TW-1010): the global link hover (oxblood) is
   unreadable on the dark header and footer; dark surfaces hover gold. */
.site-footer a:hover,
.site-header:not(.light) a:hover { color: #f3d98b; }

/* Replica round 1 fixes (TW-1010): two by two fan at mid widths,
   perch bands sized down on phones */
@media (max-width: 1020px) {
  .cluster { flex-basis: 42%; }
  .fan::before { display: none; }
}
@media (max-width: 720px) {
  .cluster { flex-basis: 100%; }
  #gen-2 .fan { margin-top: 76px; }
  #gen-3 .fan { margin-top: 112px; }
  #gen-4 .fan { margin-top: 104px; }
  .critter-woodpecker { top: 8px; }
  .critter-owl { width: 104px; top: 14px; }
  .critter-squirrel { width: 128px; top: 12px; }
}

/* Screenshot round fixes (TW-1010): the demo banner must paint above
   the fixed oak layer; the phone header stays on one row; the jay
   moves out of the headline on small screens */
body.home .demo-banner { position: relative; z-index: 2; }
@media (max-width: 720px) {
  .site-header.light .header-inner { flex-wrap: nowrap; gap: 6px; padding: 0 10px; min-height: 58px; }
  .site-header.light .wordmark { font-size: 1.18rem; }
  .site-header.light .main-nav a { padding: 8px 6px; font-size: 0.92rem; }
  .header-tools .icon-btn { display: none; }
  .member-medal { width: 34px; height: 34px; }
  .headline h1 { font-size: 2.25rem; }
  .critter-jay { top: 35%; right: 3%; width: 96px; --fly-x: -120px; --fly-y: 16px; }
}

@media (max-width: 720px) {
  .acorns-a { display: none; }
}

/* ================================================================
   HOME V4 SLICE 1 (TW-1012): the WebGL layer at the base.
   The canvas is inserted by gl/scene.js only when the device earns
   it (measured probe); without it, or after any failure, the v3
   page stands exactly as built. (TW-1152: the v3 photograph deer
   that once stood at the base is removed outright; the composed
   buck at the threshold is the only deer on the page.)
   ================================================================ */
.gl-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; opacity: 0;
  transition: opacity 0.7s ease;
}
#gen-7.gl-on .gl-canvas { opacity: 1; }
@media (max-width: 720px) {
  /* On a phone the dropzone card fills the section's width (canvas
     z 1, card z 2). The v3 critters live at z 3, over the card's
     corner; the canvas joins that layer on small screens only. */
  .gl-canvas { z-index: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .gl-canvas { transition: none; }
}

/* ================================================================
   PHASE D (TW-1147): the buck at the threshold. A page-break
   section between the journey and the base. The canvas mask
   dissolves the rendered buck and rock at both edges of the
   break, so the lower body blends into the section seam with no
   hard edge, no rectangle, no halo; the photographic oak behind
   the page never changes. Without the GL layer (fail-closed),
   the section is a quiet divider carrying one caption line.
   ================================================================ */
.buck-break {
  position: relative; overflow: hidden;
  min-height: 30vh; padding: 6vh 24px 4vh 84px;
}
.buck-break.gl-on { min-height: 96vh; }
.buck-caption {
  position: relative; z-index: 2;
  max-width: 1560px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.22em; font-weight: 700; color: #f5efdd;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(20, 14, 4, 0.55);
}
.buck-caption::after { content: ""; flex: 1; height: 1px; background: rgba(255, 250, 240, 0.35); }
#buck-break .gl-canvas {
  /* TW-1209 fix round: full opacity now holds to 84% (was 74%).
     The fade used to start at the rock's crest line, so the
     stone's body rendered at 70% opacity and falling down its
     whole face and read as a translucent sheet however it was
     textured (the core of Rosa's gate finding). The founder's
     blend direction stands: the rock is solid and realistic
     under the hooves first, and its base still dissolves into
     the section foot, transparent by 100%. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 17%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 17%, #000 84%, transparent 100%);
}
#buck-break.gl-on .gl-canvas { opacity: 1; }
@media (max-width: 720px) {
  .buck-break { padding: 5vh 14px 3vh 56px; }
  .buck-break.gl-on { min-height: 88vh; }
}
@media (prefers-reduced-motion: reduce) {
  #buck-break .gl-canvas { transition: none; }
}

/* TW-1155: Lead status chip (amber) beside the record and family
   chips, and a bounded branch panel list: a phase 1 line panel
   carries every cited fact for its people, which runs long. */
.src.lead { background: #f2e3c2; color: #6b4d12; }
.cp-list { max-height: min(52vh, 420px); overflow-y: auto; }
/* ============ Community tab: the papercraft village (TW-1077, TW-1227) ============
   The Community world is a place of its own, built like a paper
   diorama: flat paper shapes in stacked layers, each layer
   throwing a soft offset shadow onto the one beneath, a grain
   over everything, and no photographic backdrop. The sky, the
   light, and the street's bustle all follow the viewer's real
   hour; the phase is named on the svg as data-phase. */
.village-figure { margin: 26px 0 10px; }
.village-stage {
  border: 2px solid var(--pine);
  border-radius: 14px;
  overflow: hidden;
  background: #87a06c;
  line-height: 0;
}
.village-svg { width: 100%; height: auto; display: block; }
.village-svg .v-phase-rect { transition: opacity 0.9s ease; }

/* The paper layer shadow: a copy of a shape, offset down-right,
   in warm translucent brown. Everything built of paper casts it. */
.village-svg .v-psh, .village-svg .v-psh * { fill: rgba(74, 52, 32, 0.16); stroke: none; }

/* Sky: three gradient stops recolored per phase. */
.village-svg .sky-a, .village-svg .sky-b, .village-svg .sky-c { transition: stop-color 1.1s ease; }
.village-svg .sky-a { stop-color: #a8d4e6; }
.village-svg .sky-b { stop-color: #e8f0d8; }
.village-svg .sky-c { stop-color: #fbeec9; }
.village-svg[data-phase="dawn"] .sky-a { stop-color: #7f86b8; }
.village-svg[data-phase="dawn"] .sky-b { stop-color: #e8a56b; }
.village-svg[data-phase="dawn"] .sky-c { stop-color: #f7d98b; }
.village-svg[data-phase="midday"] .sky-a { stop-color: #bfe3ef; }
.village-svg[data-phase="midday"] .sky-b { stop-color: #dff2f4; }
.village-svg[data-phase="midday"] .sky-c { stop-color: #f7ecd2; }
.village-svg[data-phase="afternoon"] .sky-a { stop-color: #a5d2e8; }
.village-svg[data-phase="afternoon"] .sky-b { stop-color: #e6efdb; }
.village-svg[data-phase="afternoon"] .sky-c { stop-color: #f3e3bb; }
.village-svg[data-phase="dusk"] .sky-a { stop-color: #565d8f; }
.village-svg[data-phase="dusk"] .sky-b { stop-color: #c96f3f; }
.village-svg[data-phase="dusk"] .sky-c { stop-color: #e8a56b; }
.village-svg[data-phase="night"] .sky-a { stop-color: #131c33; }
.village-svg[data-phase="night"] .sky-b { stop-color: #22304d; }
.village-svg[data-phase="night"] .sky-c { stop-color: #2e405c; }

.village-svg .v-stars { opacity: 0; transition: opacity 1.1s ease; }
.village-svg .v-stars circle, .village-svg .v-stars path { fill: #f7efdb; stroke: none; }
.village-svg[data-phase="dusk"] .v-stars { opacity: 0.35; }
.village-svg[data-phase="night"] .v-stars { opacity: 0.9; }
.village-svg .v-sun-shadow { fill: rgba(74, 52, 32, 0.14); }
.village-svg .v-sun-ring { fill: #f0c94e; }
.village-svg .v-sun-disc { fill: #f3d98b; }
.village-svg .v-sun-core { fill: #f7e3a1; }
.village-svg[data-phase="night"] .v-sun { display: none; }
.village-svg[data-phase="dusk"] .v-sun { opacity: 0.55; }
.village-svg[data-phase="dawn"] .v-sun { opacity: 0.8; }
.village-svg .v-moon { display: none; }
.village-svg .v-moon path { fill: #f4ecd9; }
.village-svg .v-moon .v-moon-shadow { fill: rgba(10, 14, 26, 0.35); }
.village-svg[data-phase="night"] .v-moon { display: block; }
.village-svg .v-cloud path { fill: #ffffff; opacity: 0.88; }
.village-svg .v-cloud .v-cloud-shadow { fill: rgba(70, 90, 120, 0.16); opacity: 1; }
.village-svg .v-cloud { animation: v-drift 26s ease-in-out infinite alternate; }
@keyframes v-drift { from { transform: translateX(-13px); } to { transform: translateX(13px); } }
.village-svg[data-phase="night"] .v-cloud path { opacity: 0.25; }

/* Parallax layers: the world is stacked paper, and the stack
   leans a little as you look across it. */
.village-svg #v-layer-far, .village-svg #v-layer-mid, .village-svg #v-layer-fore {
  transition: transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: transform;
}

/* Far layer: hills and a distant town, muted paper. */
.village-svg .v-hills { fill: #a9bfa5; }
.village-svg .v-far-town path { fill: #93a9b8; opacity: 0.75; }
.village-svg .v-far-ground { fill: #a3b78f; }

/* Ground and street. */
.village-svg .v-grass { fill: #8ba46d; }
.village-svg .v-spurs { fill: none; stroke: #ddd2ba; stroke-width: 9; opacity: 0.5; stroke-linecap: round; }
.village-svg .v-walk-far, .village-svg .v-walk-near { fill: #ddd2ba; }
.village-svg .v-road { fill: #6e6860; }
.village-svg .v-road-edge { fill: #57534c; }
.village-svg .v-dashes { stroke: #e9e0c9; stroke-width: 5; stroke-dasharray: 36 30; opacity: 0.7; fill: none; }
.village-svg .v-crosswalk rect { fill: #e9e0c9; opacity: 0.4; }

/* Buildings: paper bodies with a soft edge line, never ink-black. */
.village-svg .v-buildings path,
.village-svg .v-buildings rect,
.village-svg .v-buildings polygon {
  stroke: rgba(59, 42, 26, 0.55); stroke-width: 2; stroke-linejoin: round;
}
.village-svg .v-buildings .v-psh, .village-svg .v-buildings .v-psh * { stroke: none; }
.village-svg .v-body-w { fill: #f4ecd9; }
.village-svg .v-body-brick { fill: #b06a4e; }
.village-svg .v-logs { fill: #e6d3a3; }
.village-svg .v-roof { fill: #a85f38; }
.village-svg .v-bld:nth-child(2) .v-roof { fill: #7c8aa0; }
.village-svg .v-bld:nth-child(3) .v-roof { fill: #96603a; }
.village-svg .v-bld:nth-child(5) .v-roof { fill: #6e4a35; }
.village-svg .v-chimney { fill: #9a8f7d; }
.village-svg .v-door { fill: #6b4a2c; }
.village-svg .v-win { fill: #f7efdb; }
.village-svg .v-win.lit { fill: #f0c94e; }
.village-svg .v-win-arch { fill: #f7efdb; }
.village-svg .v-loglines, .village-svg .v-bricklines {
  fill: none; stroke: rgba(59, 42, 26, 0.35); stroke-width: 1.6;
}
.village-svg .v-porch, .village-svg .v-cross {
  fill: none; stroke: rgba(59, 42, 26, 0.6); stroke-width: 2.4; stroke-linecap: round;
}
.village-svg .v-awning { fill: #b4502e; }
.village-svg .v-awning-shadow { fill: rgba(74, 52, 32, 0.16); stroke: none; }
.village-svg .v-sign { fill: #faf3e3; }
.village-svg .v-sign-text {
  fill: var(--ink); stroke: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.22em;
}

/* Foreground props. */
.village-svg .v-props path {
  fill: none; stroke: rgba(59, 42, 26, 0.5); stroke-width: 1.8; stroke-linejoin: round;
}
.village-svg .v-props rect,
.village-svg .v-props polygon,
.village-svg .v-props circle {
  stroke: rgba(59, 42, 26, 0.5); stroke-width: 1.8; stroke-linejoin: round;
}
.village-svg .v-props .v-psh, .village-svg .v-props .v-psh * { stroke: none; }
.village-svg .v-trunk { fill: #7a5a38; }
.village-svg .v-leaf { fill: #5f7f4a; }
.village-svg .v-leaf-hi { fill: #74925c; stroke: none; }
.village-svg .v-roof-sm { fill: #96603a; }
.village-svg .v-well-base { fill: #a49a86; }
.village-svg .v-well-lines { fill: none; stroke: rgba(59, 42, 26, 0.3); stroke-width: 1.4; }
.village-svg .v-stall-top { fill: #8a6f4d; }
.village-svg .v-stall-body { fill: #e6d7b8; }
.village-svg .v-stall-goods { fill: #d9b380; stroke: rgba(59, 42, 26, 0.4); stroke-width: 1.4; }
.village-svg .v-bench-wood { fill: #96603a; }
.village-svg .v-fence rect { fill: #a5825c; stroke: none; }
.village-svg .v-soil { fill: #7c6a4a; }
.village-svg .v-sprouts { stroke: #8fae7d; stroke-width: 2.2; fill: none; }
.village-svg .v-gas-canopy { fill: #ece2c8; }
.village-svg .v-gas-trim { fill: #b4502e; }
.village-svg .v-gas-kiosk { fill: #e6d3a3; }
.village-svg .v-gas-kiosk-roof { fill: #96603a; }
.village-svg .v-gas-post { fill: #8d8578; }
.village-svg .v-gas-sign { fill: #b4502e; }
.village-svg .v-gas-sign-text {
  fill: #faf3e3; stroke: none;
  font-size: 15px; font-weight: 700; letter-spacing: 0.3em;
}
.village-svg .v-pump rect { fill: #c9532f; }
.village-svg .v-pump .v-pump-face { fill: #faf3e3; }
.village-svg .v-pump path { fill: none; }
.village-svg .v-gas-island { fill: #a49a86; }
.village-svg .v-win { fill: #f7efdb; }
.village-svg .v-win.lit { fill: #f0c94e; }

/* Vehicle headlights and the buggy lantern wake at dusk. */
.village-svg .v-headlight { opacity: 0; transition: opacity 0.9s ease; }
.village-svg[data-phase="dusk"] .v-headlight,
.village-svg[data-phase="night"] .v-headlight { opacity: 0.4; }

/* The paper figures ride lifted off the scene on a soft shadow. */
.village-svg .wk-flip { filter: url(#v-paperlift); }
.village-svg .walker { cursor: pointer; }
.village-svg .walker:focus { outline: none; }
.village-svg .walker:focus-visible .wk-ring { opacity: 1; }
.village-svg .walker:hover .wk-ring { opacity: 0.55; }

/* Era-quirk speech: a paper bubble with a folded tail, popping
   in over the speaker and folding away. */
.village-svg .v-bubble { pointer-events: none; }
.village-svg .v-bubble .v-bubble-box {
  fill: #fffdf6; stroke: rgba(59, 42, 26, 0.45); stroke-width: 1.6;
  filter: drop-shadow(1.5px 2.5px 0 rgba(74, 52, 32, 0.18));
}
.village-svg .v-bubble .v-bubble-tail { fill: #fffdf6; stroke: rgba(59, 42, 26, 0.45); stroke-width: 1.6; }
.village-svg .v-bubble text {
  fill: #33302a; font-size: 13.5px; font-weight: 600; text-anchor: middle;
}
.village-svg .v-bubble-in { animation: v-bubble-in 0.32s cubic-bezier(0.2, 1.4, 0.4, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.village-svg .v-bubble-out { animation: v-bubble-out 0.4s ease-in both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes v-bubble-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes v-bubble-out { from { transform: scale(1); opacity: 1; } to { transform: scale(0.7) translateY(4px); opacity: 0; } }

.village-svg .v-waypoint path { fill: none; stroke: #6b4a2c; stroke-width: 3.4; stroke-linecap: round; }
.village-svg .v-waypoint rect { fill: #476b52; stroke: rgba(59, 42, 26, 0.4); stroke-width: 1.6; }
.village-svg .v-waypoint rect.v-wp-shadow { fill: rgba(74, 52, 32, 0.18); stroke: none; }
.village-svg .v-waypoint text {
  fill: #f7efdb; stroke: none;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
}
.village-svg .v-waypoint text.v-waypoint-sub {
  font-size: 10.5px; font-weight: 400; letter-spacing: 0.04em; fill: #e8dfc8;
}
.village-caption {
  display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: space-between;
  margin-top: 9px; color: var(--ink-soft); font-size: 0.94rem; line-height: 1.45;
}
.village-noscript { color: var(--ink-soft); margin: 10px 0 0; }
.village-roster { margin: 34px 0 8px; }
.village-roster h2 { margin-bottom: 8px; }
.village-roster p { max-width: 68ch; color: var(--ink-soft); }
.roster-empty { font-size: 1.05rem; color: var(--ink); }
.roster-list {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 10px;
}
.roster-btn {
  display: block; width: 100%; box-sizing: border-box;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 58px;
  color: var(--ink); text-decoration: none;
}
.roster-btn:hover, .roster-btn:focus-visible { border-color: var(--gold-deep); }
.roster-name { display: block; font-weight: 700; font-size: 1.02rem; }
.roster-meta { display: block; color: var(--ink-soft); font-size: 0.9rem; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
  .village-svg .v-phase-rect { transition: none; }
  .village-svg .v-cloud { animation: none; }
  .village-svg #v-layer-far, .village-svg #v-layer-mid, .village-svg #v-layer-fore { transition: none; }
  .village-svg .v-bubble-in, .village-svg .v-bubble-out { animation: none; }
}
@media (max-width: 560px) {
  .village-caption { font-size: 0.88rem; }
  .roster-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .roster-list { grid-template-columns: 1fr; }
}

/* ==== Community, the overhead world (TW-1232) ====
   The Community page is the world alone: a wide box holding a
   scrolling overhead neighborhood, minimap upper left in a
   paper frame, speech bubbles of paper over the canvas. */
.world-wrap { max-width: 1560px; margin: 0 auto; padding: 0 18px; }
.world-figure { margin: 20px 0 10px; }
.world-stage {
  position: relative;
  width: 100%;
  height: clamp(430px, 76vh, 840px);
  border: 2px solid var(--pine);
  border-radius: 14px;
  overflow: hidden;
  background: #466324;
  box-shadow: 0 18px 40px rgba(30, 25, 15, 0.28);
}
#world-canvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
#world-canvas:focus-visible { outline: 3px solid #b9872c; outline-offset: -3px; }
#world-minimap {
  position: absolute; top: 12px; left: 12px;
  width: 200px; height: 150px;
  border: 3px solid #f2ead8; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(20, 16, 8, 0.45);
  background: #5d8a3c;
  pointer-events: none;
}
.world-bubble {
  position: absolute; top: 0; left: 0;
  max-width: 250px;
  padding: 8px 13px;
  background: #fffdf6; color: #2b2012;
  border: 2px solid #2b2012; border-radius: 12px;
  font-weight: 600; font-size: 15px; line-height: 1.3;
  box-shadow: 0 5px 0 rgba(43, 32, 18, 0.22);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
  will-change: transform;
}
.world-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -8px;
  width: 13px; height: 13px;
  background: #fffdf6;
  border-right: 2px solid #2b2012; border-bottom: 2px solid #2b2012;
  transform: translateX(-50%) rotate(45deg);
}
.world-bubble.show { opacity: 1; }
.world-zoom {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.world-zoom button {
  width: 38px; height: 38px;
  border: 2px solid #2b2012; border-radius: 9px;
  background: #fffdf6; color: #2b2012;
  font-size: 21px; font-weight: 700; line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(43, 32, 18, 0.25);
}
.world-zoom button:hover { background: #f2ead8; }
.world-caption {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  gap: 16px;
  margin-top: 10px; color: var(--ink-soft); font-size: 0.95rem;
}
.world-caption-hint { font-style: italic; }
.world-sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
@media (max-width: 640px) {
  .world-stage { height: 64vh; }
  #world-minimap { width: 128px; height: 96px; }
  .world-bubble { font-size: 13.5px; max-width: 190px; }
  .world-caption { grid-template-columns: 1fr; }
}
