/* =========================================================
   RODRIGUEZ — HERITAGE PAGE (v3)
   Typefaces: Clarice + Termina ONLY.
   Pure CSS: no JavaScript, no libraries.
   Scroll effects use CSS scroll-driven animations; browsers
   without support show the finished state.
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face { font-family: "Clarice"; src: url("fonts/Clarice-Inline.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

@font-face { font-family: "Termina"; src: url("fonts/Termina-Thin.woff2") format("woff2");       font-weight: 200; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-ExtraLight.woff2") format("woff2"); font-weight: 250; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Light.woff2") format("woff2");      font-weight: 300; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Regular.woff2") format("woff2");    font-weight: 400; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Medium.woff2") format("woff2");     font-weight: 500; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Demi.woff2") format("woff2");       font-weight: 600; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Bold.woff2") format("woff2");       font-weight: 700; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Heavy.woff2") format("woff2");      font-weight: 800; font-display: swap; }
@font-face { font-family: "Termina"; src: url("fonts/Termina-Black.woff2") format("woff2");      font-weight: 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --night: #0c0907;
  --coal: #14100c;
  --smoke: #1d1712;
  --line: rgba(214, 177, 110, .22);
  --line-strong: rgba(214, 177, 110, .45);
  --gold: #d6b16e;
  --gold-hi: #f1dca6;
  --gold-lo: #8c6632;
  --ivory: #ece2cd;
  --muted: #a89a82;
  --parchment: #ece3cf;
  --ink: #241a12;
  --band: #8a2b1e;

  --gold-grad: linear-gradient(100deg, var(--gold-hi) 0%, var(--gold) 35%, var(--gold-lo) 60%, var(--gold-hi) 100%);

  /* only two families; each falls back to the other for missing characters */
  --display: "Clarice", "Termina";
  --text: "Termina", "Clarice";

  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --max: 1320px;
  --ease: cubic-bezier(.2, .75, .15, 1);
}

@property --n { syntax: "<integer>"; inherits: false; initial-value: 0; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--night); color: var(--ivory);
  font-family: var(--text); font-weight: 300; font-size: .8rem; line-height: 2.1; letter-spacing: .02em;
  font-synthesis: none; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
input, button, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }
p { margin: 0 0 1.1rem; }
::selection { background: var(--gold); color: var(--night); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- CSS-drawn glyphs (no symbol fonts needed) ---------- */
.dia { display: inline-block; flex: none; width: .55em; height: .55em; border: 1px solid currentColor; transform: rotate(45deg); vertical-align: middle; }
.dia--fill { background: currentColor; }
.dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); vertical-align: middle; margin: 0 .7em; }
.arr { display: inline-block; position: relative; width: 1.4em; height: 1px; background: currentColor; vertical-align: middle; transition: transform .4s var(--ease); }
.arr::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.chev { display: block; width: 10px; height: 10px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }

/* ---------- Type helpers ---------- */
.kicker {
  font-family: var(--text); font-weight: 500; font-size: .62rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 1.4rem; display: flex; align-items: center; gap: .9rem; line-height: 1.6;
}
.kicker .dia { color: var(--gold-hi); }
.kicker--sm { font-size: .55rem; margin-bottom: 1rem; }
.kicker--center { justify-content: center; }

