/* ==========================================================================
   M.A. LYCHFIELD — THE BANERIUS TRILOGY
   Architecture: Opzione 1 — Grimoire Split-Stage + WebGL2 Dark Fantasy Engine
   ========================================================================== */
:root {
  --ink: #070504;
  --ink-deep: #040302;
  --gallery-brown: #3f2f27;
  --brass: #c6a24c;
  --brass-soft: #e7d29a;
  --brass-bright: #f5dfb0;
  --brass-dim: rgba(198, 162, 76, 0.28);
  --brass-line: rgba(198, 162, 76, 0.42);
  --parch: #f3ead6;
  --parch-dim: #b6a07d;
  --ember: #ff3322;
  --amber: #ffffff;
  --ease: cubic-bezier(.16, .84, .28, 1);
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --display: "Cinzel", "EB Garamond", Georgia, serif;
  --geo: "League Spartan", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink);
  color: var(--parch);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--parch);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.drawer-open,
body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   PRESERVED BACKGROUNDS & WEBGL2 LAYER STACK
   ========================================================================== */
.scene,
.bg,
.aboutbg,
.gallerybg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

/* Home Background (Video + Poster + Wisps) */
.scene {
  background: url("home-bg.jpg") 50% 38% / cover no-repeat #070504;
}
.scene__inner {
  position: absolute;
}
.scene__inner .bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  filter: brightness(.64) saturate(.96);
}
.fx {
  position: absolute;
  pointer-events: none;
}
.wisp {
  border-radius: 50%;
  filter: blur(26px);
}
.w1 { left: 50%; top: 60%; width: 46%; height: 42%; transform: translate(-50%,-50%); background: radial-gradient(closest-side,rgba(5,3,2,.82),rgba(5,3,2,0)); animation: drift1 11s ease-in-out infinite; }
.w2 { left: 34%; top: 46%; width: 24%; height: 34%; background: radial-gradient(closest-side,rgba(5,3,2,.66),rgba(5,3,2,0)); animation: drift2 13s ease-in-out infinite; }
.w3 { left: 66%; top: 48%; width: 24%; height: 34%; background: radial-gradient(closest-side,rgba(5,3,2,.66),rgba(5,3,2,0)); animation: drift2 12s ease-in-out infinite reverse; }
.w4 { left: 46%; top: 30%; width: 18%; height: 22%; background: radial-gradient(closest-side,rgba(6,4,3,.52),rgba(6,4,3,0)); animation: drift1 9s ease-in-out infinite reverse; }
.w5 { left: 50%; top: 84%; width: 60%; height: 34%; transform: translate(-50%,-50%); background: radial-gradient(closest-side,rgba(4,2,1,.88),rgba(4,2,1,0)); animation: drift2 15s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-52%,-58%) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translateY(0) scale(1); opacity: .85; } 50% { transform: translateY(-9%) scale(1.1); opacity: 1; } }

/* Static Page Backgrounds — Preserved 1:1 */
.aboutbg {
  background: url("aldric.jpg") 50% 22% / cover no-repeat;
  filter: brightness(.62) saturate(.92);
  transform: scale(1.02);
}
.aboutbg::after,
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 100% at 50% 28%, transparent 38%, rgba(7,5,4,.52) 100%),
    linear-gradient(180deg, rgba(7,5,4,.36) 0%, rgba(7,5,4,.58) 62%, rgba(7,5,4,.88) 100%);
}
body[data-webgl-mode="books"] .bg {
  background: url("art3.jpg") 50% 18% / cover no-repeat;
  filter: brightness(.60) saturate(.85);
  transform: scale(1.02);
}
body[data-webgl-mode="contact"] .bg {
  background: url("art6.jpg") 50% 24% / cover no-repeat;
  filter: brightness(.60) saturate(.84);
  transform: scale(1.02);
}
.gallerybg {
  background: var(--gallery-brown);
}
@media (min-width: 1800px) {
  .aboutbg { background-image: url("aldric@2x.jpg"); }
  body[data-webgl-mode="books"] .bg { background-image: url("art3@2x.jpg"); }
  body[data-webgl-mode="contact"] .bg { background-image: url("art6@2x.jpg"); }
}

