/* ============================================================================
 * Runcycle Cherry Blossom Hero — Pixel-Faithful Stylesheet
 * Layered architecture:
 *   0. Muted blue atmospheric sky background
 *   1. Oversized translucent Runcycle geometric watermark
 *   2. Full-bleed Three.js WebGPU cherry blossom & falling petal canvas (pointer-events: none)
 *   10. Crisp HTML navigation, frosted-glass dropdown, hero typography & CTAs
 * ============================================================================ */

:root {
  --sky-top: #405e91;
  --sky-mid: #446296;
  --sky-lower: #4c699b;
  --sky-bottom: #556fa0;

  --ink-white: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.90);
  --ink-muted: rgba(218, 229, 248, 0.56);
  --ink-dark: #181b20;

  --glass-bg: rgba(114, 138, 178, 0.16);
  --glass-border: rgba(255, 255, 255, 0.34);
  --glass-hover: rgba(255, 255, 255, 0.11);

  --pill-outline-bg: rgba(255, 255, 255, 0.07);
  --pill-outline-border: rgba(255, 255, 255, 0.34);
  --pill-outline-hover: rgba(255, 255, 255, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
}

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

html,
body,
#root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--sky-mid);
  color: var(--ink-white);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================================
 * HERO STAGE & BACKGROUND LAYERS
 * ============================================================================ */

.hero-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* Exact measured muted-blue background with subtle natural vertical atmospheric lift */
  background:
    radial-gradient(ellipse 66% 48% at 50% 88%, rgba(126, 152, 196, 0.15) 0%, transparent 72%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-lower) 78%, var(--sky-bottom) 100%);
}

/* Layer 1: Large translucent Runcycle brand symbol (center-lower region) */
.watermark-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

.watermark-svg {
  position: absolute;
  left: 49%;
  top: 72.8%;
  transform: translate(-50%, -50%);
  width: clamp(220px, 26.2vw, 430px);
  height: auto;
  aspect-ratio: 1 / 1;
  color: rgba(255, 255, 255, 0.088);
}

/* Layer 2: Three.js WebGPU 3D Cherry Blossom & Falling Petals Canvas */
.blossom-canvas-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* Never intercepts clicks intended for nav or buttons */
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

.blossom-canvas-layer.is-ready {
  opacity: 1;
}

.blossom-webgl-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Subtle fallback backdrop if WebGPU/WebGL fails to initialize */
.canvas-fallback-note {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ============================================================================
 * LAYER 10: NAVIGATION BAR & FROSTED-GLASS DROPDOWN
 * ============================================================================ */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: clamp(10px, 1.85vh, 22px) clamp(18px, 3.25vw, 46px);
  pointer-events: none;
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.brand-link {
  pointer-events: auto;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  text-decoration: none;
  color: var(--ink-white);
  font-size: clamp(0.95rem, 1.38vw, 1.18rem);
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 1px 10px rgba(34, 52, 86, 0.25);
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.92;
}

.brand-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 4px;
  border-radius: 6px;
}

.brand-icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  color: #ffffff;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
}

.brand-run {
  font-weight: 600;
  color: #ffffff;
}

.brand-cycle {
  font-weight: 300;
  color: rgba(255, 255, 255, 0.84);
}

/* Center Navigation Links */
.nav-center {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 30px);
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-trigger,
.nav-link {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: clamp(0.75rem, 0.98vw, 0.90rem);
  font-weight: 450;
  letter-spacing: -0.008em;
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  padding: 5px 2px;
  text-shadow: 0 1px 10px rgba(28, 42, 72, 0.34);
  transition: color 0.18s ease, opacity 0.18s ease;
}

.nav-trigger:hover,
.nav-link:hover,
.nav-trigger[aria-expanded='true'] {
  color: #ffffff;
}

.nav-trigger:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
  border-radius: 5px;
}

.nav-chevron {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
  transform: translateY(0.5px) rotate(0deg);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.nav-trigger[aria-expanded='true'] .nav-chevron {
  transform: translateY(0.5px) rotate(180deg);
  opacity: 1;
}

/* Frosted-Glass Dropdown Panel — matched to crop_nav_dropdown.png */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  left: -3px;
  min-width: clamp(128px, 12.6vw, 174px);
  padding: 7px 6px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(118%);
  -webkit-backdrop-filter: blur(14px) saturate(118%);
  box-shadow: 0 8px 24px rgba(24, 38, 68, 0.12);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.20s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.20s linear;
}

/* Invisible hover bridge so cursor gliding from nav trigger to dropdown never loses hover */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item + .dropdown-item {
  margin-top: 2px;
}

.dropdown-link {
  display: block;
  width: 100%;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: clamp(0.75rem, 0.98vw, 0.89rem);
  font-weight: 450;
  letter-spacing: -0.008em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(26, 40, 68, 0.22);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.dropdown-link:hover,
.dropdown-link:focus-visible,
.dropdown-link.is-highlighted {
  background-color: var(--glass-hover);
  color: #ffffff;
  outline: none;
}

/* Right Navigation Actions */
.nav-actions {
  pointer-events: auto;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.55vw, 22px);
}

