/* ═══════════════════════════════════════════════════════════════
   THE ROUNDS — a night watchman's rounds after hours
   charcoal · candle gold · warm white
   one ease token set: --ease-turn (structural) / --ease-settle (arrivals)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #141210;
  --ink-2: #1a1714;
  --ink-3: #221e19;
  --line: #352f27;
  --gold: #e8b84b;
  --gold-deep: #b98d2f;
  --gold-dim: #8a7345;
  --warm: #f3ecdd;
  --dim: #b0a48c;
  --faint: #6b6150;

  --ease-turn: cubic-bezier(.62, .02, .18, 1);
  --ease-settle: cubic-bezier(.16, .84, .28, 1);
  --d-quick: .45s;
  --d-turn: .7s;
  --d-slow: 1.05s;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Archivo", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--warm);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

/* ─── skip link: always visible, honest ─── */
.skip-link {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(232, 184, 75, .35);
  border-radius: 99px;
  padding: .45rem 1.1rem;
  background: rgba(20, 18, 16, .82);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: border-color var(--d-quick) var(--ease-settle), color var(--d-quick) var(--ease-settle);
}
.skip-link:hover, .skip-link:focus-visible { border-color: var(--gold); color: var(--warm); }

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

/* ─── header ─── */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2rem;
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: .02em;
  color: var(--warm);
}
.brand-i { color: var(--gold); font-style: italic; }

/* progress lamp */
.lamp {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: rgba(20, 18, 16, .7);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .4rem .95rem;
  backdrop-filter: blur(6px);
}
.lamp-flames { display: flex; gap: .42rem; }
.flame {
  width: 7px; height: 10px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--ink-3);
  border: 1px solid var(--line);
  transition: background var(--d-turn) var(--ease-settle), box-shadow var(--d-turn) var(--ease-settle), border-color var(--d-turn) var(--ease-settle);
}
.flame.lit {
  background: linear-gradient(180deg, #fff3d6 0%, var(--gold) 55%, var(--gold-deep) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 8px 1px rgba(232, 184, 75, .65);
  animation: flicker 4.2s ease-in-out infinite;
}

/* candle flicker — ambient life, opacity only (composited) */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  22% { opacity: .82; }
  38% { opacity: .96; }
  57% { opacity: .78; }
  74% { opacity: .93; }
}
.lamp-count { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

/* ═══ HERO ═══ */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 7rem 1.5rem 3rem;
  position: relative;
}
.hero-eyebrow {
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 2.2rem;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.9rem, 8.4vw, 7.6rem);
  line-height: 1.04;
  letter-spacing: -.015em;
}
.hero-title { text-wrap: balance; }
.hero-line { display: block; color: var(--warm); }
.hero-line-gold em {
  font-style: italic;
  color: var(--gold);
  text-shadow: 0 0 46px rgba(232, 184, 75, .34);
}
.hero-sub {
  max-width: 34rem;
  margin-top: 2.4rem;
  font-size: 1.02rem;
  color: var(--dim);
  text-wrap: balance;
}
.hero-hint {
  margin-top: 3.4rem;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.hint-key { display: inline-block; vertical-align: middle; }

/* entrance choreography — stagger ladder on one curve */
.reveal { opacity: 0; transform: translateY(18px); }
body.entered .reveal {
  opacity: 1; transform: none;
  transition: opacity var(--d-slow) var(--ease-settle), transform var(--d-slow) var(--ease-settle);
}
body.entered .r1 { transition-delay: 0s; }
body.entered .r2 { transition-delay: .15s; }
body.entered .r3 { transition-delay: .35s; }
body.entered .r4 { transition-delay: .5s; }
body.entered .r5 { transition-delay: .6s; }

/* ═══ FOYER ═══ */
.foyer {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 2rem 7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem;
  align-items: start;
}

.door {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--ink-2) 0%, var(--ink) 78%);
  overflow: hidden;
  transition: border-color var(--d-turn) var(--ease-settle), box-shadow var(--d-turn) var(--ease-settle);
}
.door:hover { border-color: #4a4032; }
.door.open {
  border-color: rgba(232, 184, 75, .5);
  box-shadow: 0 0 60px -18px rgba(232, 184, 75, .28), inset 0 1px 0 rgba(232, 184, 75, .12);
}

.lock-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: center;
  padding: 1.9rem 1.8rem 1.4rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.door-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.door-no {
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--gold-dim);
}
.door-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--warm);
}
.door-tag {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .18rem .6rem;
}

