:root {
  /* Design terms: cursor-proximity IntersectionObserver. Space Grotesk" (Google Fonts only and */
  --bg-primary: #1a140e;
  --bg-secondary: #2e2318;
  --text-primary: #e8dcc8;
  --text-secondary: #9b8e7a;
  --accent-primary: #c9a96e;
  --accent-secondary: #8b4a3a;
  --border-rule: #8b7355;
  --highlight-glow: #f5d89a;
  --wood: #5a4a37;
  --display: "Darker Grotesque", sans-serif;
  --body: "Libre Baskerville", serif;
  --accent: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 9%, rgba(245, 216, 154, 0.08) 0, transparent 18%),
    radial-gradient(circle at 76% 30%, rgba(139, 74, 58, 0.08) 0, transparent 28%),
    linear-gradient(90deg, rgba(201, 169, 110, 0.025), transparent 42%);
  opacity: 0;
  transition: opacity 900ms ease;
  z-index: 0;
}

body.lit::before { opacity: 1; }

a { color: inherit; text-decoration: none; }

.opening-veil {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1a140e;
  z-index: 20;
  opacity: 1;
  transition: opacity 550ms ease, visibility 550ms ease;
}

.opening-veil.done { opacity: 0; visibility: hidden; }

.opening-glow {
  position: absolute;
  width: 62vw;
  height: 62vw;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(245, 216, 154, 0.03) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 800ms ease, transform 900ms ease;
}

body.lit .opening-glow { opacity: 1; transform: scale(1); }

.flame {
  width: 20px;
  height: 30px;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(245, 216, 154, 0.18));
  transition: filter 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.flame-outer { fill: #c9a96e; opacity: 0.6; transform-origin: 50% 80%; animation: flickerOuter 3s ease-in-out infinite; }
.flame-inner { fill: #f5d89a; opacity: 0.8; transform-origin: 50% 80%; animation: flickerInner 2.4s ease-in-out infinite; }
.slow .flame-outer, .slow .flame-inner { animation-duration: 3.8s; }
.quick .flame-outer, .quick .flame-inner { animation-duration: 2.1s; }
.flame.near { filter: drop-shadow(0 0 22px rgba(245, 216, 154, 0.42)); transform: scale(1.1); }

@keyframes flickerOuter { 0%, 100% { opacity: 0.42; transform: skewX(-2deg); } 46% { opacity: 0.7; transform: skewX(2deg) scaleY(1.04); } 72% { opacity: 0.54; } }
@keyframes flickerInner { 0%, 100% { transform: scale(0.95); opacity: 0.72; } 50% { transform: scale(1.05); opacity: 0.9; } }

.opening-flame { opacity: 0; width: 24px; height: 36px; transform: translateY(10px) scale(0.9); transition: opacity 450ms ease, transform 800ms cubic-bezier(.2,.8,.2,1); }
body.flame-visible .opening-flame { opacity: 1; transform: translateY(0) scale(1); }
body.flame-migrate .opening-flame { transform: translate(calc(-50vw + 12vw + 4px), calc(-50vh + 6vh - 1px)) scale(0.58); }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(245, 216, 154, 0.03) 0%, transparent 60%);
  opacity: 0;
  z-index: 1;
  transition: opacity 900ms ease;
}
body.lit .ambient { opacity: 1; }

.candelabrum-header {
  position: sticky;
  top: 0;
  min-height: 12vh;
  display: grid;
  grid-template-columns: max-content minmax(90px, 1fr) max-content;
  align-items: center;
  gap: 22px;
  padding: 0 8%;
  background: rgba(26, 20, 14, 0.92);
  border-bottom: 1px solid rgba(139, 115, 85, 0.42);
  box-shadow: 0 1px 0 rgba(201, 169, 110, 0.2), 0 0 20px rgba(245, 216, 154, 0.06);
  z-index: 10;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.candelabrum-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #c9a96e 0%, rgba(201, 169, 110, 0.35) 38%, transparent 100%);
}

body.header-revealed .candelabrum-header { opacity: 1; transform: translateY(0); }

.logotype {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.03em;
  color: #e8dcc8;
  text-shadow: 0 0 20px rgba(245, 216, 154, 0.06);
  overflow: hidden;
  white-space: nowrap;
}

.logotype span { display: inline-block; width: 0; opacity: 0; transition: width 850ms steps(10), opacity 300ms ease; }
body.title-written .logotype span { width: 5.2em; opacity: 1; }

.header-rule {
  position: relative;
  height: 1px;
  background: #8b7355;
  opacity: 0.78;
}

.header-flame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #1a140e; padding: 5px; width: 27px; height: 38px; }

