/* ==========================================================================
   Spam Sweeper – Design System & Custom Styles
   Dark cyber-clean aesthetic with emerald glows & glassmorphism
   ========================================================================== */

:root {
  --bg: #0b0f19;
  --bg-elevated: #111827;
  --bg-panel: rgba(17, 24, 39, 0.55);
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.45);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(16, 185, 129, 0.35);
  --danger: #f87171;
  --gold: #fbbf24;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Sora", sans-serif;
  --nav-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(16, 185, 129, 0.35);
  color: #fff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.section-lead {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.125rem);
  max-width: 36rem;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   Atmosphere / Background
   -------------------------------------------------------------------------- */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 20%, rgba(16, 185, 129, 0.06), transparent 50%),
    radial-gradient(ellipse 35% 35% at 10% 60%, rgba(52, 211, 153, 0.05), transparent 50%),
    var(--bg);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Glass & Glow utilities
   -------------------------------------------------------------------------- */

.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

.glow-accent {
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.25),
    0 0 24px rgba(16, 185, 129, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Header / Nav
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s var(--ease-out), border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  z-index: 110;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  color: var(--accent-bright);
  flex-shrink: 0;
}

.logo-mark img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.logo-mark svg {
  width: 20px;
  height: 20px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1.35rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #04110c;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.4),
    0 0 28px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.5),
    0 0 40px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.btn-primary.pulse-glow {
  animation: pulse-glow 2.8s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(16, 185, 129, 0.4),
      0 0 24px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(52, 211, 153, 0.55),
      0 0 40px rgba(16, 185, 129, 0.55);
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.25);
}

.btn-nav {
  display: none;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
}

.nav-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  border-radius: 0.5rem;
  z-index: 110;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  padding: 0.75rem 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mobile-nav a:hover {
  color: var(--accent-bright);
}

.mobile-nav .btn {
  margin-top: 1.5rem;
  width: 100%;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }

  .btn-nav {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 70% 55%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(16, 185, 129, 0.06), transparent 55%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
  position: relative;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.5rem;
  }
}

.brand-hero {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 1.25rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(16, 185, 129, 0.25);
  animation: brand-in 0.9s var(--ease-out) both;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text);
  max-width: 28ch;
  animation: fade-up 0.8s 0.15s var(--ease-out) both;
}

.hero-sub {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  max-width: 36rem;
  margin: 0 0 2rem;
  animation: fade-up 0.8s 0.28s var(--ease-out) both;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  animation: fade-up 0.8s 0.4s var(--ease-out) both;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  animation: fade-up 0.8s 0.5s var(--ease-out) both;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.store-badge:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.store-badge svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-badge .tiny {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.store-badge .name {
  font-size: 0.85rem;
  font-weight: 600;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Phone Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  animation: fade-up 1s 0.35s var(--ease-out) both;
}

.phone {
  width: min(280px, 78vw);
  aspect-ratio: 9 / 19.2;
  border-radius: 2.25rem;
  padding: 10px;
  background: linear-gradient(160deg, #1e293b, #0f172a 40%, #0b1220);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.15),
    0 0 60px rgba(16, 185, 129, 0.18),
    0 40px 80px rgba(0, 0, 0, 0.55);
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #020617;
  border-radius: 1rem;
  z-index: 5;
}

.phone-screen {
  height: 100%;
  border-radius: 1.75rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(16, 185, 129, 0.2), transparent 55%),
    linear-gradient(180deg, #0d1424 0%, #0b0f19 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2.75rem 0.85rem 1rem;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.zen-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  align-self: flex-start;
  margin-bottom: 0.85rem;
}

.zen-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.inbox-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.inbox-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.mail-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  position: relative;
  min-height: 0;
}

.mail-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.7rem 0.75rem;
  transition: transform 0.55s var(--ease-out), opacity 0.55s, filter 0.55s;
  will-change: transform, opacity;
}

.mail-card.is-spam {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}

.mail-card.is-clean {
  border-color: rgba(16, 185, 129, 0.25);
}

.mail-card.swipe-out {
  transform: translateX(120%) rotate(8deg);
  opacity: 0;
  filter: blur(2px);
}

.mail-card .from {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mail-card .subject {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.35rem;
  border-radius: 0.25rem;
}

.mail-tag.spam {
  background: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

.mail-tag.ai {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-bright);
}

.phone-fab {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-top: 0.75rem;
}

.sweep-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #04110c;
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.45);
  animation: float-fab 3s ease-in-out infinite;
}

