/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light theme (default) */
  --bg:          #F8FAF9;
  --bg-sec:      #EFF4F1;
  --text:        #1A1A2E;
  --text-sec:    rgba(26, 26, 46, 0.62);
  --text-ter:    rgba(26, 26, 46, 0.35);
  --accent:      #3EB489;
  --accent-h:    #35A07A;
  --accent2:     #9F7AEA;
  --grad:        linear-gradient(135deg, #3EB489 0%, #9F7AEA 100%);
  --grad-text:   linear-gradient(90deg, #3EB489 0%, #9F7AEA 100%);
  --accent-bg:   rgba(62, 180, 137, 0.08);
  --error:       #D94F4F;
  --surface:     rgba(255, 255, 255, 0.85);
  --border:      rgba(26, 26, 46, 0.1);
  --shadow:      0 4px 32px rgba(26, 26, 46, 0.08);
  --shadow-lg:   0 8px 48px rgba(26, 26, 46, 0.12);
  --pad-x:       20px;
  --radius:      16px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --dur:         0.28s;
}

@media (min-width: 768px)  { :root { --pad-x: 40px; } }
@media (min-width: 1100px) { :root { --pad-x: 80px; } }

/* Dark theme */
[data-theme="dark"] {
  --bg:        #1B1B2F;
  --bg-sec:    #151525;
  --text:      #ECEEFF;
  --text-sec:  rgba(236, 238, 255, 0.60);
  --text-ter:  rgba(236, 238, 255, 0.30);
  --surface:   rgba(255, 255, 255, 0.05);
  --border:    rgba(255, 255, 255, 0.09);
  --shadow:    0 4px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.45);
  --accent-bg: rgba(62, 180, 137, 0.1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* ── Gradient text utility ─────────────────────────────────── */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Aurora canvas background ──────────────────────────────── */
#aurora-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ── Layout helpers ─────────────────────────────────────────── */
section { position: relative; z-index: 1; }

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px var(--pad-x);
}

.section-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
  display: inline-block;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-headline {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 56px;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(248, 250, 249, 0.82);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

[data-theme="dark"] .site-header {
  background: rgba(27, 27, 47, 0.88);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-leaf {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-sec);
  backdrop-filter: blur(8px);
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.theme-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── HERO ────────────────────────────────────────────────────── */
#hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: 64px;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px var(--pad-x) 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hero-headline {
  font-size: clamp(3rem, 10.5vw, 9rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: 28px;
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(50px) scale(0.94); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.hero-headline .grad-text {
  background: linear-gradient(90deg, #3EB489, #9F7AEA, #64FFDA, #9F7AEA, #3EB489);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 7s linear infinite;
}

@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  color: var(--text-sec);
  max-width: 540px;
  margin-bottom: 40px;
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.25s;
}

/* CTA button */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 38px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 28px rgba(62, 180, 137, 0.28);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              filter var(--dur) var(--ease);
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.4s;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(62, 180, 137, 0.38);
  filter: brightness(1.06);
}

.cta-btn:active { transform: scale(0.96); }
.cta-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Toast */
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(18px);
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 100px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Scroll arrow */
.scroll-arrow {
  margin-top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-ter);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: arrowBounce 2.2s ease-in-out infinite;
}

.scroll-arrow svg { width: 20px; height: 20px; }

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(9px); }
}

@media (prefers-reduced-motion: reduce) { .scroll-arrow { animation: none; } }

/* ── STATS ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 44px rgba(62, 180, 137, 0.14);
  border-color: rgba(62, 180, 137, 0.3);
}

.stat-number {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 16px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-text {
  font-size: 0.95rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 12px;
}

.stat-source { font-size: 0.72rem; color: var(--text-ter); }

/* ── DEMO ───────────────────────────────────────────────────── */
#demo .section-headline { margin-bottom: 8px; }

.demo-sub {
  color: var(--text-sec);
  font-size: 1.05rem;
  margin-bottom: 48px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 479px) {
  .demo-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 16px;
    margin: 0 calc(-1 * var(--pad-x));
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
    scrollbar-width: none;
  }
  .demo-grid::-webkit-scrollbar { display: none; }
  .demo-grid .demo-card {
    flex: 0 0 78vw;
    scroll-snap-align: start;
  }
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform 0.18s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}

.card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.demo-card.active { cursor: pointer; }

.demo-card.active:hover {
  border-color: rgba(62, 180, 137, 0.5);
  box-shadow: 0 6px 28px rgba(62, 180, 137, 0.13);
}

.demo-card.inactive { opacity: 0.38; pointer-events: none; }

.card-header {
  padding: 28px 28px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  user-select: none;
}

.card-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }

.card-title-wrap { flex: 1; }

.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.card-sub   { font-size: 0.85rem; color: var(--text-sec); }

.card-badge {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--border);
  color: var(--text-ter);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-chevron {
  width: 18px; height: 18px;
  color: var(--text-ter);
  flex-shrink: 0;
  align-self: center;
  transition: transform 0.3s var(--ease);
}

