/* iOS Safari: clip position:fixed elements that overflow viewport */
html { overflow-x: clip; }

/* ========================================================
   CATALYST SHARED CSS — shared.css
   Only truly shared styles: reset, variables, body, scrollbar,
   film grain, accessibility. Nav, footer, and curtain are
   page-specific (each page has different implementations).
   ======================================================== */

/* ==================================================
   CSS RESET & FORM ELEMENTS
   ================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button,
input {
  font-family: inherit;
}

/* ==================================================
   CSS VARIABLES (superset across all pages)
   ================================================== */
:root {
  /* Colors — primary palette */
  --bg: #f5f3f0;
  --white: #fff;
  --bg-dark: #141414;
  --bg-darker: #0e0e0e;

  /* Text colors */
  --carbon: #2A2A2A;
  --carbon-soft: #2b2b2b;
  --text-secondary: #5a5a5a;
  --text-muted: #666;
  --text-disabled: #c5c0bb;

  /* Brand accent colors */
  --catalyst-orange: #EB622E;
  --catalyst-teal: #5EBBA1;
  --catalyst-teal-dark: #4A9585; /* WCAG AA safe on light backgrounds */
  --catalyst-gold: #EEE183;
  --catalyst-blue: #81AAD5;
  --catalyst-carbon: #2A2A2A;
  --gray: #D9D9D9;
  --coral: #D84D4D;
  --error: #D84D4D;

  /* Series color coding */
  --series-origin: var(--catalyst-orange);
  --series-navigation: var(--catalyst-blue);
  --series-science: var(--catalyst-teal);
  --series-lifestyle: var(--catalyst-gold);

  /* Payment brand colors (third-party — intentionally off-palette) */
  --pay-cashapp: #00D632;
  --pay-venmo: #3D95CE;
  --pay-zelle: #6D1ED4;
  --pay-ach: #1A1A1A;

  /* Validation states */
  --success: #2EAC6E;
  --success-bg: #d1fae5;
  --error-bg: #FFF5F5;

  /* Borders & surfaces */
  --border: rgb(42, 42, 42, 0.08);
  --border-hover: rgb(42, 42, 42, 0.2);
  --border-light: #eae6e1;
  --border-solid: #ddd8d3;
  --surface-warm: #edebe7;

  /* Typography */
  --font: "Satoshi", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Fira Code", monospace;
  --font-logo: "Montserrat", "Helvetica Neue", Helvetica, sans-serif;

  /* Spacing/radius system */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 40px;

  /* Transition durations */
  --transition-fast: 0.15s;
  --transition-base: 0.2s;
  --transition-slow: 0.35s;

  /* Typography scale */
  --text-xs: 10px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --text-2xl: 40px;
  --text-3xl: clamp(40px, 5vw, 64px);

  /* Font weights */
  --weight-light: 300;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Line heights */
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* Spacing scale (8-point grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Shadow elevation */
  --shadow-sm: 0 1px 3px rgba(42, 42, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(42, 42, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(42, 42, 42, 0.1);
  --shadow-xl: 0 24px 48px rgba(42, 42, 42, 0.12);

  /* Dark surfaces */
  --surface-dark: #141414;
  --surface-darker: #0e0e0e;
  --text-on-dark: rgba(255, 255, 255, 0.9);
  --text-on-dark-muted: rgba(255, 255, 255, 0.5);
  --text-on-dark-faint: rgba(255, 255, 255, 0.3);
  --border-on-dark: rgba(255, 255, 255, 0.08);
}

/* ==================================================
   HTML & BODY BASE STYLES
   ================================================== */
html {
  font-size: 16px;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-solid) transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  width: 100%;
  min-height: 100vh; /* fallback for browsers without dvh support */

  /* biome-ignore lint/suspicious/noDuplicateProperties: progressive enhancement — 100dvh overrides 100vh in supporting browsers */
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  font-family: var(--font);
  background: var(--bg);
  color: var(--carbon);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================================================
   SCROLLBAR STYLES
   ================================================== */
html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: var(--border-solid);
  border-radius: 3px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ==================================================
   FILM GRAIN OVERLAY (fixed fullscreen)
   z-index: 9998 — nav is 200, content below both
   ================================================== */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.022;
  pointer-events: none;
  z-index: 9998;
}

/* ==================================================
   ACCESSIBILITY UTILITIES
   ================================================== */

/* Skip link — visible on focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--carbon);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* Screen reader only — hide from visual display */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(
    0,
    0,
    0,
    0
  ); /* stylelint-disable-line property-no-deprecated -- progressive enhancement */

  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}

/* Universal focus-visible indicator (orange) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--catalyst-orange);
  outline-offset: 2px;
}

/* ==================================================
   REDUCED MOTION — disable animations for users who prefer it
   ================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================================================
   PAGE TRANSITIONS — smooth fade between navigations
   ================================================== */
main {
  animation: catalyst-fadeIn 0.3s ease-out both;
}

@keyframes catalyst-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   SKELETON LOADING STATES
   Premium shimmer placeholders for content areas
   ================================================== */
.skeleton {
  background: linear-gradient(
    110deg,
    var(--border-light) 0%,
    #f0ece8 40%,
    var(--border-light) 60%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 14px;
  width: 80%;
  margin-bottom: 10px;
}

.skeleton--text-sm {
  height: 10px;
  width: 60%;
  margin-bottom: 8px;
}

.skeleton--heading {
  height: 28px;
  width: 50%;
  margin-bottom: 16px;
}

.skeleton--card {
  height: 120px;
  width: 100%;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}

.skeleton--circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton--btn {
  height: 48px;
  width: 160px;
  border-radius: var(--radius-pill);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================================================
   AGE GATE + COOKIE CONSENT — branded combo modal
   ================================================== */

/* Hide the plugin's default overlay completely */
#evav-overlay-wrap { display: none !important; }

/* ── Age Gate v2 — "The Curtain Pull" ── */
.catalyst-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 14, 0.35);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  animation: gateReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gateReveal {
  from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); }
}

