/* ==========================================================
   Alderwick Estate
   Palette drawn from the key art: brass lamplight, verdigris
   roofs, red brick, parchment, and a deep valley dusk.
   ========================================================== */

:root {
  --night: #10171a;
  --night-2: #172126;
  --night-3: #1f2c31;
  --moss: #22312b;
  --paper: #f4ead6;
  --paper-2: #eadcbf;
  --paper-edge: #d9c59c;
  --ink: #2a211a;
  --ink-soft: #5b4a3a;
  --brass: #c99a45;
  --brass-hi: #f2cf7e;
  --brass-lo: #8a6426;
  --verdigris: #5fa595;
  --verdigris-lo: #2f6b5f;
  --brick: #a2432f;
  --brick-lo: #6e2a1d;
  --cream: #efe4cc;
  --cream-soft: #b9b09d;
  --cold: #7fa6c4;

  --serif-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "IM Fell English SC", "Cormorant Garamond", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --lit: 0; /* 0 = dusk, 1 = lamps lit (set by JS) */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--serif);
  font-size: clamp(1.06rem, 1rem + .3vw, 1.2rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.1; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); font-size: .86em; }
q { quotes: "\201C" "\201D"; }
button { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--brass); color: var(--night); padding: .6rem 1rem; border-radius: var(--radius);
  font-family: var(--caps); text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap.narrow { --wrap: 820px; }
.center { text-align: center; }