.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(7,5,4,.08), rgba(7,5,4,.08)),
    radial-gradient(135% 100% at 50% 28%, transparent 44%, rgba(7,5,4,.44) 100%),
    linear-gradient(180deg, rgba(7,5,4,.22) 0%, transparent 24%, transparent 48%, rgba(7,5,4,.68) 82%, var(--ink) 100%);
}

/* WebGL2 Atmospheric Canvas */
.banerius-webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 7;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); }
  33% { transform: translate(-4%,2%); }
  66% { transform: translate(3%,-3%); }
  100% { transform: translate(0,0); }
}

/* ==========================================================================
   FLOATING GRIMOIRE NAVIGATION (DESKTOP + MOBILE DRAWER)
   ========================================================================== */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1380px, calc(100vw - 44px));
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 26px;
  background: rgba(8, 6, 4, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(198, 162, 76, 0.36);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body[data-webgl-mode="gallery"] .nav {
  background: rgba(34, 24, 19, 0.84);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--parch);
  flex-shrink: 0;
}
.navlogo {
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.7));
}
.navlogo img {
  display: block;
  height: 2rem;
  width: auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--display);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--parch);
}
.brand-trilogy {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--brass-soft);
  letter-spacing: 0.03em;
}

.navright {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu {
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 17px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  color: var(--parch);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .24s var(--ease);
}
.menu a:hover,
.menu a:focus-visible {
  color: var(--brass-soft);
  border-color: rgba(198, 162, 76, 0.32);
  background: rgba(198, 162, 76, 0.08);
  outline: none;
}
.menu a[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(135deg, var(--brass-soft), var(--brass));
  border-color: var(--brass);
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(198, 162, 76, 0.25);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border: 1px solid rgba(198, 162, 76, 0.26);
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--geo);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.lang button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--parch-dim);
  padding: 4px 5px;
  font: inherit;
  transition: color .2s, background .2s;
  border-radius: 3px;
}
.lang button:hover {
  color: var(--parch);
}
.lang button.on {
  color: var(--ink);
  background: var(--brass-soft);
}
.lang span {
  color: rgba(182, 160, 125, 0.35);
  font-size: 0.68rem;
  user-select: none;
}

.fx-toggle-btn {
  background: rgba(198, 162, 76, 0.08);
  border: 1px solid rgba(198, 162, 76, 0.32);
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.fx-toggle-btn:hover {
  background: var(--brass);
  color: var(--ink);
}

/* Mobile Hamburger Button & Drawer (Hidden on Desktop) */
.nav-mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
}
.drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: rgba(198, 162, 76, 0.12);
  border: 1px solid rgba(198, 162, 76, 0.45);
  color: var(--parch);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  cursor: pointer;
}
.drawer-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.drawer-toggle-bars i {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--brass-soft);
  transition: transform .25s ease, opacity .25s ease;
}
body.drawer-open .drawer-toggle-bars i:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
body.drawer-open .drawer-toggle-bars i:nth-child(2) {
  opacity: 0;
}
body.drawer-open .drawer-toggle-bars i:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 114;
  background: rgba(4, 3, 2, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.mobile-drawer {
  position: fixed;
  top: 78px;
  left: 14px;
  right: 14px;
  z-index: 118;
  background: linear-gradient(170deg, rgba(12, 9, 7, 0.96), rgba(7, 5, 4, 0.98));
  border: 1px solid rgba(198, 162, 76, 0.45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.9);
  padding: 20px;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
body.drawer-open .mobile-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.drawer-open .mobile-drawer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--parch);
  text-decoration: none;
  border: 1px solid rgba(198, 162, 76, 0.2);
  background: rgba(255, 255, 255, 0.02);
}
.mobile-drawer-menu a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(198, 162, 76, 0.25), rgba(198, 162, 76, 0.08));
  border-color: var(--brass);
  color: var(--brass-soft);
}
.mobile-drawer-menu a::after {
  content: "→";
  color: var(--brass);
  font-style: normal;
}
.mobile-drawer-langs {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(198, 162, 76, 0.22);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.mobile-drawer-langs button {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(198, 162, 76, 0.26);
  color: var(--parch-dim);
  font-family: var(--geo);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.mobile-drawer-langs button.on {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass-soft);
}

/* ==========================================================================
   OPZIONE 1 — GRIMOIRE SPLIT-STAGE LAYOUT CONTAINERS
   ========================================================================== */
.grimoire-stage {
  position: relative;
  z-index: 5;
  width: min(1380px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 124px 32px 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split-stage {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6.5fr);
  gap: 54px;
  align-items: start;
}
.split-stage > * {
  min-width: 0;
  max-width: 100%;
}

/* Left Monument Column */
.hero-monument {
  position: sticky;
  top: 132px;
  padding: 16px 6px 16px 0;
  text-align: left;
}

.eyebrow-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(0.78rem, 1.3vw, 0.96rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass-soft);
  text-shadow: 0 2px 16px rgba(0,0,0,.9);
  margin-bottom: 14px;
}
.eyebrow-tag::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass);
}

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--parch);
  text-shadow: 0 8px 36px rgba(0, 0, 0, 0.92);
}

