/* ============================================================
   KITE HOLDINGS — Design System
   Aesthetic: Clean editorial light mode
   Fonts: Outfit / Newsreader / DM Mono
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400&family=Newsreader:ital,wght@0,400;1,400&family=Outfit:wght@400;600;900&display=swap');

/* --- Tokens --- */
:root {
  --brand: #0066FF;
  --brand-dark: #0052CC;
  --brand-light: #E6F0FF;
  --snow: #FAFBFD;
  --cloud: #F3F4F8;
  --ink: #1A1D2B;
  --ink-light: #6B7280;
  --ink-lighter: #9CA3AF;
  --accent-coral: #FF6B4A;
  --accent-teal: #00C9A7;
  --accent-gold: #F5A623;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(26,29,43,.06);
  --shadow-md: 0 4px 16px rgba(26,29,43,.08);
  --shadow-lg: 0 12px 40px rgba(26,29,43,.12);
  --shadow-xl: 0 20px 60px rgba(26,29,43,.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: 'Outfit', sans-serif;
  --font-serif: 'Newsreader', serif;
  --font-mono: 'DM Mono', monospace;
  --nav-h: 76px;
  --max-w: 1200px;
  --max-w-lg: 1400px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  background: var(--snow);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 900; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; font-weight: 600; }
p { max-width: 65ch; }
.serif { font-family: var(--font-serif); }
.serif-i { font-family: var(--font-serif); font-style: italic; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; }
.text-center { text-align: center; }
.text-brand { color: var(--brand); }
.text-light { color: var(--ink-light); }
.text-lighter { color: var(--ink-lighter); }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-lg { width: 100%; max-width: var(--max-w-lg); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }

/* --- Section Label --- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--brand);
}

.section-intro { max-width: 600px; color: var(--ink-light); font-size: 1.125rem; line-height: 1.7; margin-top: 16px; }

/* --- Grid --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-center-last { justify-items: center; }
.grid-center-last > * { width: 100%; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .container, .container-lg { padding: 0 20px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,102,255,.3);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 24px rgba(0,102,255,.4);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}
.btn-white {
  background: var(--white);
  color: var(--brand);
}
.btn-white:hover {
  background: var(--cloud);
  transform: translateY(-2px);
}
.btn-sm { padding: 10px 24px; font-size: 0.875rem; }
.btn-lg { padding: 18px 40px; font-size: 1rem; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .btn { padding: 12px 24px; font-size: 0.875rem; }
  .btn-lg { padding: 14px 28px; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }
}

/* Arrow icon for buttons */
.btn .arrow {
  transition: transform 0.3s ease;
}
.btn:hover .arrow {
  transform: translateX(4px);
}

/* --- Card --- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.25rem;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-light); font-size: 0.9375rem; }

/* Product card variant */
.product-card {
  text-align: center;
  padding: 40px 32px;
}
.product-card .product-logo {
  height: 80px;
  width: auto;
  max-width: 200px;
  margin: 0 auto 20px;
  object-fit: contain;
}
.product-card .product-tagline {
  font-size: 0.9375rem;
  color: var(--ink-light);
  margin-bottom: 20px;
}
.product-card .card-link {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s ease;
}
.product-card:hover .card-link {
  gap: 10px;
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  padding: 40px;
  text-align: center;
  position: relative;
}
.stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border);
}
.stat-number {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-light);
}
@media (max-width: 768px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2)::after { display: none; }
  .stat { padding: 24px; }
}
@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .stat::after { display: none !important; }
  .stat:not(:last-child) { border-bottom: 1px solid var(--border); }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(250,251,253,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(250,251,253,0.95);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: var(--max-w-lg);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  height: 44px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink-light);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--ink);
  background: var(--cloud);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-toggle .chevron {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}
.nav-dropdown:hover .chevron {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.nav-dropdown-item:hover {
  background: var(--cloud);
}
.nav-dropdown-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}
.nav-dropdown-item span {
  font-size: 0.9375rem;
  font-weight: 500;
}
.nav-dropdown-item small {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-light);
  font-weight: 400;
}

.nav-cta {
  margin-left: 8px;
}

/* Mobile nav */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
}
.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 1024px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--snow);
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-cta { margin-left: 0; margin-top: 16px; width: 100%; text-align: center; }
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - var(--nav-h));
}
.hero-content { padding: 60px 0; }
.hero-content h1 { margin-bottom: 20px; }
.hero-content .hero-sub {
  font-size: 1.125rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 500px;
}
.hero-img-wrap {
  position: relative;
  height: 100%;
  min-height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.hero-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,102,255,0.3) 0%, rgba(0,102,255,0.05) 100%);
}

