/* ============================================================
   PLAYRIPPL.CYOU — MASTER STYLESHEET
   Design System: Playful Depth, Warm Digital, Ripple Motion
   Color Palette: Deep Indigo, Soft Coral Peach, Electric Violet,
                  Warm Cream, Teal Pulse
   ============================================================ */

/* ── VARIABLES ──────────────────────────────────────────── */
:root {
  /* Core Colors */
  --color-bg:           #0D0E1A;
  --color-bg-alt:       #111224;
  --color-surface:      #161829;
  --color-surface-2:    #1C1F36;
  --color-border:       rgba(255,255,255,0.07);
  --color-border-hover: rgba(255,255,255,0.14);

  /* Accent Palette */
  --color-accent-1:     #7C5CFC;   /* Electric violet */
  --color-accent-2:     #F97B5C;   /* Coral peach */
  --color-accent-3:     #3DD9C5;   /* Teal pulse */
  --color-accent-glow:  rgba(124,92,252,0.22);
  --color-accent-2-glow:rgba(249,123,92,0.18);

  /* Gradients */
  --grad-hero:   linear-gradient(135deg, #0D0E1A 0%, #161432 55%, #0F1824 100%);
  --grad-accent: linear-gradient(135deg, #7C5CFC 0%, #F97B5C 100%);
  --grad-teal:   linear-gradient(135deg, #3DD9C5 0%, #7C5CFC 100%);
  --grad-card:   linear-gradient(145deg, rgba(28,31,54,0.9) 0%, rgba(22,24,41,0.95) 100%);

  /* Typography */
  --color-text-primary:   #F0EEF8;
  --color-text-secondary: #9896B0;
  --color-text-muted:     #5E5C78;
  --color-text-accent:    #7C5CFC;

  /* Spacing */
  --spacing-xs:   8px;
  --spacing-sm:   16px;
  --spacing-md:   24px;
  --spacing-lg:   40px;
  --spacing-xl:   64px;
  --spacing-2xl:  100px;
  --spacing-3xl:  140px;

  /* Typography Scale */
  --font-primary:   'Sora', sans-serif;
  --font-body:      'Manrope', sans-serif;
  --text-hero:      clamp(2.8rem, 6vw, 5.2rem);
  --text-page-hero: clamp(2.4rem, 5vw, 4rem);
  --text-section:   clamp(2rem, 3.5vw, 3rem);
  --text-lg:        1.25rem;
  --text-base:      1rem;
  --text-sm:        0.875rem;
  --text-xs:        0.75rem;

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.35);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.45);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.55);
  --shadow-accent: 0 8px 40px rgba(124,92,252,0.25);

  /* Borders */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast:   0.18s ease;
  --trans-base:   0.28s ease;
  --trans-slow:   0.45s ease;
  --trans-spring: 0.38s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-primary); line-height: 1.2; }

/* ── LAYOUT / CONTAINER ─────────────────────────────────── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}
.section-pad { padding: var(--spacing-3xl) 0; }

@media (max-width: 1024px) {
  .section-pad { padding: var(--spacing-xl) 0; }
  .container { padding: 0 var(--spacing-md); }
}
@media (max-width: 768px) {
  .section-pad { padding: var(--spacing-xl) 0; }
}
@media (max-width: 480px) {
  .section-pad { padding: var(--spacing-lg) 0; }
  .container { padding: 0 var(--spacing-sm); }
}

/* ── TYPOGRAPHY UTILITIES ───────────────────────────────── */
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-1);
  margin-bottom: var(--spacing-sm);
}
.section-title {
  font-family: var(--font-primary);
  font-size: var(--text-section);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.15;
  margin-bottom: var(--spacing-md);
}
.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.75;
}
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}
.headline-accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  padding: 12px 26px;
  transition: all var(--trans-base);
  position: relative;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 50px rgba(124,92,252,0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border-hover);
}
.btn-ghost:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent-1);
  color: var(--color-accent-1);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.6);
}
.btn-large { padding: 16px 38px; font-size: var(--text-base); }
.btn-small  { padding: 9px 20px; font-size: var(--text-xs); }
.btn-full   { width: 100%; }