.book-banner {
  margin-top: 20px;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--brass);
  text-shadow: 0 2px 18px rgba(0,0,0,.92);
}
.book-banner .no {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 4px;
}
.book-banner em {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.2vw, 1.82rem);
  color: var(--parch);
}

/* Epigraph Card in Left Column */
.epi-card {
  margin-top: 28px;
  padding: 20px 22px;
  background: linear-gradient(155deg, rgba(10, 8, 6, 0.64), rgba(6, 4, 3, 0.78));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(198, 162, 76, 0.3);
  border-left: 3px solid var(--brass);
  font-family: var(--serif);
  font-style: italic;
  color: var(--brass-soft);
  text-align: left;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65);
}
.epi__p {
  font-size: clamp(0.95rem, 1.35vw, 1.04rem);
  line-height: 1.64;
  margin-bottom: 0.75em;
}
.epi__p:last-child {
  margin-bottom: 0;
}

.cta-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn-grimoire {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parch);
  text-decoration: none;
  background: linear-gradient(135deg, rgba(198, 162, 76, 0.2), rgba(198, 162, 76, 0.05));
  border: 1px solid rgba(198, 162, 76, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: all .25s var(--ease);
}
.btn-grimoire:hover {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass-soft);
  transform: translateY(-2px);
}
.btn-grimoire.secondary {
  background: rgba(10, 8, 6, 0.55);
  border-color: rgba(198, 162, 76, 0.34);
}
.btn-grimoire.secondary:hover {
  background: rgba(198, 162, 76, 0.18);
  color: var(--brass-soft);
  border-color: var(--brass);
}

/* Right Column: Obsidian & Brass Grimoire Slab */
.grimoire-slab {
  --mx: 50%;
  --my: 30%;
  position: relative;
  background:
    radial-gradient(560px circle at var(--mx) var(--my), rgba(198, 162, 76, 0.11), transparent 65%),
    linear-gradient(165deg, rgba(12, 9, 7, 0.68), rgba(7, 5, 4, 0.82));
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  border: 1px solid rgba(198, 162, 76, 0.42);
  padding: 38px 42px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.8),
    inset 0 0 0 4px rgba(7, 5, 4, 0.55),
    inset 0 0 0 5px rgba(198, 162, 76, 0.16);
}

/* Royal Root Frames flanking the Grimoire Slab */
.grimoire-slab.with-roots::before,
.grimoire-slab.with-roots::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 52px;
  height: 210px;
  background: url("root-frame.svg?v=royal2") center / contain no-repeat;
  opacity: 0.78;
  filter: drop-shadow(0 0 6px rgba(198, 162, 76, 0.32)) brightness(1.15);
  pointer-events: none;
}
.grimoire-slab.with-roots::before {
  left: -34px;
  transform: translateY(-50%);
}
.grimoire-slab.with-roots::after {
  right: -34px;
  transform: translateY(-50%) scaleX(-1);
}

.slab-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(198, 162, 76, 0.26);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

.blurb,
.prose {
  font-family: var(--serif);
  font-size: clamp(1.06rem, 1.45vw, 1.18rem);
  line-height: 1.72;
  color: rgba(243, 234, 214, 0.94);
  text-align: left;
}
.blurb p,
.prose p {
  margin-bottom: 0.98em;
}
.blurb p:last-child {
  margin-bottom: 0;
  color: var(--brass-soft);
  font-style: italic;
  font-size: 1.12em;
}
.blurb p:first-of-type::first-letter,
.prose p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.35rem;
  line-height: 0.84;
  padding-right: 12px;
  padding-top: 4px;
  color: var(--brass);
  text-shadow: 0 2px 14px rgba(198, 162, 76, 0.38);
}
.prose em {
  font-style: italic;
  color: var(--brass-soft);
}
.prose strong {
  color: var(--brass-bright);
  font-weight: 600;
}