/* ---------- Type ---------- */
.kicker, .eyebrow, .mini {
  font-family: var(--caps);
  letter-spacing: .08em;
  font-size: .95rem;
  color: var(--brass);
  margin-bottom: .6rem;
}
.h2 {
  font-family: var(--serif-display);
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem);
  font-weight: 600;
  letter-spacing: -.005em;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
}
.section-head .h2, .h3.center { justify-content: center; }
.h3 {
  font-family: var(--serif-display);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  margin-bottom: .8rem;
}
.lede { font-size: 1.15em; max-width: 40em; margin-inline: auto; opacity: .92; }
.section-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Lamp marks: little lanterns next to headings that light as you arrive */
.lamp-mark {
  width: 18px; height: 26px; flex: none; position: relative;
  display: inline-block;
  background:
    linear-gradient(var(--brass-lo), var(--brass-lo)) 50% 0 / 10px 3px no-repeat,
    linear-gradient(var(--brass-lo), var(--brass-lo)) 50% 100% / 18px 3px no-repeat;
}
.lamp-mark::before {
  content: ""; position: absolute; inset: 4px 3px 4px;
  border: 2px solid var(--brass-lo); border-radius: 3px;
  background: rgba(40, 32, 20, .45);
  transition: background .9s var(--ease), box-shadow .9s var(--ease), border-color .9s;
}
.is-lit .lamp-mark::before, .lamp-mark.is-lit::before {
  background: radial-gradient(circle at 50% 55%, #fff6d8 0 20%, var(--brass-hi) 45%, var(--brass) 100%);
  border-color: var(--brass);
  box-shadow: 0 0 14px 4px rgba(242, 207, 126, .55), 0 0 40px 10px rgba(242, 180, 80, .22);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  font-family: var(--caps);
  font-size: 1.05rem; letter-spacing: .06em;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .3s, background .3s, color .3s, border-color .3s;
}
.btn svg { width: 16px; height: 22px; fill: currentColor; }
.btn-brass {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo));
  color: #2a1b08;
  border-color: #f7dc9b;
  box-shadow: 0 6px 24px -6px rgba(242, 190, 90, .55), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-brass:hover { transform: translateY(-2px); box-shadow: 0 10px 34px -6px rgba(242, 190, 90, .75), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-ghost {
  color: var(--cream);
  border-color: rgba(239, 228, 204, .45);
  background: rgba(16, 23, 26, .35);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { border-color: var(--brass-hi); color: var(--brass-hi); transform: translateY(-2px); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  transition: background .4s, box-shadow .4s, padding .3s;
}
.topbar.scrolled {
  background: rgba(16, 23, 26, .86);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(201, 154, 69, .25);
  padding-block: .55rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-family: var(--caps); font-size: 1.15rem; letter-spacing: .06em;
  color: var(--cream);
}
.brand-lamp, .footer-lamp { width: 18px; height: 24px; fill: var(--brass); }
.brand-lamp .flame, .footer-lamp .flame { fill: #3a3020; transition: fill .8s, filter .8s; }
body.lit .brand-lamp .flame, .footer-lamp .flame { fill: #ffe7a6; filter: drop-shadow(0 0 4px #ffcf6a); }

.site-nav { display: flex; align-items: center; gap: clamp(.6rem, 1.6vw, 1.6rem); }
.site-nav a {
  text-decoration: none; font-family: var(--caps); letter-spacing: .05em; font-size: 1rem;
  color: var(--cream); opacity: .85; position: relative; padding-block: .3rem;
}
.site-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--brass-hi); transform: scaleX(0); transition: transform .3s var(--ease);
}
.site-nav a:hover { opacity: 1; }
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { opacity: 1; color: var(--brass-hi); }
.nav-cta {
  border: 1px solid var(--brass); border-radius: 999px; padding: .35rem .95rem !important;
  color: var(--brass-hi) !important;
}
.nav-cta:hover { background: var(--brass); color: var(--night) !important; }

.menu-btn {
  display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 0;
  position: relative;
}
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--cream);
  transition: transform .3s var(--ease), opacity .2s; content: "";
}
.menu-btn .bars { top: 21px; }
.menu-btn .bars::before { left: 0; top: -7px; }
.menu-btn .bars::after { left: 0; top: 7px; }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .site-nav {
    position: fixed; inset: 60px 1rem auto 1rem;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(16, 23, 26, .97); border: 1px solid rgba(201,154,69,.35); border-radius: 12px;
    padding: .6rem; box-shadow: 0 20px 60px -10px rgba(0,0,0,.7);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility 0s .25s;
  }
  .site-nav.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .25s, transform .25s var(--ease); }
  .site-nav a { padding: .8rem 1rem; font-size: 1.1rem; }
  .site-nav a::after { display: none; }
  .nav-cta { text-align: center; margin-top: .4rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: grid; grid-template-rows: 1fr auto;
  isolation: isolate; overflow: hidden;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  filter: brightness(calc(.36 + var(--lit) * .4)) saturate(calc(.5 + var(--lit) * .5)) contrast(1.05);
  transform: scale(calc(1.08 - var(--lit) * .04));
  transition: filter 2.6s var(--ease), transform 6s var(--ease);
}
.hero-dusk {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 22, 40, .78) 0%, rgba(14, 22, 40, .35) 45%, rgba(10, 16, 20, .9) 100%);
  mix-blend-mode: multiply;
  opacity: calc(1 - var(--lit) * .55);
  transition: opacity 2.6s var(--ease);
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(46% 40% at 50% 46%, rgba(8, 12, 16, .62), rgba(8, 12, 16, .25) 60%, transparent 80%),
    radial-gradient(30% 30% at 12% 70%, rgba(255, 170, 70, .22), transparent 70%),
    radial-gradient(30% 30% at 88% 62%, rgba(255, 170, 70, .22), transparent 70%),
    linear-gradient(180deg, rgba(16,23,26,.55) 0%, transparent 30%, transparent 55%, rgba(16,23,26,.96) 100%);
  opacity: calc(.35 + var(--lit) * .65);
  transition: opacity 2.6s var(--ease);
}
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -10px;
  width: var(--s, 4px); height: var(--s, 4px); border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0 30%, #ffc760 60%, transparent 70%);
  box-shadow: 0 0 10px 2px rgba(255, 200, 100, .6);
  opacity: 0;
  animation: rise var(--d, 12s) linear var(--delay, 0s) infinite;
}
body:not(.lit) .ember { animation-play-state: paused; visibility: hidden; }
@keyframes rise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  10% { opacity: var(--o, .8); }
  50% { transform: translate3d(var(--x, 20px), -50vh, 0); }
  90% { opacity: calc(var(--o, .8) * .6); }
  100% { transform: translate3d(calc(var(--x, 20px) * -1), -100vh, 0); opacity: 0; }
}

