/* ============================================================
   HelloCharge Website — Theme & Foundation
   Built on the HelloCharge Design System (green-on-black).
   Two themes: dark (electric green / near-black) + light (peach-white).
   ============================================================ */

/* ---------- Brand constants (theme-independent) ---------- */
:root {
  --green:        #22C55E;
  --green-glow:   #4ADE80;
  --green-deep:   #16A34A;
  --green-logo:   #51FF7D;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 10px;  --r-md: 16px;  --r-lg: 22px;  --r-xl: 28px;  --r-pill: 999px;

  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1240px;
  --nav-h: 76px;
}

/* ---------- DARK THEME ---------- */
[data-theme="dark"] {
  --bg:            #0A0A0A;
  --bg-elevated:   #0E0F0E;
  --bg-section:    #0C0D0C;
  --surface:       #141514;
  --surface-2:     #1B1D1B;
  --surface-hover: #202220;
  --border:        #262826;
  --border-strong: #343734;
  --ink:           #FFFFFF;
  --ink-2:         rgba(255,255,255,0.72);
  --ink-3:         rgba(255,255,255,0.50);
  --ink-4:         rgba(255,255,255,0.34);
  --accent:        #22C55E;
  --accent-ink:    #22C55E;       /* green text that needs contrast */
  --accent-soft:   rgba(34,197,94,0.12);
  --accent-line:   rgba(34,197,94,0.30);
  --on-accent:     #06210F;
  --glow:          0 0 0 1px rgba(34,197,94,0.25), 0 10px 40px rgba(34,197,94,0.28);
  --glow-soft:     0 8px 30px rgba(34,197,94,0.18);
  --shadow-card:   0 18px 50px -20px rgba(0,0,0,0.8);
  --shadow-lift:   0 30px 70px -28px rgba(0,0,0,0.9);
  --hero-aura:     radial-gradient(70% 90% at 78% -8%, rgba(34,197,94,0.20) 0%, rgba(34,197,94,0.05) 32%, transparent 62%);
  --grid-line:     rgba(255,255,255,0.035);
  --img-frame:     rgba(255,255,255,0.08);
  color-scheme: dark;
}