/* ==========================================================================
   BOOKS PAGE — GRIMOIRE SPLIT & TOME CARDS
   ========================================================================== */
.books-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.tomes-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 22px;
}
.tome-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(198, 162, 76, 0.12), transparent 65%),
    linear-gradient(160deg, rgba(12, 9, 7, 0.72), rgba(7, 5, 4, 0.86));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(198, 162, 76, 0.36);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.72);
}
.tome-card.lead {
  border-color: var(--brass);
  background:
    radial-gradient(480px circle at var(--mx) var(--my), rgba(198, 162, 76, 0.18), transparent 65%),
    linear-gradient(160deg, rgba(24, 18, 11, 0.82), rgba(8, 6, 4, 0.88));
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.82), inset 0 0 0 1px rgba(198, 162, 76, 0.25);
}
.tome-card:hover {
  border-color: var(--brass-soft);
}
.tome-card .num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
}
.tome-card .vtitle {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  line-height: 1.2;
  color: var(--parch);
}
.tome-card.tba .vtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--parch-dim);
}
.tome-card .tome-ornament {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--brass-line), transparent);
  margin-top: 8px;
}

/* ==========================================================================
   CONTACT PAGE — SPLIT GRIMOIRE FORM
   ========================================================================== */
.contact-slab {
  --mx: 50%;
  --my: 40%;
  background:
    radial-gradient(500px circle at var(--mx) var(--my), rgba(198, 162, 76, 0.10), transparent 65%),
    linear-gradient(165deg, rgba(12, 9, 7, 0.72), rgba(7, 5, 4, 0.86));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(198, 162, 76, 0.42);
  padding: 36px 38px;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.8);
}
.row {
  display: flex;
  gap: 16px;
}
.row .field {
  flex: 1;
}
.field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.field label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-soft);
  margin-bottom: 7px;
}
.field input,
.field textarea {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--parch);
  background: rgba(6, 4, 3, 0.72);
  border: 1px solid rgba(198, 162, 76, 0.36);
  padding: 12px 15px;
  width: 100%;
  outline: none;
  transition: border-color .22s, box-shadow .22s;
}
.field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--brass-soft);
  box-shadow: 0 0 0 1px var(--brass), 0 0 22px -6px rgba(198, 162, 76, 0.45);
}
.field .hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.86rem;
  color: var(--parch-dim);
  margin-top: 6px;
}
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}
.send {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 32px;
  margin-top: 6px;
  color: var(--parch);
  background: linear-gradient(135deg, rgba(198, 162, 76, 0.24), rgba(198, 162, 76, 0.06));
  border: 1px solid var(--brass);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.send:hover {
  background: var(--brass);
  color: var(--ink);
}
.send:disabled {
  opacity: 0.5;
  cursor: default;
}
.formmsg {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 1rem;
  min-height: 1.4em;
}
.formmsg.ok { color: var(--brass-soft); }
.formmsg.err { color: var(--ember); }
.privacy {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--parch-dim);
  line-height: 1.55;
}

/* ==========================================================================
   LANGUAGE GATE & 3D BOOK OPENING INTRO (PRESERVED FROM LIVE)
   ========================================================================== */
#langgate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(24, 17, 11, 0.94), #050403 75%);
  padding: 24px;
}
.has-lang #langgate {
  display: none;
}
.lg-box {
  text-align: center;
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  background: rgba(10, 8, 6, 0.85);
  border: 1px solid rgba(198, 162, 76, 0.42);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9);
}
.lg-t {
  font-family: var(--display);
  font-size: 1.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--parch);
  margin-bottom: 24px;
}
.lg-o {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lg-o button {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--parch);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(198, 162, 76, 0.38);
  padding: 13px;
  cursor: pointer;
  transition: all .2s;
}
.lg-o button:hover {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass-soft);
}