/* ── HEADER / NAV ───────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background var(--trans-base), box-shadow var(--trans-base);
  background: transparent;
}
.site-header.scrolled {
  background: rgba(13,14,26,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--color-border);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--spacing-lg);
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-primary);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.logo-mark { color: var(--color-accent-1); }
.logo-play {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.main-nav { flex: 1; display: flex; justify-content: center; }
.nav-list { display: flex; align-items: center; gap: var(--spacing-sm); }
.nav-link {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--trans-fast), background var(--trans-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--color-text-primary);
  background: rgba(255,255,255,0.06);
}
.nav-link.active { color: var(--color-accent-1); }
.nav-cta { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all var(--trans-base);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,14,26,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-slow);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-nav-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}
.mobile-nav-link {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: color var(--trans-fast);
}
.mobile-nav-link:hover { color: var(--color-accent-1); }
.mobile-cta { margin-top: var(--spacing-md); }

@media (max-width: 1060px) {
  .main-nav { display: none; }
  .nav-cta  { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--grad-hero);
  padding-top: 72px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: orbFloat 12s ease-in-out infinite;
}
.hero-orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--color-accent-1), transparent 70%);
  top: -120px; right: -80px;
  animation-delay: 0s;
}
.hero-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--color-accent-2), transparent 70%);
  bottom: -80px; left: -60px;
  animation-delay: -4s;
  opacity: 0.25;
}
.hero-orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--color-accent-3), transparent 70%);
  top: 40%; left: 30%;
  animation-delay: -8s;
  opacity: 0.15;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(20px,-30px) scale(1.04); }
  66%       { transform: translate(-15px,20px) scale(0.97); }
}
.hero-ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(124,92,252,0.15);
  animation: rippleExpand 8s ease-out infinite;
  pointer-events: none;
}
.hero-ripple-1 { width: 300px; height: 300px; top: 50%; left: 50%; margin: -150px 0 0 -150px; animation-delay: 0s; }
.hero-ripple-2 { width: 300px; height: 300px; top: 50%; left: 50%; margin: -150px 0 0 -150px; animation-delay: -2.5s; }
.hero-ripple-3 { width: 300px; height: 300px; top: 50%; left: 50%; margin: -150px 0 0 -150px; animation-delay: -5s; }
@keyframes rippleExpand {
  0%   { transform: scale(0.4); opacity: 0.5; }
  100% { transform: scale(5); opacity: 0; }
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--spacing-3xl) 0;
  max-width: 860px;
}
.hero-eyebrow {
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-3);
  margin-bottom: var(--spacing-md);
}
.hero-headline {
  font-family: var(--font-primary);
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-primary);
}
.hero-subtext {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: var(--spacing-xl);
}
.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-xl);
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-number {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label { font-size: var(--text-sm); color: var(--color-text-muted); }
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: scrollBob 2.5s ease-in-out infinite;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-accent-1), transparent);
}
@keyframes scrollBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ── TRUST BAND ─────────────────────────────────────────── */
.trust-band {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0;
}
.trust-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
}
.trust-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.trust-logos {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}
.trust-tag {
  display: inline-block;
  padding: 7px 16px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  transition: all var(--trans-fast);
}
.trust-tag:hover {
  border-color: var(--color-accent-1);
  color: var(--color-accent-1);
}

