/* ============================================================================
   TEMPLATE 10 — MONOLITH · "Levi Marrow: An Examined Life"
   Category: BIOGRAPHY / CAIRNS · founder legacy / philosopher
   Salt-flat + black slab + sunset · Kubrick / Wenders / 2001
   ============================================================================ */

:root {
  /* palette — salt + matte-black + burnt orange */
  --salt:        #efe9da;   /* salt-flat / parchment / paper */
  --salt-soft:   #d8d0bd;
  --salt-warm:   #ead7b8;
  --slab:        #060606;   /* monolith — true black */
  --ink:         #14110b;   /* readable body text on salt */
  --ink-soft:    #4a3f30;
  --ink-mute:    #7a6e5a;
  --ink-faint:   rgba(20,17,11,0.32);
  --amber:       #c4622c;   /* burnt sunset */
  --amber-soft:  #e08a4a;
  --ember:       #ff7a2f;
  --bruise:      #2a1135;   /* deep purple zenith */
  --hair:        rgba(20, 17, 11, 0.10);
  --hair-strong: rgba(20, 17, 11, 0.20);

  /* type */
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* motion */
  --ease-deliberate: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-slow:       cubic-bezier(0.14, 1, 0.34, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  min-height: 100svh;
  background: #060606;
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }
body.is-locked { overflow: hidden; height: 100svh; }
::selection { background: var(--amber); color: var(--salt); }
img, svg, canvas { display: block; max-width: 100%; }

/* ============ WebGL canvas — fixed backdrop ============ */
#pillar-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100svh;
  z-index: 0; background: #060606;
}

/* ============ Atmospheric overlays ============ */
.pillar-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 95% at 50% 60%, transparent 38%, rgba(8,5,2,0.55) 88%, rgba(0,0,0,0.92) 100%),
    radial-gradient(60% 40% at 50% 100%, rgba(120,40,8,0.18), transparent 70%);
  mix-blend-mode: multiply;
}
.pillar-grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 0.95   0 0 0 0 0.86   0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
.pillar-heat {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.20;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(8,3,0,0.10) 3px 4px),
    linear-gradient(180deg, rgba(255,150,80,0.10) 0%, transparent 35%, transparent 70%, rgba(40,10,60,0.18) 100%);
  mix-blend-mode: overlay;
}

/* ============ Loading gate ============ */
.pillar-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 100% at 50% 60%, #1a0e04 0%, #060201 100%);
  transition: opacity 1.1s var(--ease-slow), visibility 1.1s;
}
.pillar-gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.pillar-gate__inner {
  text-align: center; max-width: 640px; padding: 0 32px;
  color: var(--salt);
}
.pillar-gate__rule {
  width: 1px; height: 56px; margin: 0 auto 28px;
  background: linear-gradient(180deg, transparent, var(--amber), transparent);
}
.pillar-gate__eye {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: rgba(239,233,218,0.42); margin-bottom: 36px;
}
.pillar-gate__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(46px, 6vw, 86px); line-height: 1.04;
  letter-spacing: -0.012em; color: var(--salt); margin-bottom: 28px;
}
.pillar-gate__title em { font-style: italic; color: var(--amber-soft); font-weight: 300; }
.pillar-gate__sub {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(13px, 1vw, 15px); line-height: 1.7;
  color: rgba(239,233,218,0.62); margin-bottom: 44px;
  max-width: 460px; margin-left: auto; margin-right: auto;
}
.pillar-gate__sub strong { color: var(--salt); font-weight: 400; }
.pillar-gate__btns {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 44px;
}
.pillar-gate__btn {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.24em;
  text-transform: uppercase;
  min-height: 48px; min-width: 180px; padding: 0 28px;
  background: transparent; color: var(--salt);
  border: 1px solid rgba(239,233,218,0.32); cursor: pointer;
  touch-action: manipulation;
  transition: all 0.4s var(--ease-deliberate);
}
.pillar-gate__btn:hover { border-color: var(--amber); color: var(--amber-soft); letter-spacing: 0.30em; }
.pillar-gate__btn--primary {
  background: var(--amber); border-color: var(--amber); color: #1a0a02;
}
.pillar-gate__btn--primary:hover { background: var(--amber-soft); border-color: var(--amber-soft); color: #1a0a02; }
.pillar-gate__legal {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.36em;
  text-transform: uppercase; color: rgba(239,233,218,0.28);
}

/* ============ Fixed chrome rails ============ */
.pillar-chrome {
  position: fixed; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 3vw, 48px);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--salt);
  pointer-events: none;
}
.pillar-chrome--top { top: 0; }
.pillar-chrome--bot { bottom: 0; }