.hero-inner {
  align-self: center; text-align: center;
  padding: 7rem 1rem 2rem;
  max-width: 900px; margin-inline: auto;
}
.eyebrow { color: var(--brass-hi); font-size: clamp(.9rem, .8rem + .3vw, 1.05rem); text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.eyebrow .dot { opacity: .6; margin-inline: .3em; }
.hero-title {
  font-family: var(--serif-display);
  display: flex; flex-direction: column; align-items: center;
  margin: .4rem 0 1rem; line-height: .9;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.7));
}
.hero-title .t-small { font-family: var(--caps); font-size: clamp(1rem, .8rem + 1vw, 1.5rem); letter-spacing: .4em; color: var(--brass-hi); margin-bottom: .4rem; padding-left: .4em; }
.hero-title .t-big, .hero-title .t-mid {
  background: linear-gradient(180deg, #fff2c8 0%, var(--brass-hi) 30%, var(--brass) 62%, var(--brass-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title .t-big { font-size: clamp(3.6rem, 1.5rem + 10vw, 9.5rem); font-weight: 700; letter-spacing: -.01em; }
.hero-title .t-mid { font-size: clamp(2rem, 1rem + 5vw, 4.6rem); font-weight: 600; letter-spacing: .32em; padding-left: .32em; margin-top: .1em; }
.tagline {
  font-family: var(--serif-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 1.8vw, 2.3rem);
  color: #fff3d6; text-shadow: 0 2px 14px rgba(0,0,0,.85);
  margin-bottom: .8rem;
}
.hero-lede { max-width: 34em; margin: 0 auto 2rem; color: var(--cream); text-shadow: 0 1px 10px rgba(0,0,0,.95); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
body.lit #lightBtn { background: rgba(16,23,26,.4); color: var(--brass-hi); border-color: var(--brass); box-shadow: 0 0 30px -4px rgba(242, 190, 90, .5); }
body.lit #lightBtn svg { filter: drop-shadow(0 0 6px #ffcf6a); }

.hero-facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  width: min(100% - 2rem, var(--wrap)); margin: 0 auto 4.5rem;
  border-top: 1px solid rgba(201,154,69,.4);
  padding-top: 1.2rem;
}
.hero-facts li { text-align: center; padding-inline: .5rem; }
.hero-facts li + li { border-left: 1px solid rgba(201,154,69,.22); }
.hero-facts strong { display: block; font-family: var(--serif-display); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); color: var(--brass-hi); line-height: 1; }
.hero-facts span { font-family: var(--caps); font-size: .9rem; letter-spacing: .05em; color: var(--cream-soft); }
@media (max-width: 640px) {
  .hero-facts { grid-template-columns: repeat(2, 1fr); row-gap: 1rem; }
  .hero-facts li:nth-child(3) { border-left: 0; }
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  width: 26px; height: 40px; border: 1.5px solid rgba(239,228,204,.55); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--brass-hi); border-radius: 2px; animation: cue 2s var(--ease) infinite;
}
@media (max-width: 640px), (max-height: 700px) { .scroll-cue { display: none; } }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(4.5rem, 10vw, 8rem) 0; }
.section.night { background: var(--night); color: var(--cream); }
.section.paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(190, 150, 90, .18), transparent 70%),
    radial-gradient(90% 60% at 100% 100%, rgba(190, 150, 90, .14), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
}
.section.paper .kicker, .section.paper .mini { color: var(--brick); }
.section.paper .lamp-mark::before { background: rgba(120, 90, 40, .15); }
.section.paper.is-lit .lamp-mark::before, .section.paper .is-lit .lamp-mark::before { background: radial-gradient(circle at 50% 55%, #fff6d8 0 20%, var(--brass-hi) 45%, var(--brass) 100%); }

/* Ornamental scalloped edges between night and paper */
.section.paper::before, .section.paper::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background: radial-gradient(circle at 10px -2px, transparent 9px, var(--paper) 10px) 0 0 / 20px 14px repeat-x;
}
.section.paper::before { top: -13px; }
.section.paper::after { bottom: -13px; transform: scaleY(-1); }
.section.night + .section.paper, .section.paper + .section.night { z-index: 1; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; translate: 0 22px; transition: opacity .9s var(--ease), translate .9s var(--ease), transform .35s var(--ease), box-shadow .35s; }
.reveal.in { opacity: 1; translate: none; }
.no-js .reveal { opacity: 1; translate: none; }

/* ---------- Letter ---------- */
.letter-grid {
  display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  margin-bottom: clamp(4rem, 8vw, 6rem);
}
.framed { margin: 0; position: relative; transform: rotate(-1.4deg); }
.framed img {
  border: 12px solid #2b1d12;
  outline: 2px solid var(--brass); outline-offset: -8px;
  box-shadow: 0 2px 0 #4a3420, 0 30px 60px -20px rgba(60, 35, 10, .55), 0 0 0 1px rgba(0,0,0,.2);
  border-radius: 2px;
  background: #2b1d12;
}
.framed figcaption {
  font-family: var(--serif-display); font-style: italic; text-align: center;
  margin-top: 1rem; color: var(--ink-soft);
}
.letter {
  position: relative;
  background: linear-gradient(180deg, #fbf5e7, #f3e7cd);
  padding: clamp(1.6rem, 4vw, 3rem);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 24px 50px -24px rgba(80, 50, 20, .5), 0 0 0 1px rgba(150, 110, 50, .2);
  transform: rotate(.6deg);
}
.letter::after {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(162, 67, 47, .18); pointer-events: none;
}
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .2rem; }
.postmark {
  font-family: var(--caps); font-size: .7rem; line-height: 1.3; text-align: center; letter-spacing: .1em;
  color: rgba(162, 67, 47, .7);
  border: 2px solid rgba(162, 67, 47, .55); border-radius: 50%;
  width: 78px; height: 78px; flex: none; display: grid; place-items: center;
  transform: rotate(12deg);
}
.letter .h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); color: var(--ink); }
.dropcap::first-letter {
  float: left; font-family: var(--serif-display); font-weight: 700;
  font-size: 4.2em; line-height: .8; padding: .08em .1em 0 0; color: var(--brick);
}
.signoff { margin-top: 1.6rem; margin-bottom: 0; font-style: italic; color: var(--ink-soft); }
.signature { font-family: var(--serif-display); font-size: 1.6em; font-style: italic; color: var(--ink); }

