/* ============================================================
   VEYLOCRA — shared foundation (v2, responsive evolution)
   palette : bone on warm-black · blood-red primary · ember/gold secondary
   type    : Cinzel (display) · Newsreader (editorial) · JetBrains Mono (data)
   ============================================================ */

:root {
  /* ---- surfaces ---- */
  --bg:    #0b0a09;
  --bg-2:  #131110;
  --bg-3:  #1c1916;
  --panel: rgba(255, 255, 255, 0.022);

  /* ---- ink ---- */
  --fg:    #ece7de;
  --fg-2:  #a8a299;
  --fg-3:  #6a635a;
  --line:  #2a2623;
  --line-2:#3a3531;

  /* ---- accents (oklch, shared chroma/lightness, varied hue) ---- */
  --blood:   oklch(0.56 0.19 26);
  --blood-2: oklch(0.50 0.17 26);
  --ember:   oklch(0.72 0.12 62);

  /* legacy hex fallbacks used in a couple of shadows/gradients */
  --blood-rgb: 188, 36, 33;
  --ember-rgb: 206, 150, 92;

  /* ---- metrics ---- */
  --maxw: 1320px;
  --wide: 1560px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 68px;

  /* ---- fluid type scale ---- */
  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.88rem);
  --step-0:  clamp(0.95rem, 0.90rem + 0.3vw, 1.10rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.6vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.25rem + 1.1vw, 2.10rem);
  --step-3:  clamp(1.95rem, 1.55rem + 2.0vw, 3.20rem);
  --step-4:  clamp(2.60rem, 1.90rem + 3.4vw, 4.80rem);

  /* ---- motion ---- */
  --ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 380;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body { min-height: 100svh; }

::selection { background: var(--blood); color: var(--fg); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
ul, ol { list-style: none; }

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

/* monospace helper */
.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ===================== ATMOSPHERE ===================== */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: 0.08;
  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='1.6' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.vignette {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 998;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.5) 100%);
}

/* lighten atmosphere on phones — perf + legibility */
@media (max-width: 760px) {
  .grain { opacity: 0.05; }
  .vignette { background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.42) 100%); }
}

/* ===================== LAYOUT PRIMITIVES ===================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 11vw, 150px);
  position: relative;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--step--1);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--blood);
}

/* section header: index · title · kicker */
.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: clamp(14px, 2.5vw, 26px);
  margin-bottom: clamp(36px, 6vw, 68px);
  padding-bottom: clamp(18px, 2.5vw, 26px);
  border-bottom: 1px solid var(--line);
}
.section-head .num {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--step--1);
  letter-spacing: 0.3em;
  color: var(--blood);
  padding-bottom: 0.45em;
}
.section-head .title {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: var(--step-3);
  letter-spacing: 0.03em;
  line-height: 0.95;
}
.section-head .kicker {
  grid-column: 1 / -1;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--step--1);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-3);
}
@media (min-width: 760px) {
  .section-head {
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
  }
  .section-head .kicker { grid-column: auto; justify-self: end; text-align: right; }
}

/* ===================== BUTTONS ===================== */
.btn {
  --bd: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 15px 24px;
  min-height: 48px;
  border: 1px solid var(--bd);
  background: var(--fg);
  color: var(--bg);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
  cursor: pointer;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--blood);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
  z-index: -1;
}
.btn:hover { color: var(--fg); border-color: var(--blood); }
.btn:hover::before { transform: translateX(0); }

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn.ghost::before { background: var(--fg); }
.btn.ghost:hover { color: var(--bg); border-color: var(--fg); }

/* ===================== NAV ===================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  background: linear-gradient(180deg, rgba(11,10,9,0.94) 0%, rgba(11,10,9,0.7) 60%, rgba(11,10,9,0) 100%);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-solid {
  background: rgba(11,10,9,0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(15px, 1.4vw, 19px);
  letter-spacing: 0.3em;
  color: var(--fg);
  z-index: 2;
}
.brand .dot { color: var(--blood); }

.nav-links {
  display: none;
  gap: clamp(20px, 3vw, 44px);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--fg-2);
  position: relative;
  padding: 6px 0;
  transition: color 0.3s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--blood);
  transition: right 0.4s var(--ease);
}
.nav-links a:hover::after { right: 0; }

.nav-cta {
  display: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  color: var(--fg);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-cta:hover { border-color: var(--blood); color: var(--blood); background: rgba(var(--blood-rgb), 0.06); }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-block; }
}

/* hamburger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 46px;
  padding: 12px;
  z-index: 2;
  margin-right: -8px;
}
.nav-toggle span {
  display: block; height: 1.5px; width: 100%;
  background: var(--fg);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
@media (min-width: 960px) { .nav-toggle { display: none; } }
/* portrait tablets up to the 12.9" iPad (1024px wide): keep the touch-friendly
   overlay menu instead of the cramped inline desktop nav. Placed after the
   min-width:960 rules so it wins by source order at equal specificity. */
@media (orientation: portrait) and (max-width: 1024px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* full-screen overlay menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow-y: auto;
  padding: calc(var(--nav-h) + 28px) var(--gutter) max(40px, env(safe-area-inset-bottom));
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease-out);
  pointer-events: none;
}
.nav-overlay::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(var(--blood-rgb), 0.16), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(var(--ember-rgb), 0.08), transparent 55%);
  pointer-events: none;
}
body.menu-open .nav-overlay { clip-path: inset(0 0 0 0); pointer-events: auto; }