.pillar-brand { display: inline-flex; align-items: center; gap: 12px; pointer-events: auto; color: var(--salt); text-decoration: none; opacity: 0.86; }
.pillar-brand:hover { opacity: 1; }
.pillar-brand__glyph { color: var(--amber); font-size: 14px; line-height: 1; }
.pillar-brand__label em { color: rgba(239,233,218,0.55); font-style: normal; letter-spacing: 0.18em; margin-left: 6px; text-transform: lowercase; }

.pillar-meta { display: inline-flex; gap: 28px; }
.pillar-meta__pair { display: inline-flex; gap: 8px; align-items: baseline; opacity: 0.78; }
.pillar-meta__pair span { color: rgba(239,233,218,0.45); }
.pillar-meta__pair strong { color: var(--salt); font-weight: 500; }

.pillar-cypher { color: rgba(239,233,218,0.44); font-size: 10px; letter-spacing: 0.20em; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pillar-frame { color: var(--amber-soft); }

/* ============ Side rail (chapter index) ============ */
.pillar-rail {
  position: fixed; left: clamp(16px, 2.4vw, 36px); top: 50%; z-index: 50;
  transform: translateY(-50%);
  pointer-events: none;
}
.pillar-rail__list {
  list-style: none; display: flex; flex-direction: column; gap: 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(239,233,218,0.42);
}
.pillar-rail__list li { display: flex; align-items: center; gap: 10px; transition: color 0.5s var(--ease-deliberate); }
.pillar-rail__list li::before {
  content: ''; width: 14px; height: 1px; background: currentColor; opacity: 0.5;
  transition: width 0.5s var(--ease-deliberate);
}
.pillar-rail__list li.is-active { color: var(--amber-soft); }
.pillar-rail__list li.is-active::before { width: 28px; opacity: 1; }
.pillar-rail__list li span { font-weight: 500; }
.pillar-rail__list li em { font-style: normal; opacity: 0.72; }

/* ============ Document deck ============ */
.pillar-deck {
  position: relative; z-index: 5;
  padding: 0 clamp(20px, 6vw, 88px);
}

/* ============ HERO (title plate) ============ */
.pillar-hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 880px; margin: 0 auto; padding: 18vh 0 14vh;
  color: var(--salt);
}
.pillar-hero__eye {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.30em;
  text-transform: uppercase; color: var(--amber-soft); margin-bottom: 32px;
  opacity: 0.78;
}
.pillar-hero__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(72px, 14vw, 220px); line-height: 0.92;
  letter-spacing: -0.02em; margin-bottom: 36px;
  text-shadow: 0 4px 36px rgba(0,0,0,0.45);
}
.pillar-hero__title .line { display: block; }
.pillar-hero__title em { font-style: italic; color: var(--amber-soft); font-weight: 300; }
.pillar-hero__life {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(239,233,218,0.62); margin-bottom: 32px;
}
.pillar-hero__life strong { color: var(--salt); font-weight: 500; }
.pillar-hero__lede {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(17px, 1.4vw, 22px); line-height: 1.65;
  max-width: 640px; color: rgba(239,233,218,0.85);
  font-style: italic;
}
.pillar-hero__lede strong { font-style: normal; font-weight: 400; color: var(--salt); }
.pillar-hero__cue {
  margin-top: clamp(56px, 8vh, 96px);
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.30em;
  text-transform: uppercase; color: rgba(239,233,218,0.52);
}
.pillar-hero__cue-line { display: inline-block; width: 56px; height: 1px; background: currentColor; opacity: 0.6; animation: pillar-pulse 2.6s ease-in-out infinite; }
@keyframes pillar-pulse { 50% { opacity: 0.2; } }

/* ============ CHAPTER blocks ============ */
.pillar-chapter {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 920px; margin: 0 auto; padding: 16vh 0 14vh;
  position: relative;
}
/* depth-layer color treatment — each chapter darker/older */
.pillar-chapter--i   { color: var(--salt); }
.pillar-chapter--ii  { color: rgba(239,233,218,0.92); }
.pillar-chapter--iii { color: rgba(234,215,184,0.90); }
.pillar-chapter--iv  { color: rgba(224,138,74,0.88); }
.pillar-chapter--v   { color: rgba(224,138,74,0.96); }

.pillar-chapter__head {
  display: flex; align-items: baseline; gap: 22px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; margin-bottom: 36px;
  color: var(--amber-soft);
}
.pillar-chapter__ord { font-weight: 500; }
.pillar-chapter__date { color: rgba(239,233,218,0.55); letter-spacing: 0.22em; }

.pillar-chapter__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(54px, 9vw, 124px); line-height: 0.96;
  letter-spacing: -0.018em; margin-bottom: 44px;
  text-shadow: 0 3px 28px rgba(0,0,0,0.40);
}
.pillar-chapter__title em { font-style: italic; color: var(--amber-soft); font-weight: 300; }