.catalyst-gate.dismissed {
  animation: gateDismiss 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gateDismiss {
  0%   { opacity: 1; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  100% { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); pointer-events: none; }
}

.catalyst-gate__card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
  animation: gateCardFloat 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes gateCardFloat {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header lockup: icon + title side by side — forced row */
.catalyst-gate__header {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.catalyst-gate__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.9;
}

.catalyst-gate__logo svg {
  width: 100%;
  height: 100%;
}

.catalyst-gate__title {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.25;
  text-align: left;
}

.catalyst-gate__subtitle {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  margin-bottom: 28px;
  text-align: left;
}

.catalyst-gate__confirm {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 15px 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s;
  min-height: 50px;
}

.catalyst-gate__confirm:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--bg-dark);
  border-color: rgba(255, 255, 255, 0.95);
}

.catalyst-gate__confirm:active {
  background: #fff;
  transition-duration: 0.08s;
}

.catalyst-gate__confirm:focus-visible {
  outline: 2px solid var(--catalyst-orange);
  outline-offset: 2px;
}

.catalyst-gate__alt {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.catalyst-gate__alt:hover { color: rgba(255, 255, 255, 0.8); }
.catalyst-gate__alt span { display: inline-block; transition: transform 0.2s; }
.catalyst-gate__alt:hover span { transform: translateX(3px); }

.catalyst-gate__alt:focus-visible {
  outline: 2px solid var(--catalyst-orange);
  outline-offset: 2px;
}

/* ── Legal section with expandable policy pills ── */
.catalyst-gate__legal {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.catalyst-gate__legal-label {
  font-size: 11px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.40);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Pill row */
.catalyst-gate__legal-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Individual pill — dark glass variant of contact page pills */
.catalyst-gate__legal-pill {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.50);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
}

.catalyst-gate__legal-pill:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.75);
}

.catalyst-gate__legal-pill.is-active {
  border-color: rgba(255, 255, 255, 0.70);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.90);
}

.catalyst-gate__legal-pill svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
  transition: transform 0.25s;
}

.catalyst-gate__legal-pill.is-active svg {
  transform: rotate(180deg);
  opacity: 1;
}

/* Expandable policy panel */
.catalyst-gate__policy-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
              margin 0.35s,
              opacity 0.25s;
}

.catalyst-gate__policy-panel.is-open {
  max-height: 300px;
  opacity: 1;
  margin-top: 12px;
}

.catalyst-gate__policy-inner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 14px 16px;
}

/* Definition rows inside panel */
.catalyst-gate__policy-row {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 11px;
  line-height: 1.5;
}

.catalyst-gate__policy-row + .catalyst-gate__policy-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.catalyst-gate__policy-dt {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.40);
  min-width: 62px;
  padding-top: 1px;
  flex-shrink: 0;
}

.catalyst-gate__policy-dd {
  color: rgba(255, 255, 255, 0.60);
  font-weight: 300;
}

/* "Full policy" link inside panel */
.catalyst-gate__policy-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.40);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.catalyst-gate__policy-link:hover {
  color: rgba(255, 255, 255, 0.70);
}

/* Denied state */
.catalyst-gate__denied { display: none; }
.catalyst-gate.show-denied .catalyst-gate__main { display: none; }
.catalyst-gate.show-denied .catalyst-gate__denied {
  display: block;
  animation: gateCardFloat 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.catalyst-gate__denied-title {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
}

.catalyst-gate__denied-text {
  font-size: 13px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  margin-bottom: 24px;
}

.catalyst-gate__denied-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 400;
  color: var(--catalyst-orange);
  text-decoration: none;
  transition: opacity 0.2s;
}

.catalyst-gate__denied-link:hover { opacity: 0.8; }

@media (max-width: 480px) {
  .catalyst-gate__card {
    max-width: calc(100% - 32px);
    padding: 32px 24px 28px;
    border-radius: 20px;
  }
  .catalyst-gate__title { font-size: 17px; }
  .catalyst-gate__logo { width: 32px; height: 32px; }
  .catalyst-gate__header { gap: 12px; }
  .catalyst-gate__policy-inner { padding: 12px 14px; }
  .catalyst-gate__policy-dt { min-width: 54px; font-size: 8px; }
  .catalyst-gate__policy-dd { font-size: 11px; }
}

/* ==================================================
   EXIT INTENT OVERLAY — checkout only
   ================================================== */
.catalyst-exit-intent {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 42, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.catalyst-exit-intent.active {
  opacity: 1;
  pointer-events: auto;
}

.catalyst-exit-intent__card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  max-width: 380px;
  width: calc(100% - 48px);
  text-align: center;
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.catalyst-exit-intent.active .catalyst-exit-intent__card {
  transform: translateY(0);
}

.catalyst-exit-intent__title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--carbon);
  margin-bottom: 8px;
}

.catalyst-exit-intent__title strong {
  font-weight: 500;
}

.catalyst-exit-intent__text {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.catalyst-exit-intent__stay {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 28px;
  border: 1px solid var(--carbon);
  border-radius: var(--radius-pill);
  background: var(--carbon);
  color: var(--bg);
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 10px;
  min-height: 48px;
}

.catalyst-exit-intent__stay:hover {
  background: transparent;
  color: var(--carbon);
}

.catalyst-exit-intent__leave {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.catalyst-exit-intent__leave:hover {
  color: var(--carbon);
}