.lock-stage {
  display: block;
  position: relative;
  margin: 1.4rem auto .9rem;
  width: min(300px, 88%);
}
.lock-stage svg { display: block; width: 100%; height: auto; }

/* keyhole peep-preview — a glimpse through the keyway on hover */
.peep {
  position: absolute;
  left: 23.8%;
  top: 53.3%;
  width: 128px;
  height: 128px;
  transform: translate(-50%, -50%) scale(.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.1rem;
  background: radial-gradient(circle, rgba(232, 184, 75, .13) 0%, rgba(232, 184, 75, .05) 46%, transparent 72%);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-turn) var(--ease-settle), transform var(--d-turn) var(--ease-settle);
}
.lock-btn:hover .peep,
.lock-btn:focus-visible .peep { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.door.open .peep,
.lock-btn.holding .peep { opacity: 0 !important; }

.door-tease {
  display: block;
  font-size: .92rem;
  color: var(--dim);
  max-width: 26rem;
  margin: 0 auto;
  min-height: 3em;
  text-wrap: balance;
}

.lock-hint {
  display: block;
  margin-top: .9rem;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: .75;
  transition: color var(--d-quick) var(--ease-settle), opacity var(--d-quick) var(--ease-settle);
}
.lock-btn:hover .lock-hint { opacity: 1; color: var(--gold-dim); }
.lock-hint.nudge { color: var(--gold); opacity: 1; animation: nudge .5s var(--ease-settle) 2; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.door.open .lock-hint { display: none; }
.door.open .door-tease { min-height: 0; }

/* opened panel — expands in place */
.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--d-slow) var(--ease-turn);
}
.door.open .panel { grid-template-rows: 1fr; }
.panel-in {
  overflow: hidden;
  visibility: hidden;
  padding: 0 2rem;
  text-align: center;
  transition: visibility 0s var(--d-slow);
}
.door.open .panel-in {
  visibility: visible;
  transition: visibility 0s;
  padding-bottom: 2.1rem;
}

.panel-stat {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  margin: 0 0 .9rem;
}
.stat-big {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 3.1rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(232, 184, 75, .3);
  font-feature-settings: "lnum" 1;
  font-variant-numeric: lining-nums;
}
.stat-label {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  max-width: 15rem;
  text-align: left;
  line-height: 1.5;
}
.panel-body {
  font-size: .95rem;
  color: var(--dim);
  max-width: 30rem;
  margin: 0 auto 1.2rem;
}
.panel-body strong { color: var(--warm); font-weight: 500; }
.panel-status {
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border: 1px dashed rgba(138, 115, 69, .5);
  border-radius: 99px;
  display: inline-block;
  padding: .3rem .85rem;
  margin-bottom: 1.2rem;
}
.panel-price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.price-then { font-family: var(--font-body); font-size: .8rem; color: var(--faint); letter-spacing: .1em; }
.panel-cta {
  display: inline-block;
  color: var(--warm);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: .2rem;
  transition: color var(--d-quick) var(--ease-settle), border-color var(--d-quick) var(--ease-settle);
}
.panel-cta:hover { color: var(--gold); border-color: var(--gold); }
.cta-arrow { color: var(--gold); }