/* ---------- LIGHT THEME (peach-white) ---------- */
[data-theme="light"] {
  --bg:            #FAF5EE;
  --bg-elevated:   #FFFDFA;
  --bg-section:    #F4ECE1;
  --surface:       #FFFFFF;
  --surface-2:     #FBF5EC;
  --surface-hover: #F6EFE4;
  --border:        #EADFD0;
  --border-strong: #DFD1BD;
  --ink:           #15120D;
  --ink-2:         #57514733;
  --ink-2:         rgba(28,24,18,0.72);
  --ink-3:         rgba(28,24,18,0.52);
  --ink-4:         rgba(28,24,18,0.34);
  --accent:        #16A34A;
  --accent-ink:    #15803D;
  --accent-soft:   rgba(22,163,74,0.10);
  --accent-line:   rgba(22,163,74,0.28);
  --on-accent:     #FFFFFF;
  --glow:          0 0 0 1px rgba(22,163,74,0.18), 0 16px 40px -12px rgba(22,163,74,0.30);
  --glow-soft:     0 14px 34px -16px rgba(22,163,74,0.22);
  --shadow-card:   0 22px 50px -28px rgba(70,50,20,0.30);
  --shadow-lift:   0 34px 70px -30px rgba(70,50,20,0.34);
  --hero-aura:     radial-gradient(70% 90% at 80% -10%, rgba(34,197,94,0.18) 0%, rgba(34,197,94,0.05) 34%, transparent 64%);
  --grid-line:     rgba(20,15,8,0.04);
  --img-frame:     rgba(20,15,8,0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html.anim body { transition: background 0.5s var(--ease), color 0.5s var(--ease); }

::selection { background: var(--green); color: #06210F; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }
.section { position: relative; padding: 120px 0; }
.section.tight { padding: 88px 0; }
.section--alt { background: var(--bg-section); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before {
  content: ""; width: 40px; height: 15px; display: inline-block; flex: 0 0 auto;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cline x1='1' y1='8' x2='21' y2='8' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Crect x='20.5' y='3.4' width='11' height='9.2' rx='2' fill='%23000'/%3E%3Cline x1='31.5' y1='6' x2='38' y2='6' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3Cline x1='31.5' y1='10' x2='38' y2='10' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cline x1='1' y1='8' x2='21' y2='8' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Crect x='20.5' y='3.4' width='11' height='9.2' rx='2' fill='%23000'/%3E%3Cline x1='31.5' y1='6' x2='38' y2='6' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3Cline x1='31.5' y1='10' x2='38' y2='10' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.eyebrow.center::before { display: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.04; }
.h-display { font-size: clamp(44px, 6.4vw, 92px); letter-spacing: -0.035em; line-height: 0.98; }
.h1 { font-size: clamp(38px, 4.6vw, 66px); }
.h2 { font-size: clamp(30px, 3.4vw, 48px); }
.h3 { font-size: clamp(21px, 1.7vw, 27px); }
.lead { font-size: clamp(16px, 1.15vw, 19px); line-height: 1.62; color: var(--ink-2); font-weight: 400; }
.muted { color: var(--ink-3); }
.text-grad {
  background: linear-gradient(102deg, var(--green) 0%, var(--green-glow) 60%, var(--green) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15px; border-radius: var(--r-pill);
  padding: 14px 26px; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease), background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green); color: var(--on-accent); box-shadow: var(--glow-soft); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border-strong); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { transform: translateY(-3px); background: var(--accent); color: var(--on-accent); }
.btn .arrow { transition: transform .35s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); transition: transform .45s var(--ease-out), border-color .4s, box-shadow .45s, background .4s;
}
.card.hoverable:hover { transform: translateY(-8px); border-color: var(--accent-line); box-shadow: var(--shadow-lift); }

/* spotlight glow that follows cursor */
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
  transition: opacity .4s; pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo img { width: 38px; height: 38px; }
.logo .word { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo .word b { color: var(--accent-ink); font-weight: 700; }
[data-theme="light"] .logo img { filter: brightness(0.78) saturate(1.3); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s, border-color .4s, backdrop-filter .4s, box-shadow .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 26px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-link {
  position: relative; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 15px; border-radius: var(--r-pill); transition: color .25s, background .25s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--accent-ink); }
.nav-link.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); border: 1px solid var(--border); background: var(--surface);
  transition: color .25s, border-color .25s, transform .3s, background .25s;
}
.icon-btn:hover { color: var(--accent-ink); border-color: var(--accent-line); transform: translateY(-2px); }
.icon-btn svg { width: 18px; height: 18px; }

.switch-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700;
  color: var(--accent-ink); border: 1.4px solid var(--accent-line); background: var(--accent-soft);
  padding: 9px 16px; border-radius: var(--r-pill);
  transition: transform .3s var(--ease-out), background .3s, box-shadow .3s;
}
.switch-pill:hover { transform: translateY(-2px); box-shadow: var(--glow-soft); }
.switch-pill svg { width: 15px; height: 15px; }

.dl-mini { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); }
.dl-mini span { font-size: 13px; font-weight: 600; }
.dl-mini a { color: var(--ink-2); display: inline-flex; transition: color .25s, transform .25s; }
.dl-mini a:hover { color: var(--accent-ink); transform: translateY(-2px); }
.dl-mini svg { width: 17px; height: 17px; }

/* ---------- Mobile burger + menu ---------- */
.nav-burger {
  display: none; position: relative; width: 44px; height: 44px; margin-left: auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: border-color .25s, background .25s;
}
.nav-burger span {
  display: block; width: 19px; height: 2px; border-radius: 2px; background: var(--ink);
  transition: transform .3s var(--ease-out), opacity .2s;
}
.nav-burger.open { border-color: var(--accent-line); }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; z-index: 99; pointer-events: none; visibility: hidden; }
.mobile-menu.open { pointer-events: auto; visibility: visible; }
.mm-backdrop {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s;
}
.mobile-menu.open .mm-backdrop { opacity: 1; }
.mm-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(360px, 86vw);
  background: var(--bg); border-left: 1px solid var(--border);
  padding: calc(var(--nav-h) + 18px) 26px 30px; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s var(--ease-out);
  overflow-y: auto; box-shadow: -24px 0 60px -20px rgba(0,0,0,.5);
}
.mobile-menu.open .mm-panel { transform: translateX(0); }
.mm-links { display: flex; flex-direction: column; gap: 2px; }
.mm-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; font-size: 19px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--border); cursor: pointer; transition: color .2s, padding .25s var(--ease-out);
}
.mm-link svg { width: 18px; height: 18px; color: var(--ink-3); opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s, color .2s; }
.mm-link:hover, .mm-link.active { color: var(--accent-ink); padding-left: 10px; }
.mm-link:hover svg, .mm-link.active svg { opacity: 1; transform: translateX(0); color: var(--accent-ink); }
.mm-foot { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.mm-switch { justify-content: center; padding: 14px 18px; font-size: 15px; border-radius: var(--r-pill); }
.mm-store { display: flex; align-items: center; gap: 12px; color: var(--ink-3); }
.mm-store span { font-size: 14px; font-weight: 600; margin-right: auto; }
.mm-store a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); transition: border-color .25s, color .25s;
}
.mm-store a:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.mm-theme {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  background: none; border: none; padding: 4px; transition: color .2s;
}
.mm-theme:hover { color: var(--accent-ink); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 1; transform: none; }
/* Hidden-start + reveal animation enabled ONLY when the timeline is confirmed live (html.anim). */
html.anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); will-change: opacity, transform; }
html.anim .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  html.anim .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html.anim .fade-swap { animation: none; }
  html { scroll-behavior: auto; }
}
/* Stall fail-safe: force everything visible instantly, no transitions to freeze. */
html.shown .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html.shown .fade-swap { animation: none !important; opacity: 1 !important; }
html.shown .rotor .in, html.shown .rotor .out { animation: none !important; }
html.shown body { transition: none !important; }