.h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 1.02; margin: 0; text-transform: uppercase;
}
.h2 em { color: var(--gold); }
.h3 {
  font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.12; margin: 0 0 1.4rem; text-transform: uppercase;
}
.gold-text {
  background: var(--gold-grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.frame { border: 1px solid var(--line-strong); outline: 1px solid var(--line); outline-offset: -9px; }

/* ---------- Buttons & links ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 1.15rem 2.4rem; overflow: hidden; isolation: isolate; line-height: 1;
  font-family: var(--text); font-weight: 600; font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  transition: color .45s var(--ease), box-shadow .45s var(--ease);
}
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-101%); transition: transform .55s var(--ease); }
.btn:hover::after { transform: none; }
.btn--gold { background: linear-gradient(180deg, #e4c78b, #b98c4f); color: var(--night); box-shadow: 0 0 0 1px var(--night), 0 0 0 2px #e4c78b; }
.btn--gold::after { background: var(--ivory); }
.btn--gold:hover { box-shadow: 0 0 0 1px var(--night), 0 0 0 2px var(--ivory), 0 10px 30px -8px rgba(214,177,110,.5); }
.btn--ghost { color: var(--ivory); border: 1px solid var(--line-strong); }
.btn--ghost::after { background: var(--gold); }
.btn--ghost:hover { color: var(--night); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }

.link-arrow {
  font-family: var(--text); font-weight: 500; font-size: .58rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); display: inline-flex; gap: .9rem; align-items: center;
  padding-bottom: .5rem; border-bottom: 1px solid var(--line-strong);
}
.link-arrow:hover .arr { transform: translateX(6px); }

.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 120; background: var(--gold-grad); transform-origin: left; transform: scaleX(0); }

/* =========================================================
   ANNOUNCEMENT + HEADER
   ========================================================= */
.announce {
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  background: var(--coal); border-bottom: 1px solid var(--line); padding: .55rem var(--pad);
  font-weight: 400; font-size: .52rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); text-align: center;
}
.announce p { margin: 0; }
.announce > .dia { color: var(--gold); }

.header { position: sticky; top: 0; z-index: 80; background: rgba(12,9,7,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header__inner {
  width: min(100% - 2 * var(--pad), 1440px); margin-inline: auto; height: 92px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem;
}
.brand img { height: 58px; width: auto; transition: transform .5s var(--ease); }
.brand:hover img { transform: scale(1.05); }
.nav { display: flex; gap: clamp(1rem, 2.2vw, 2.3rem); }
.nav--right { justify-content: flex-end; }
.nav a {
  position: relative; padding: .35rem 0;
  font-weight: 500; font-size: .55rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ivory); transition: color .3s;
}
.nav a::before {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px; background: var(--gold);
  transform: translateX(-50%) translateY(-4px) rotate(45deg); opacity: 0; transition: opacity .3s, transform .4s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--gold-hi); }
.nav a:hover::before, .nav a.is-active::before { opacity: 1; transform: translateX(-50%) rotate(45deg); }
.bag span { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; margin-left: .4rem; border: 1px solid var(--gold); color: var(--gold); letter-spacing: 0; }
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: none; }

/* =========================================================
   HERO — typographic, smoke + emblem, no photo
   ========================================================= */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: calc(100svh - 128px);
  display: grid; grid-template-rows: 1fr auto;
  background:
    radial-gradient(ellipse 55% 45% at 50% 40%, rgba(214,177,110,.16), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(138,43,30,.18), transparent 70%),
    var(--night);
}
.hero__veins { /* tobacco-leaf vein pattern */
  position: absolute; inset: -10%; z-index: -2; opacity: .55;
  background:
    repeating-linear-gradient(118deg, rgba(214,177,110,.07) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(62deg, rgba(214,177,110,.07) 0 1px, transparent 1px 46px);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, #000 0%, transparent 75%);
  animation: veins 30s linear infinite alternate;
}
.hero::before { /* central stem of the leaf */
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; z-index: -1;
  background: linear-gradient(transparent, var(--line-strong) 6%, transparent 17%, transparent 88%, var(--line-strong) 96%);
}

.smoke { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.smoke span {
  position: absolute; left: 50%; bottom: 8%; width: 260px; height: 260px; margin-left: -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236,226,205,.13) 0%, rgba(236,226,205,.04) 45%, transparent 70%);
  filter: blur(22px); opacity: 0;
  animation: smoke 16s linear infinite;
}
.smoke span:nth-child(1) { --dx: -120px; animation-delay: 0s; }
.smoke span:nth-child(2) { --dx: 90px;   animation-delay: 3.2s; }
.smoke span:nth-child(3) { --dx: -40px;  animation-delay: 6.4s; }
.smoke span:nth-child(4) { --dx: 160px;  animation-delay: 9.6s; }
.smoke span:nth-child(5) { --dx: -180px; animation-delay: 12.8s; }

.hero__inner { align-self: center; text-align: center; padding: clamp(2rem, 5vh, 4rem) var(--pad) 2rem; }

