/* =========================================================================
   PerfectAiStudio — marketing site
   Design system: dark cinematic, storytelling. Brand indigo→violet (matches
   the app). Type: Inter. Accessible (WCAG AA), reduced-motion aware.
   ========================================================================= */

:root {
  /* Brand */
  --indigo: #6366f1;
  --indigo-600: #4f46e5;
  --violet: #8b5cf6;
  --violet-700: #7c3aed;
  --pink: #ec4899;

  /* Surfaces (dark) */
  --bg: #0b0b12;
  --bg-elev: #12121c;
  --surface: #16161f;
  --surface-2: #1c1c28;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --fg: #f6f6fb;
  --fg-muted: #b4b4c6;
  --fg-dim: #8a8a9e;

  /* Accents */
  --ring: #8b5cf6;
  --grad: linear-gradient(120deg, var(--indigo) 0%, var(--violet) 55%, var(--pink) 110%);
  --grad-soft: linear-gradient(120deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.14));

  /* Scale */
  --maxw: 1160px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 20px 70px rgba(99, 102, 241, 0.28);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 800; }

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--indigo);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding: 96px 0; position: relative; }
.section--tight { padding: 64px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet);
  background: var(--grad-soft);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
}

.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 18px 0 14px; }
.section-head p { color: var(--fg-muted); font-size: 1.06rem; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 18, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(11, 11, 18, 0.9);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--fg-muted); font-weight: 500; font-size: 0.95rem; transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--fg); }

.nav-cta { display: flex; align-items: center; gap: 14px; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  color: var(--fg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.2s var(--ease);
  min-height: 46px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32); }