/* ── SERVICES ───────────────────────────────────────────── */
.services { background: var(--color-bg-alt); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}
.service-card {
  position: relative;
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--trans-base);
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--trans-base);
}
.service-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.service-card:hover::before { opacity: 1; }
.featured-card {
  border-color: rgba(124,92,252,0.35);
  background: linear-gradient(145deg, rgba(124,92,252,0.08) 0%, rgba(28,31,54,0.98) 100%);
}
.featured-card::before { opacity: 0.6; }
.featured-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--grad-accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--spacing-md);
}
.service-icon-wrap { margin-bottom: var(--spacing-md); }
.service-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-accent-1);
  transition: all var(--trans-base);
}
.service-card:hover .service-icon {
  background: var(--color-accent-glow);
  border-color: var(--color-accent-1);
}
.service-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
}
.service-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
}
.service-link {
  display: inline-flex;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-primary);
  color: var(--color-accent-1);
  transition: gap var(--trans-fast), color var(--trans-fast);
  gap: 4px;
}
.service-link:hover { color: var(--color-accent-2); gap: 8px; }

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ── WHY US ─────────────────────────────────────────────── */
.why-us {
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
}
.why-bg-shape {
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,252,0.07), transparent 70%);
  pointer-events: none;
}
.why-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-3xl);
  align-items: center;
}
.why-left .section-title { margin-bottom: var(--spacing-md); }
.why-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-xl);
  max-width: 420px;
}
.why-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}
.why-feature {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}
.why-feature-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad-accent);
  flex-shrink: 0;
  margin-top: 7px;
  box-shadow: 0 0 12px rgba(124,92,252,0.5);
}
.why-feature-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-primary);
  margin-bottom: 6px;
  color: var(--color-text-primary);
}
.why-feature-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

@media (max-width: 860px) {
  .why-container { grid-template-columns: 1fr; gap: var(--spacing-xl); }
  .why-body { max-width: 100%; }
}

/* ── SHOWCASE ───────────────────────────────────────────── */
.showcase { background: var(--color-bg-alt); }
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: var(--spacing-md);
}
.showcase-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
  cursor: pointer;
}
.showcase-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}
.showcase-item:hover img { transform: scale(1.06); }
.showcase-large {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
.showcase-wide {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
.showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--spacing-md);
  opacity: 0.85;
  transition: opacity var(--trans-base);
}
.showcase-item:hover .showcase-overlay { opacity: 1; }
.showcase-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-accent-glow);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(124,92,252,0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent-1);
  margin-bottom: 8px;
  width: fit-content;
}
.showcase-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-primary);
  color: #fff;
}

/* Placeholder for showcase when images not loaded */
.showcase-item:not(:has(img[src])) {
  background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface));
}

@media (max-width: 860px) {
  .showcase-grid { grid-template-columns: 1fr 1fr; }
  .showcase-large, .showcase-wide { grid-column: span 2; }
}
@media (max-width: 540px) {
  .showcase-grid { grid-template-columns: 1fr; }
  .showcase-large, .showcase-wide { grid-column: span 1; }
}

/* ── TESTIMONIALS ───────────────────────────────────────── */
.testimonials { background: var(--color-bg); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}
.testimonial-card {
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  position: relative;
  transition: all var(--trans-base);
}
.testimonial-card:hover {
  border-color: rgba(124,92,252,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.testimonial-quote-mark {
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent-1);
  opacity: 0.4;
  margin-bottom: var(--spacing-sm);
}
.testimonial-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
  font-style: italic;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--grad-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-xs);
  color: #fff;
  flex-shrink: 0;
}
.testimonial-name {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}
.testimonial-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .testimonials-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}

