/* ============================================================
   Blackburn Legacy — public welcome page (v2/welcome.php)
   Version 2026-09-15. Loads after heirloom.css and public.css and
   uses the Heirloom Ledger tokens (Branch B brand). Night mode
   follows localStorage la-theme, like every other page.
   ============================================================ */

body.bl-welcome {
  --w-ground: var(--parchment, #f6f1e4);
  --w-paper: var(--paper, #fffdf8);
  --w-deep: var(--parchment-dark, #ece3cd);
  --w-heading: var(--ink-navy, #1c2436);
  --w-text: var(--ink-text, #2b2a26);
  --w-muted: var(--ink-muted, #6b6558);
  --w-line: var(--line, #dcd0b4);
  --w-accent: var(--brass, #8b5e34);
  --w-soft: var(--gold, #b08d57);
  --w-band: var(--ink-navy, #1c2436);
  --w-band-text: #ece3cd;
  --w-band-muted: #b3aa96;
  --w-band-accent: var(--gold-light, #d3b787);
  --w-band-line: #3a4560;
  --w-btn: var(--ink-navy, #1c2436);
  --w-btn-text: #f6f1e4;
  --w-btn-hover: var(--ink-navy-light, #2a3550);

  display: block;
  min-height: 100vh;
  margin: 0;
  background: var(--w-ground);
  color: var(--w-text);
  font-family: var(--font-body, "Source Sans 3", -apple-system, "Segoe UI", sans-serif);
  font-size: 17px;
  line-height: 1.6;
}
html.la-night body.bl-welcome {
  --w-ground: #10141d;
  --w-paper: #171d2b;
  --w-deep: #1d2434;
  --w-heading: #ece4d0;
  --w-text: #d9d1bc;
  --w-muted: #a9a08a;
  --w-line: #2f384b;
  --w-accent: #d3b787;
  --w-soft: #b08d57;
  --w-band: #0b0f17;
  --w-band-line: #262f42;
  --w-btn: #d3b787;
  --w-btn-text: #14181f;
  --w-btn-hover: #e2c99e;
}

body.bl-welcome :is(h1, h2, h3) {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  color: var(--w-heading); font-weight: 600; text-wrap: balance;
}
:where(body.bl-welcome) :where(h1, h2, h3) {
  margin: 0;
}
:where(body.bl-welcome) :where(p) { margin: 0; }
body.bl-welcome a { color: var(--w-accent); }
body.bl-welcome a:hover { color: var(--w-heading); }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

.w-wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.w-label {
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--w-accent);
}

/* ---------- top bar ---------- */
.w-top { position: sticky; top: 0; z-index: 40; background: var(--w-band); border-bottom: 3px solid var(--w-soft); }
.w-top .w-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
body.bl-welcome .w-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.12; color: var(--w-band-accent); }
.w-brand svg { width: 38px; height: 38px; flex: none; }
.w-brand b { display: block; font-family: var(--font-display, "Fraunces", Georgia, serif); font-weight: 600; font-size: 1.25rem; color: #f6f1e4; white-space: nowrap; }
.w-brand b em { font-style: italic; font-weight: 400; color: var(--w-band-accent); }
.w-brand small { display: block; font-family: var(--font-mono, monospace); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--w-band-muted); }
.w-nav { display: flex; align-items: center; gap: 6px; }
body.bl-welcome .w-nav a { color: var(--w-band-text); text-decoration: none; font-size: 0.95rem; padding: 8px 10px; border-radius: 6px; }
body.bl-welcome .w-nav a:hover { color: var(--w-band-accent); }
body.bl-welcome .w-nav a.w-signin { margin-left: 8px; border: 1px solid var(--w-band-accent); color: var(--w-band-accent); padding: 7px 16px; }
body.bl-welcome .w-nav a.w-signin:hover { background: var(--w-band-accent); color: #1c2436; }
.w-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 4px; border-radius: 999px;
  border: 1px solid var(--w-band-line); background: transparent; color: var(--w-band-text); cursor: pointer;
}
.w-theme:hover { color: var(--w-band-accent); border-color: var(--w-band-accent); }
.w-theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 720px) { body.bl-welcome .w-nav a:not(.w-signin) { display: none; } }
@media (max-width: 380px) { .w-brand small { display: none; } .w-brand b { font-size: 1.1rem; } }

/* ---------- buttons ---------- */
body.bl-welcome .w-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 1.02rem/1 var(--font-body, sans-serif);
  padding: 16px 26px; border-radius: 8px; text-decoration: none;
  background: var(--w-btn); color: var(--w-btn-text);
  box-shadow: 0 10px 24px -14px rgba(28, 36, 54, 0.7);
  transition: background 160ms ease, transform 160ms ease;
}
body.bl-welcome .w-btn:hover { background: var(--w-btn-hover); color: var(--w-btn-text); transform: translateY(-1px); }
body.bl-welcome .w-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.bl-welcome .w-quiet {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 2px;
  font-weight: 600; color: var(--w-heading); text-decoration: none;
  border-bottom: 1.5px solid var(--w-soft);
}
body.bl-welcome .w-quiet:hover { color: var(--w-accent); }
body.bl-welcome :focus-visible { outline: 3px solid var(--w-soft); outline-offset: 3px; border-radius: 4px; }

/* ---------- hero ---------- */
.w-hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 92px) clamp(44px, 6vw, 80px); }
.w-hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(176, 141, 87, 0.20), transparent 70%); pointer-events: none;
}
.w-hero .w-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.w-hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.02em; margin: 18px 0 22px; font-variation-settings: "opsz" 144; }
.w-hero h1 em { font-style: italic; font-weight: 400; color: var(--w-accent); }
.w-lede { font-size: 1.16rem; color: var(--w-muted); max-width: 36ch; }
.w-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 32px; }
.w-fine { margin-top: 18px; font-size: 0.92rem; color: var(--w-muted); max-width: 44ch; }
@media (max-width: 860px) { .w-hero .w-wrap { grid-template-columns: 1fr; } }

/* pedigree chart */
.w-chart { margin: 0; background: var(--w-paper); border: 1px solid var(--w-line); border-radius: 10px; padding: clamp(14px, 2.5vw, 26px); box-shadow: 0 24px 50px -30px rgba(28, 36, 54, 0.45); transform: rotate(-0.6deg); }
.w-chart svg { display: block; width: 100%; height: auto; }
.w-chart .colhead { font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: 0.14em; fill: var(--w-muted); }
.w-chart .num { font-family: var(--font-mono, monospace); font-size: 11px; fill: var(--w-accent); font-weight: 500; }
.w-chart .role { font-family: var(--font-display, serif); font-size: 14px; fill: var(--w-heading); }
.w-chart .you { font-family: var(--font-display, serif); font-style: italic; font-size: 17px; fill: var(--w-accent); }
.w-chart .vitals { font-family: var(--font-mono, monospace); font-size: 10px; fill: var(--w-muted); }
.w-chart .rule { stroke: var(--w-line); stroke-width: 1; }
.w-chart .branch { stroke: var(--w-soft); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 0; }
.w-chart .dot { fill: var(--w-soft); }
.w-chart .further { stroke: var(--w-soft); stroke-width: 1.2; stroke-dasharray: 2 4; fill: none; }
.w-chart figcaption { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--w-line); font-size: 0.87rem; color: var(--w-muted); }
.w-chart figcaption b { font-family: var(--font-mono, monospace); font-weight: 500; font-size: 0.78rem; color: var(--w-accent); }
@media (prefers-reduced-motion: no-preference) {
  .w-chart .branch { animation: w-draw 1.6s ease-out both; }
  .w-chart .branch.b2 { animation-delay: 0.5s; }
  .w-chart .branch.b3 { animation-delay: 0.8s; }
  .w-chart .dot, .w-chart .role, .w-chart .vitals, .w-chart .num { animation: w-fade 0.8s ease-out both; animation-delay: 0.9s; }
  @keyframes w-draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
  @keyframes w-fade { from { opacity: 0; } to { opacity: 1; } }
  .js .w-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .w-reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- sections ---------- */
.w-block { padding-block: clamp(56px, 8vw, 100px); }
.w-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 48px; align-items: end; margin-bottom: 44px; }
.w-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1; margin-top: 10px; }
.w-head p { color: var(--w-muted); max-width: 58ch; }
@media (max-width: 760px) { .w-head { grid-template-columns: 1fr; } }

/* rooms */
.w-rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.w-room { background: var(--w-paper); border: 1px solid var(--w-line); border-radius: 12px; padding: 24px 24px 12px; }
.w-room h3 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; padding-bottom: 12px; border-bottom: 2px solid var(--w-heading); margin-bottom: 4px; }
.w-room h3 svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--w-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.w-room ul { list-style: none; margin: 0; padding: 0; }
.w-room li { padding-block: 12px; border-bottom: 1px solid var(--w-line); }
.w-room li:last-child { border-bottom: 0; }
.w-room li strong { display: block; font-weight: 600; color: var(--w-heading); }
.w-room li span { display: block; font-size: 0.94rem; color: var(--w-muted); }
@media (max-width: 900px) { .w-rooms { grid-template-columns: 1fr; } }