.lineage {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: 2.5rem; position: relative; counter-reset: gen;
}
.lineage::before {
  content: ""; position: absolute; top: 28px; left: 16%; right: 16%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--brass) 0 8px, transparent 8px 14px);
  opacity: .6;
}
.lineage li { text-align: center; position: relative; }
.gen {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 1rem;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--brass);
  font-family: var(--serif-display); font-weight: 700; font-size: 1.4rem; color: var(--brick);
  position: relative; z-index: 1;
  box-shadow: 0 0 0 6px var(--paper);
}
.lineage h4 { font-family: var(--serif-display); font-size: 2rem; }
.role { font-family: var(--caps); color: var(--brick); letter-spacing: .06em; font-size: .95rem; margin-bottom: .6rem; }
.lineage p:last-child { color: var(--ink-soft); max-width: 22em; margin-inline: auto; }

@media (max-width: 860px) {
  .letter-grid { grid-template-columns: 1fr; }
  .framed { max-width: 420px; margin-inline: auto; }
  .lineage { grid-template-columns: 1fr; }
  .lineage::before { top: 0; bottom: 0; left: 50%; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--brass) 0 8px, transparent 8px 14px); opacity: .35; }
  .lineage li { background: var(--paper); padding-bottom: 1rem; }
}

/* ---------- Machines ---------- */
.machines-section {
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(95, 165, 149, .12), transparent 70%),
    var(--night) !important;
}
.machines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.machine {
  position: relative;
  border: 1px solid rgba(201,154,69,.25);
  background: linear-gradient(180deg, var(--night-2), #121b1f);
  border-radius: 10px;
  padding: 1.6rem 1.4rem 1.3rem 5.4rem;
  min-height: 112px;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.machine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 2px, transparent 2px 8px);
}
.machine h3 { font-family: var(--serif-display); font-size: 1.45rem; font-weight: 600; margin-bottom: .2rem; }
.machine .state {
  margin: 0; font-family: var(--caps); font-size: .9rem; letter-spacing: .08em; color: var(--verdigris);
  display: inline-flex; align-items: center; gap: .5rem;
}
.machine .state::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verdigris);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: 1; box-shadow: 0 0 8px var(--verdigris); } }
/* Brass pressure gauge, needle resting at zero */
.gauge {
  position: absolute; left: 1.2rem; top: 50%; width: 52px; height: 52px; margin-top: -26px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #2b2418 0 3px, transparent 4px),
    conic-gradient(from 225deg, rgba(95,165,149,.5) 0 60deg, rgba(201,154,69,.35) 60deg 200deg, rgba(162,67,47,.6) 200deg 270deg, transparent 270deg),
    radial-gradient(circle, #f1e6cd 0 58%, #d9c59c 60%);
  border: 3px solid var(--brass);
  box-shadow: inset 0 0 0 2px #6b4c1d, 0 4px 12px rgba(0,0,0,.5);
}
.gauge::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 20px; margin-left: -1px;
  background: var(--brick-lo); transform-origin: 50% 0; transform: rotate(135deg);
  transition: transform 1.6s cubic-bezier(.3, 1.6, .5, 1);
}
.machine:hover .gauge::before { transform: rotate(160deg); }
.motto {
  margin: clamp(3rem, 6vw, 4.5rem) auto 0; text-align: center; max-width: 760px;
}
.motto p {
  font-family: var(--serif-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.15;
  color: var(--brass-hi);
  margin-bottom: .6rem;
}
.motto footer { font-family: var(--caps); letter-spacing: .08em; color: var(--cream-soft); }
.motto footer::before, .motto footer::after { content: "—"; margin-inline: .6em; color: var(--brass); }
.machines-section code, .way code {
  background: rgba(201,154,69,.14); color: var(--brass-hi); padding: .12em .45em; border-radius: 4px;
  border: 1px solid rgba(201,154,69,.25);
}
@media (max-width: 860px) { .machines { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .machines { grid-template-columns: 1fr; } }

/* ---------- Who you are ---------- */
.heir {
  display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center;
  max-width: 760px; margin: 0 auto 3rem;
  padding: 1.6rem 2rem;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.2));
  border: 1px solid rgba(150,110,50,.25); border-radius: 10px;
}
.heir p:last-child { margin: 0; }
.heir .h3 { margin-bottom: .3rem; }
.heir-seal {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #d4644b, var(--brick) 50%, var(--brick-lo));
  box-shadow: inset 0 -4px 10px rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.25), 0 6px 16px -4px rgba(110, 42, 29, .6);
  font-family: var(--serif-display); font-weight: 700; font-size: 2.6rem; color: #f2c9b4;
  border: 4px double rgba(255, 210, 190, .35);
}
.heir-seal span { text-shadow: 0 -1px 0 rgba(0,0,0,.35); }
.identities-intro { text-align: center; color: var(--ink-soft); font-style: italic; }
.identities { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.4rem; }
.envelope {
  width: 100%; aspect-ratio: 4 / 3; position: relative; cursor: pointer;
  border: 1px solid rgba(150, 110, 50, .35); border-radius: 4px;
  background: linear-gradient(180deg, #f7eedb, #e9d9b6);
  box-shadow: 0 10px 24px -14px rgba(80, 50, 20, .55);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s;
  padding: 0;
}
.envelope::before {
  /* the flap */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 58%;
  background: linear-gradient(180deg, #efe1c0, #e3d0a8);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform .6s var(--ease);
  z-index: 2;
  filter: drop-shadow(0 2px 1px rgba(80,50,20,.2));
}
.envelope:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 18px 30px -16px rgba(80, 50, 20, .6); }
.numeral {
  position: absolute; left: .8rem; bottom: .55rem; z-index: 1;
  font-family: var(--serif-display); font-weight: 700; font-size: 1.2rem; color: var(--brick); opacity: .6;
}
.wax {
  position: absolute; left: 50%; top: 58%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 3;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4644b, var(--brick) 50%, var(--brick-lo));
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.35), 0 3px 6px rgba(110,42,29,.4);
  transition: transform .5s var(--ease), opacity .4s;
}
.wax::after { content: "A"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif-display); font-weight: 700; color: #f2c9b4; font-size: 1.3rem; }
.env-inner {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 2.2rem 1rem 1rem;
  font-family: var(--serif-display); font-size: 1.25rem; font-weight: 600; line-height: 1.15; color: var(--ink);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s .25s, transform .5s .25s var(--ease);
}
.envelope[aria-expanded="true"]::before { transform: rotateX(180deg) translateY(4px); opacity: .0; transition: transform .6s var(--ease), opacity .3s .3s; }
.envelope[aria-expanded="true"] .wax { transform: translateY(-40px) scale(.4) rotate(-40deg); opacity: 0; }
.envelope[aria-expanded="true"] .env-inner { opacity: 1; transform: none; }
.warning-note {
  text-align: center; margin: 2.2rem auto 0; max-width: 34em;
  font-family: var(--serif-display); font-size: 1.35rem; font-style: italic;
}
.warning-note strong { font-style: normal; color: var(--brick); }
@media (max-width: 860px) { .identities { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .heir { grid-template-columns: 1fr; text-align: center; padding: 1.4rem; }
  .heir-seal { margin-inline: auto; }
  .env-inner { font-size: 1.05rem; padding: 1.6rem .6rem .6rem; }
}

/* ---------- Villages ---------- */
.villages-section {
  background:
    linear-gradient(180deg, rgba(16,23,26,.86), rgba(16,23,26,.97)),
    url("assets/estate-scene.webp") center 30% / cover no-repeat fixed,
    var(--night) !important;
}
@media (max-width: 860px), (hover: none) { .villages-section { background-attachment: scroll !important; } }
.village-tabs {
  display: flex; justify-content: center; gap: .3rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.village-tabs button {
  background: none; border: 0; cursor: pointer;
  font-family: var(--serif-display); font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); font-weight: 600;
  padding: .4rem 1.1rem; color: var(--cream-soft); position: relative;
  transition: color .3s;
}
.village-tabs button::after {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 2px;
  background: var(--brass-hi); transform: scaleX(0); transition: transform .35s var(--ease);
  box-shadow: 0 0 10px var(--brass-hi);
}
.village-tabs button:hover { color: var(--cream); }
.village-tabs button[aria-selected="true"] { color: var(--brass-hi); }
.village-tabs button[aria-selected="true"]::after { transform: scaleX(1); }

.village {
  display: grid; grid-template-columns: 1fr 220px; gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 900px; margin-inline: auto;
  padding: clamp(1.6rem, 4vw, 3rem);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(31,44,49,.92), rgba(18,27,31,.95));
  border: 1px solid rgba(201,154,69,.28);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
  animation: fadeup .5s var(--ease);
}
.village[hidden] { display: none; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.village-name { font-family: var(--serif-display); font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); margin-bottom: 1rem; color: #fff1d0; }
.festivals { display: grid; gap: .6rem; margin-bottom: 1rem; }
.festivals li { padding-left: 1.4rem; position: relative; }
.festivals li::before { content: "✦"; position: absolute; left: 0; top: .1em; color: var(--brass); font-size: .8em; }
.festivals strong { color: var(--brass-hi); font-weight: 600; margin-right: .35em; }
.nickname { font-style: italic; color: var(--cream-soft); margin: 0; }
.mini { font-size: .9rem; margin-top: 1.4rem; }
.impression {
  border-left: 1px solid rgba(201,154,69,.22); padding-left: clamp(1.2rem, 3vw, 2.4rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.impression .mini { margin-top: 0; }
.temp {
  width: 26px; height: 170px; border-radius: 13px; position: relative;
  background: rgba(255,255,255,.06); border: 2px solid rgba(201,154,69,.5);
  margin: .6rem 0 .8rem; overflow: hidden;
}
.temp::after {
  /* graduations */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 16px, rgba(239,228,204,.18) 16px 17px);
}
.temp-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  transition: height 1.2s var(--ease);
}
.village[data-mood="warm"] .temp-fill { height: 82%; background: linear-gradient(0deg, var(--brick), #e7884f 60%, var(--brass-hi)); box-shadow: 0 0 20px rgba(231,136,79,.6); }
.village[data-mood="cold"] .temp-fill { height: 18%; background: linear-gradient(0deg, #3d5f7a, var(--cold)); }
.village[data-mood="divided"] .temp-fill { height: 50%; background: linear-gradient(90deg, #4f7f98 0 50%, #c56a42 50% 100%); }
.impression-word { font-family: var(--serif-display); font-size: 2rem; font-weight: 600; margin: 0; }
.village[data-mood="warm"] .impression-word { color: #f0a36a; }
.village[data-mood="cold"] .impression-word { color: var(--cold); }
.village[data-mood="divided"] .impression-word {
  background: linear-gradient(90deg, var(--cold) 50%, #f0a36a 50%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 680px) {
  .village { grid-template-columns: 1fr; }
  .impression { border-left: 0; border-top: 1px solid rgba(201,154,69,.22); padding: 1.4rem 0 0; flex-direction: row; gap: 1rem; justify-content: flex-start; flex-wrap: wrap; }
  .temp { width: 160px; height: 22px; margin: 0; order: 2; }
  .temp-fill { top: 0; right: auto; height: 100% !important; transition: width 1.2s var(--ease); }
  .village[data-mood="warm"] .temp-fill { width: 82%; background: linear-gradient(90deg, var(--brick), #e7884f 60%, var(--brass-hi)); }
  .village[data-mood="cold"] .temp-fill { width: 18%; background: linear-gradient(90deg, #3d5f7a, var(--cold)); }
  .village[data-mood="divided"] .temp-fill { width: 100%; }
  .temp::after { background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(239,228,204,.18) 16px 17px); }
  .impression .mini { width: 100%; text-align: left; margin: 0; }
  .impression-word { order: 3; font-size: 1.6rem; }
}

.fair {
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  max-width: 760px; margin: 2.5rem auto 0; text-align: left;
  padding: 1.2rem 1.6rem; border-radius: 999px;
  border: 1px dashed rgba(242,207,126,.45);
  background: rgba(201,154,69,.07);
}
.fair p { margin: 0; }
.fair strong { color: var(--brass-hi); font-weight: 500; }
.apple { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 12px rgba(242, 207, 126, .55)); }
.apple path:first-child { fill: var(--brass-hi); }
.apple .stem { fill: none; stroke: var(--brass-lo); stroke-width: 2.5; stroke-linecap: round; }
.apple .leaf { fill: var(--verdigris); }
@media (max-width: 560px) { .fair { border-radius: 16px; flex-direction: column; text-align: center; } }

/* ---------- People ---------- */
.greeting {
  display: grid; grid-template-columns: 300px 1fr; gap: 0; margin: 0 auto 4rem; max-width: 980px;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(60, 35, 10, .55);
}
.greeting-card {
  background: var(--night-2); color: var(--cream); padding: 2rem;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 3px solid var(--brass);
}
.greeting-card .kicker { color: var(--brass-hi); }
.greeting-card .role { color: var(--brass); }
.greeting-card p:last-child { margin: 0; color: var(--cream-soft); }
.greeting blockquote {
  margin: 0; padding: clamp(1.6rem, 4vw, 3rem);
  background: linear-gradient(135deg, #fbf5e7, #f0e2c4);
  display: flex; align-items: center; position: relative;
}
.greeting blockquote::before {
  content: "\201C"; position: absolute; top: -.1em; left: .15em;
  font-family: var(--serif-display); font-size: 9rem; line-height: 1; color: rgba(162,67,47,.15);
}
.greeting blockquote p {
  margin: 0; position: relative;
  font-family: var(--serif-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); line-height: 1.3; color: var(--ink);
}
@media (max-width: 760px) {
  .greeting { grid-template-columns: 1fr; }
  .greeting-card { border-right: 0; border-bottom: 3px solid var(--brass); }
}

.people-groups { display: grid; gap: 2.6rem; }
.group-name {
  font-family: var(--caps); font-weight: 400; font-size: 1.3rem; letter-spacing: .1em; color: var(--brick);
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem;
}
.group-name::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(162,67,47,.4), transparent); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card {
  position: relative; padding: 1.5rem 1.4rem 1.3rem;
  background: #fbf6ea;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 12px 26px -18px rgba(70, 45, 15, .7), 0 0 0 1px rgba(150, 110, 50, .18);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.card::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(201,154,69,.35); border-radius: 2px; pointer-events: none;
}
.card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 22px 34px -20px rgba(70, 45, 15, .7), 0 0 0 1px rgba(150, 110, 50, .28); }
.mono {
  float: right; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em;
  color: var(--brass-lo); border: 1.5px solid var(--brass);
  background: radial-gradient(circle, #fff9ea, #f1e3c2);
  margin: 0 0 .4rem .6rem;
}
.card h4 { font-family: var(--serif-display); font-size: 1.55rem; margin-bottom: .15rem; }
.card .role { margin-bottom: .5rem; font-size: .9rem; }
.card p:last-child { margin: 0; color: var(--ink-soft); }
@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

/* ---------- How it plays ---------- */
.ways-section { background: radial-gradient(80% 50% at 50% 100%, rgba(162,67,47,.12), transparent 70%), var(--night) !important; }
.ways { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.way {
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--night-2), #131c20);
  border: 1px solid rgba(201,154,69,.2);
}
.way .h3 { color: #fff1d0; }
.way > p:last-child { margin-bottom: 0; }
.aside { font-size: .95em; color: var(--cream-soft); font-style: italic; }
.controls { display: grid; gap: .75rem; margin: 1.2rem 0 1.4rem; }
.controls li { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .6rem; }
.controls li > span:last-child { color: var(--cream-soft); }
.plus { color: var(--brass); }
.key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.2em; padding: .2em .6em;
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  color: #2a1b08;
  background: linear-gradient(180deg, #f8ecd0, #dcc797);
  border-radius: 5px;
  box-shadow: 0 3px 0 #8a6426, 0 4px 8px rgba(0,0,0,.4), inset 0 1px 0 #fff;
  border: 1px solid #b8955a;
}
.key-big { font-size: 2rem; width: 72px; height: 72px; border-radius: 10px; box-shadow: 0 5px 0 #8a6426, 0 8px 18px rgba(0,0,0,.45), inset 0 1px 0 #fff; }
.skills-dial { display: flex; align-items: center; gap: 1.4rem; margin: 1.2rem 0 1.4rem; }
.big-num { font-family: var(--serif-display); font-size: 3rem; font-weight: 700; line-height: 1; color: var(--brass-hi); margin: 0 0 .2rem; }
.big-num span { font-size: 1.3rem; font-weight: 500; color: var(--cream); }
.small { font-size: .95em; color: var(--cream-soft); margin: 0; }
.ticks { display: grid; gap: .7rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; transform: rotate(45deg);
  border: 1.5px solid var(--brass); background: rgba(201,154,69,.2);
}
.notice {
  background: #efe4c8; color: var(--ink);
  padding: 1.3rem 1.4rem 1rem; margin: 1rem 0 1.3rem;
  border-radius: 2px; position: relative; transform: rotate(-.8deg);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.8);
  text-align: center;
}
.notice::before, .notice::after {
  content: ""; position: absolute; top: 8px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d9b26b, #6b4c1d);
}
.notice::before { left: 10px; } .notice::after { right: 10px; }
.notice-head { font-family: var(--caps); letter-spacing: .2em; color: var(--brick); border-bottom: 1px solid rgba(162,67,47,.35); padding-bottom: .4rem; }
.notice p:last-child { margin: 0; }
.notice strong { color: var(--brick); }
@media (max-width: 760px) { .ways { grid-template-columns: 1fr; } }

.salvage { margin-top: clamp(3rem, 6vw, 4.5rem); }
.salvage-head { text-align: center; max-width: 640px; margin: 0 auto 1.8rem; }
.salvage-head .h3 { color: #fff1d0; }
.salvage-head p { color: var(--cream-soft); }
.salvage-head strong { color: #fff; }
.placards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.placard {
  position: relative;
  background: linear-gradient(180deg, #fbfaf5, #e9e5da);
  color: #2b2a26;
  padding: 1.6rem 1.2rem 1.2rem; text-align: center;
  border-radius: 3px;
  box-shadow: 0 0 0 4px #3b2c1e, 0 0 0 5px rgba(201,154,69,.5), 0 18px 30px -12px rgba(0,0,0,.8);
  margin-top: 18px;
  transition: opacity .9s var(--ease), translate .9s var(--ease), transform .3s var(--ease);
}
.placard:nth-child(odd) { transform: rotate(-1.2deg); }
.placard:nth-child(even) { transform: rotate(1deg); }
.placard:hover { transform: rotate(0) translateY(-3px); }
.placard::before {
  /* the post */
  content: ""; position: absolute; left: 50%; top: -22px; width: 8px; height: 22px; margin-left: -4px;
  background: linear-gradient(90deg, #4a3624, #6b4f35, #4a3624); border-radius: 2px;
}
.placard h4 { font-family: var(--serif-display); font-size: 1.4rem; margin-bottom: .4rem; }
.placard p { margin: 0; font-style: italic; color: #59544a; }
.placard-danger { box-shadow: 0 0 0 4px var(--brick-lo), 0 0 0 5px #e1745a, 0 18px 30px -12px rgba(0,0,0,.8), 0 0 40px -6px rgba(225, 80, 50, .35); }
.placard-danger strong { color: var(--brick); font-style: normal; }
@media (max-width: 860px) { .placards { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; } }
@media (max-width: 480px) { .placards { grid-template-columns: 1fr; } }

/* ---------- Getting started ---------- */
.steps { counter-reset: step; display: grid; gap: 1.2rem; }
.step {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 1.6rem 1.4rem 5.2rem;
  background: #fbf6ea;
  border-radius: 8px;
  box-shadow: 0 12px 26px -20px rgba(70,45,15,.7), 0 0 0 1px rgba(150,110,50,.2);
}
.step::before {
  content: counter(step);
  position: absolute; left: 1.3rem; top: 1.3rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif-display); font-weight: 700; font-size: 1.4rem;
  color: #fff4dc;
  background: radial-gradient(circle at 35% 30%, #d4644b, var(--brick) 55%, var(--brick-lo));
  box-shadow: 0 4px 10px -3px rgba(110,42,29,.6);
}
.step h3 { font-family: var(--serif-display); font-size: 1.6rem; margin-bottom: .4rem; }
.step p { margin: 0; color: var(--ink-soft); }
.step strong { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) {
  .step { padding: 4.4rem 1.2rem 1.2rem; }
  .step::before { left: 1.2rem; top: 1.2rem; }
}

.pocket {
  margin-top: 3rem; padding: clamp(1.5rem, 3vw, 2.2rem);
  background: var(--night-2); color: var(--cream); border-radius: 12px;
  border: 1px solid rgba(201,154,69,.35);
  box-shadow: 0 30px 60px -30px rgba(30, 20, 5, .7);
}
.pocket .h3 { color: var(--brass-hi); }
.ref { display: grid; gap: .8rem; }
.ref li { display: grid; grid-template-columns: 13rem 1fr; align-items: center; gap: 1rem; }
.ref li > span:last-child { color: var(--cream-soft); }
.ref .key { justify-self: start; font-size: 1rem; }
.cmd code { white-space: nowrap; }
.cmd {
  justify-self: start; display: inline-flex; align-items: center; gap: .6rem;
  background: rgba(201,154,69,.12); border: 1px solid rgba(201,154,69,.35); border-radius: 6px;
  padding: .35rem .5rem .35rem .7rem; cursor: pointer; color: var(--brass-hi);
  transition: background .25s, border-color .25s;
}
.cmd:hover { background: rgba(201,154,69,.22); border-color: var(--brass); }
.copy-label { font-family: var(--caps); font-size: .78rem; letter-spacing: .06em; color: var(--cream-soft); border-left: 1px solid rgba(201,154,69,.3); padding-left: .5rem; }
.cmd.copied .copy-label { color: var(--verdigris); }
@media (max-width: 520px) {
  .ref li { grid-template-columns: 1fr; gap: .3rem; padding-bottom: .6rem; border-bottom: 1px solid rgba(201,154,69,.15); }
  .ref li:last-child { border-bottom: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0b1013; color: var(--cream-soft);
  padding: clamp(4rem, 8vw, 6rem) 0 3rem; text-align: center;
  border-top: 1px solid rgba(201,154,69,.2);
}
.footer-lamp { width: 30px; height: 40px; margin: 0 auto 1rem; display: block; }
.footer-tag { font-family: var(--serif-display); font-style: italic; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); color: var(--brass-hi); }
.credit { max-width: 36em; margin: 1.6rem auto; font-size: .9rem; line-height: 1.6; }
.to-top { font-family: var(--caps); letter-spacing: .06em; text-decoration: none; color: var(--brass); }
.to-top:hover { color: var(--brass-hi); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--night-3); color: var(--cream); border: 1px solid var(--brass);
  padding: .6rem 1.1rem; border-radius: 999px; font-family: var(--caps); letter-spacing: .05em;
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; translate: none; }
  .embers { display: none; }
}
