/* =====================================================================
   Calix Leigh-Reign — calix.co
   Cinematic dark-luxe editorial. Accessible by construction.
   ===================================================================== */

:root {
  /* Palette */
  --ink:        #0b0b0d;   /* near-black ground */
  --ink-2:      #101015;   /* raised panel */
  --ink-3:      #17171d;   /* card */
  --ivory:      #f4efe7;   /* primary text (warm) */
  --ivory-dim:  #cfc8bd;   /* secondary text */
  --muted:      #8f8a82;   /* tertiary / captions */
  --gold:       #cda862;   /* primary accent */
  --gold-soft:  #e6cf9a;   /* accent hover / large text */
  --rose:       #c98b84;   /* secondary accent, used sparingly */
  --line:       rgba(205, 168, 98, 0.28); /* hairlines */
  --line-soft:  rgba(244, 239, 231, 0.12);

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Metrics */
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  --radius: 4px;
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------ Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ------------------------------ Utilities ------------------------------ */
.wrap { width: min(100% - (var(--gutter) * 2), var(--wrap)); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--gold); color: #1a1408; padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; transform: translateY(-140%); transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Focus visibility — gold ring everywhere */
:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  --btn-py: 0.85em; --btn-px: 1.5em;
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--btn-py) var(--btn-px);
  font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn-primary { background: var(--gold); color: #1a1408; }
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ivory); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ------------------------------ Shared type ------------------------------ */
.kicker {
  font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.section-index {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.4rem;
}
.section-index span { color: var(--gold); font-variant-numeric: tabular-nums; }

.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
.section + .section { border-top: 1px solid var(--line-soft); }

.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--ivory); font-weight: 600; }
.prose em { font-style: italic; color: var(--gold-soft); }

h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ivory);
}

/* ============================ HEADER ============================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(11, 11, 13, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 2rem; }
.wordmark { text-decoration: none; margin-right: auto; }
.wordmark-name {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 500;
  letter-spacing: 0.01em; color: var(--ivory);
}
.nav-list { display: flex; gap: 1.9rem; }
.nav-list a {
  text-decoration: none; font-size: 0.9rem; color: var(--ivory-dim);
  letter-spacing: 0.01em; position: relative; padding-block: 4px;
  transition: color 0.2s var(--ease);
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width 0.28s var(--ease);
}
.nav-list a:hover { color: var(--ivory); }
.nav-list a:hover::after { width: 100%; }
.header-cta { --btn-py: 0.6em; --btn-px: 1.2em; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; align-items: center; justify-content: center;
}
.nav-toggle-bars { position: relative; width: 26px; height: 12px; display: block; }
.nav-toggle-bars span {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--ivory);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle-bars span:first-child { top: 0; }
.nav-toggle-bars span:last-child { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child { transform: translateY(-5px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  background: rgba(11, 11, 13, 0.97); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
  padding: 1.5rem var(--gutter) 2.2rem;
}
.mobile-nav ul { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-nav a {
  display: block; text-decoration: none; font-family: var(--serif);
  font-size: 1.5rem; color: var(--ivory); padding: 0.5rem 0;
}
.mobile-nav a.btn { font-family: var(--sans); font-size: 0.95rem; margin-top: 0.8rem; align-self: flex-start; }

/* ============================ HERO ============================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding-block: calc(var(--header-h) + 40px) clamp(64px, 12vh, 120px);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-video, .hero-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero-video { object-fit: cover; object-position: 70% 30%; }
.hero-fallback img {
  width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; display: block;
}
.hero-video { opacity: 0; transition: opacity 0.8s var(--ease); }
.hero-video.is-ready { opacity: 1; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,11,13,0.55) 0%, rgba(11,11,13,0.15) 32%, rgba(11,11,13,0.35) 62%, rgba(11,11,13,0.94) 100%),
    linear-gradient(90deg, rgba(11,11,13,0.78) 0%, rgba(11,11,13,0.30) 45%, rgba(11,11,13,0) 75%);
}
.hero-inner { position: relative; z-index: 1; max-width: 46rem; }
.hero-title {
  font-family: var(--serif); font-optical-sizing: auto;
  font-size: clamp(2.6rem, 1.2rem + 6.2vw, 6rem);
  line-height: 0.98; letter-spacing: -0.025em; color: var(--ivory);
  margin: 1.1rem 0 0;
}
.hero-title em { font-style: italic; color: var(--gold-soft); }
.hero-lede {
  margin-top: 1.6rem; max-width: 40rem;
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  color: var(--ivory-dim); line-height: 1.6;
}
.hero-actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 2; width: 26px; height: 42px; border: 1px solid var(--line);
  border-radius: 999px; display: grid; place-items: start center; padding-top: 8px;
}
.scroll-cue span {
  width: 3px; height: 8px; border-radius: 2px; background: var(--gold);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue span { animation: none; } }

/* ============================ STORY ============================ */
.story-grid {
  display: grid; grid-template-columns: 0.85fr 1fr; gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}