/* Product hero variant */
.hero-product {
  text-align: center;
  justify-content: center;
  padding: 120px 0 80px;
  min-height: 70vh;
}
.hero-product .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-product h1 { margin-bottom: 20px; }
.hero-product .hero-sub { margin: 0 auto 32px; text-align: center; }
.hero-product-img {
  margin-top: 40px;
  width: 100%;
  max-width: 800px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.hero-product-logo {
  height: 100px;
  width: auto;
  margin-bottom: 24px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-img-wrap { min-height: 280px; }
  .hero { min-height: auto; }
  .hero-product { padding: 100px 0 40px; min-height: auto !important; }
  .hero-content { padding: 40px 0 20px; }
  .cta-section { padding: 60px 0; }
}

/* --- Dark Section --- */
.section-dark {
  background: var(--ink);
  color: var(--white);
}
.section-dark .section-label { color: var(--accent-teal); }
.section-dark .section-label::before { background: var(--accent-teal); }
.section-dark .section-intro { color: rgba(255,255,255,0.7); }
.section-dark h2 { color: var(--white); }
.section-dark .text-light { color: rgba(255,255,255,0.6); }

/* Gradient CTA section */
.cta-section {
  background: linear-gradient(135deg, var(--ink) 0%, #2A2D3B 100%);
  color: var(--white);
  text-align: center;
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,0.15) 0%, transparent 70%);
}
.cta-section h2 { margin-bottom: 16px; }
.cta-section p {
  color: rgba(255,255,255,0.7);
  font-size: 1.125rem;
  margin: 0 auto 32px;
}
.cta-section .btn-group { justify-content: center; }

/* --- How It Works (Steps) --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: calc(16.66% + 20px);
  right: calc(16.66% + 20px);
  height: 2px;
  background: var(--border);
}
.step {
  text-align: center;
  position: relative;
}
.step-num {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 900;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
}
.step h4 { margin-bottom: 8px; }
.step p { color: var(--ink-light); font-size: 0.9375rem; margin: 0 auto; }
@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps::before { display: none; }
}

/* --- Photo Gallery --- */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.photo-gallery img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: transform 0.4s ease;
}
.photo-gallery img:hover { transform: scale(1.03); }
@media (max-width: 768px) {
  .photo-gallery { grid-template-columns: 1fr; }
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}
.pricing-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: all 0.4s ease;
}
.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 8px 32px rgba(0,102,255,.15);
  transform: scale(1.05);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}
.pricing-card:hover { box-shadow: var(--shadow-lg); }
.pricing-plan-name {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 8px;
}
.pricing-price {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 4px;
  line-height: 1;
}
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--ink-light); }
.pricing-period { font-size: 0.875rem; color: var(--ink-light); margin-bottom: 24px; }
.pricing-features {
  text-align: left;
  margin-bottom: 32px;
}
.pricing-features li {
  padding: 8px 0;
  font-size: 0.9375rem;
  color: var(--ink-light);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pricing-features li::before {
  content: '\2713';
  color: var(--accent-teal);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-card .btn { width: 100%; justify-content: center; }
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .pricing-card.featured { transform: none; }
}

/* --- FAQ Accordion --- */
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 0;
  font-size: 1.0625rem;
  font-weight: 600;
  font-family: var(--font-display);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--ink);
}
.faq-question .faq-icon {
  font-size: 1.25rem;
  color: var(--ink-light);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-answer-inner {
  padding: 0 0 20px;
  color: var(--ink-light);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- Contact Form --- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s ease;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,102,255,.1);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

/* --- Footer --- */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 60px;
}
.footer-brand p {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 300px;
}
.footer-logo { height: 44px; filter: brightness(0) invert(1); margin-bottom: 8px; }
.footer-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}
.footer-social {
  display: flex;
  gap: 16px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-size: 0.875rem;
}
.footer-social a:hover { background: var(--brand); color: var(--white); }
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Scroll Reveal --- */
.rv {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
  transition-delay: var(--delay, 0ms);
}
.rv.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > .rv:nth-child(1) { --delay: 0ms; }
.stagger > .rv:nth-child(2) { --delay: 100ms; }
.stagger > .rv:nth-child(3) { --delay: 200ms; }
.stagger > .rv:nth-child(4) { --delay: 300ms; }
.stagger > .rv:nth-child(5) { --delay: 400ms; }
.stagger > .rv:nth-child(6) { --delay: 500ms; }

