/* ==========================================================================
   The Stonewall Inn, Design System
   Black & white foundation, Pride-inspired neon accents, glassmorphism.
   ========================================================================== */

:root {
  /* Neutrals */
  --black: #0a0a0a;
  --black-soft: #121214;
  --charcoal: #1a1a1e;
  --charcoal-light: #262629;
  --white: #ffffff;
  --off-white: #f5f5f2;
  --gray-300: #d4d4d8;
  --gray-500: #8a8a92;
  --gray-700: #4a4a52;

  /* Pride / neon accents */
  --neon-magenta: #ff2fb0;
  --neon-cyan: #22e5ff;
  --neon-purple: #9b3bff;
  --neon-blue: #3b7bff;
  --neon-emerald: #23e696;
  --neon-gold: #ffc93b;
  --neon-red: #ff4d4d;
  --neon-orange: #ff9a3b;

  --pride-gradient: linear-gradient(
    90deg,
    #ff4d4d 0%,
    #ff9a3b 16%,
    #ffe93b 32%,
    #23e696 48%,
    #22e5ff 64%,
    #3b7bff 80%,
    #9b3bff 100%
  );
  --pride-gradient-diag: linear-gradient(
    135deg,
    #ff4d4d 0%,
    #ff9a3b 16%,
    #ffe93b 32%,
    #23e696 48%,
    #22e5ff 64%,
    #3b7bff 80%,
    #9b3bff 100%
  );

  /* Typography */
  --font-display: "Bebas Neue", "Anton", "Arial Narrow", sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 1280px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --header-height: 100px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-med: 420ms;
  --dur-slow: 800ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--off-white);
  color: var(--black);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p, figure { margin: 0; }

@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;
    scroll-behavior: auto !important;
  }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* ---------- Focus & accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--neon-gold);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  z-index: 1000;
  background: var(--neon-gold);
  color: var(--black);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-sm); }

.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;
}

@media (prefers-contrast: more) {
  :root { --gray-500: #6a6a70; }
}

/* ---------- Typography scale ---------- */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.95;
  font-size: clamp(3rem, 8vw, 7rem);
  text-transform: uppercase;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  font-size: clamp(2.25rem, 5vw, 4rem);
  text-transform: uppercase;
}
h3, .h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}
h4, .h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
}
p { font-size: 1.05rem; color: var(--gray-700); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon-magenta);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--pride-gradient);
  border-radius: 2px;
}
.gradient-text {
  background: var(--pride-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-flow 6s linear infinite;
}
@keyframes gradient-flow {
  to { background-position: 200% center; }
}

section[data-theme="dark"], .theme-dark {
  background: var(--black);
  color: var(--white);
}
section[data-theme="dark"] p, .theme-dark p { color: var(--gray-300); }
section[data-theme="dark"] .h3, section[data-theme="dark"] h3 { color: var(--white); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.section { padding-block: var(--space-2xl); position: relative; }
.section-head {
  max-width: 720px;
  margin-bottom: var(--space-lg);
}
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--white);
  color: var(--black);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 8px 24px -8px rgba(255,47,176,0.5);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pride-gradient);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.btn-primary:hover { color: var(--black); box-shadow: 0 0 30px -4px var(--neon-magenta), 0 0 60px -10px var(--neon-cyan); }
.btn-primary:hover::before { opacity: 1; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
}
.btn-outline:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px -4px var(--neon-cyan);
}

.btn-dark {
  background: var(--black);
  color: var(--white);
  border: 1.5px solid transparent;
}
.btn-dark:hover { box-shadow: 0 0 24px -6px var(--neon-purple); }

.btn-ghost {
  color: var(--black);
  border: 1.5px solid var(--gray-700);
}
.btn-ghost:hover { border-color: var(--neon-magenta); color: var(--neon-magenta); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Cards / glass ---------- */
.glass {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.14);
}
.glass-light {
  background: rgba(10,10,10,0.04);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(10,10,10,0.08);
}

.card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.92); }
[data-reveal="scale"].is-visible { transform: scale(1); }
[data-reveal-group] > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- Floating pride particles (decorative) ---------- */
.pride-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.pride-field span {
  position: absolute;
  bottom: -10%;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: float-up linear infinite;
}
@keyframes float-up {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.55; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-120vh) translateX(var(--drift, 40px)) scale(1.3); opacity: 0; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.flow > * + * { margin-top: var(--space-sm); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Lightbox (shared) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur-med), visibility var(--dur-med);
}
.lightbox.is-open { visibility: visible; opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.lightbox-panel { position: relative; z-index: 1; max-width: 560px; width: 100%; }
.lightbox-image { width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); }
.lightbox-caption { color: var(--white); text-align: center; margin-top: 1rem; }
.lightbox-close {
  position: absolute; top: -50px; right: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}

::selection { background: var(--neon-magenta); color: var(--white); }

/* Custom scrollbar (progressive enhancement) */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--pride-gradient); border-radius: 8px; border: 3px solid var(--black); background-size: 300% 100%; }

/* ---------- Page loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 600ms var(--ease-out), visibility 600ms;
}
.loader.is-hidden { opacity: 0; visibility: hidden; }
.loader-mark {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--white);
  letter-spacing: 0.05em;
  position: relative;
}
.loader-bar {
  position: absolute;
  left: 0; right: 0; bottom: -14px;
  height: 3px;
  background: var(--pride-gradient);
  background-size: 300% 100%;
  animation: gradient-flow 1.4s linear infinite;
  border-radius: 3px;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: var(--space-sm);
  bottom: var(--space-sm);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility var(--dur-fast), box-shadow var(--dur-fast);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { box-shadow: 0 0 22px -4px var(--neon-cyan); }