.pillar-chapter__lede {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(17px, 1.45vw, 24px); line-height: 1.72;
  max-width: 720px; margin-bottom: 56px;
  color: inherit; opacity: 0.92;
}
.pillar-chapter__lede em { font-style: italic; color: var(--amber-soft); }
.pillar-chapter__lede strong { font-style: normal; font-weight: 400; color: var(--salt); }

.pillar-chapter__pulls {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  max-width: 720px; margin-bottom: 48px;
}
@media (min-width: 900px) {
  .pillar-chapter__pulls { grid-template-columns: 1fr 1fr; gap: 36px 48px; }
  .pillar-chapter__pulls .pillar-pull:first-child { grid-column: 1 / -1; }
}
.pillar-pull {
  border-left: 1px solid rgba(224,138,74,0.42);
  padding: 6px 0 6px 24px;
}
.pillar-pull p {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(18px, 1.55vw, 28px); line-height: 1.42;
  color: var(--salt); margin-bottom: 14px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}
.pillar-pull cite {
  font-family: var(--mono); font-style: normal;
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(239,233,218,0.52);
}

.pillar-chapter__stamp {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.30em;
  text-transform: uppercase; color: rgba(224,138,74,0.62);
  border-top: 1px solid rgba(224,138,74,0.18);
  padding-top: 18px; max-width: 460px;
}

/* ============ INSCRIPTION (closing plate) ============ */
.pillar-inscription {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  max-width: 900px; margin: 0 auto; padding: 16vh 0;
  color: var(--salt);
}
.pillar-inscription__eye {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--amber-soft); margin-bottom: 56px;
}
.pillar-inscription__line {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(40px, 6vw, 88px); line-height: 1.10;
  letter-spacing: -0.012em; margin-bottom: 56px;
  color: var(--salt);
}
.pillar-inscription__line span { display: block; }
.pillar-inscription__line em { font-style: italic; color: var(--amber-soft); font-weight: 300; }
.pillar-inscription__sig {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.28em;
  text-transform: uppercase; color: rgba(239,233,218,0.72); margin-bottom: 64px;
}
.pillar-inscription__after {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(15px, 1.15vw, 18px); line-height: 1.7;
  max-width: 580px; color: rgba(239,233,218,0.65);
  font-style: italic;
}
.pillar-inscription__after strong { font-style: normal; font-weight: 400; color: var(--salt); letter-spacing: 0.04em; }

/* ============ FOOTER ============ */
.pillar-footer {
  min-height: 60svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1100px; margin: 0 auto; padding: 12vh 0 10vh;
  color: var(--salt);
}
.pillar-footer__rule {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,138,74,0.5), transparent);
  margin-bottom: 64px;
}
.pillar-footer__cols {
  display: grid; grid-template-columns: 1fr; gap: 44px;
  margin-bottom: 56px;
}
@media (min-width: 900px) {
  .pillar-footer__cols { grid-template-columns: 1fr 1fr 1fr; gap: 56px; }
}
.pillar-footer__col p { margin-bottom: 14px; line-height: 1.65; color: rgba(239,233,218,0.78); font-family: var(--sans); font-weight: 300; font-size: 14px; }
.pillar-footer__col p:last-child { margin-bottom: 0; color: rgba(239,233,218,0.50); }
.pillar-footer__eye {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.30em;
  text-transform: uppercase; color: var(--amber-soft) !important; margin-bottom: 18px !important;
}
.pillar-footer__last {
  text-align: center;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.36em;
  text-transform: uppercase; color: rgba(239,233,218,0.34);
  padding-top: 28px; border-top: 1px solid rgba(239,233,218,0.10);
}

/* ============ Letter-by-letter reveal hooks ============ */
.splitch {
  display: inline-block; opacity: 0;
  filter: blur(10px); transform: translateY(8px);
  transition: opacity 1.2s var(--ease-slow), filter 1.2s var(--ease-slow), transform 1.2s var(--ease-slow);
}
.splitch.is-visible { opacity: 1; filter: blur(0); transform: translateY(0); }

/* ============ Scroll-in reveal ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease-deliberate), transform 1.1s var(--ease-deliberate); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============ Mobile ============ */
@media (max-width: 720px) {
  .pillar-rail { display: none; }
  .pillar-meta { display: none; }
  .pillar-cypher { display: none; }
  .pillar-chrome { padding: 16px 18px; }
  .pillar-deck { padding: 0 22px; }
  .pillar-hero__title { font-size: clamp(56px, 18vw, 92px); }
  .pillar-chapter__title { font-size: clamp(42px, 12vw, 72px); }
  .pillar-inscription__line { font-size: clamp(32px, 9vw, 58px); }
  .pillar-gate__btn { min-width: 160px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .splitch { opacity: 1; filter: none; transform: none; }
  .reveal { opacity: 1; transform: none; }
}
