/* =========================================
   Design tokens — light + dark
   (Dark mode reuses the same navy/red/blue the main site already uses
   for its dark sections — not a separate arbitrary dark palette.)
========================================= */
:root {
  --navy: #0b1830;
  --red: #da3031;
  --blue: #0c4084;
  --blue-light: #438dee;
  --white: #ffffff;

  --font-body: "Lato", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-wordmark: "Permanent Marker", cursive;

  /* light mode (default) */
  --bg: #ffffff;
  --bg-card: #f6f7fb;
  --text: var(--navy);
  --text-muted: #5b6472;
  --border: rgba(11, 24, 48, 0.1);
  --doodle-color: rgba(11, 24, 48, 0.5);
  --toggle-icon: var(--navy);

  --x: 50%;
  --y: 50%;
}

html.dark {
  color-scheme: dark;
  --bg: var(--navy);
  --bg-card: #16264a;
  --text: #ffffff;
  --text-muted: #a9b3c7;
  --border: rgba(255, 255, 255, 0.12);
  --doodle-color: rgba(255, 255, 255, 0.35);
  --toggle-icon: #ffffff;
}

/* =========================================
   Reset
========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.is-loading {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =========================================
   Loading screen (same mark as the main site)
========================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--navy);
  transition: opacity 0.8s ease, visibility 0s 0.8s, transform 0.8s ease;
  animation: loader-failsafe 0s 6s forwards;
}

body.loaded .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

@keyframes loader-failsafe {
  to {
    visibility: hidden;
    pointer-events: none;
  }
}

.loader-doodle {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.loader-weave {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
}

.loader-weave .thread {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: draw-thread 1.1s ease forwards;
}

.thread-blue {
  stroke: var(--blue-light);
  animation-delay: 0.1s;
}

.thread-red {
  stroke: var(--red);
  animation-delay: 0.35s;
}

@keyframes draw-thread {
  to {
    stroke-dashoffset: 0;
  }
}

.loader-word {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  letter-spacing: 4px;
  font-size: 0.8rem;
  color: #ffffff;
}

.loader-word span {
  color: var(--blue-light);
}

/* =========================================
   Scroll reveal
========================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .loader {
    display: none !important;
  }
  body.is-loading {
    overflow: visible !important;
  }
  .loader-weave .thread {
    animation: none !important;
    stroke-dashoffset: 0 !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* =========================================
   Light/dark toggle
   (Icon built from box-shadow tricks — no image/SVG needed.
   Adapted from the provided lightdark.css to use brand tokens.)
========================================= */
.toggle {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  cursor: pointer;
  z-index: 500;
}

.toggle input {
  display: none;
}

.toggle input + div {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  position: relative;
  box-shadow: inset 16px -16px 0 0 var(--toggle-icon);
  transform: scale(1) rotate(-2deg);
  transition: box-shadow 0.5s ease 0s, transform 0.4s ease 0.1s;
}

.toggle input + div::before {
  content: "";
  width: inherit;
  height: inherit;
  border-radius: inherit;
  position: absolute;
  left: 0;
  top: 0;
  background: transparent;
  transition: background 0.3s ease;
}

.toggle input + div::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: -4px 0 0 -4px;
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow: 0 -23px 0 var(--toggle-icon), 0 23px 0 var(--toggle-icon), 23px 0 0 var(--toggle-icon),
    -23px 0 0 var(--toggle-icon), 15px 15px 0 var(--toggle-icon), -15px 15px 0 var(--toggle-icon),
    15px -15px 0 var(--toggle-icon), -15px -15px 0 var(--toggle-icon);
  transform: scale(0);
  transition: all 0.3s ease;
}

.toggle input:checked + div {
  box-shadow: inset 32px -32px 0 0 var(--bg);
  transform: scale(0.5) rotate(0deg);
  transition: transform 0.3s ease 0.1s, box-shadow 0.2s ease 0s;
}

.toggle input:checked + div::before {
  background: var(--toggle-icon);
  transition: background 0.3s ease 0.1s;
}

.toggle input:checked + div::after {
  transform: scale(1.5);
  transition: transform 0.5s ease 0.15s;
}

/* Circular "reveal" transition when the theme switches (Chromium browsers;
   other browsers just get an instant, un-animated switch — no error, no
   missing functionality, just no transition flourish). */