.emblem { position: relative; width: 150px; aspect-ratio: 1; margin: 0 auto 1.6rem; display: grid; place-items: center; animation: pop 1.4s var(--ease) .1s both; }
.emblem__ring { position: absolute; border-radius: 50%; transition: transform .8s var(--ease), border-color .5s; }
.emblem__ring--outer { inset: 0; border: 1px solid var(--line-strong); }
.emblem__ring--dash { inset: 10px; border: 1px dashed rgba(214,177,110,.55); animation: spin 40s linear infinite; }
.emblem__ring--inner { inset: 22px; border: 1px solid var(--gold); box-shadow: inset 0 0 30px rgba(214,177,110,.15), 0 0 40px rgba(214,177,110,.12); }
.emblem img { width: 62px; position: relative; }
.emblem:hover .emblem__ring--outer { transform: scale(1.12); border-color: var(--gold); }
.emblem:hover .emblem__ring--inner { transform: scale(.94); }

.hero .kicker { animation: rise 1s var(--ease) .35s both; }
.hero__title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(3rem, 8vw, 7.2rem); line-height: .98; margin: 0 0 1.6rem;
}
.mask { display: block; overflow: hidden; padding-bottom: .06em; }
.mask > span { display: inline-block; animation: up 1.3s var(--ease) both; }
.mask:nth-child(1) > span { animation-delay: .5s; }
.mask .gold-text { animation: up 1.3s var(--ease) .65s both, shimmer 7s ease-in-out 2s infinite; }
.hero__lede { max-width: 540px; margin: 0 auto 1.8rem; font-size: .82rem; color: var(--muted); animation: rise 1.1s var(--ease) .9s both; }

.scroll-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: .9rem; color: var(--gold);
  font-weight: 500; font-size: .52rem; letter-spacing: .3em; text-transform: uppercase;
  animation: rise 1s var(--ease) 1.1s both;
}
.scroll-btn .chev { animation: bob 2s ease-in-out infinite; }
.scroll-btn:hover { color: var(--gold-hi); }

