/* ─── THE SAGE CONSORTIUM — SHARED STYLES ─── */

:root {
  --black:      #0c0b09;
  --void:       #030302;
  --charcoal:   #1a1916;
  --warm-dark:  #211f1b;
  --gold:       #d4a843;
  --gold-light: #f0cf72;
  --parchment:  #e8dfc8;
  --mist:       #a89f8c;
  --cream:      #f2ead8;
}

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

html {
  scroll-behavior: smooth;
}

body {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* ─── GRAIN — references standalone cacheable SVG file ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('grain.svg');
  background-repeat: repeat;
  background-size: 512px 512px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 1000;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: rgba(212,168,67,0.3); }

/* ─── FOCUS STYLES — keyboard navigation ─── */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Stronger focus for interactive elements */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 5px;
  box-shadow: 0 0 0 4px rgba(212,168,67,0.15);
  border-radius: 2px;
}

/* ─── BUTTON RESET — semantic <button> elements used site-wide ─── */
button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* ─── SHARED ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes veil-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.7; }
  50%       { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

/* ─── SHARED BUTTON ─── */
.btn-primary {
  display: inline-block;
  padding: 1rem 2.5rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  transition: color 0.5s ease;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  word-break: break-all;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform 0.5s ease;
}

.btn-primary span { position: relative; z-index: 1; }
.btn-primary:hover,
.btn-primary:active { color: var(--black); box-shadow: 0 0 24px rgba(212,168,67,0.2); }
.btn-primary:hover::before,
.btn-primary:active::before { transform: translateX(0); }

/* ─── SECONDARY BUTTON ─── */
.btn-secondary {
  display: inline-block;
  padding: 1rem 2.5rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  transition: color 0.5s ease;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(101%);
  transition: transform 0.5s ease;
}

.btn-secondary span { position: relative; z-index: 1; }
.btn-secondary:hover,
.btn-secondary:active { color: var(--black); box-shadow: 0 0 24px rgba(212,168,67,0.15); }
.btn-secondary:hover::before,
.btn-secondary:active::before { transform: translateX(0); }

/* ─── SHARED SECTION RULE ─── */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0 auto 2rem;
  max-width: 60rem;
}

.section-rule::before,
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.65;
}

.section-rule-label {
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

/* ─── SHARED PARTICLES ─── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 1px;
  height: 1px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0%   { transform: translateY(100vh) translateX(0);    opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

/* ─── SHARED AMBIENT GLOW ─── */
.glow {
  position: fixed;
  width: min(700px, 120vw);
  height: min(700px, 120vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,0.06) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: breathe 8s ease-in-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ─── WALL DIVIDER ─── */
.wall-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(212,168,67,0.38), transparent);
}

/* ─── PREFERS-REDUCED-MOTION ─── */
/* Respects OS-level "reduce motion" setting for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
  /* Pause all decorative animations */
  .particle          { display: none; }
  .chamber-ring      { animation: none !important; }
  .chamber-dot       { animation: none !important; }
  .texts-track       { animation: none !important; }
  .threshold-glow    { animation: none !important; }
  .scroll-line       { animation: none !important; }
  .glow              { animation: none !important; }
  .ring              { animation: none !important; }
  .ring-dot::after   { animation: none !important; }
  .veil-text         { animation: none !important; opacity: 0.7; }
  .word-appear       { animation: none !important; opacity: 1; }

  /* Keep functional transitions but make them instant */
  #entry-veil        { transition-duration: 0.01ms !important; }
  #room              { transition-duration: 0.01ms !important; }
  nav                { transition-duration: 0.01ms !important; }
  .btn-primary::before { transition-duration: 0.01ms !important; }

  /* Smooth scroll removed — jump cuts instead */
  html               { scroll-behavior: auto; }
}

/* ─── SKIP LINK — keyboard navigation shortcut ─── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.8rem 1.5rem;
  background: var(--gold);
  color: var(--black);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ─── UNIVERSAL HAMBURGER — applies to all pages ─── */
/* When inside a nav bar, override fixed positioning */
nav .hamburger {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px;
  position: fixed;
  top: calc(1.2rem + env(safe-area-inset-top));
  right: 5vw;
  z-index: 400;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Universal mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,5,4,0.98);
  z-index: 350;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--mist);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}
.mobile-menu a:hover,
.mobile-menu a:active { color: var(--gold-light); }
.mobile-menu .mobile-room-link {
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}


/* ─── SITE NAV — used across all pages ─── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 5vw;
  padding-top: calc(1.2rem + env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(12,11,9,0.96), transparent);
  opacity: 1;
}

/* ─── UNIVERSAL FOOTER ─── */
footer {
  border-top: 1px solid rgba(212,168,67,0.32);
  padding: 2rem 5vw;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
}
.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.footer-legal {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  position: static;
  background: none;
  padding: 0;
  opacity: 1;
  animation: none;
  inset: auto;
}
.footer-legal a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: none;
  opacity: 0.7;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.footer-legal a:hover,
.footer-legal a:active { color: var(--gold); opacity: 1; }
.footer-legal a[aria-current="page"] { color: var(--gold); opacity: 1; }
.footer-copy {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  opacity: 0.35;
}

@media (max-width: 480px) {
  .footer-legal { gap: 1.5rem; }
}