@keyframes reveal-in {
  from {
    clip-path: circle(0% at var(--x) var(--y));
  }
  to {
    clip-path: circle(150% at var(--x) var(--y));
  }
}

@keyframes reveal-out {
  from {
    clip-path: circle(150% at var(--x) var(--y));
  }
  to {
    clip-path: circle(0% at var(--x) var(--y));
  }
}

::view-transition-new(root) {
  animation: reveal-in 0.5s ease-in-out forwards;
  z-index: 1;
}

::view-transition-old(root) {
  animation: reveal-out 0.5s ease-in-out forwards;
  z-index: 0;
}

::view-transition-image-pair(root) {
  isolation: isolate;
}

/* =========================================
   Hero
========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
}

.eyebrow-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.eyebrow-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: eyebrow-blink 1.4s step-end infinite;
}

@keyframes eyebrow-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow-live::before {
    animation: none;
  }
}

.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1;
  color: var(--text);
  transform: rotate(-2deg);
  margin-bottom: 1.25rem;
}

.tagline {
  font-family: var(--font-wordmark);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text);
  margin-bottom: 2rem;
}

.incentive-line {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

/* Plus signs get a hand-drawn accent — Permanent Marker, larger, a slight
   rotation, and brand red — instead of blending in as plain "+" glyphs. */
.plus-mark {
  display: inline-block;
  font-family: var(--font-wordmark);
  font-size: 1.2em;
  color: var(--red);
  transform: rotate(-8deg);
  margin: 0 0.05em;
}

/* =========================================
   Countdown
========================================= */
.countdown {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.cd-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  min-width: 82px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.cd-num {
  display: block;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.cd-label {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cd-target {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* =========================================
   Newsletter signup
========================================= */
.signup-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.signup-form input {
  flex: 1 1 240px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.signup-form input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.signup-form button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--red);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.signup-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(218, 48, 49, 0.3);
}

.signup-form button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Submit feedback shows as a temporary label swap on the button itself
   (see js/main.js) — no separate status text element, per design. */
.signup-form button.is-success {
  background: var(--blue);
}

.signup-form button.is-error {
  background: #8a1f14;
}

/* =========================================
   Utility icons: add-to-calendar + share
========================================= */
.utility-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.75rem;
  position: relative;
}

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.icon-btn.is-success {
  color: var(--blue);
  border-color: var(--blue);
}

.icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s ease;
}

/* Share success feedback — a checkmark overlay instead of swapping the
   generated icon image for a transient 2-second state */
.icon-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #ffffff;
  font-size: 1.1rem;
}

.icon-feedback[hidden] {
  display: none;
}

.icon-btn.is-success .icon-img {
  opacity: 0;
}

.calendar-widget {
  position: relative;
}

/* Lightbox — fixed overlay with backdrop, centered panel */
.calendar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.calendar-lightbox[hidden] {
  display: none;
}

.calendar-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 24, 48, 0.55);
  backdrop-filter: blur(4px);
}

.calendar-lightbox-panel {
  position: relative;
  width: 100%;
  max-width: 300px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 30px 70px rgba(11, 24, 48, 0.3);
}

.calendar-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.calendar-lightbox-close:hover {
  color: var(--text);
}

.calendar-lightbox-title {
  font-family: var(--font-wordmark);
  font-size: 1.35rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
}

.calendar-lightbox-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cal-option-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cal-option-btn:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
}

.cal-option-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* =========================================
   Footer
   The footer is fixed to the bottom of the viewport and sits BEHIND the
   main content (lower z-index). Main content reserves space equal to the
   footer's height via margin-bottom (set in JS, since footer height
   varies by screen size) and has its own solid background — so as you
   scroll down, the page appears to lift up and reveal the footer rising
   from underneath, rather than the footer just scrolling into view like
   ordinary content.
========================================= */
.main-content {
  position: relative;
  z-index: 1;
  background: var(--bg);
  transition: background-color 0.3s ease;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: var(--navy);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  overflow: hidden;
}

/* Bubbling social icons — decorative background texture rising behind
   the real footer content, confined to the footer via its overflow:
   hidden above. Kept low-opacity so it doesn't compete visually with
   the actual clickable social-row icons. */
.footer-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.floating-footer-icon {
  position: absolute;
  bottom: -30px;
  color: rgba(255, 255, 255, 0.12);
  animation-name: footer-icon-rise;
  animation-timing-function: linear;
}