.nav-links { display: flex; gap: clamp(14px, 2vw, 28px); font-family: var(--accent); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #9b8e7a; }
.nav-links a { transition: color 220ms ease, text-shadow 220ms ease; }
.nav-links a:hover { color: #c9a96e; text-shadow: 0 0 20px rgba(245, 216, 154, 0.15); }

.document { position: relative; z-index: 2; padding-bottom: 16vh; }

.primary-crossbar, .secondary-crossbar, .vertical-cascade, .seal-section {
  display: grid;
  grid-template-columns: minmax(8%, 1fr) minmax(0, 680px) 1fr;
}

.primary-crossbar {
  min-height: 58vh;
  padding-top: 7vh;
  align-items: start;
}

.primary-copy { grid-column: 2 / span 1; width: 65vw; max-width: 920px; }

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9a96e;
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: #e8dcc8;
}

h1 { font-size: clamp(2.8rem, 5.5vw, 5rem); max-width: 11ch; }
h2 { font-size: clamp(2.2rem, 4vw, 4rem); max-width: 11ch; }

p { font-size: clamp(1rem, 1.8vw, 1.2rem); line-height: 1.72; letter-spacing: 0.005em; color: #9b8e7a; }

.primary-copy > p:last-child { max-width: 720px; color: #e8dcc8; }

.glow-card-stack { grid-column: 3; justify-self: start; display: grid; gap: 16px; margin-left: 42px; }
.glow-card {
  width: 180px;
  padding: 22px 18px;
  background: linear-gradient(170deg, #2e2318 0%, #1a140e 100%);
  border: 1px solid rgba(139, 115, 85, 0.34);
  box-shadow: inset 0 0 40px rgba(201, 169, 110, 0.08), 0 0 20px rgba(245, 216, 154, 0.06);
}
.glow-card span { font-family: var(--accent); font-size: 0.7rem; letter-spacing: 0.08em; color: #8b7355; }
.glow-card strong { display: block; margin: 10px 0 6px; font-family: var(--display); font-size: 1.45rem; color: #e8dcc8; }
.glow-card p { margin: 0; font-size: 0.84rem; line-height: 1.55; }

.wax-drip { grid-column: 2; display: block; width: min(640px, 76vw); height: 96px; margin: 2vh 0 8vh 8%; overflow: visible; }
.wax-drip path { fill: none; stroke: #8b7355; stroke-width: 1.5; stroke-linecap: round; opacity: 0.72; stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 800ms ease; }
.wax-drip.drawn path { stroke-dashoffset: 0; }
.wax-drip.short { width: min(480px, 58vw); margin-top: 0; }
.final-drip { margin-top: 8vh; }

.secondary-crossbar { min-height: 45vh; position: relative; align-items: start; }
.secondary-copy { grid-column: 2; width: 50vw; max-width: 690px; }
.candlestick-line { grid-column: 3; width: 1px; height: 38vh; background: linear-gradient(#5a4a37, rgba(90, 74, 55, 0)); margin-left: 28%; }

.seal-watermark { position: absolute; right: 11%; top: 2vh; width: 240px; height: 240px; opacity: 0.04; stroke: #c9a96e; fill: none; stroke-width: 3; }

.vertical-cascade { row-gap: 80px; padding-top: 1vh; }
.concept-block { grid-column: 2; width: 40vw; min-width: 420px; position: relative; padding-left: 42px; }
.bullet-flame { position: absolute; left: 0; top: 5px; width: 18px; height: 27px; }
.concept-block::after { content: ""; position: absolute; left: calc(100% + 10vw); top: 28px; width: 22vw; height: 1px; background: rgba(139, 115, 85, 0.3); }

.seal-section { min-height: 70vh; padding-top: 9vh; position: relative; }
.seal-section > .eyebrow, .seal-section > h2, .seal-section > p { grid-column: 2; width: 40vw; min-width: 420px; }
.seal-section > p { margin-top: 24px; }
.seal-mark { position: absolute; right: 12%; top: 18%; width: min(260px, 28vw); stroke: #c9a96e; fill: none; opacity: 0.14; stroke-width: 2; }
.seal-mark text { fill: #c9a96e; stroke: none; font-family: var(--accent); font-size: 16px; letter-spacing: 0.16em; }

.focus-block { opacity: 0; transform: scale(1.04); filter: blur(2px); transition: opacity 500ms cubic-bezier(.22,1,.36,1), transform 500ms cubic-bezier(.22,1,.36,1), filter 500ms cubic-bezier(.22,1,.36,1); }
.focus-block.in-focus { opacity: 1; transform: scale(1); filter: blur(0); }
.focus-block.warmed p { color: #e1d2bb; }

@media (max-width: 900px) {
  .candelabrum-header { grid-template-columns: 1fr; gap: 10px; padding: 22px 7%; }
  .header-rule { width: 100%; }
  .nav-links { flex-wrap: wrap; }
  .primary-crossbar, .secondary-crossbar, .vertical-cascade, .seal-section { grid-template-columns: 7% 1fr 7%; }
  .primary-copy, .secondary-copy, .concept-block, .seal-section > .eyebrow, .seal-section > h2, .seal-section > p { grid-column: 2; width: auto; min-width: 0; }
  .glow-card-stack { grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 36px 0 0; }
  .glow-card { width: auto; }
  .candlestick-line, .seal-watermark, .concept-block::after { display: none; }
}

@media (max-width: 620px) {
  .glow-card-stack { grid-template-columns: 1fr; }
  .wax-drip { margin-left: 7%; width: 82vw; }
  .nav-links { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 120ms !important; }
  .focus-block { transform: none; filter: none; }
}