.story-figure figure { margin: 0; }
.story-figure picture { display: block; }
.story-figure img {
  width: 100%; height: auto; display: block; object-fit: cover; border-radius: var(--radius);
  aspect-ratio: 3 / 4; filter: saturate(1.02) contrast(1.02);
}
.story-body h2 { margin-bottom: 1.4rem; max-width: 16ch; }
.stat-row {
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.6rem;
  padding-top: 2rem; border-top: 1px solid var(--line-soft);
}
.stat-num {
  display: block; font-family: var(--serif); font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  color: var(--gold-soft); line-height: 1;
}
.stat-label { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; letter-spacing: 0.04em; }

/* ============================ SCION SAGA ============================ */
.saga { background: var(--ink-2); }
.saga-head { max-width: 60rem; }
.saga-head h2 { margin: 0.2rem 0 1.4rem; }
.saga-lede { font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.28rem); color: var(--ivory-dim); }
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.6rem;
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.5em 1.1em;
}

.books {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}
.book {
  background: var(--ink-3); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.2rem);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.book:hover { border-color: var(--line); transform: translateY(-4px); background: #1b1b22; }
@media (prefers-reduced-motion: reduce) { .book:hover { transform: none; } }
.book-order { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.book-title { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); color: var(--ivory); margin: 0.6rem 0 0.2rem; }
.book-year { font-size: 0.85rem; color: var(--muted); }
.book-note { margin-top: 1rem; color: var(--ivory-dim); font-size: 0.98rem; }

.pullquote {
  margin: clamp(3rem, 7vw, 5rem) auto 0; max-width: 52rem; text-align: center;
}
.pullquote blockquote {
  margin: 0; font-family: var(--serif); font-style: italic;
  font-size: clamp(1.4rem, 1rem + 2vw, 2.3rem); line-height: 1.3; color: var(--ivory);
}
.pullquote figcaption { margin-top: 1.2rem; color: var(--gold); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; }

.worlds { margin-top: clamp(3rem, 7vw, 5rem); text-align: center; }
.worlds-title { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.4rem; }
.world-list { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.2rem, 4vw, 3rem); }
.world-list li { font-family: var(--serif); font-size: clamp(1.3rem, 1rem + 1.4vw, 2rem); color: var(--gold-soft); font-style: italic; }

.saga-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: clamp(2.6rem, 6vw, 4rem); }

/* ============================ BUILDING ============================ */
.building-grid {
  display: grid; grid-template-columns: 1fr 0.8fr; gap: clamp(2rem, 5vw, 5.5rem); align-items: center;
}
.building-body h2 { margin: 0.2rem 0 1.4rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.8rem 0 2rem; }
.pill-row li {
  font-size: 0.82rem; color: var(--ivory-dim); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 0.5em 1.1em; letter-spacing: 0.02em;
}
.building-figure { width: 100%; max-width: 30rem; margin-inline: auto; align-self: center; }
.building-figure figure { margin: 0; }
.building-figure picture { display: block; }
.building-figure img {
  width: 100%; height: auto; display: block; aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: var(--radius);
}