.nav-overlay ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 2vw, 20px);
  position: relative;
}
.nav-overlay ol li {
  overflow: hidden;
}
.nav-overlay ol a {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 2vw, 16px);
  font-family: "Cinzel", serif;
  font-weight: 800;
  /* scale down to keep the longest label ("Join The Coven") on one line on
     phones, but cap the max so it isn't huge on tablets/small laptops */
  font-size: clamp(1.6rem, 6vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--fg);
  transform: translateY(110%);
  transition: transform 0.6s var(--ease-out), color 0.3s var(--ease);
}
.nav-overlay ol a .ix {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--blood);
  font-weight: 400;
  transform: translateY(-0.6em);
}
.nav-overlay ol a:hover { color: var(--ember); }
body.menu-open .nav-overlay ol a { transform: translateY(0); }
body.menu-open .nav-overlay ol li:nth-child(1) a { transition-delay: 0.10s; }
body.menu-open .nav-overlay ol li:nth-child(2) a { transition-delay: 0.16s; }
body.menu-open .nav-overlay ol li:nth-child(3) a { transition-delay: 0.22s; }
body.menu-open .nav-overlay ol li:nth-child(4) a { transition-delay: 0.28s; }
body.menu-open .nav-overlay ol li:nth-child(5) a { transition-delay: 0.34s; }

.nav-overlay .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.3s;
}
.nav-overlay .meta a { color: var(--fg-2); }
.nav-overlay .meta a:hover { color: var(--blood); }
body.menu-open .nav-overlay .meta { opacity: 1; }

/* short viewports (landscape phones): size to height so all 5 items + meta fit */
@media (max-width: 960px) and (max-height: 560px) {
  .nav-overlay { padding-top: calc(var(--nav-h) + 14px); }
  .nav-overlay ol { gap: clamp(4px, 1.4vh, 12px); }
  .nav-overlay ol a { font-size: clamp(1.25rem, 4.6vh, 2rem); }
  .nav-overlay .meta { padding-top: 16px; }
}

/* ===================== REVEAL ===================== */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; will-change: auto; }

/* ===================== FOOTER ===================== */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(56px, 9vw, 120px) 28px;
  position: relative;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 5vw, 52px);
  max-width: var(--maxw);
  margin: 0 auto clamp(40px, 6vw, 64px);
}
.foot-brand .glyph {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.foot-brand .glyph .dot { color: var(--blood); }
.foot-brand p {
  color: var(--fg-2);
  font-style: italic;
  max-width: 340px;
  font-size: var(--step-0);
}
.foot-col h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blood);
  margin-bottom: 18px;
}
.foot-col li {
  margin-bottom: 11px;
  font-size: var(--step-0);
  color: var(--fg-2);
}
.foot-col a { transition: color 0.3s var(--ease); }
.foot-col a:hover { color: var(--blood); }

/* "Connect" social links — brand glyph at the start, blood-red on hover */
.foot-col .social li { margin-bottom: 13px; }
.foot-col .social a {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.foot-col .social svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
  color: var(--fg-3);
  transition: color 0.3s var(--ease);
}
.foot-col .social a:hover svg { color: var(--blood); }

.foot-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.foot-bar .disclaimer { color: var(--fg-3); font-style: normal; }

@media (min-width: 620px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .foot-bar { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--blood); }
html { scrollbar-color: var(--line-2) var(--bg); }

/* ===================== LIGHTBOX (shared) ===================== */
.lb {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(11,10,9,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; align-items: start;
  overflow-y: auto;
  padding: clamp(20px, 5vw, 56px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.lb.open { opacity: 1; pointer-events: auto; }
/* image-only mode */
.lb-inner .lb-img {
  max-width: min(90vw, 88svh);
  max-height: min(90vw, 88svh);
  object-fit: contain;
  box-shadow: 0 32px 90px rgba(0,0,0,0.7);
  transform: scale(0.92);
  transition: transform 0.35s var(--ease-out);
}
.lb.open .lb-inner .lb-img { transform: scale(1); }

/* rich panel */
.lb-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 900px;
  width: min(900px, 92vw);
  align-items: start;
}
.lb-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.lb-info { display: flex; flex-direction: column; gap: 20px; }
.lb-title {
  font-family: "Cinzel", serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--fg);
  letter-spacing: .05em;
  line-height: 1.2;
}
.lb-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: .75rem;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.lb-links { display: flex; flex-direction: column; gap: 10px; }
.lb-btn {
  display: block;
  padding: 10px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.lb-btn:hover { color: var(--fg); border-color: var(--fg-2); }
.lb-btn.is-yt:hover { border-color: #ff4e4e; color: #ff4e4e; }
.lb-btn.is-sp:hover { border-color: #1db954; color: #1db954; }
.lb-btn.is-am:hover { border-color: #fc3c44; color: #fc3c44; }
.lb-video { aspect-ratio: 16 / 9; width: 100%; }
.lb-video iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 680px) {
  .lb-panel { grid-template-columns: 1fr; max-width: 480px; gap: 24px; }
}

.lb-close {
  position: absolute; top: 18px; right: 20px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lb-close:hover { color: var(--fg); border-color: var(--fg-2); }

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .grain { display: none; }
  .reveal { opacity: 1; transform: none; }
}