.ribbon {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(12,9,7,.6); backdrop-filter: blur(6px);
}
.ribbon li { border-right: 1px solid var(--line); animation: rise .9s var(--ease) both; }
.ribbon li:nth-child(1) { animation-delay: 1.2s; }
.ribbon li:nth-child(2) { animation-delay: 1.3s; }
.ribbon li:nth-child(3) { animation-delay: 1.4s; }
.ribbon li:nth-child(4) { animation-delay: 1.5s; border-right: 0; }
.ribbon a { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 1rem; padding: 1.5rem 1rem; transition: background .4s; }
.ribbon a::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--gold-grad); transform: scaleX(0); transition: transform .6s var(--ease); }
.ribbon a:hover { background: rgba(214,177,110,.06); }
.ribbon a:hover::after { transform: scaleX(1); }
.ribbon strong { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1; color: var(--gold-hi); }
.ribbon span { font-weight: 400; font-size: .52rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* =========================================================
   PROLOGUE
   ========================================================= */
.prologue { padding: clamp(6rem, 13vw, 10rem) 0; text-align: center; background: linear-gradient(var(--night), var(--coal)); }
.prologue__inner { max-width: 1050px; }
.prologue__quote { font-family: var(--display); font-size: clamp(1.8rem, 4.2vw, 3.6rem); line-height: 1.2; text-transform: uppercase; margin: 0 0 2.2rem; }
.prologue__sub { font-weight: 400; font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0; }
.fill { color: var(--ink); }
.fill--light { color: var(--ivory); }

/* =========================================================
   CHAPTERS
   ========================================================= */
.chapters { padding: clamp(5rem, 10vw, 8rem) 0; position: relative; }
.chapters__head { display: grid; grid-template-columns: 1.3fr 1fr; align-items: end; gap: 3rem; padding-bottom: clamp(3rem, 6vw, 5rem); }
.chapters__intro { color: var(--muted); max-width: 420px; justify-self: end; margin: 0; }

.chapter {
  position: relative; scroll-margin-top: 110px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .9fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: start; padding: clamp(3.5rem, 7vw, 6rem) 0;
}
.chapter::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, var(--gold), var(--line) 40%, transparent); transform-origin: left; }
.chapter::after { content: ""; position: absolute; top: -3px; left: 0; width: 7px; height: 7px; background: var(--gold-hi); transform: rotate(45deg); }
.chapter__year { position: sticky; top: 140px; }
.chapter__year span {
  display: block; font-family: var(--display); font-size: clamp(4.4rem, 10vw, 9rem); line-height: .9;
  background: var(--gold-grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chapter__text { max-width: 470px; color: #d3c6ae; }
.chapter__text .h3 { color: var(--ivory); }
.big { font-family: var(--display); font-size: clamp(1.15rem, 1.8vw, 1.45rem); line-height: 1.5; color: var(--ivory); }
.chapter--quiet { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.9fr); }
.chapter--quiet .chapter__text { max-width: 720px; }
.chapter--quiet .chapter__year span { background: none; -webkit-text-stroke: 1px var(--band); }

.chapter__img { margin: 0; position: relative; overflow: hidden; }
.chapter__img::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(241,220,166,.35); pointer-events: none; transition: inset .6s var(--ease); }
.chapter__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(.15) contrast(1.05) brightness(.9); transition: scale 1.2s var(--ease), filter .8s var(--ease); }
.chapter__img:hover img { scale: 1.06; filter: grayscale(0) contrast(1.12) brightness(1); }
.chapter__img:hover::after { inset: 18px; }
.chapter__img figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.4rem 1.2rem; line-height: 1.6;
  background: linear-gradient(transparent, rgba(12,9,7,.85));
  font-weight: 400; font-size: .48rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi);
}
.figures { display: flex; gap: 2.5rem; margin: 2rem 0 0; }
.figures div { border-left: 1px solid var(--line-strong); padding-left: 1.1rem; }
.figures dt { font-weight: 400; font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.figures dd { margin: .3rem 0 0; font-family: var(--display); font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; color: var(--gold-hi); }

/* =========================================================
   MANIFESTO
   ========================================================= */
.manifesto {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--parchment); color: var(--ink); text-align: center;
  padding: clamp(6rem, 12vw, 10rem) 0 clamp(14rem, 26vw, 22rem);
}
.manifesto::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, rgba(140,102,50,.15), transparent 55%); }
.manifesto__bg { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: min(1200px, 110%); z-index: -1; }
.manifesto__bg img { width: 100%; mix-blend-mode: multiply; opacity: .75; mask-image: linear-gradient(transparent, #000 35%); }
.manifesto__inner { max-width: 1000px; display: grid; justify-items: center; }
.manifesto__over { font-weight: 500; font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-lo); margin-bottom: 1.8rem; }
.manifesto__crest { width: 66px; margin-bottom: 2rem; filter: brightness(.75) sepia(.4); }
.manifesto__title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.9rem, 4.4vw, 3.8rem); line-height: 1.1; margin: 0 0 3rem; }
.legend { max-width: 560px; padding: 2.2rem 2.6rem 1.4rem; background: rgba(236,227,207,.85); border-color: rgba(140,102,50,.45); outline-color: rgba(140,102,50,.2); }
.legend h3 { font-weight: 600; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-lo); margin: 0 0 .8rem; }
.legend p { font-size: .78rem; color: #4a3a2a; }

/* =========================================================
   THREE HOMES — CSS-only tabs
   ========================================================= */
.homes { padding: clamp(6rem, 12vw, 10rem) 0; background: linear-gradient(var(--night), var(--coal)); }
.homes__head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: end; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.homes__aside { justify-self: end; max-width: 380px; color: var(--muted); }

.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs__list { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.tabs__list label { position: relative; cursor: pointer; padding: 1.6rem 1.5rem; display: flex; align-items: baseline; gap: 1.2rem; border-right: 1px solid var(--line); color: var(--muted); transition: color .35s, background .35s; }
.tabs__list label:last-child { border-right: 0; }
.tabs__list label::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold-grad); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.tabs__list strong { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; color: var(--line-strong); transition: color .35s; }
.tabs__list span { font-weight: 500; font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; }
.tabs__list label:hover { color: var(--ivory); background: rgba(214,177,110,.04); }

#t1:checked ~ .tabs__list label[for="t1"], #t2:checked ~ .tabs__list label[for="t2"], #t3:checked ~ .tabs__list label[for="t3"] { color: var(--gold-hi); background: rgba(214,177,110,.06); }
#t1:checked ~ .tabs__list label[for="t1"]::after, #t2:checked ~ .tabs__list label[for="t2"]::after, #t3:checked ~ .tabs__list label[for="t3"]::after { transform: scaleX(1); }
#t1:checked ~ .tabs__list label[for="t1"] strong, #t2:checked ~ .tabs__list label[for="t2"] strong, #t3:checked ~ .tabs__list label[for="t3"] strong { color: var(--gold); }
#t1:focus-visible ~ .tabs__list label[for="t1"], #t2:focus-visible ~ .tabs__list label[for="t2"], #t3:focus-visible ~ .tabs__list label[for="t3"] { outline: 1px solid var(--gold); outline-offset: -6px; }

.tabs__panels { display: grid; padding-top: clamp(2.5rem, 5vw, 4rem); }
.panel {
  grid-area: 1 / 1; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  opacity: 0; visibility: hidden; transform: translateY(24px);
  transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s .6s;
}
#t1:checked ~ .tabs__panels .panel--1, #t2:checked ~ .tabs__panels .panel--2, #t3:checked ~ .tabs__panels .panel--3 { opacity: 1; visibility: visible; transform: none; transition-delay: .1s, .1s, 0s; }
.panel__img { position: relative; overflow: hidden; }
.panel__img img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; filter: brightness(.88); transform: scale(1.12); transition: transform 1.4s var(--ease); }
#t1:checked ~ .tabs__panels .panel--1 img, #t2:checked ~ .tabs__panels .panel--2 img, #t3:checked ~ .tabs__panels .panel--3 img { transform: scale(1); }
.panel__num { position: absolute; z-index: 1; left: 1.4rem; bottom: .6rem; font-family: var(--display); font-size: clamp(5rem, 10vw, 9rem); line-height: 1; color: rgba(12,9,7,.25); -webkit-text-stroke: 1px rgba(241,220,166,.85); }
.panel__body { max-width: 520px; color: #d3c6ae; }
.panel__body .h3 { color: var(--ivory); }
.specs { list-style: none; padding: 0; margin: 1.8rem 0 2.2rem; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.specs li { padding: 1rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .25rem; line-height: 1.5; }
.specs li:nth-child(odd) { padding-right: 1rem; border-right: 1px solid var(--line); }
.specs li:nth-child(even) { padding-left: 1.2rem; }
.specs span { font-weight: 400; font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.specs strong { font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--gold-hi); }
.note { font-size: .72rem; color: var(--muted); border-left: 2px solid var(--band); padding-left: 1.1rem; margin: 0; }

.tabs__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.tcard {
  cursor: pointer; display: grid; gap: .35rem; padding: 1.4rem 1.5rem; line-height: 1.5;
  border: 1px solid var(--line); background: rgba(29,23,18,.5);
  transition: border-color .4s, background .4s, transform .5s var(--ease);
}
.tcard:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.tcard__eyebrow { display: flex; align-items: center; gap: .6rem; font-weight: 500; font-size: .5rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.tcard strong { font-family: var(--display); font-weight: 400; font-size: 1.35rem; text-transform: uppercase; color: var(--ivory); }
.tcard > span:last-child { font-size: .62rem; color: var(--muted); }
#t1:checked ~ .tabs__cards .tcard--1, #t2:checked ~ .tabs__cards .tcard--2, #t3:checked ~ .tabs__cards .tcard--3 { border-color: var(--gold); background: rgba(214,177,110,.08); box-shadow: inset 0 0 0 1px rgba(214,177,110,.25); }

/* =========================================================
   GRATITUDE
   ========================================================= */
.gratitude { position: relative; isolation: isolate; overflow: hidden; padding: clamp(6rem, 12vw, 10rem) var(--pad); display: grid; place-items: center; }
.gratitude__bg { position: absolute; inset: -10% 0; z-index: -2; }
.gratitude__bg img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.3) brightness(.45) blur(1px); }
.gratitude::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(12,9,7,.55), var(--night) 80%); }
.gratitude__card { width: min(100%, 840px); text-align: center; padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 6vw, 4.5rem); background: rgba(20,16,12,.9); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.gratitude__crest { width: 58px; margin: 0 auto 1.6rem; }
.gratitude__title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.2; margin: 0 0 1.5rem; }
.gratitude__text { font-size: clamp(.74rem, 1vw, .82rem); color: var(--muted); margin: 0 auto 2.4rem; max-width: 620px; }
.gratitude__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--night); border-top: 1px solid var(--line); padding-top: clamp(4rem, 8vw, 6rem); font-size: .72rem; color: var(--muted); }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 3rem; padding-bottom: 3.5rem; }
.footer__brand img { height: 62px; width: auto; margin-bottom: 1.2rem; }
.footer__brand p { max-width: 300px; line-height: 1.9; }
.footer h2 { font-weight: 600; font-size: .55rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin: 0 0 1.2rem; }
.footer h2.mt { margin-top: 2rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer ul a { background: linear-gradient(var(--gold), var(--gold)) no-repeat left bottom / 0 1px; transition: background-size .45s var(--ease), color .3s; }
.footer ul a:hover { color: var(--ivory); background-size: 100% 1px; }
.social { display: flex !important; flex-wrap: wrap; gap: 1.2rem !important; }
.news { display: flex; border: 1px solid var(--line-strong); transition: border-color .3s; }
.news:focus-within { border-color: var(--gold); }
.news input { flex: 1; min-width: 0; background: transparent; border: 0; padding: .9rem 1rem; color: var(--ivory); font-weight: 300; font-size: .68rem; }
.news input::placeholder { color: rgba(168,154,130,.7); }
.news input:focus { outline: none; }
.news button { border: 0; cursor: pointer; padding: 0 1.1rem; background: var(--gold); color: var(--night); font-weight: 600; font-size: .5rem; letter-spacing: .2em; text-transform: uppercase; transition: background .3s; }
.news button:hover { background: var(--gold-hi); }
.partners { display: flex; gap: .7rem; }
.partners a { width: 108px; overflow: hidden; filter: grayscale(1); opacity: .6; transition: filter .4s, opacity .4s, transform .4s var(--ease); }
.partners a:hover { filter: none; opacity: 1; transform: translateY(-3px); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.6rem 0; border-top: 1px solid var(--line); font-size: .6rem; }
.footer__bottom span { display: inline-flex; align-items: center; gap: .8rem; }
.footer__bottom .dia { color: var(--gold); }
.footer__bottom a:hover { color: var(--gold-hi); }

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes bob { 50% { translate: 0 6px; } }
@keyframes veins { from { transform: translateY(0); } to { transform: translateY(-46px); } }
@keyframes smoke {
  0%   { opacity: 0; transform: translate(0, 0) scale(.5); }
  15%  { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--dx), -75vh) scale(2.6); }
}