@keyframes footer-icon-rise {
  from {
    transform: translateY(0);
  }
  to {
    /* Generously larger than any realistic footer height — the parent's
       overflow: hidden clips it the moment it exits the footer, so this
       just needs to clear the tallest footer this site will ever have. */
    transform: translateY(-60vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-footer-icon {
    display: none;
  }
}

.bubbles-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20vh;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Galaxy-colored liquid pool the bubbles appear to rise out of — two
   overlapping wave shapes drifting at different speeds/directions to
   read as flowing liquid rather than a static striped band. */
.galaxy-pool {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  overflow: hidden;
}

.pool-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.pool-wave-1 {
  opacity: 0.85;
  animation: pool-flow-1 9s linear infinite;
}

.pool-wave-2 {
  opacity: 0.55;
  animation: pool-flow-2 13s linear infinite;
}

@keyframes pool-flow-1 {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes pool-flow-2 {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pool-wave-1,
  .pool-wave-2 {
    animation: none;
  }
}

/* Liquid bubble effect: the canvas draws plain circles, and this filter
   (blur + sharpened alpha) is what makes overlapping circles visually
   fuse into a single fluid blob instead of staying separate — the
   filter itself is defined once in the HTML (#goo) and referenced here. */
.goo-wrap {
  position: absolute;
  inset: 0;
  filter: url(#goo);
}

#liquidCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The goo filter relies on blur, which doesn't degrade gracefully —
   reduced-motion users get a plain, unfiltered, unanimated pool instead
   (animation is also stopped in JS under this same media query). */
@media (prefers-reduced-motion: reduce) {
  .goo-wrap {
    display: none;
  }
}

.footer-inner {
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.footer-logo span {
  color: var(--red);
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  list-style: none;
  margin-bottom: 1.5rem;
}

.social-icon {
  position: relative;
}

.social-icon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  animation: social-pulse 2.6s ease-in-out infinite;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* Stagger each icon's pulse slightly so they don't beat in unison */
.social-icon:nth-child(1) a { animation-delay: 0s; }
.social-icon:nth-child(2) a { animation-delay: 0.4s; }
.social-icon:nth-child(3) a { animation-delay: 0.8s; }
.social-icon:nth-child(4) a { animation-delay: 1.2s; }

@keyframes social-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
}

.social-icon:hover a {
  background: var(--red);
  transform: translateY(-3px);
}

.social-icon i {
  font-size: 1rem;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .social-icon a {
    animation: none;
  }
}

.social-icon::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  background: #ffffff;
  color: var(--navy);
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-icon:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.footer-copy {
  font-size: 0.78rem;
  color: #7c869c;
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 480px) {
  .cd-block {
    min-width: 68px;
    padding: 0.85rem 0.7rem;
  }
  .cd-num {
    font-size: 1.6rem;
  }
}

/* =========================================
   Audio toggle
========================================= */
.audio-toggle {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(50% 115% at 50% -5%, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(11, 24, 48, 0.35);
  transition: transform 0.15s ease;
}

.audio-toggle:hover {
  transform: scale(1.06);
}

.audio-toggle:active {
  transform: scale(0.95);
}

.audio-toggle:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 3px;
}

.audio-icon {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
}

/* =========================================
   Launch-live state
   Shown once the countdown reaches zero, replacing the countdown + signup.
========================================= */
.launch-live {
  animation: launch-live-in 0.6s ease forwards;
}

@keyframes launch-live-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.launch-live-headline {
  font-family: var(--font-wordmark);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--text);
  transform: rotate(-2deg);
  margin-bottom: 0.5rem;
}

.launch-live-sub {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.launch-live-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.launch-live-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(218, 48, 49, 0.35);
}

.launch-live-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* =========================================
   Launch-moment celebration
   A one-time confetti burst in brand colors, triggered by JS when the
   countdown reaches zero. Particles are plain divs, animated with CSS —
   no external confetti library needed.
========================================= */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  background: var(--color);
  border-radius: var(--radius, 2px);
  opacity: 0;
  animation: confetti-fall var(--fall-time) ease-in forwards;
  animation-delay: var(--fall-delay);
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(var(--fall-distance)) rotate(var(--spin));
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece {
    display: none;
  }
  .launch-live {
    animation: none;
  }
}

.goo-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