/* --- Parallax --- */
.parallax-wrap {
  position: relative;
  overflow: hidden;
}
.parallax-img {
  position: absolute;
  inset: -20% 0;
  width: 100%;
  height: 140%;
  object-fit: cover;
  will-change: transform;
}

/* --- Ecosystem cards --- */
.eco-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  color: inherit;
}
.eco-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  transform: translateY(-3px);
}
.eco-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eco-card-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.eco-card-body { flex: 1; min-width: 0; }
.eco-card-body h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.eco-card-body p { font-size: 0.8125rem; color: var(--ink-light); line-height: 1.4; margin: 0; }
.eco-card-arrow {
  font-size: 1.125rem;
  color: var(--ink-lighter);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.eco-card:hover .eco-card-arrow { color: var(--brand); transform: translateX(3px); }

/* --- Feature split --- */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.feature-split.reverse { direction: rtl; }
.feature-split.reverse > * { direction: ltr; }
.feature-split-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.feature-split-img img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}
@media (max-width: 768px) {
  .feature-split, .feature-split.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 32px;
  }
}

/* Logo crop utility — for logos with excessive whitespace (e.g. Play logo) */
.logo-crop-top {
  object-fit: cover !important;
  object-position: center top !important;
}

/* --- Misc utilities --- */
.bg-cloud { background: var(--cloud); }
.rounded-img { border-radius: var(--radius-md); }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* ============================================================
   CAPTURE THE CASTLE — Interactive Demo
   ============================================================ */

/* --- Container --- */
.castle-demo {
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
  font-family: var(--font-display);
  position: relative;
}

/* --- Team Selection --- */
.castle-team-select {
  padding: 48px 32px;
  text-align: center;
}
.castle-team-select h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #fff;
}
.castle-team-select p {
  color: rgba(255,255,255,.6);
  margin: 0 auto 32px;
  max-width: 500px;
  font-size: .9375rem;
}
.castle-team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}
.castle-team-btn {
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.castle-team-btn:hover {
  border-color: var(--team-color);
  background: rgba(255,255,255,.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.castle-team-btn .team-shield {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--team-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.castle-team-btn .team-name {
  font-weight: 600;
  font-size: .9375rem;
}

/* --- Game Layout --- */
.castle-game {
  display: none;
}
.castle-game.active {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto;
}
.castle-game-header {
  grid-column: 1 / -1;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.5);
}
.castle-game-header .castle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: .8125rem;
}
.castle-game-header .castle-timer {
  color: var(--accent-teal);
}

/* --- Castle Map --- */
.castle-map {
  padding: 32px;
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.castle-map-inner {
  position: relative;
  width: 340px;
  height: 360px;
}
/* Stone paths connecting bases */
.castle-path {
  position: absolute;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
}
.castle-path-h {
  height: 3px;
  top: 50%;
  left: 50px;
  right: 50px;
  transform: translateY(-1px);
}
.castle-path-v {
  width: 3px;
  left: 50%;
  top: 50px;
  bottom: 50px;
  transform: translateX(-1px);
}
.castle-path-d1, .castle-path-d2 {
  width: 3px;
  height: 160px;
  left: 50%;
}
.castle-path-d1 {
  top: 60px;
  transform: rotate(35deg);
  transform-origin: top center;
}
.castle-path-d2 {
  top: 60px;
  transform: rotate(-35deg);
  transform-origin: top center;
}
/* Wall border */
.castle-wall {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  pointer-events: none;
}
.castle-wall::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: calc(var(--radius-lg) - 4px);
}

/* --- Base Nodes --- */
.castle-base {
  position: absolute;
  width: 120px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  transition: all .3s ease;
  cursor: default;
}
.castle-base[data-base="tower"] {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}
.castle-base[data-base="throne"] {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}
.castle-base[data-base="keep"] {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.castle-base[data-base="gatehouse"] {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.castle-base-icon {
  margin-bottom: 4px;
  opacity: .7;
}
.castle-base-icon svg {
  width: 20px;
  height: 20px;
}
.castle-base-name {
  font-size: .6875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.6);
  margin-bottom: 8px;
}
.castle-base-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  min-height: 14px;
}
.castle-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pip-color);
  transition: all .3s ease;
}
.castle-pip.pop {
  animation: pipPop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pipPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.castle-base.flash-attack {
  animation: attackFlash .5s ease;
}
@keyframes attackFlash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 20px rgba(255,60,60,.5); border-color: rgba(255,60,60,.6); }
}
.castle-base.flash-setup {
  animation: setupFlash .5s ease;
}
@keyframes setupFlash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 20px rgba(0,201,167,.4); border-color: rgba(0,201,167,.5); }
}