/* ── CTA BANNER ─────────────────────────────────────────── */
.cta-banner {
  position: relative;
  background: var(--color-surface);
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.cta-bg { position: absolute; inset: 0; pointer-events: none; }
.cta-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: orbFloat 10s ease-in-out infinite;
}
.cta-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,92,252,0.18), transparent 70%);
  top: -150px; left: -100px;
}
.cta-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(249,123,92,0.12), transparent 70%);
  bottom: -100px; right: -50px;
  animation-delay: -5s;
}
.cta-content { position: relative; z-index: 1; }
.cta-headline {
  font-family: var(--font-primary);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
}
.cta-subtext {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto var(--spacing-xl);
  line-height: 1.75;
}
.cta-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* ── CONTACT PREVIEW ────────────────────────────────────── */
.contact-preview { background: var(--color-bg-alt); }
.contact-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
}
.contact-preview-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-xl);
}
.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
}
.contact-info-item svg {
  color: var(--color-accent-1);
  flex-shrink: 0;
  margin-top: 2px;
}
.contact-link {
  color: var(--color-accent-1);
  font-weight: 600;
  transition: color var(--trans-fast);
}
.contact-link:hover { color: var(--color-accent-2); }
.map-container {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-placeholder {
  text-align: center;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}
.map-placeholder svg { color: var(--color-accent-1); margin-bottom: 8px; }
.map-placeholder p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

@media (max-width: 860px) {
  .contact-preview-grid { grid-template-columns: 1fr; gap: var(--spacing-xl); }
}

/* ── PAGE HERO ──────────────────────────────────────────── */
.page-hero {
  position: relative;
  padding: calc(72px + var(--spacing-3xl)) 0 var(--spacing-3xl);
  overflow: hidden;
  background: var(--grad-hero);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.page-hero-content { position: relative; z-index: 2; max-width: 760px; }
.page-hero-headline {
  font-family: var(--font-primary);
  font-size: var(--text-page-hero);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--spacing-lg);
}
.page-hero-subtext {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.75;
  max-width: 600px;
}

/* ── ABOUT PAGE ─────────────────────────────────────────── */
.about-story { background: var(--color-bg-alt); }
.about-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
}
.about-story-img-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.about-story-img-wrap img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}
.about-story-badge {
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  background: rgba(13,14,26,0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.badge-year {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 1.2rem;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.badge-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.about-story-text .section-title { margin-bottom: var(--spacing-lg); }
.about-story-text p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-md);
}
.about-story-text p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .about-story-grid { grid-template-columns: 1fr; }
  .about-story-img-wrap img { aspect-ratio: 16/9; }
}

/* ── VALUES ─────────────────────────────────────────────── */
.values-section {
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
}
.values-bg-shape {
  position: absolute;
  bottom: -300px; left: -150px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,217,197,0.05), transparent 70%);
  pointer-events: none;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}
.value-card {
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--trans-base);
}
.value-card:hover {
  border-color: rgba(124,92,252,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.value-number {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.4;
  line-height: 1;
  margin-bottom: var(--spacing-sm);
}
.value-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}
.value-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.75;
}

@media (max-width: 900px) {
  .values-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .values-grid { grid-template-columns: 1fr; }
}

/* ── TEAM ───────────────────────────────────────────────── */
.team-section { background: var(--color-bg-alt); }
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}
.team-card {
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--trans-base);
}
.team-card:hover {
  border-color: rgba(124,92,252,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.team-photo-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-surface-2);
}
.team-photo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}
.team-card:hover .team-photo-wrap img { transform: scale(1.04); }
.team-info { padding: var(--spacing-md); }
.team-name {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-primary);
  margin-bottom: 4px;
  color: var(--color-text-primary);
}
.team-role {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent-1);
  display: block;
  margin-bottom: var(--spacing-sm);
}
.team-bio {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.7;
}

@media (max-width: 1000px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .team-grid { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
}

/* ── CONTACT PAGE ───────────────────────────────────────── */
.contact-main { background: var(--color-bg-alt); }
.contact-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--spacing-3xl);
  align-items: flex-start;
  margin-bottom: var(--spacing-3xl);
}
.contact-form-title {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-primary);
  margin-bottom: var(--spacing-xl);
  color: var(--color-text-primary);
}
.contact-form { display: flex; flex-direction: column; gap: var(--spacing-md); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-primary);
  color: var(--color-text-secondary);
}
.required { color: var(--color-accent-2); }
.form-input, .form-select, .form-textarea {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-accent-1);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.12);
}
.form-input.error, .form-select.error, .form-textarea.error {
  border-color: var(--color-accent-2);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--color-text-muted);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239896B0' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.form-select option { background: var(--color-bg); color: var(--color-text-primary); }