@keyframes float-fab {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.phone-glow {
  position: absolute;
  width: 180%;
  height: 60%;
  bottom: -20%;
  left: -40%;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.2), transparent 65%);
  pointer-events: none;
  z-index: -1;
}

/* --------------------------------------------------------------------------
   Audience Tabs
   -------------------------------------------------------------------------- */

.audience-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
}

.audience-tab {
  padding: 0.7rem 1.15rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease-out);
}

.audience-tab:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.25);
}

.audience-tab.is-active {
  color: #04110c;
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

.audience-panels {
  position: relative;
}

.audience-panel {
  display: none;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  animation: panel-in 0.4s var(--ease-out);
}

.audience-panel.is-active {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .audience-panel.is-active {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.audience-icon {
  width: 72px;
  height: 72px;
  border-radius: 1.15rem;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-bright);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.audience-icon svg {
  width: 32px;
  height: 32px;
}

.audience-panel h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.audience-panel p {
  margin: 0;
  color: var(--text-muted);
  max-width: 40rem;
}

/* --------------------------------------------------------------------------
   Features Grid
   -------------------------------------------------------------------------- */

.features-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .features-grid .feature:nth-child(4),
  .features-grid .feature:nth-child(5) {
    grid-column: span 1;
  }

  .features-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .features-grid .feature {
    grid-column: span 2;
  }

  .features-grid .feature:nth-child(4),
  .features-grid .feature:nth-child(5) {
    grid-column: span 3;
  }
}

.feature {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.12);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-bright);
  margin-bottom: 1rem;
  transition: box-shadow 0.3s;
}

.feature:hover .feature-icon {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Time Calculator
   -------------------------------------------------------------------------- */

.calculator {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  max-width: 640px;
}

.calc-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  gap: 1rem;
}

.calc-label span:first-child {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.calc-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-bright);
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--fill, 30%),
    rgba(148, 163, 184, 0.2) var(--fill, 30%),
    rgba(148, 163, 184, 0.2) 100%
  );
  outline: none;
  margin-bottom: 2rem;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  cursor: pointer;
}

.calc-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-stat {
  padding: 1.15rem;
  border-radius: var(--radius);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  text-align: center;
}

.calc-stat .num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--accent-bright);
  line-height: 1.1;
}

.calc-stat .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.calc-note {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.pricing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 2rem 0 2.5rem;
  flex-wrap: wrap;
}

.pricing-toggle-wrap span {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-toggle-wrap span.is-active {
  color: var(--text);
}

.save-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
  margin-left: 0.35rem;
}

.toggle {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.toggle.is-yearly {
  background: rgba(16, 185, 129, 0.35);
  border-color: rgba(16, 185, 129, 0.5);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease-out);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle.is-yearly .toggle-knob {
  transform: translateX(24px);
}

.pricing-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 840px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.price-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.price-card.is-featured {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 50px rgba(16, 185, 129, 0.15);
}

@media (min-width: 840px) {
  .price-card.is-featured {
    transform: scale(1.04);
    z-index: 1;
  }
}

.popular-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #04110c;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.price-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.5rem 0 0.75rem;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.price-amount .period {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
}

.price-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  min-height: 1.2em;
}

.price-features {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.price-features li svg {
  width: 16px;
  height: 16px;
  color: var(--accent-bright);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.price-card .btn {
  width: 100%;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-list {
  margin-top: 2.5rem;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.03);
}

.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-bright);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out);
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer-inner p {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.footer-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 28rem;
  margin: 0 0 1.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 2s ease-in-out infinite;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Modal (Live Demo)
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(520px, 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.35s var(--ease-out);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  padding-right: 2rem;
}

.modal > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.demo-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.demo-mail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: transform 0.5s var(--ease-out), opacity 0.5s, border-color 0.3s;
}

.demo-mail.swept {
  transform: translateX(40px);
  opacity: 0.35;
  border-color: rgba(16, 185, 129, 0.4);
}

.demo-mail .avatar {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.demo-mail .avatar.spam {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.demo-mail .avatar.ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-bright);
}

.demo-mail .meta {
  flex: 1;
  min-width: 0;
}

.demo-mail .meta strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

.demo-mail .meta span {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.demo-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */

[x-cloak] {
  display: none !important;
}

.back-to-top-wrap {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
}

.back-to-top {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-bright);
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.12),
    0 0 24px rgba(16, 185, 129, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.back-to-top:hover {
  transform: translateY(-2px);
  color: #fff;
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.3),
    0 0 36px rgba(16, 185, 129, 0.4),
    0 10px 28px rgba(0, 0, 0, 0.4);
}

.back-to-top:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