/* ============================ LEGACY ============================ */
.legacy { background: var(--ink-2); }
.legacy h2 { margin: 0.2rem 0 2rem; }
.legacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.legacy-lede { font-family: var(--serif); font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); line-height: 1.4; color: var(--ivory); font-style: italic; }
.legacy-facts { display: grid; gap: 1.3rem; }
.legacy-facts li { border-left: 2px solid var(--line); padding-left: 1.1rem; }
.legacy-facts strong { display: block; color: var(--gold-soft); font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.legacy-facts span { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 0.2rem; }
.legacy-note { margin-top: 2.6rem; color: var(--ivory-dim); max-width: 46rem; }

/* ============================ PRESS ============================ */
.press h2 { margin: 0.2rem 0 clamp(2rem, 5vw, 3.5rem); }
.press-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.press-item {
  background: var(--ink-3); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.4rem); display: flex; flex-direction: column; gap: 1.2rem;
}
.press-quote { font-family: var(--serif); font-size: 1.15rem; line-height: 1.4; color: var(--ivory); }
.press-source { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-top: auto; }
.press-source a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--line); }
.press-source a:hover { color: var(--gold-soft); }

/* ============================ JOIN ============================ */
.join { background: var(--ink-2); text-align: center; }
.join-inner { max-width: 44rem; margin-inline: auto; }
.join .section-index { display: inline-block; }
.join h2 { margin: 0.2rem 0 1.2rem; }
.join-lede { color: var(--ivory-dim); font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.2rem); }
.join-form {
  margin-top: 2.4rem; display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 0.8rem;
  align-items: end; text-align: left;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ivory-dim); }
.field label .opt { text-transform: none; letter-spacing: 0; color: var(--muted); }
.field input {
  background: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--radius);
  color: var(--ivory); padding: 0.85em 1em; font: inherit; font-size: 0.98rem;
  transition: border-color 0.2s var(--ease);
}
.field input::placeholder { color: var(--muted); }
.field input:hover { border-color: var(--line); }
.field input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(205,168,98,0.25); }
.join-form .btn { height: fit-content; }
.form-msg { grid-column: 1 / -1; font-size: 0.9rem; margin-top: 0.4rem; }
.form-msg[hidden] { display: none; }
.form-error, #join-error:not([hidden]) { color: var(--rose); }
.form-success { color: var(--gold-soft); font-family: var(--serif); font-size: 1.15rem; }
.join-fineprint { margin-top: 1.4rem; font-size: 0.82rem; color: var(--muted); }

/* ============================ FOOTER ============================ */
.site-footer { background: var(--ink); padding-block: clamp(56px, 8vw, 90px) 32px; border-top: 1px solid var(--line-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.footer-word { font-family: var(--serif); font-size: 1.4rem; color: var(--ivory); }
.footer-rule { height: 1px; width: 240px; max-width: 100%; margin: 0.9rem 0 0.8rem; background: linear-gradient(90deg, var(--gold), rgba(205,168,98,0)); }
.footer-tag { color: var(--gold); font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-blurb { color: var(--muted); margin-top: 1rem; max-width: 22rem; }
.footer-h { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 1.2rem; }
.footer-links { display: grid; gap: 0.7rem; }
.footer-links a { text-decoration: none; color: var(--ivory-dim); font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--gold-soft); }
.footer-base {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  margin-top: clamp(3rem, 6vw, 5rem); padding-top: 1.6rem; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 0.85rem;
}
.to-top { text-decoration: none; color: var(--ivory-dim); }
.to-top:hover { color: var(--gold-soft); }

/* ============================ REVEAL (scroll-in) ============================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 940px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .story-grid, .building-grid, .legacy-grid { grid-template-columns: 1fr; }
  .building-figure { order: -1; }
  .story-figure { max-width: 26rem; }
  .books, .press-list { grid-template-columns: 1fr; }
  .join-form { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { align-items: flex-end; }
  .hero-actions .btn { flex: 1 1 auto; }
}