/* wax seal — stamped when you open a door */
.seal {
  display: block;
  width: 64px;
  height: 64px;
  margin: 1.5rem auto 0;
  opacity: 0;
  transform: scale(1.7) rotate(-14deg);
}
.door.open .seal {
  opacity: 1;
  transform: scale(1) rotate(-8deg);
  transition: opacity var(--d-turn) var(--ease-turn) .75s, transform var(--d-turn) var(--ease-turn) .75s;
}
@media (prefers-reduced-motion: reduce) {
  .seal { transition: none !important; transform: scale(1) rotate(-8deg); }
}

/* whispers — only legible where your light has been */
.whisper {
  position: absolute;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.6s var(--ease-settle);
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  top: 34%;
  white-space: nowrap;
}
.whisper.lit { opacity: .5; }

/* ═══ BOOK ═══ */
.book {
  text-align: center;
  padding: 8rem 1.5rem 9rem;
  position: relative;
}
.book-flames {
  display: flex;
  justify-content: center;
  gap: .55rem;
  margin-bottom: 2.4rem;
}
.bflame {
  width: 8px; height: 12px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--ink-3);
  border: 1px solid var(--line);
  transition: background var(--d-turn) var(--ease-settle), box-shadow var(--d-turn) var(--ease-settle), border-color var(--d-turn) var(--ease-settle);
}
.bflame.lit {
  background: linear-gradient(180deg, #fff3d6 0%, var(--gold) 55%, var(--gold-deep) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 10px 2px rgba(232, 184, 75, .55);
  animation: flicker 3.7s ease-in-out infinite;
}
.bflame.lit:nth-child(even) { animation-delay: 1.9s; }
.flame.lit:nth-child(even) { animation-delay: 1.4s; }
.book-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.08;
  margin-bottom: 2.6rem;
  text-wrap: balance;
}
.book-title em { font-style: italic; color: var(--gold); }
.cta {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
  background: linear-gradient(180deg, #f6d98a 0%, var(--gold) 60%, var(--gold-deep) 100%);
  text-decoration: none;
  border-radius: 99px;
  padding: 1rem 2.7rem;
  transition: box-shadow var(--d-turn) var(--ease-settle), transform var(--d-quick) var(--ease-settle);
  box-shadow: 0 0 0 rgba(232, 184, 75, 0);
}
.cta:hover { transform: translateY(-2px); }
.book.ignited .cta {
  box-shadow: 0 0 70px 6px rgba(232, 184, 75, .38);
}
.book-honest {
  margin-top: 1.6rem;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--faint);
}

/* ═══ FOOTER ═══ */
.site-foot {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 2.6rem 1.5rem 5rem;
  font-size: .8rem;
  color: var(--faint);
}
.foot-spine {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-dim);
  margin-top: .5rem;
}
.foot-guide {
  display: inline-block;
  margin-top: 1rem;
  color: var(--faint);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.foot-guide:hover { color: var(--gold-dim); }

/* ═══ the dark + your light (JS-built layers) ═══ */
#trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}
#keyfollow {
  position: fixed;
  top: 0; left: 0;
  z-index: 55;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  transition: opacity .4s var(--ease-settle);
}
#keyfollow.on { opacity: 1; }
#keyfollow svg { display: block; filter: drop-shadow(0 0 6px rgba(232, 184, 75, .5)); }

/* ═══ responsive ═══ */
@media (max-width: 860px) {
  .foyer { grid-template-columns: 1fr; padding: 1rem 1.1rem 5rem; gap: 1.4rem; }
  .site-head { padding: .9rem 1.1rem; }
  .lamp-count { display: none; }
  .hero { min-height: 86vh; padding-top: 6rem; }
  .hero-sub { font-size: .95rem; }
  .door-name { font-size: 1.45rem; }
  .lock-stage { width: min(260px, 90%); }
  .whisper { display: none; }
  .skip-link { font-size: .72rem; }
}

/* ═══ reduced motion: click opens, no theatre ═══ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .panel { transition: none; }
  .flame, .bflame, .cta, .door { transition: none; }
  .flame.lit, .bflame.lit { animation: none; }
  .lock-hint.nudge { animation: none; }
  #keyfollow { display: none; }
}