/* ---------- Decorative background pieces ---------- */
.aura { position: absolute; inset: 0; background: var(--hero-aura); pointer-events: none; z-index: 0; }
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(75% 70% at 50% 0%, #000 30%, transparent 80%);
  mask-image: radial-gradient(75% 70% at 50% 0%, #000 30%, transparent 80%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; z-index: 0; }

/* ---------- Image frame ---------- */
.img-frame {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--img-frame); box-shadow: var(--shadow-card);
  background: var(--surface);
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Pills / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700;
  padding: 11px 18px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); transition: transform .3s var(--ease-out), border-color .3s, background .3s, color .3s;
}
.chip:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.chip .ic-dot { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.chip .ic-dot svg { width: 16px; height: 16px; }

/* ---------- Floating glass stat chips ---------- */
.fchip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: 13px 17px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.fchip .fi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.fchip .fi svg { width: 19px; height: 19px; }
.fchip .ft { font-size: 17px; font-weight: 800; line-height: 1; white-space: nowrap; }
.fchip .fl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 3px; white-space: nowrap; }

/* ---------- Stat strip ---------- */
.stat-num { font-size: clamp(40px, 4.6vw, 62px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.stat-num .text-grad, .stat-num.text-grad { display: inline-block; }
.stat-label { font-size: 14.5px; color: var(--ink-3); font-weight: 600; margin-top: 12px; }

/* ---------- Accordion ---------- */
.acc-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; transition: border-color .3s, background .3s; }
.acc-item.open { border-color: var(--accent-line); }
.acc-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; text-align: left; padding: 22px 24px; font-size: 16.5px; font-weight: 700; }
.acc-q .acc-ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); transition: transform .4s var(--ease), background .3s, color .3s; }
.acc-item.open .acc-q .acc-ic { transform: rotate(45deg); background: var(--accent); color: var(--on-accent); }
.acc-a { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.acc-a-inner { padding: 0 24px 24px; color: var(--ink-2); line-height: 1.6; font-size: 15px; }

/* ---------- Forms ---------- */
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 9px; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface-2); border: 1.4px solid var(--border); border-radius: var(--r-md);
  padding: 15px 17px; transition: border-color .25s, box-shadow .25s, background .25s; outline: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 22px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.partner {
  flex: 0 0 auto; width: 188px; height: 116px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  color: var(--ink-2); transition: transform .35s var(--ease-out), border-color .3s, color .3s;
}
.partner:hover { transform: translateY(-5px); border-color: var(--accent-line); }
.partner img { max-width: 122px; max-height: 50px; width: auto; height: auto; object-fit: contain; opacity: .58; transition: opacity .3s var(--ease-out); }
.partner:hover img { opacity: 1; }

/* ---------- Toggle (mode/theme) micro ---------- */
.fade-swap { }
html.anim .fade-swap { animation: fadeUp .55s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Misc utilities ---------- */
.grid { display: grid; gap: 22px; }
.flex { display: flex; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); border: none; margin: 0; }

/* word rotator */
.rotor { position: relative; display: inline-grid; vertical-align: bottom; overflow: hidden; }
.rotor > span { grid-area: 1 / 1; color: var(--accent-ink); }
.rotor .out { }
.rotor .in { }
html.anim .rotor .out { animation: rotorOut .5s var(--ease) forwards; }
html.anim .rotor .in { animation: rotorIn .5s var(--ease) forwards; }
@keyframes rotorIn { from { transform: translateY(92%) rotate(3deg); } to { transform: none; } }
@keyframes rotorOut { from { transform: none; } to { transform: translateY(-92%) rotate(-3deg); } }

/* pulse pin */
@keyframes pinPulse { 0% { transform: scale(.7); opacity: .9; } 70% { transform: scale(2.6); opacity: 0; } 100% { opacity: 0; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* responsive */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .nav-burger { display: flex; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 22px; }
  .section { padding: 84px 0; }
  .dl-mini { display: none; }
}