.form-textarea { resize: vertical; min-height: 140px; }
.form-check { flex-direction: row; align-items: flex-start; gap: var(--spacing-sm); }
.form-checkbox {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid var(--color-border-hover);
  border-radius: 4px;
  background: var(--color-surface-2);
  cursor: pointer;
  accent-color: var(--color-accent-1);
}
.form-check-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.form-check-label a { color: var(--color-accent-1); text-decoration: underline; }
.form-error {
  font-size: var(--text-xs);
  color: var(--color-accent-2);
  font-weight: 500;
  min-height: 18px;
}
.form-success {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(61,217,197,0.08);
  border: 1px solid rgba(61,217,197,0.25);
  border-radius: var(--radius-md);
  color: var(--color-accent-3);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--spacing-sm);
}

/* Sidebar */
.contact-sidebar { display: flex; flex-direction: column; gap: var(--spacing-md); }
.sidebar-card {
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}
.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-sm);
}
.sidebar-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--spacing-sm);
}
.hours-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.hours-row.closed span:last-child { color: var(--color-text-muted); }
.sidebar-card p { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.7; }

/* Map Section */
.map-section { margin-top: 0; }
.large-map {
  aspect-ratio: 21/7;
  border-radius: var(--radius-xl);
  min-height: 280px;
}

@media (max-width: 900px) {
  .contact-main-grid { grid-template-columns: 1fr; gap: var(--spacing-xl); }
  .form-row { grid-template-columns: 1fr; }
  .large-map { aspect-ratio: 16/9; }
}

/* ── LEGAL PAGES ────────────────────────────────────────── */
.legal-hero {
  padding: calc(72px + var(--spacing-xl)) 0 var(--spacing-xl);
  background: var(--grad-hero);
  border-bottom: 1px solid var(--color-border);
}
.legal-hero-content { max-width: 800px; }
.legal-title {
  font-family: var(--font-primary);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
}
.legal-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.legal-body { background: var(--color-bg-alt); }
.legal-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--spacing-3xl);
  align-items: flex-start;
}
.legal-toc {
  position: sticky;
  top: calc(72px + var(--spacing-lg));
  background: var(--grad-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}
.toc-title {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.toc-list { display: flex; flex-direction: column; gap: 8px; list-style: decimal; padding-left: var(--spacing-md); }
.toc-list a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: color var(--trans-fast);
  line-height: 1.6;
}
.toc-list a:hover { color: var(--color-accent-1); }
.legal-content { max-width: 780px; }
.legal-section {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
  border-bottom: 1px solid var(--color-border);
}
.legal-section:last-child { border-bottom: none; }
.legal-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}
.legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-primary);
  color: var(--color-text-secondary);
  margin: var(--spacing-md) 0 var(--spacing-sm);
}
.legal-section p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: var(--spacing-md);
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul, .legal-section ol {
  padding-left: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--spacing-md);
  list-style: disc;
}
.legal-section ol { list-style: decimal; }
.legal-section li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.75;
}
.legal-section li strong { color: var(--color-text-primary); font-weight: 600; }
.legal-section a { color: var(--color-accent-1); transition: color var(--trans-fast); }
.legal-section a:hover { color: var(--color-accent-2); }
.legal-contact-block {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
}
.legal-contact-block p { margin-bottom: var(--spacing-sm); }
.legal-contact-block p:last-child { margin-bottom: 0; }

/* Rules intro card */
.rules-intro-card {
  background: linear-gradient(135deg, rgba(124,92,252,0.08) 0%, rgba(28,31,54,0.95) 100%);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  grid-column: 1 / -1;
}
.rules-intro-card h2 {
  font-family: var(--font-primary);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}
