/* ============================================================
   Publy — landing page styles
   Design: dark premium, aurora background, glassmorphism,
   scroll reveals, animated accents.
   ============================================================ */

:root {
  --bg: #0a0a12;
  --bg-2: #0f0f1c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef0f6;
  --muted: #9aa0b4;
  --primary: #7c5cff;
  --primary-2: #3ea6ff;
  --accent: #ff6ec7;
  --grad: linear-gradient(110deg, #7c5cff 0%, #3ea6ff 50%, #ff6ec7 100%);
  --radius: 18px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }

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

code {
  font-family: "Space Grotesk", monospace;
  background: rgba(124, 92, 255, 0.16);
  color: #c9bdff;
  padding: 0.1em 0.45em;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ---------- Aurora background ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(1200px 800px at 70% -10%, #161636 0%, var(--bg) 60%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.blob-1 { width: 520px; height: 520px; background: #7c5cff; top: -120px; left: -80px; }
.blob-2 { width: 460px; height: 460px; background: #3ea6ff; top: 30%; right: -120px; animation-delay: -6s; }
.blob-3 { width: 420px; height: 420px; background: #ff6ec7; bottom: -140px; left: 30%; animation-delay: -12s; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(124, 92, 255, 0.7);
  animation: shimmer 6s ease infinite;
}
.btn-primary:hover { box-shadow: 0 18px 40px -10px rgba(124, 92, 255, 0.9); }
.btn-soft { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-soft:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.btn-block { width: 100%; }
.btn-lg { padding: 1em 2em; font-size: 1.05rem; }
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 18, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-color: var(--border); background: rgba(10, 10, 18, 0.8); }
.brand { font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; gap: 0.4em; }
.brand-mark { color: var(--primary); }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: color 0.18s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: 0; }
@media (max-width: 760px) { .nav-links { display: none; } .nav-cta { margin-left: auto; } }

/* ---------- Layout ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 3rem); max-width: var(--maxw); margin: 0 auto; }
.section-alt { max-width: none; background: linear-gradient(180deg, transparent, rgba(124,92,255,0.04), transparent); border-block: 1px solid var(--border); }
.section-alt > .section-head, .section-alt .steps, .section-alt .contact-form { max-width: var(--maxw); margin-inline: auto; }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary-2); margin-bottom: 0.7rem;
}
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; }
.section-lead { color: var(--muted); margin-top: 0.8rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem;
  align-items: center;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 3rem) 4rem;
  max-width: var(--maxw); margin: 0 auto;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.82rem; font-weight: 600;
  padding: 0.4em 0.9em; border-radius: 999px;
  background: rgba(124, 92, 255, 0.14); color: #c9bdff;
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.hero-title { font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.05; margin: 1.2rem 0 1rem; font-weight: 700; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.12rem; color: var(--muted); max-width: 520px; }
.hero-sub strong { color: var(--text); }
.hero-cta { display: flex; gap: 0.9rem; margin: 1.8rem 0 1.2rem; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 1.3rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.hero-meta span { color: #8fffc4; }

/* Hero mockup */
.hero-visual { perspective: 1200px; }
.mock {
  position: relative;
  background: linear-gradient(160deg, #15152a, #0d0d18);
  border: 1px solid var(--border);
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow);
  animation: tilt 9s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes tilt {
  0%,100% { transform: rotateY(-6deg) rotateX(3deg) translateY(0); }
  50%     { transform: rotateY(6deg) rotateX(-2deg) translateY(-10px); }
}
.mock-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 1rem; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.amber { background: #febc2e; } .dot.green { background: #28c840; }
.mock-url { margin-left: 0.8rem; font-size: 0.8rem; color: var(--muted); font-family: "Space Grotesk", monospace; }
.mock-body { padding: 2.2rem 1.8rem; text-align: center; }
.mock-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 0.9rem;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.3rem; color: #fff; font-family: "Space Grotesk";
}
.mock-body h3 { font-size: 1.3rem; }
.mock-role { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.2rem; }
.mock-links { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.4rem; }
.mock-link {
  display: block; padding: 0.6rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; transition: transform 0.18s, background 0.18s;
}
.mock-link:hover { transform: translateX(4px); background: var(--surface-2); }
.mock-cta {
  width: 100%; padding: 0.7rem; border-radius: 10px; border: none;
  background: var(--grad); color: #fff; font-weight: 600; cursor: pointer;
  transition: transform 0.18s;
}
.mock-cta:hover { transform: scale(1.02); }
.mock-float {
  position: absolute; padding: 0.5em 0.9em; border-radius: 999px;
  background: rgba(15,15,28,0.9); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; backdrop-filter: blur(6px);
  box-shadow: var(--shadow); white-space: nowrap;
}
.chip-1 { top: 18%; right: -8%; animation: bob 4s ease-in-out infinite; }
.chip-2 { bottom: 12%; left: -10%; animation: bob 4s ease-in-out infinite -2s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { max-width: 420px; }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); padding: 0.9rem 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; gap: 1.5rem; white-space: nowrap; animation: scroll 30s linear infinite; font-family: "Space Grotesk", monospace; color: var(--muted); font-size: 0.9rem; }
.marquee-track span:nth-child(odd) { color: #c9bdff; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem,5vw,3rem) 4rem; }
.stat { text-align: center; padding: 1.6rem 1rem; }
.stat-num { font-family: "Space Grotesk"; font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-unit { color: var(--muted); margin-left: 0.2em; font-size: 1rem; }
.stat-label { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }
@media (max-width: 680px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature { padding: 1.6rem; transition: transform 0.2s, border-color 0.2s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(124,92,255,0.4); }
.feature-ico { font-size: 1.8rem; display: block; margin-bottom: 0.8rem; }
.feature h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature p { color: var(--muted); font-size: 0.94rem; }
@media (max-width: 880px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; counter-reset: step; }
.step { padding: 1.8rem; position: relative; }
.step-num { font-family: "Space Grotesk"; font-size: 0.9rem; font-weight: 700; color: var(--primary-2); }
.step h3 { font-size: 1.15rem; margin: 0.6rem 0 0.5rem; }
.step p { color: var(--muted); font-size: 0.94rem; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Demo ---------- */
.demo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.demo-card {
  max-width: 380px; margin: 0 auto; padding: 0 1.6rem 1.8rem; text-align: center;
  background: linear-gradient(180deg, #14142a, #0e0e1a);
  border: 1px solid var(--border); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.3s;
}
.demo-card:hover { transform: translateY(-6px); }
.demo-cover { height: 90px; background: var(--grad); background-size: 200% 200%; animation: shimmer 8s ease infinite; }
.demo-avatar {
  width: 78px; height: 78px; border-radius: 50%; margin: -39px auto 0.8rem;
  background: #15152a; border: 3px solid #0e0e1a;
  display: flex; align-items: center; justify-content: center;
  font-family: "Space Grotesk"; font-weight: 700; font-size: 1.5rem; color: #c9bdff;
}
.demo-name { font-size: 1.4rem; }
.demo-role { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.8rem; }
.demo-bio { color: var(--text); font-size: 0.92rem; margin-bottom: 1rem; }
.demo-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.2rem; }
.demo-tags span { font-size: 0.78rem; color: var(--primary-2); background: rgba(62,166,255,0.12); padding: 0.2em 0.6em; border-radius: 999px; }
.demo-links { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.4rem; }
.demo-links a { padding: 0.55rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; transition: transform 0.18s, background 0.18s; }
.demo-links a:hover { transform: translateX(4px); background: var(--surface-2); }
.demo-cta { width: 100%; }
.demo-note h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.demo-note p { color: var(--muted); margin-bottom: 1rem; }
.demo-note .muted { font-size: 0.9rem; opacity: 0.8; }
@media (max-width: 880px) { .demo-wrap { grid-template-columns: 1fr; } .demo-note { text-align: center; } }

/* ---------- Contact form ---------- */
.contact-form { max-width: 560px; padding: 2rem; display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.field input, .field textarea {
  background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.9rem; color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.18s, box-shadow 0.18s; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.2);
}
.field input.invalid, .field textarea.invalid { border-color: #ff6b6b; }
.err { color: #ff8585; font-size: 0.8rem; min-height: 1em; }
.form-success {
  background: rgba(143,255,196,0.12); border: 1px solid rgba(143,255,196,0.3);
  color: #8fffc4; padding: 0.9rem 1rem; border-radius: 10px; font-size: 0.92rem;
  animation: pop 0.4s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ---------- Final CTA ---------- */
.final-cta { text-align: center; padding: clamp(4rem, 9vw, 7rem) 1rem; max-width: 720px; margin: 0 auto; }
.final-cta h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.15; margin-bottom: 1rem; }
.final-cta p { color: var(--muted); margin-bottom: 1.8rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 1rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.footer-brand { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-tag { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.footer-meta { display: flex; gap: 1.2rem; justify-content: center; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.footer-meta a { color: var(--primary-2); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.2,0.7,0.2,1), transform 0.7s cubic-bezier(0.2,0.7,0.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .mock, .blob, .chip-1, .chip-2, .marquee-track, .demo-cover { animation: none !important; }
  html { scroll-behavior: auto; }
}