/* =============================================
   JC MAINSTAGE — Design System
   Brand: Teal #1a9fa6 + Purple #9b30c8
   Fonts: Clash Display (display) + Plus Jakarta Sans (body)
   ============================================= */

/* ---- Design Tokens ---- */
:root, [data-theme="light"] {
  /* Brand Colors */
  --color-teal:         #1a9fa6;
  --color-teal-light:   #7dd3da;
  --color-teal-dark:    #0d7880;
  --color-purple:       #9b30c8;
  --color-purple-light: #c47ae0;
  --color-purple-dark:  #6f1e91;

  /* Surfaces */
  --color-bg:           #f9f8f6;
  --color-surface:      #ffffff;
  --color-surface-2:    #f3f1ef;
  --color-divider:      #e2deda;
  --color-border:       #d4d0cb;

  /* Text */
  --color-text:         #1a1715;
  --color-text-muted:   #6b6762;
  --color-text-faint:   #b0ada8;
  --color-text-inverse: #f9f8f6;

  /* Primary (Teal) */
  --color-primary:        var(--color-teal);
  --color-primary-hover:  var(--color-teal-dark);

  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,23,21,0.06);
  --shadow-md: 0 4px 16px rgba(26,23,21,0.08);
  --shadow-lg: 0 12px 40px rgba(26,23,21,0.12);

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-display: 'Clash Display', 'Georgia', sans-serif;
  --font-body:    'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;

  /* Layout */
  --content-default: 1100px;
  --content-narrow:  720px;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --color-bg:           #131211;
  --color-surface:      #1a1917;
  --color-surface-2:    #1f1e1c;
  --color-divider:      #2d2b28;
  --color-border:       #38362f;
  --color-text:         #e8e6e3;
  --color-text-muted:   #8a8783;
  --color-text-faint:   #56534f;
  --color-text-inverse: #131211;
  --color-teal:         #4dbec6;
  --color-teal-light:   #7dd3da;
  --color-teal-dark:    #2aa3ab;
  --color-purple:       #c47ae0;
  --color-purple-light: #d9a8ef;
  --color-purple-dark:  #9b30c8;
  --color-primary:      var(--color-teal);
  --color-primary-hover: var(--color-teal-dark);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #131211; --color-surface: #1a1917; --color-surface-2: #1f1e1c;
    --color-divider: #2d2b28; --color-border: #38362f;
    --color-text: #e8e6e3; --color-text-muted: #8a8783; --color-text-faint: #56534f;
    --color-text-inverse: #131211;
    --color-teal: #4dbec6; --color-teal-light: #7dd3da; --color-teal-dark: #2aa3ab;
    --color-purple: #c47ae0; --color-purple-dark: #9b30c8;
  }
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; }

::selection { background: rgba(26,159,166,0.18); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Layout Utilities ---- */
.container {
  width: min(var(--content-default), 100% - var(--space-8));
  margin-inline: auto;
}

/* =============================================
   NAVIGATION
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}
.nav-container {
  width: min(var(--content-default), 100% - var(--space-8));
  margin-inline: auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.nav-logo-text em {
  display: block;
  font-style: normal;
  background: linear-gradient(135deg, var(--color-teal), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.nav-cta {
  font-weight: 600;
  color: var(--color-primary) !important;
  background: color-mix(in oklab, var(--color-teal) 12%, transparent) !important;
}
.nav-cta:hover {
  background: color-mix(in oklab, var(--color-teal) 20%, transparent) !important;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-2); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text);
  z-index: 300;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-teal), var(--color-purple));
  color: #fff;
  box-shadow: 0 4px 20px rgba(26,159,166,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(26,159,166,0.4);
}
.btn-outline {
  border-color: var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
}
.btn-outline:hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
  background: color-mix(in oklab, var(--color-teal) 6%, var(--color-surface));
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(var(--space-16), 10vw, var(--space-24)) var(--space-8);
  /* Uses CSS var so it respects dark mode bg */
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
  box-shadow: 0 8px 32px rgba(26,23,21,0.07);
}
.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.2;
}
[data-theme="dark"] .shape { opacity: 0.18; }
.shape-1 {
  width: 600px; height: 600px;
  background: var(--color-teal);
  top: -200px; right: -150px;
}
.shape-2 {
  width: 500px; height: 500px;
  background: var(--color-purple);
  bottom: -150px; left: -100px;
}
.shape-3 {
  width: 300px; height: 300px;
  background: var(--color-teal-light);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-8);
  max-width: 800px;
  width: 100%;
}
.hero-logo-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
}
.hero-logo {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.hero-mission {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.7;
}

/* Ensure hero text is always legible in both modes */
.hero-stat-value { color: var(--color-text); }
.hero-stat-label { color: var(--color-text-faint); }

/* Hero stats bar */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  width: 100%;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}
.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.hero-stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-divider);
  flex-shrink: 0;
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) 0;
}
.section-alt {
  background: var(--color-surface);
}
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}
.feature-grid-reverse { direction: rtl; }
.feature-grid-reverse > * { direction: ltr; }
.feature-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.feature-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  /* Force correct color in both modes */
  color: var(--color-text);
}
.feature-year {
  display: block;
  font-size: var(--text-lg);
  background: linear-gradient(135deg, var(--color-teal), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: var(--space-2);
}
.feature-meta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}
.feature-body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 58ch;
  word-break: break-word;
  overflow-wrap: break-word;
}
.feature-image-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--color-surface-2);
}
.feature-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature-image-wrap:hover .feature-image { transform: scale(1.03); }