.rules-intro-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: var(--spacing-sm);
}
.rules-intro-card p:last-child { margin-bottom: 0; }
.rules-intro-card a { color: var(--color-accent-1); }

@media (max-width: 900px) {
  .legal-container { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
  .rules-intro-card { grid-column: 1; }
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-top: var(--spacing-3xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--spacing-xl);
  padding-bottom: var(--spacing-3xl);
}
.footer-brand { max-width: 300px; }
.footer-logo { margin-bottom: var(--spacing-md); }
.footer-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}
.footer-address {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.75;
}
.footer-col-title {
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a, .footer-links li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--trans-fast);
}
.footer-links a:hover { color: var(--color-accent-1); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-md) 0;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.footer-bottom-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.footer-bottom-links a { color: var(--color-text-muted); transition: color var(--trans-fast); }
.footer-bottom-links a:hover { color: var(--color-accent-1); }
.footer-bottom-links span { color: var(--color-border-hover); }

@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); }
  .footer-brand { max-width: 100%; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }
.delay-4 { transition-delay: 0.48s; }

/* ── UTILITIES ──────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
/* ENDFILE -->

<!-- FILE: main.js -->
/* ============================================================
   PLAYRIPPL.CYOU — MAIN JAVASCRIPT
   Handles: nav scroll, mobile menu, fade animations, form
   ============================================================ */