/* tree band */
.w-band { background: var(--w-band); color: var(--w-band-text); border-top: 3px solid var(--w-soft); }
body.bl-welcome .w-band h2, body.bl-welcome .w-band h3 { color: var(--w-band-text); }
.w-band .w-label { color: var(--w-band-accent); }
.w-band .w-head p { color: var(--w-band-muted); }
.w-charts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--w-band-line); border: 1px solid var(--w-band-line); border-radius: 12px; overflow: hidden; }
.w-charts article { background: var(--w-band); padding: 28px 24px 30px; display: grid; grid-template-rows: auto auto 1fr; gap: 12px; }
.w-charts svg { width: 100%; max-width: 180px; height: 96px; }
.w-charts svg * { stroke: var(--w-band-accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.w-charts svg .fill { fill: var(--w-band-accent); stroke: none; }
.w-charts svg .faint { stroke: var(--w-band-line); }
.w-charts h3 { font-size: 1.2rem; }
.w-charts p { font-size: 0.94rem; color: var(--w-band-muted); }
.w-also { margin-top: 28px; font-size: 0.96rem; color: var(--w-band-muted); max-width: 80ch; }
.w-also b { color: var(--w-band-text); font-weight: 600; }
@media (max-width: 900px) { .w-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .w-charts { grid-template-columns: 1fr; } }

/* promise (privacy) */
.w-promise { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px 48px; }
.w-promise h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1; margin-top: 10px; }
.w-promise p.w-sub { margin-top: 14px; color: var(--w-muted); }
.w-promise dl { margin: 0; }
.w-promise dl div { display: grid; grid-template-columns: 2.4rem 11rem 1fr; gap: 6px 18px; padding-block: 20px; border-top: 1px solid var(--w-line); align-items: start; }
.w-promise dl div:last-child { border-bottom: 1px solid var(--w-line); }
.w-promise dl svg { width: 28px; height: 28px; fill: none; stroke: var(--w-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.w-promise dt { font-family: var(--font-display, serif); font-weight: 600; color: var(--w-heading); font-size: 1.1rem; line-height: 1.35; }
.w-promise dd { margin: 0; color: var(--w-muted); }
@media (max-width: 760px) {
  .w-promise { grid-template-columns: 1fr; }
  .w-promise dl div { grid-template-columns: 2.4rem 1fr; }
  .w-promise dd { grid-column: 2; }
}

/* joining */
.w-join { background: var(--w-paper); border-block: 1px solid var(--w-line); }
.w-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.w-steps li { position: relative; padding: 22px 22px 24px; border: 1px solid var(--w-line); border-radius: 12px; background: var(--w-ground); }
.w-steps .w-n {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 999px; background: var(--w-band); color: var(--w-band-accent);
  font-family: var(--font-mono, monospace); font-size: 0.85rem;
}
.w-steps h3 { font-size: 1.22rem; margin-bottom: 6px; }
.w-steps p { color: var(--w-muted); font-size: 0.97rem; }
@media (max-width: 760px) { .w-steps { grid-template-columns: 1fr; } }
.w-close { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; margin-top: 44px; padding-top: 32px; border-top: 1px dashed var(--w-line); }
.w-close p { flex: 1 1 260px; font-family: var(--font-display, serif); font-style: italic; font-size: 1.35rem; color: var(--w-heading); }

/* footer */
.w-foot { padding-block: 32px 48px; font-size: 0.92rem; color: var(--w-muted); }
.w-foot .w-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.w-foot .w-mini { display: inline-flex; align-items: center; gap: 8px; }
.w-foot .w-mini svg { width: 20px; height: 20px; color: var(--w-heading); }

@media print {
  .w-top, .w-theme, .w-close, .w-actions { display: none !important; }
  .w-band { background: #fff; color: #000; }
}