/* --- Scoreboard --- */
.castle-sidebar {
  border-left: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
}
.castle-scoreboard {
  padding: 20px;
  flex-shrink: 0;
}
.castle-scoreboard h4 {
  font-family: var(--font-mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  margin-bottom: 16px;
  font-weight: 400;
}
.castle-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.castle-score-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.castle-score-name {
  font-size: .8125rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.castle-score-you {
  font-size: .5625rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255,255,255,.12);
  padding: 2px 6px;
  border-radius: 3px;
  color: rgba(255,255,255,.7);
}
.castle-score-bar-wrap {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.castle-score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.castle-score-count {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  font-family: var(--font-mono);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* --- Your Team / Cooldown --- */
.castle-status {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.castle-status-label {
  font-size: .6875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  margin-bottom: 6px;
}
.castle-status-team {
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: 12px;
}
.castle-cooldown-wrap {
  margin-top: 8px;
}
.castle-cooldown-label {
  font-size: .6875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.castle-cooldown-bar {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
}
.castle-cooldown-fill {
  height: 100%;
  background: var(--accent-teal);
  border-radius: 2px;
  transition: width .1s linear;
  width: 100%;
}
.castle-cooldown-bar.on-cooldown .castle-cooldown-fill {
  background: var(--accent-coral);
}

/* --- Actions --- */
.castle-actions {
  grid-column: 1 / -1;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.castle-actions-label {
  font-family: var(--font-mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  margin-right: 4px;
}
.castle-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .8125rem;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  position: relative;
}
.castle-action-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.castle-action-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
/* Dropdown inside action */
.castle-action-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #2A2D3B;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  min-width: 180px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  z-index: 10;
  display: none;
}
.castle-action-dropdown.open {
  display: block;
}
.castle-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .8125rem;
  color: rgba(255,255,255,.8);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  transition: background .15s ease;
}
.castle-dropdown-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.castle-dropdown-section {
  font-size: .625rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: 6px 12px 4px;
}

/* --- Battle Log --- */
.castle-log {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,.08);
  max-height: 180px;
  overflow-y: auto;
  padding: 12px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.castle-log::-webkit-scrollbar {
  width: 4px;
}
.castle-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 2px;
}
.castle-log-header {
  font-family: var(--font-mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  margin-bottom: 8px;
}
.castle-log-entry {
  font-size: .8125rem;
  padding: 4px 0;
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.castle-log-entry .log-icon {
  flex-shrink: 0;
  opacity: .6;
}
.castle-log-entry .log-team {
  font-weight: 600;
}
.castle-log-entry.log-attack { color: rgba(255,107,74,.9); }
.castle-log-entry.log-setup { color: rgba(0,201,167,.9); }
.castle-log-entry.log-check { color: rgba(245,166,35,.9); }
.castle-log-entry.log-win { color: #fff; font-weight: 600; }

/* --- Victory Overlay --- */
.castle-victory {
  position: absolute;
  inset: 0;
  background: rgba(26,29,43,.92);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  z-index: 20;
}
.castle-victory.active {
  display: flex;
}
.castle-victory-shield {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 20px;
  animation: victoryPulse 1.5s ease infinite;
}
@keyframes victoryPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.2); }
  50% { box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}
.castle-victory h3 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: #fff;
}
.castle-victory p {
  color: rgba(255,255,255,.6);
  margin-bottom: 24px;
  max-width: 400px;
}
.castle-victory .btn { margin: 6px; }

/* Confetti burst */
.castle-confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2.5s ease forwards;
  pointer-events: none;
  z-index: 19;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .castle-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .castle-game.active {
    grid-template-columns: 1fr;
  }
  .castle-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .castle-map {
    padding: 24px 16px;
    min-height: 340px;
  }
  .castle-map-inner {
    width: 280px;
    height: 300px;
  }
  .castle-base {
    width: 100px;
    padding: 10px 8px;
  }
  .castle-actions {
    padding: 12px 16px;
  }
  .castle-log {
    padding: 12px 16px;
    max-height: 140px;
  }
}
@media (max-width: 480px) {
  .castle-team-select { padding: 32px 20px; }
  .castle-team-grid { gap: 10px; }
  .castle-map-inner {
    width: 240px;
    height: 260px;
  }
  .castle-base {
    width: 88px;
    padding: 8px 6px;
  }
  .castle-base-name { font-size: .5625rem; }
  .castle-pip { width: 7px; height: 7px; }
  .castle-actions { gap: 8px; }
  .castle-action-btn { padding: 8px 14px; font-size: .75rem; }
}

/* View Transitions API */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
}
