@import "tailwindcss";

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.woff2") format("woff2-variations"),
       url("fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Polygin Store — shared stylesheet
   Dark is the default (per Mithtech brand). Light activates via [data-theme="light"] on <html>.
   Primary accent #00AAFF (Mithtech blue). Secondary accent #25D366 (WhatsApp green)
   used sparingly on WhatsApp-specific cues. */

:root,
[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #111111;
  --text: #ffffff;
  --text-dim: #e4e4e7;
  --muted: #9b9b9b;
  --muted-2: #777777;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --card-bg: #111111;
  --card-featured-bg: #0b0b0b;
  --grid-line: rgba(255, 255, 255, 0.04);
  --accent: #00aaff;
  --accent-on: #000000;
  --accent-soft: rgba(0, 170, 255, 0.1);
  --accent-border: rgba(0, 170, 255, 0.35);
  --wa: #25d366;
  --wa-soft: rgba(37, 211, 102, 0.12);
  --wa-border: rgba(37, 211, 102, 0.4);
  --shadow-featured: 0 0 0 1px rgba(0, 170, 255, 0.1), 0 30px 60px -30px rgba(0, 170, 255, 0.35);
  --input-bg: #000000;
  --input-border: rgba(255, 255, 255, 0.12);
  --select-chev: #777777;
  --header-bg: rgba(0, 0, 0, 0.72);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --surface: #f5f5f5;
  --text: #000000;
  --text-dim: #1a1a1a;
  --muted: #4a4a4a;
  --muted-2: #6b6b6b;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --card-bg: #ffffff;
  --card-featured-bg: #ffffff;
  --grid-line: rgba(0, 0, 0, 0.05);
  --accent: #0085cc;
  --accent-on: #ffffff;
  --accent-soft: rgba(0, 133, 204, 0.08);
  --accent-border: rgba(0, 133, 204, 0.35);
  --wa: #128c7e;
  --wa-soft: rgba(18, 140, 126, 0.1);
  --wa-border: rgba(18, 140, 126, 0.4);
  --shadow-featured: 0 0 0 1px rgba(0, 133, 204, 0.12), 0 30px 60px -30px rgba(0, 133, 204, 0.4);
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.15);
  --select-chev: #6b6b6b;
  --header-bg: rgba(255, 255, 255, 0.78);
}

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

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.bg-page { background: var(--bg); }
.bg-surface { background: var(--surface); }
.text-page { color: var(--text); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--muted-2); }
.text-accent { color: var(--accent); }
.text-wa { color: var(--wa); }
.bg-accent { background: var(--accent); }
.bg-accent-soft { background: var(--accent-soft); }
.bg-wa-soft { background: var(--wa-soft); }

.hairline { border-color: var(--border) !important; }
.border-default { border-color: var(--border); }

.header-blur {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card-featured {
  background: var(--card-featured-bg);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-featured);
  border-radius: 12px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-wa {
  background: var(--wa);
  color: #fff;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-wa:hover { filter: brightness(1.08); }
.btn-wa:active { transform: translateY(1px); }

a.link { color: var(--accent); text-decoration: none; }
a.link:hover { text-decoration: underline; }
a.nav-link { color: var(--muted-2); transition: color 0.15s; }
a.nav-link:hover { color: var(--text); }
a.nav-link.active { color: var(--text); }

.grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 80%);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: 999px;
}
.chip.on { color: var(--accent); border-color: var(--accent-border); }
.chip.wa { color: var(--wa); border-color: var(--wa-border); }

.tick { color: var(--accent); flex-shrink: 0; margin-right: 10px; margin-top: 4px; }
.check { color: var(--accent); }

.billing-toggle button {
  color: var(--muted-2);
  padding: 8px 20px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  font: inherit;
  font-size: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.billing-toggle button.active {
  background: var(--accent);
  color: var(--accent-on);
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--select-chev) 50%),
    linear-gradient(135deg, var(--select-chev) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
::placeholder { color: var(--muted-2); opacity: 0.6; }

details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] .chev { transform: rotate(45deg); }
.chev { transition: transform 0.2s; color: var(--accent); font-size: 1.25rem; line-height: 1; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.logo-mark {
  width: 28px;
  height: 28px;
  color: var(--text);
  flex-shrink: 0;
}

.border-b, .border-t, .border-y, .border { border-color: var(--border); }

.badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.tile-grid > * { background: var(--bg); padding: 1.5rem; }

html { scroll-behavior: smooth; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-on); padding: 8px 12px; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* WhatsApp message bubble preview used in hero */
.chat-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.chat-mock .bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  max-width: 85%;
  line-height: 1.5;
}
.chat-mock .bubble.theirs {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-mock .bubble.mine {
  background: var(--wa-soft);
  border: 1px solid var(--wa-border);
  color: var(--text);
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* Sticky bottom CTA bar (mobile-first) */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(120%);
  transition: transform 0.25s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta .label { font-size: 12px; color: var(--muted-2); flex: 1; line-height: 1.3; }
.sticky-cta .label strong { color: var(--text); font-weight: 600; display: block; font-size: 13px; }
.sticky-cta a { font-size: 13px; padding: 10px 14px; border-radius: 8px; white-space: nowrap; }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* Trust strip */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  font-size: 12px;
  color: var(--muted-2);
  align-items: center;
}
.trust-row .dot { width: 4px; height: 4px; border-radius: 999px; background: var(--wa); display: inline-block; margin-right: 8px; vertical-align: middle; }

/* Step cards (how-it-works) */
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600; font-size: 13px;
  border: 1px solid var(--accent-border);
}