/* Season section — byebyebirdie-1500 is square 1:1 */
#season .feature-image-wrap {
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin-inline: auto;
}

/* Tickets section — bye-bye-birdie banner is 3.2:1 wide */
#tickets .feature-image-wrap {
  aspect-ratio: 3.2 / 1;
  width: 100%;
}
#tickets .feature-image {
  object-fit: cover;
  object-position: center;
}

/* =============================================
   SPONSOR TICKER
   ============================================= */
.sponsors-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-6) 0;
}
.sponsors-header {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.ticker-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.ticker-wrapper::before,
.ticker-wrapper::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.ticker-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--color-surface), transparent);
}
.ticker-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--color-surface), transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 50s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.ticker-group img {
  height: 64px;
  width: auto;
  margin: 0 var(--space-8);
  object-fit: contain;
  flex-shrink: 0;
  filter: grayscale(30%);
  opacity: 0.8;
  transition: opacity var(--transition), filter var(--transition);
}
.ticker-group img:hover { opacity: 1; filter: grayscale(0%); }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-12) 0 var(--space-8);
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-8);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-tagline {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.footer-nav {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.footer-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--color-primary); }
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.6;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .feature-grid-reverse { direction: ltr; }
  .feature-image-wrap { order: -1; }
  .feature-image-wrap { aspect-ratio: 16/9; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }

  /* Mobile drawer — sits above everything, full viewport height */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(300px, 85vw);
    height: 100dvh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-20) var(--space-6) var(--space-8);
    gap: var(--space-2);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow-y: auto;
    /* Ensure the panel renders above the sticky header backdrop blur */
    isolation: isolate;
  }
  .nav-links.nav-open {
    transform: translateX(0);
  }

  .nav-link {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }
  .theme-toggle { margin-top: auto; }

  .hero { min-height: 70vh; padding-left: var(--space-4); padding-right: var(--space-4); }
  .hero-logo-wrap { padding: var(--space-4); max-width: 100%; width: 100%; }
  .hero-mission { font-size: var(--text-base); padding: 0 var(--space-2); }
  .hero-stats { gap: var(--space-3); padding: 0 var(--space-2); }
  .hero-stat-value { font-size: var(--text-sm); white-space: normal; text-align: center; }
  .hero-stat-divider { display: none; }

  .footer-inner { flex-direction: column; }
  .footer-nav { gap: var(--space-1); }
}

/* =============================================
   TICKETS SECTION
   ============================================= */
.btn-tickets {
  background: linear-gradient(135deg, #9b30c8, #1a9fa6);
  color: #fff;
  font-size: var(--text-base);
  padding: 1rem 2rem;
  box-shadow: 0 6px 28px rgba(155,48,200,0.35);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  width: fit-content;
}
.btn-tickets:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(155,48,200,0.45);
}

.ticket-dates {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.ticket-date-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: color-mix(in oklab, var(--color-purple) 8%, var(--color-surface));
  border: 1px solid color-mix(in oklab, var(--color-purple) 20%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
}
.ticket-date-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-purple);
}
.ticket-dates-list {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}