(function () {
  'use strict';

  /* ── DOM READY ──────────────────────────────────────── */
  document.addEventListener('DOMContentLoaded', function () {
    initNavScroll();
    initMobileMenu();
    initFadeObserver();
    initContactForm();
    initSmoothScroll();
  });

  /* ── NAV SCROLL BEHAVIOR ────────────────────────────── */
  function initNavScroll() {
    var header = document.getElementById('site-header');
    if (!header) return;

    function onScroll() {
      if (window.scrollY > 48) {
        header.classList.add('scrolled');
      } else {
        header.classList.remove('scrolled');
      }
    }

    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
  }

  /* ── MOBILE MENU ────────────────────────────────────── */
  function initMobileMenu() {
    var hamburger  = document.getElementById('hamburger');
    var mobileMenu = document.getElementById('mobile-menu');
    if (!hamburger || !mobileMenu) return;

    var isOpen = false;

    function openMenu() {
      isOpen = true;
      hamburger.classList.add('open');
      hamburger.setAttribute('aria-expanded', 'true');
      mobileMenu.classList.add('open');
      mobileMenu.setAttribute('aria-hidden', 'false');
      document.body.style.overflow = 'hidden';
    }

    function closeMenu() {
      isOpen = false;
      hamburger.classList.remove('open');
      hamburger.setAttribute('aria-expanded', 'false');
      mobileMenu.classList.remove('open');
      mobileMenu.setAttribute('aria-hidden', 'true');
      document.body.style.overflow = '';
    }

    hamburger.addEventListener('click', function () {
      if (isOpen) { closeMenu(); } else { openMenu(); }
    });

    /* Close when a link is clicked */
    var mobileLinks = mobileMenu.querySelectorAll('a');
    mobileLinks.forEach(function (link) {
      link.addEventListener('click', closeMenu);
    });

    /* Close on Escape */
    document.addEventListener('keydown', function (e) {
      if (e.key === 'Escape' && isOpen) closeMenu();
    });
  }

  /* ── INTERSECTION OBSERVER (fade-up) ────────────────── */
  function initFadeObserver() {
    var elements = document.querySelectorAll('.fade-up');
    if (!elements.length) return;

    if (!('IntersectionObserver' in window)) {
      elements.forEach(function (el) { el.classList.add('visible'); });
      return;
    }

    var observer = new IntersectionObserver(function (entries) {
      entries.forEach(function (entry) {
        if (entry.isIntersecting) {
          entry.target.classList.add('visible');
          observer.unobserve(entry.target);
        }
      });
    }, {
      threshold: 0.1,
      rootMargin: '0px 0px -40px 0px'
    });

    elements.forEach(function (el) { observer.observe(el); });
  }

  /* ── SMOOTH SCROLL for anchor links ─────────────────── */
  function initSmoothScroll() {
    var anchors = document.querySelectorAll('a[href^="#"]');
    anchors.forEach(function (anchor) {
      anchor.addEventListener('click', function (e) {
        var target = document.querySelector(this.getAttribute('href'));
        if (!target) return;
        e.preventDefault();
        var headerHeight = 72;
        var top = target.getBoundingClientRect().top + window.scrollY - headerHeight;
        window.scrollTo({ top: top, behavior: 'smooth' });
      });
    });
  }

  /* ── CONTACT FORM ───────────────────────────────────── */
  function initContactForm() {
    var form    = document.getElementById('contact-form');
    if (!form) return;

    var submitBtn = document.getElementById('form-submit');
    var successEl = document.getElementById('form-success');

    function getField(id)  { return document.getElementById(id); }
    function getError(id)  { return document.getElementById(id + '-error'); }

    function setError(fieldId, msg) {
      var field = getField(fieldId);
      var error = getError(fieldId);
      if (field)  field.classList.add('error');
      if (error)  error.textContent = msg;
    }

    function clearError(fieldId) {
      var field = getField(fieldId);
      var error = getError(fieldId);
      if (field)  field.classList.remove('error');
      if (error)  error.textContent = '';
    }

    function validateEmail(email) {
      return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
    }

    function validate() {
      var valid = true;

      ['first-name', 'last-name', 'email', 'subject', 'message'].forEach(clearError);
      clearError('consent');

      var firstName = getField('first-name');
      if (firstName && firstName.value.trim().length < 1) {
        setError('first-name', 'Please enter your first name.');
        valid = false;
      }

      var lastName = getField('last-name');
      if (lastName && lastName.value.trim().length < 1) {
        setError('last-name', 'Please enter your last name.');
        valid = false;
      }

      var email = getField('email');
      if (email && !validateEmail(email.value.trim())) {
        setError('email', 'Please enter a valid email address.');
        valid = false;
      }

      var subject = getField('subject');
      if (subject && subject.value === '') {
        setError('subject', 'Please select a topic.');
        valid = false;
      }

      var message = getField('message');
      if (message && message.value.trim().length < 10) {
        setError('message', 'Please write a message (at least 10 characters).');
        valid = false;
      }

      var consent = getField('consent');
      if (consent && !consent.checked) {
        setError('consent', 'You must agree to the Privacy Policy to continue.');
        valid = false;
      }

      return valid;
    }

    /* Live validation on blur */
    ['first-name', 'last-name', 'email', 'subject', 'message'].forEach(function (id) {
      var field = getField(id);
      if (field) {
        field.addEventListener('blur', function () { validate(); });
        field.addEventListener('input', function () { clearError(id); });
      }
    });

    form.addEventListener('submit', function (e) {
      e.preventDefault();

      if (!validate()) return;

      /* Simulate async submission */
      if (submitBtn) {
        var btnText    = submitBtn.querySelector('.btn-text');
        var btnLoading = submitBtn.querySelector('.btn-loading');
        submitBtn.disabled = true;
        if (btnText)    btnText.style.display    = 'none';
        if (btnLoading) btnLoading.style.display = 'inline';
      }

      setTimeout(function () {
        if (submitBtn) {
          submitBtn.disabled = false;
          var btnText    = submitBtn.querySelector('.btn-text');
          var btnLoading = submitBtn.querySelector('.btn-loading');
          if (btnText)    btnText.style.display    = 'inline';
          if (btnLoading) btnLoading.style.display = 'none';
        }
        if (successEl) {
          successEl.style.display = 'flex';
          form.reset();
          successEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
        }
      }, 1600);
    });
  }

})();