/* Quote card */
.quote {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  position: relative;
}
.quote::before {
  content: "“";
  position: absolute;
  top: 6px; left: 16px;
  font-size: 56px; line-height: 1;
  color: var(--accent);
  opacity: 0.25;
  font-family: Georgia, serif;
}
.quote p { font-size: 15px; line-height: 1.55; }
.quote footer { margin-top: 14px; font-size: 12px; color: var(--muted-2); }
.quote footer strong { color: var(--text); font-weight: 600; }

/* Inline-on-hero signup bar */
.hero-cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 14px;
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}
.hero-cta-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-cta-card .row a { flex: 1 1 auto; text-align: center; padding: 12px 18px; border-radius: 10px; font-size: 14px; min-width: 180px; }
.hero-cta-card .meta { font-size: 11px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero-cta-card .meta span::before { content: "✓ "; color: var(--wa); }

/* Social-proof rating pill */
.rating-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--muted-2);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.rating-pill .stars { color: var(--accent); letter-spacing: 1px; }

/* ============================================================
 * GSAP / SVG sceneries
 * ============================================================ */

/* Hero scene container */
.scene {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 480px;
  margin-left: auto;
  width: 100%;
}
.scene svg.scene-bg-orbits {
  position: absolute;
  inset: -10% -10% -10% -10%;
  width: 120%;
  height: 120%;
  pointer-events: none;
  opacity: 0.55;
}
.scene .floater {
  position: absolute;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
  color: var(--accent);
  z-index: 2;
}
[data-theme="light"] .scene .floater { box-shadow: 0 14px 30px -14px rgba(0,0,0,0.18); }
.scene .floater.wa { color: var(--wa); }
.scene .floater svg { width: 28px; height: 28px; }
.scene .phone {
  position: absolute;
  inset: 4% 18% 4% 18%;
  background: linear-gradient(180deg, var(--surface), var(--bg));
  border: 1px solid var(--border-strong);
  border-radius: 36px;
  box-shadow: 0 30px 80px -30px rgba(0, 170, 255, 0.45), 0 6px 20px -6px rgba(0,0,0,0.45);
  overflow: hidden;
  z-index: 3;
}
.scene .phone::before {
  content: "";
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 22px;
  background: var(--bg);
  border-radius: 0 0 14px 14px;
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.scene .phone-inner {
  position: absolute;
  inset: 50px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene .phone-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.scene .phone-header .avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--wa-soft);
  display: grid; place-items: center;
  color: var(--wa);
}
.scene .phone-header .meta { font-size: 11px; line-height: 1.2; }
.scene .phone-header .meta b { display: block; color: var(--text); font-size: 12px; font-weight: 600; }
.scene .phone-header .meta span { color: var(--muted-2); font-size: 10px; }
.scene .phone-bubbles {
  flex: 1;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.scene .pb {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.45;
  max-width: 82%;
  opacity: 0;
}
.scene .pb.theirs {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.scene .pb.mine {
  background: var(--wa-soft);
  border: 1px solid var(--wa-border);
  color: var(--text);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.scene .pb.typing {
  display: inline-flex; gap: 4px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.scene .pb.typing span {
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--muted-2);
  display: inline-block;
}
.scene .ring {
  position: absolute;
  border: 2px solid var(--wa-border);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
}

/* Wave divider between sections */
.wave-divider {
  display: block;
  width: 100%;
  height: 60px;
  color: var(--border);
}
.wave-divider path { stroke: currentColor; stroke-width: 1.5; fill: none; }
.wave-divider .accent { stroke: var(--accent); stroke-width: 1.5; opacity: 0.7; }

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  color: var(--accent);
  flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-card .stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* Tile-grid icons */
.tile-grid > * .tile-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 8px;
  margin-bottom: 10px;
}
.tile-grid > * .tile-icon svg { width: 16px; height: 16px; }

/* Payment marquee (GSAP-driven) */
.pay-marquee {
  position: relative;
  overflow: hidden;
  margin: 0 -24px;
  padding: 12px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.pay-marquee-track {
  display: flex; gap: 14px;
  width: max-content;
  will-change: transform;
}
.pay-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted-2);
  background: var(--card-bg);
  white-space: nowrap;
}
.pay-pill .pp-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
}
.pay-pill .pp-dot.wa { background: var(--wa); }

/* Step section connector */
.steps-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  z-index: 2;
}
.step-illus {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
}
.step-illus svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.steps-connector {
  display: none;
  position: absolute;
  top: 75px; left: 16%; right: 16%;
  height: 2px;
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 768px) { .steps-connector { display: block; } }
.steps-connector svg { width: 100%; height: 100%; overflow: visible; }
.steps-connector path {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 4 6;
}

/* CTA blob background */
.cta-blob-wrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.cta-blob-wrap > .cta-blob-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}
.cta-blob-wrap > .cta-blob-svg path {
  filter: blur(60px);
}

/* Floating WhatsApp button */
.fab-wa {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 49;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 14px 40px -12px rgba(37,211,102,0.6);
  transform: scale(0);
}
.fab-wa svg { width: 26px; height: 26px; }
.fab-wa::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid var(--wa);
  opacity: 0.5;
}
@media (min-width: 900px) {
  .fab-wa { bottom: 24px; }
}