.btn-primary:hover { box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn svg { width: 19px; height: 19px; }

/* App Store badge */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  padding: 11px 20px 11px 18px;
  transition: transform 0.18s var(--ease), border-color 0.2s var(--ease), box-shadow 0.25s var(--ease);
  min-height: 56px;
}
.appstore-badge:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.4); box-shadow: 0 12px 34px rgba(0,0,0,0.5); }
.appstore-badge svg { width: 26px; height: 26px; flex: none; }
.appstore-badge .ab-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore-badge .ab-small { font-size: 0.68rem; color: #cfcfe0; letter-spacing: 0.02em; }
.appstore-badge .ab-big { font-size: 1.18rem; font-weight: 600; color: #fff; letter-spacing: -0.01em; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 84px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -20% 0 auto -10%;
  height: 700px;
  background: radial-gradient(60% 60% at 30% 20%, rgba(99, 102, 241, 0.35), transparent 70%),
    radial-gradient(50% 50% at 85% 10%, rgba(236, 72, 153, 0.22), transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  margin: 22px 0 20px;
  letter-spacing: -0.03em;
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--fg-muted); max-width: 33ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 34px; align-items: center; }
.hero-note { margin-top: 20px; color: var(--fg-dim); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.hero-note svg { width: 16px; height: 16px; color: var(--violet); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 8% 12%;
  background: var(--grad);
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
  border-radius: 50%;
}
.hero-visual img {
  position: relative;
  z-index: 1;
  max-height: 560px;
  width: auto;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
}

/* ---------- Trust strip ---------- */
.trust {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 34px 0;
}
.trust-item { display: flex; align-items: center; gap: 13px; }
.trust-item svg { width: 26px; height: 26px; color: var(--violet); flex: none; }
.trust-item b { display: block; font-size: 1rem; color: var(--fg); }
.trust-item span { font-size: 0.85rem; color: var(--fg-dim); }

/* ---------- Feature cards ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); }
.feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.feature-card:hover .feature-media img { transform: scale(1.05); }
.feature-body { padding: 22px 22px 26px; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 14px;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--violet); }
.feature-body h3 { font-size: 1.22rem; margin-bottom: 8px; }
.feature-body p { color: var(--fg-muted); font-size: 0.96rem; }

/* Large highlight card (span 2) */
.feature-card--wide { grid-column: span 2; }
@media (max-width: 900px) { .feature-card--wide { grid-column: span 1; } }

/* ---------- Capability cards (image-free sections) ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cap-card {
  display: flex;
  gap: 18px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cap-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.cap-card .feature-icon { margin-bottom: 0; flex: none; }
.cap-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.cap-card p { color: var(--fg-muted); font-size: 0.95rem; }
@media (max-width: 720px) { .cap-grid { grid-template-columns: 1fr; } }

/* Alternating band background helper */
.band { background: var(--bg-elev); border-block: 1px solid var(--border); }

/* ---------- App Store screenshot showcase ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 320px));
  gap: 28px;
  justify-content: center;
  align-items: start;
}
.shot { margin: 0; }
.shot img {
  width: 100%;
  height: auto;
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease);
}
.shot:hover img { transform: translateY(-6px); }
/* Lift the middle screenshot for a subtle staggered feel */
.shot:nth-child(2) { transform: translateY(-24px); }
@media (max-width: 760px) {
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .shot:nth-child(2) { transform: none; }
  .shot:nth-child(3) { display: none; }
}
@media (max-width: 460px) {
  .shots { grid-template-columns: minmax(0, 260px); }
  .shot:nth-child(3) { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .shot:nth-child(2) { transform: none; }
}

/* ---------- About ---------- */
.about-lead { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.about-lead p { color: var(--fg-muted); font-size: 1.12rem; line-height: 1.7; }

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.about-intro .eyebrow { margin-bottom: 16px; }
.about-intro h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 20px; }
.about-intro p { color: var(--fg-muted); font-size: 1.08rem; line-height: 1.75; margin-bottom: 28px; }
.about-intro .btn svg { width: 18px; height: 18px; }

.values-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.value {
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.value:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.value .feature-icon { margin-bottom: 16px; }
.value h3 { font-size: 1.08rem; margin-bottom: 8px; }
.value p { color: var(--fg-muted); font-size: 0.92rem; line-height: 1.6; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 460px) { .values-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ (native details/summary) ---------- */
.faq { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 12px; height: 12px;
  flex: none;
  border-right: 2px solid var(--fg-dim);
  border-bottom: 2px solid var(--fg-dim);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover { color: var(--violet); }
.faq-answer { padding: 0 24px 22px; }
.faq-answer p { color: var(--fg-muted); line-height: 1.7; }
.faq-answer a { color: var(--violet); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
}

/* Stat row */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 8px; }
.stat { text-align: center; padding: 20px; }
.stat b { display: block; font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; }
.stat span { color: var(--fg-dim); font-size: 0.95rem; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Split showcase ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split--reverse .split-media { order: 2; }
.split-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.split-text h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: 16px; }
.split-text p { color: var(--fg-muted); font-size: 1.05rem; margin-bottom: 22px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.checklist li { display: flex; align-items: flex-start; gap: 12px; color: var(--fg); }
.checklist svg { width: 22px; height: 22px; color: var(--violet); flex: none; margin-top: 1px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 26px; position: relative; }
.step-num {
  width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; margin-bottom: 16px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--fg-muted); font-size: 0.96rem; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
@media (max-width: 720px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; }
.cta-inner {
  position: relative;
  z-index: 1;
  background: var(--grad);
  border-radius: 32px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}
.cta-inner h2 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); color: #fff; margin-bottom: 14px; }
.cta-inner p { color: rgba(255, 255, 255, 0.9); font-size: 1.1rem; max-width: 46ch; margin: 0 auto 30px; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.cta-inner .appstore-badge { border-color: rgba(255,255,255,0.35); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 56px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand img { height: 30px; margin-bottom: 16px; }
.footer-brand p { color: var(--fg-dim); font-size: 0.92rem; max-width: 34ch; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-dim); margin: 0 0 16px; font-weight: 600; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.footer-col a { color: var(--fg-muted); font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--fg-dim);
  font-size: 0.86rem;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .feature-card, .appstore-badge { transition: none; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 820px; margin-inline: auto; padding: 56px 22px 90px; }
.legal-back { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-weight: 500; margin-bottom: 30px; }
.legal-back:hover { color: var(--fg); }
.legal-back svg { width: 18px; height: 18px; }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 8px; }
.legal .legal-meta { color: var(--fg-dim); font-size: 0.9rem; margin-bottom: 40px; }
.legal h2 {
  font-size: 1.3rem;
  margin: 40px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-weight: 700;
}
.legal h3 { font-size: 1.05rem; margin: 26px 0 10px; color: var(--fg); font-weight: 600; }
.legal p { color: var(--fg-muted); margin-bottom: 14px; }
.legal ul { color: var(--fg-muted); margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; }
.legal a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.legal strong { color: var(--fg); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-sub { max-width: 100%; }
  .hero-actions, .hero-note { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-visual img { max-height: 420px; }
  .split, .split--reverse .split-media { grid-template-columns: 1fr; order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .section { padding: 68px 0; }
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav-cta .btn-text-hide { display: none; }
  .features-grid, .steps, .trust-grid { grid-template-columns: 1fr; }
  .trust-grid { gap: 18px; }
  .cta-inner { padding: 44px 24px; }

  /* Mobile menu */
  .mobile-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px 22px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(11,11,18,0.97);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { padding: 13px 6px; color: var(--fg-muted); font-weight: 500; border-radius: 10px; }
  .mobile-menu a:hover { color: var(--fg); background: rgba(255,255,255,0.05); }
}

@media (min-width: 761px) { .mobile-menu { display: none; } }

@media (max-width: 460px) {
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn, .hero-actions .appstore-badge { width: 100%; }
}