.demo-card.active[aria-expanded="true"] .card-chevron {
  transform: rotate(180deg);
}

.card-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.38s var(--ease), opacity 0.3s var(--ease);
}

.card-body.open { max-height: 540px; opacity: 1; }

.card-body-inner {
  padding: 24px 28px 28px;
  border-top: 1px solid var(--border);
}

/* PIN form */
.pin-form { display: flex; flex-direction: column; gap: 12px; }

.pin-label {
  font-size: 0.82rem;
  color: var(--text-sec);
  margin-bottom: 4px;
  display: block;
}

.pin-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(26, 26, 46, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

[data-theme="dark"] .pin-input { background: rgba(255, 255, 255, 0.06); }

.pin-input:focus { border-color: var(--accent); }
.pin-input::placeholder { color: var(--text-ter); }

.pin-btn {
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 14px rgba(62, 180, 137, 0.22);
  transition: transform var(--dur) var(--ease),
              filter var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.pin-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 24px rgba(62, 180, 137, 0.32);
  transform: translateY(-1px);
}

.pin-btn:active { transform: scale(0.96); }

.pin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* PIN result */
.pin-result { display: none; text-align: center; }
.pin-result.visible { display: block; }

.pin-digits {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.pin-digit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 72px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 14px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  box-shadow: var(--shadow);
  animation: pinPop 0.25s var(--ease) both;
}

.pin-digit:nth-child(1) { animation-delay: 0.00s; }
.pin-digit:nth-child(2) { animation-delay: 0.06s; }
.pin-digit:nth-child(3) { animation-delay: 0.12s; margin-left: 8px; }
.pin-digit:nth-child(4) { animation-delay: 0.18s; }

@keyframes pinPop {
  from { opacity: 0; transform: translateY(6px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.pin-instructions {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 20px;
}

.pin-instructions strong {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.pin-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 100px;
  text-decoration: none;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.pin-call-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

.pin-error {
  font-size: 0.84rem;
  color: var(--error);
  display: none;
  margin-top: 2px;
}

.pin-error.visible { display: block; }

/* Sound wave (hero) */
.sound-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 44px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.sound-wave .bar {
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.65;
  animation: wavePulse 1.5s ease-in-out infinite;
}

.sound-wave .bar:nth-child(1) { height: 10px; animation-delay: 0.00s; }
.sound-wave .bar:nth-child(2) { height: 20px; animation-delay: 0.12s; }
.sound-wave .bar:nth-child(3) { height: 30px; animation-delay: 0.24s; }
.sound-wave .bar:nth-child(4) { height: 38px; animation-delay: 0.12s; }
.sound-wave .bar:nth-child(5) { height: 44px; animation-delay: 0.00s; }
.sound-wave .bar:nth-child(6) { height: 38px; animation-delay: 0.12s; }
.sound-wave .bar:nth-child(7) { height: 30px; animation-delay: 0.24s; }
.sound-wave .bar:nth-child(8) { height: 20px; animation-delay: 0.12s; }
.sound-wave .bar:nth-child(9) { height: 10px; animation-delay: 0.00s; }

@keyframes wavePulse {
  0%, 100% { transform: scaleY(0.3); opacity: 0.35; }
  50%       { transform: scaleY(1);   opacity: 0.75; }
}

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinRound 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}

.spinner.active { display: block; }

@keyframes spinRound { to { transform: rotate(360deg); } }

/* ── CONTACT SECTION ────────────────────────────────────────── */
.contact-sub {
  color: var(--text-sec);
  font-size: 1.02rem;
  margin-top: -44px;
  margin-bottom: 40px;
}

.contact-form-wrap { max-width: 600px; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }

.c-textarea,
.c-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.c-textarea {
  padding: 16px;
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

.c-input { padding: 14px 16px; }

.c-textarea:focus,
.c-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 180, 137, 0.12);
}

.c-textarea::placeholder,
.c-input::placeholder { color: var(--text-ter); }

.c-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 34px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(62, 180, 137, 0.24);
  transition: transform var(--dur) var(--ease),
              filter var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.c-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }

.c-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
  box-shadow: 0 10px 34px rgba(62, 180, 137, 0.34);
}

.c-btn:active { transform: scale(0.96); }

.c-error {
  font-size: 0.84rem;
  color: var(--error);
  display: none;
}

.c-error.visible { display: block; }

.c-confirm {
  display: none;
  background: var(--accent-bg);
  border: 1px solid rgba(62, 180, 137, 0.22);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-size: 0.95rem;
  color: var(--text-sec);
  line-height: 1.6;
}

.c-confirm.visible { display: block; }

.c-confirm strong {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 36px var(--pad-x);
  transition: border-color var(--dur) var(--ease);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

.footer-links a {
  color: var(--text-ter);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--dur) var(--ease);
}

.footer-links a:hover { color: var(--text-sec); }

.footer-copy { font-size: 0.8rem; color: var(--text-ter); }

/* ── SCROLL REVEAL ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.10s; }
.reveal-d2 { transition-delay: 0.20s; }
.reveal-d3 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