#bookIntro {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  perspective: 1800px;
  pointer-events: auto;
  overflow: hidden;
}
.has-lang #bookIntro {
  display: block;
  animation: bookIntroDismiss .16s ease 3.25s forwards;
}
.skip-intro #bookIntro {
  display: none !important;
}
.book-intro__cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  color: var(--brass);
  background: radial-gradient(circle at 50% 46%, rgba(198,162,76,.08), transparent 35%), url("book-cover-frame-v1.webp?v=1") center / cover no-repeat, #050403;
  animation: bookCoverOpen .78s cubic-bezier(.62,.02,.27,.99) 2s forwards;
}
.book-intro__spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3.5%;
  background: linear-gradient(90deg, rgba(0,0,0,.38), transparent 82%);
  box-shadow: 14px 0 30px rgba(0,0,0,.24);
}
.book-intro__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 3px 22px rgba(198,162,76,.2);
}
.book-intro__copy::before,
.book-intro__copy::after {
  content: "";
  position: absolute;
  left: 50%;
  width: clamp(42px, 6vw, 60px);
  height: clamp(150px, 24vw, 220px);
  background: url("root-frame.svg?v=royal2") center / contain no-repeat;
  opacity: .9;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.58)) brightness(1.08);
  pointer-events: none;
}
.book-intro__copy::before { top: calc(-1 * clamp(48px, 6vw, 72px)); transform: translate(-50%,-50%) rotate(90deg); }
.book-intro__copy::after { bottom: calc(-1 * clamp(48px, 6vw, 72px)); transform: translate(-50%,50%) rotate(-90deg) scaleX(-1); }
.book-intro__copy span,
.book-intro__copy small {
  font-family: var(--serif);
  font-size: clamp(.62rem, 1.15vw, .82rem);
  letter-spacing: .3em;
}
.book-intro__copy strong {
  margin: clamp(.85rem, 2vw, 1.4rem) 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 7.2rem);
  font-weight: 400;
  line-height: .78;
  letter-spacing: -.045em;
}
.book-intro__ornament {
  width: clamp(90px, 18vw, 190px);
  height: 1px;
  margin-bottom: clamp(.85rem, 2vw, 1.4rem);
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
@keyframes bookCoverOpen {
  0% { transform: rotateY(0); opacity: 1; }
  74% { transform: rotateY(-96deg); opacity: 1; }
  99% { transform: rotateY(-108deg); opacity: .08; }
  100% { transform: rotateY(-108deg); opacity: 0; visibility: hidden; }
}
@keyframes bookIntroDismiss {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ==========================================================================
   RESPONSIVE & MOBILE OPTIMIZATION (<= 960px and <= 560px)
   ========================================================================== */
@media (max-width: 1024px) {
  .split-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .hero-monument {
    position: static;
    padding: 0;
  }
  .tomes-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .grimoire-slab.with-roots::before,
  .grimoire-slab.with-roots::after {
    display: none;
  }
}

@media (max-width: 900px) {
  .nav {
    top: 10px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    padding: 9px 12px;
    gap: 8px;
  }
  .navlogo img {
    height: 1.65rem;
  }
  .brand {
    gap: 9px;
    min-width: 0;
  }
  .brand-name {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
  .navright {
    display: none;
  }
  .nav-mobile-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }
  .fx-toggle-btn {
    padding: 5px 8px;
    font-size: 0.6rem;
  }
  .drawer-toggle {
    height: 34px;
    padding: 0 10px;
    font-size: 0.88rem;
    gap: 6px;
  }
  .brand-trilogy {
    display: none;
  }
  .grimoire-stage {
    padding: 84px 14px 56px;
    justify-content: flex-start;
  }
  .grimoire-slab,
  .contact-slab {
    padding: 22px 18px;
  }
  .wordmark {
    font-size: clamp(1.9rem, 8vw, 3rem);
    overflow-wrap: break-word;
  }
  .book-intro__cover {
    background-image: radial-gradient(circle at 50% 46%, rgba(198,162,76,.08), transparent 34%), url("book-cover-frame-mobile-v1.webp?v=1");
    background-size: 100% 100%;
    animation-duration: .58s;
  }
  .book-intro__copy { max-width: 68vw; }
  .book-intro__copy strong { font-size: clamp(2.25rem, 10.8vw, 4rem); }
}

@media (max-width: 560px) {
  .row {
    flex-direction: column;
    gap: 0;
  }
  .lg-o {
    grid-template-columns: 1fr;
  }
  .epi-card {
    padding: 15px 15px;
  }
  .tome-card {
    padding: 20px 16px;
  }
  .slab-meta {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.62rem;
    letter-spacing: 0.11em;
  }
  .cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .btn-grimoire {
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.96rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
