/* ============================================
   WineVision Website — Design System & Styles
   ============================================ */

:root {
  --bg: #0a0a0f;
  --bg-surface: rgba(255, 255, 255, 0.05);
  --bg-surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --text-body: #a0a0b0;
  --text-muted: #6b7280;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --green: #22c55e;
  --red: #ef4444;
  --gradient: linear-gradient(135deg, var(--purple), var(--pink));
  --gradient-h: linear-gradient(90deg, var(--purple), var(--pink));
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --nav-height: 64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--pink); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit;
  border: none; outline: none; background: none;
}

/* Typography */
h1, h2, h3, h4 { color: var(--text); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- Navigation ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.nav-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--text-body); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 20px; border-radius: var(--radius-sm);
  background: var(--gradient); color: #fff !important;
  font-weight: 600; font-size: 0.85rem;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.9; color: #fff; }
.nav-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-mobile-toggle span {
  display: block; width: 20px; height: 2px; background: var(--text);
  margin: 5px 0; transition: all 0.3s;
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  text-align: center;
}
.hero h1 { margin-bottom: 20px; }
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 640px; margin: 0 auto 40px;
  color: var(--text-body);
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.2s;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }
.btn-outline {
  border: 1px solid var(--border); color: var(--text);
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  color: var(--text);
}
.hero-phone {
  margin: 60px auto 0;
  max-width: 320px;
  position: relative;
  isolation: isolate;
  perspective: 1400px;
}
.hero-phone::before {
  content: '';
  position: absolute;
  inset: -40px -60px;
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
/* iPhone body — titanium-like bezel, body aspect 71.5/149.6 mm */
.hero-screenshot {
  width: 100%;
  aspect-ratio: 71.5/149.6;
  border-radius: 56px;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  background:
    linear-gradient(145deg, #3a3a40 0%, #16161a 35%, #26262c 70%, #0c0c10 100%);
  box-shadow:
    0 40px 80px -20px rgba(139, 92, 246, 0.35),
    0 15px 40px -10px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 2px 1px rgba(255, 255, 255, 0.06),
    inset 0 -8px 24px -8px rgba(0, 0, 0, 0.6);
}
/* Dynamic Island */
.hero-screenshot::before {
  content: '';
  position: absolute;
  top: 2.4%;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  aspect-ratio: 3.1;
  background: #000;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* Bezel ring overlay — stacks above the carousel so sliding images never bleed into the phone frame */
.hero-screenshot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 11px;
  background: linear-gradient(145deg, #3a3a40 0%, #16161a 35%, #26262c 70%, #0c0c10 100%) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  /* Lift forward in 3D so preserve-3d on .hero-screenshot can't reorder us behind the carousel */
  transform: translateZ(1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.phone-carousel {
  position: absolute;
  inset: 11px;
  border-radius: 46px;
  overflow: hidden;
  background: #000;
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
  /* Force own compositor layer so transformed slides clip to border-radius in Safari */
  isolation: isolate;
  transform: translateZ(0);
  /* Hard clip — overflow:hidden alone leaks transformed children past rounded corners in Safari */
  clip-path: inset(0 round 46px);
}
/* Glass screen sheen — sits above slides, below dynamic island */
.phone-carousel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  background:
    linear-gradient(118deg,
      rgba(255, 255, 255, 0) 32%,
      rgba(255, 255, 255, 0.05) 44%,
      rgba(255, 255, 255, 0.09) 50%,
      rgba(255, 255, 255, 0.05) 56%,
      rgba(255, 255, 255, 0) 68%),
    radial-gradient(140% 90% at 15% 0%,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.035) 0%,
      rgba(255, 255, 255, 0) 22%);
  mix-blend-mode: screen;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
}
.carousel-slide.active {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.carousel-dot:hover { background: rgba(255, 255, 255, 0.35); }
.carousel-dot.active {
  width: 24px;
  background: var(--gradient-h);
}
.carousel-dot:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .carousel-slide { transition: none; }
}

/* ---- Section Common ---- */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header p { color: var(--text-body); margin-top: 12px; font-size: 1.1rem; }

/* ---- How It Works ---- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.step {
  text-align: center; padding: 40px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s;
}
.step:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
}
.step-number {
  width: 48px; height: 48px;
  border-radius: 50%; margin: 0 auto 20px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.2rem; color: #fff;
}
.step-icon { font-size: 2rem; margin-bottom: 16px; }
.step h3 { margin-bottom: 12px; }

/* ---- Features ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s;
}
.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }

/* Features — expandable list */
.features-more {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.features-more summary {
  padding: 16px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}
.features-more summary::-webkit-details-marker { display: none; }
.features-more summary::before {
  content: '▸';
  transition: transform 0.2s;
}
.features-more[open] summary::before {
  transform: rotate(90deg);
}
.features-more summary:hover { color: var(--text); }
.features-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 8px 24px 28px;
}
.features-more-col h4 {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.features-more-col ul {
  list-style: none;
}
.features-more-col li {
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-body);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.features-more-col li::before {
  content: '✓';
  color: var(--green);
  font-size: 0.8rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .features-more-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
.pricing-card {
  padding: 28px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}
.pricing-card.popular {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.08);
  transform: scale(1.02);
}
.pricing-card.popular:hover { transform: scale(1.02) translateY(-4px); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; border-radius: 20px;
  background: var(--gradient); color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  white-space: nowrap;
}
.pricing-tier { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pricing-price { font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pricing-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.pricing-features { text-align: left; margin-bottom: 24px; flex: 1; }
.pricing-features li {
  padding: 6px 0; font-size: 0.85rem;
  display: flex; align-items: flex-start; gap: 8px;
}
.pricing-features .check { color: var(--green); flex-shrink: 0; }
.pricing-features .x { color: var(--text-muted); flex-shrink: 0; }
.pricing-features .muted { color: var(--text-muted); }
.pricing-btn {
  display: block; width: 100%;
  padding: 10px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-surface);
}
.pricing-btn:hover { border-color: var(--border-hover); background: var(--bg-surface-hover); color: var(--text); }
.pricing-btn.primary {
  background: var(--gradient); border: none; color: #fff;
}
.pricing-btn.primary:hover { opacity: 0.9; color: #fff; }

/* ---- Download CTA ---- */
.cta-section {
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.06) 40%, rgba(236, 72, 153, 0.04) 70%, transparent);
}
.cta-section .container { position: relative; }
.cta-section h2 { margin-bottom: 16px; }
.cta-section p { margin-bottom: 32px; }
.cta-section .cta-note { margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }

/* ---- Footer ---- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.footer .container {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }


/* ---- Legal Pages ---- */
.legal-content {
  max-width: 780px; margin: 0 auto;
  padding-top: calc(var(--nav-height) + 60px);
}
.legal-content h1 { margin-bottom: 8px; }
.legal-date { color: var(--text-muted); margin-bottom: 40px; }
.legal-toc {
  padding: 24px; margin-bottom: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.legal-toc h3 { margin-bottom: 12px; font-size: 1rem; }
.legal-toc ol { counter-reset: toc; padding-left: 0; }
.legal-toc li {
  counter-increment: toc;
  padding: 4px 0;
}
.legal-toc li::before {
  content: counter(toc) ". ";
  color: var(--text-muted);
}
.legal-toc a { color: var(--text-body); }
.legal-toc a:hover { color: var(--purple); }
.legal-content h2 {
  font-size: 1.3rem; margin: 48px 0 16px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.legal-content h2:first-of-type { border-top: none; }
.legal-content p { margin-bottom: 16px; line-height: 1.8; }
.legal-content ul, .legal-content ol {
  margin: 12px 0 16px 24px; list-style: disc;
}
.legal-content ol { list-style: lower-alpha; }
.legal-content li { margin-bottom: 8px; line-height: 1.7; }
.legal-content strong { color: var(--text); }

/* ---- 404 ---- */
.error-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.error-code {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.error-page p { margin: 12px 0 32px; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    padding: 24px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
  }
  .hero { padding-top: calc(var(--nav-height) + 40px); padding-bottom: 40px; }
  section { padding: 60px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px; margin: 0 auto;
  }
  .pricing-card.popular { transform: none; }
  .pricing-card.popular:hover { transform: translateY(-4px); }
  .footer .container { flex-direction: column; text-align: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Animations ---- */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