/* scroll-driven */
@keyframes sx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes head-tight { to { height: 72px; } }
@keyframes logo-small { to { transform: scale(.82); } }
@keyframes hero-out { to { opacity: 0; transform: translateY(-70px) scale(.96); } }
@keyframes emblem-turn { to { rotate: 120deg; } }
@keyframes reveal { from { opacity: 0; transform: translateY(56px); } to { opacity: 1; transform: none; } }
@keyframes year-in { from { opacity: 0; transform: translateX(-60px); background-position: 100% 50%; } to { opacity: 1; transform: none; background-position: 0% 50%; } }
@keyframes img-wipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes img-par { from { translate: 0 -8%; scale: 1.2; } to { translate: 0 8%; scale: 1.2; } }
@keyframes fill { to { background-size: 100% 100%, 100% 100%; } }
@keyframes count { from { --n: 0; } to { --n: var(--to); } }
@keyframes crest-spin { from { rotate: -180deg; scale: .4; opacity: 0; } to { rotate: 0deg; scale: 1; opacity: 1; } }
@keyframes horses { from { transform: translateY(25%); } to { transform: none; } }
@keyframes card-zoom { from { opacity: 0; transform: scale(.88) translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes bg-par { from { transform: translateY(-8%); } to { transform: translateY(8%); } }

@supports (animation-timeline: view()) {
  .progress { animation: sx linear both; animation-timeline: scroll(root); }
  .header__inner { animation: head-tight linear both; animation-timeline: scroll(root); animation-range: 0 220px; }
  .brand img { animation: logo-small linear both; animation-timeline: scroll(root); animation-range: 0 220px; }

  .hero__inner { animation: hero-out linear both; animation-timeline: scroll(root); animation-range: 5vh 70vh; }
  .emblem__ring--outer { animation: emblem-turn linear both; animation-timeline: scroll(root); animation-range: 0 100vh; border-style: dotted; }

  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }

  .chapter::before { animation: sx linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
  .chapter__year span { animation: year-in linear both; animation-timeline: view(); animation-range: entry 10% cover 40%; }
  .chapter__img { animation: img-wipe linear both; animation-timeline: view(); animation-range: entry 10% cover 45%; }
  .chapter__img img { animation: img-par linear both; animation-timeline: view(); }
  .chapter__img:hover img { scale: 1.26; }

  .fill {
    color: transparent;
    background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(rgba(36,26,18,.16), rgba(36,26,18,.16));
    background-repeat: no-repeat; background-size: 0% 100%, 100% 100%;
    -webkit-background-clip: text; background-clip: text;
    animation: fill linear both; animation-timeline: view(); animation-range: cover 15% cover 50%;
  }
  .fill--light { background-image: linear-gradient(90deg, var(--ivory), var(--gold-hi)), linear-gradient(rgba(236,226,205,.14), rgba(236,226,205,.14)); }

  .manifesto__crest { animation: crest-spin linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; }
  .manifesto__bg { animation: horses linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }

  .count { font-size: 0; counter-reset: n var(--n); animation: count linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
  .count::after { content: counter(n); font-size: clamp(2rem, 3.4vw, 2.8rem); }
  .count--k::after { content: counter(n) ",000"; }
  .legend .count::after { font-size: .62rem; }

  .tcard { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }

  .gratitude__bg { animation: bg-par linear both; animation-timeline: view(); }
  .gratitude__card { animation: card-zoom linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .header__inner { grid-template-columns: auto 1fr; }
  .brand { grid-column: 2; justify-self: start; grid-row: 1; }
  .burger { display: grid; gap: 7px; width: 30px; cursor: pointer; grid-column: 1; grid-row: 1; position: relative; z-index: 3; }
  .burger i { height: 1px; background: var(--ivory); transition: transform .45s var(--ease); }
  .nav { position: fixed; left: 0; right: 0; z-index: 2; flex-direction: column; align-items: center; gap: 1.4rem; background: var(--coal); padding: 2rem; clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease); }
  .nav--left { top: 0; padding-top: 7rem; }
  .nav--right { top: 15.5rem; padding-top: 0; border-bottom: 1px solid var(--line); }
  .nav a { font-size: .68rem; }
  .menu-toggle:checked ~ .nav { clip-path: inset(0 0 0 0); }
  .menu-toggle:checked ~ .burger i:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle:checked ~ .burger i:last-child { transform: translateY(-4px) rotate(-45deg); }
  .menu-toggle:focus-visible ~ .burger { outline: 1px solid var(--gold); outline-offset: 6px; }

  .ribbon { grid-template-columns: repeat(2, 1fr); }
  .ribbon li:nth-child(2) { border-right: 0; }
  .ribbon li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .chapter { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .chapter__img { grid-column: 2; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .announce { font-size: .45rem; }
  .header__inner { height: 74px; }
  .brand img { height: 44px; }
  .emblem { width: 120px; }
  .emblem img { width: 50px; }
  .ribbon a { flex-direction: column; align-items: center; gap: .3rem; padding: 1.1rem .5rem; }
  .chapters__head, .homes__head { grid-template-columns: 1fr; }
  .chapters__intro, .homes__aside { justify-self: start; }
  .chapter, .chapter--quiet { grid-template-columns: 1fr; gap: 1.5rem; }
  .chapter__year { position: static; }
  .chapter__img { grid-column: auto; }
  .chapter__img img { aspect-ratio: 4 / 3.2; }
  .tabs__list label { flex-direction: column; gap: .4rem; padding: 1.1rem .9rem; }
  .tabs__list span { font-size: .48rem; }
  .panel { grid-template-columns: 1fr; }
  .tabs__cards { grid-template-columns: 1fr; }
  .figures { gap: 1.5rem; }
  .footer__top { grid-template-columns: 1fr; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .smoke { display: none; }
  .count { font-size: inherit !important; }
  .count::after { content: none !important; }
  .fill { color: var(--ink) !important; background: none !important; }
  .fill--light { color: var(--ivory) !important; }
}
