/* ReelEsto — shared base: reset, common components (nav / buttons / cards /
   forms), keyframes, the .reveal system, the giant footer wordmark, and the
   prefers-reduced-motion block. Loaded by both pages, after tokens.css. */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--t1);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

::selection { background: var(--brand-soft); color: var(--t1); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--brand);
}

.accent { font-style: italic; color: var(--brand); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  --_bg: var(--fill); --_fg: var(--on-fill);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 26px;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  color: var(--_fg); background: var(--_bg);
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer;
  transition: transform .5s var(--snap), color .3s var(--ease);
}
.btn span { position: relative; z-index: 1; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--brand);
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--snap);
}
.btn:hover::before { transform: scaleX(1); }
.btn:hover { color: var(--fill); }
.btn:active { transform: scale(.97); }

.btn-ghost {
  --_bg: transparent; --_fg: var(--t1);
  border-color: var(--hair);
}
.btn-ghost:hover { color: var(--fill); }

/* Arrow that nudges on hover */
.btn .arrow { transition: transform .4s var(--snap); position: relative; z-index: 1; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Nav ----
   Scoped to the top-level nav (a direct child of <body>) so it never
   catches nested <nav> elements like the footer's link row. */
body > nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
  border-bottom: 1px solid transparent;
}
body > nav.nav-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--hair-soft);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 24px;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-brand); font-weight: 900;
  font-size: 21px; letter-spacing: -.02em;
  color: var(--t1); text-decoration: none;
}
.logo-mark { flex-shrink: 0; display: block; }
.nav-right { display: flex; align-items: center; gap: 8px; }

/* ---- Theme toggle + language switcher (pill controls) ---- */
.pill {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 4px;
  background: var(--bg-lift);
  border: 1px solid var(--hair);
  border-radius: 999px;
}
.theme-toggle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 999px;
  cursor: pointer; color: var(--t2);
  transition: color .3s var(--ease), background .3s var(--ease);
}
.theme-toggle:hover { color: var(--t1); background: var(--brand-soft); }
.theme-toggle svg { width: 17px; height: 17px; transition: transform .5s var(--snap); }
.theme-toggle:hover svg { transform: rotate(35deg); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-btn {
  min-width: 30px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--t3); cursor: pointer;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.lang-btn:hover { color: var(--t1); }
.lang-btn[aria-current="true"] { color: var(--fill); background: var(--brand); }

/* Tighten the header on phones. */
@media (max-width: 600px) {
  .nav-inner { height: 60px; padding: 0 16px; }
  .nav-right { gap: 6px; }
  .pill { height: 38px; }
}

/* ---- Cards / inputs (shared) ---- */
.card {
  background: var(--bg-lift);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  padding: 13px 15px;
  background: var(--bg-sunk);
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  color: var(--t1);
  font-family: var(--font-body); font-size: 15px;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input::placeholder { color: var(--t3); }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---- Reveal system ---- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .09s; }
.reveal-delay-2 { transition-delay: .18s; }
.reveal-delay-3 { transition-delay: .27s; }

/* JS-toggled cards (display:none -> block) can't use IntersectionObserver,
   so they fade in with their own class applied at show-time. */
.card-in { animation: cardIn .6s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Line-mask headline reveal — operates on the line box, script-agnostic */
.line-mask { display: block; overflow: hidden; }
.line-inner {
  display: block;
  transform: translateY(112%);
  animation: lineReveal .9s var(--ease) forwards;
}
@keyframes lineReveal { to { transform: translateY(0); } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes drawLine { from { stroke-dashoffset: var(--dash, 600); } to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: var(--gradient);
}

/* ---- Giant footer wordmark (LIFETIME-store style) ---- */
footer {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--hair);
  padding: 64px 24px 0;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: flex-end; justify-content: space-between;
}
.footer-meta { font-size: 13px; color: var(--t3); }
.footer-meta a { color: var(--t2); text-decoration: none; border-bottom: 1px solid var(--hair); transition: color .2s; }
.footer-meta a:hover { color: var(--brand); }
.footer-links { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.footer-links a { color: var(--t2); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--brand); }
.footer-wordmark {
  margin-top: 28px;
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: clamp(64px, 22vw, 340px);
  line-height: .82;
  letter-spacing: -.03em;
  text-align: center;
  color: var(--t1);
  white-space: nowrap;
  transform: translateY(20%);
  user-select: none;
}
.footer-wordmark .dot { color: var(--brand); }

/* ---- Language-gated Latin-only techniques ----
   Uppercase + heavy tracking break conjunct shaping in Indic scripts, and
   neither Baloo face ships a true italic (browser would synthesize a broken
   oblique), so turn both off for hi/ml. */
:is(html[lang="hi"], html[lang="ml"])
  :is(.eyebrow, .hero-eyebrow, .btn, .footer-links, .lang-btn,
      .stat-key, .compare-card h3, label, .reel-card-footer .name, .wa-btn) {
  text-transform: none;
  letter-spacing: normal;
}
html[lang="hi"] .accent, html[lang="ml"] .accent { font-style: normal; font-weight: 800; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .line-inner, .card-in { opacity: 1 !important; transform: none !important; }
}