.nav-signin {
  font-size: clamp(0.75rem, 0.98vw, 0.90rem);
  font-weight: 450;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(28, 42, 72, 0.32);
  transition: opacity 0.18s ease;
}

.nav-signin:hover {
  opacity: 0.82;
}

.nav-signin:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 4px;
  border-radius: 5px;
}

/* Shared Pill Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.14s ease,
    box-shadow 0.18s ease;
}

.btn-pill:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.btn-pill:active {
  transform: scale(0.975);
}

.btn-pill-nav {
  background: #ffffff;
  color: var(--ink-dark);
  border: 1px solid rgba(255, 255, 255, 0.95);
  font-size: clamp(0.74rem, 0.95vw, 0.88rem);
  padding: clamp(6px, 0.72vw, 9px) clamp(13px, 1.35vw, 19px);
}

.btn-pill-nav:hover {
  background: #f4f7fc;
  box-shadow: 0 4px 16px rgba(18, 30, 56, 0.18);
}

/* ============================================================================
 * HERO MAIN CONTENT (LOWER-LEFT HEADING + LOWER-RIGHT COPY & CTAs)
 * ============================================================================ */

.hero-main {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(22px, 5.1vw, 72px) clamp(24px, 5.4vh, 52px);
  gap: 32px;
}

/* Lower-Left Staggered 3-Line Display Heading */
.hero-heading {
  pointer-events: auto;
  font-size: clamp(2.25rem, 4.72vw, 4.45rem);
  font-weight: 400;
  line-height: 1.07;
  letter-spacing: -0.032em;
  max-width: 11.5ch;
  user-select: text;
}

.hero-heading-bright {
  color: #ffffff;
}

.hero-heading-muted {
  color: var(--ink-muted);
}

/* Lower-Right Supporting Description & Button Pair */
.hero-right {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: clamp(240px, 24.8vw, 342px);
  margin-bottom: clamp(2px, 0.55vh, 8px);
}

.hero-description {
  font-size: clamp(0.74rem, 1.08vw, 0.94rem);
  font-weight: 400;
  line-height: 1.48;
  letter-spacing: -0.006em;
  color: var(--ink-soft);
}

.hero-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(8px, 0.95vw, 12px);
  margin-top: clamp(14px, 2.6vh, 24px);
}

.btn-pill-primary {
  background: #ffffff;
  color: var(--ink-dark);
  border: 1px solid #ffffff;
  font-size: clamp(0.74rem, 0.96vw, 0.89rem);
  padding: clamp(8px, 0.85vw, 11px) clamp(15px, 1.55vw, 22px);
}

.btn-pill-primary:hover {
  background: #f3f6fb;
  box-shadow: 0 6px 20px rgba(20, 34, 62, 0.20);
}

.btn-pill-secondary {
  background: var(--pill-outline-bg);
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--pill-outline-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: clamp(0.74rem, 0.96vw, 0.89rem);
  padding: clamp(8px, 0.85vw, 11px) clamp(15px, 1.45vw, 20px);
}

.btn-pill-secondary:hover {
  background: var(--pill-outline-hover);
  border-color: rgba(255, 255, 255, 0.54);
  color: #ffffff;
}

/* Mobile Menu Button (hidden on desktop) */
.mobile-menu-toggle {
  display: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  border-radius: 9999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

/* ============================================================================
 * RESPONSIVE TABLET & MOBILE ADAPTATION
 * ============================================================================ */

@media (max-width: 900px) {
  .site-nav {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .nav-center {
    gap: 14px;
  }

  .hero-main {
    padding: 0 28px 32px;
  }

  .hero-right {
    width: 265px;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 16px 20px;
  }

  .site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-center {
    display: none;
  }

  .nav-center.is-mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 4px);
    left: 20px;
    right: 20px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(66, 94, 146, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    gap: 6px;
  }

  .nav-center.is-mobile-open .nav-dropdown {
    position: static;
    margin-top: 6px;
    width: 100%;
    transform: none;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-center.is-mobile-open .nav-dropdown.is-open {
    display: block;
  }

  .nav-signin {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
  }

  .watermark-svg {
    left: 50%;
    top: 52%;
    width: 58vw;
  }

  .hero-main {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 24px 34px;
    gap: 20px;
  }

  .hero-heading {
    font-size: clamp(2.15rem, 10vw, 2.9rem);
  }

  .hero-right {
    width: 100%;
    max-width: 340px;
    margin-bottom: 0;
  }

  .hero-description {
    font-size: 0.9rem;
  }

  .btn-pill-primary,
  .btn-pill-secondary {
    font-size: 0.86rem;
    padding: 10px 18px;
  }
}

/* ============================================================================
 * REDUCED MOTION ACCESSIBILITY
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .blossom-canvas-layer,
  .nav-dropdown,
  .nav-chevron,
  .btn-pill {
    transition: none;
  }
}
