/* ===================================
   Vino AI: Wine Scanner — getvinoai.com
   Design system matched to iOS app
   =================================== */

/* --- CSS Custom Properties --- */
:root {
  --color-accent: #722f37;
  --color-accent-dark: #59242b;
  --color-bg-dark: #2d191e;
  --color-bg-darker: #1e1014;
  --color-white: #ffffff;
  --color-white-70: rgba(255, 255, 255, 0.7);
  --color-white-50: rgba(255, 255, 255, 0.5);
  --color-white-10: rgba(255, 255, 255, 0.1);
  --color-white-06: rgba(255, 255, 255, 0.06);
  --color-safe: #34c759;
  --color-card-shadow: rgba(0, 0, 0, 0.08);

  --font-display: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;

  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --max-width: 1120px;
  --nav-height: 72px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-white);
  background-color: var(--color-bg-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.125rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
}

.text-secondary {
  color: var(--color-white-70);
}

.text-muted {
  color: var(--color-white-50);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(45, 25, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-white-06);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: var(--color-white-70);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-white);
  opacity: 1;
}

.nav-links a.active {
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
}

.nav-cta svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-white) !important;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--color-accent-dark);
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
}

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(114, 47, 55, 0.3);
  margin: 0 auto var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero .subtitle {
  font-size: 1.125rem;
  color: var(--color-white-70);
  max-width: 560px;
  margin: 0 auto var(--space-xl);
}

.hero-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.app-store-badge {
  height: 54px;
  transition: transform 0.2s;
}

.app-store-badge:hover {
  transform: scale(1.05);
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  font-size: 0.875rem;
  color: var(--color-white-50);
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Screenshots --- */
.screenshots {
  padding: var(--space-2xl) 0;
  overflow: hidden;
}

.screenshots h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.screenshot-scroll {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md) var(--space-lg);
  scrollbar-width: none;
}

.screenshot-scroll::-webkit-scrollbar {
  display: none;
}

.screenshot-scroll.grabbing {
  cursor: grabbing;
  scroll-snap-type: none;
}

.screenshot-scroll:not(.grabbing) {
  cursor: grab;
}

.screenshot-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  text-align: center;
}

.screenshot-item img {
  width: 260px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-white-06);
}

.screenshot-item p {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-white-50);
  font-weight: 500;
}

/* --- Features Grid --- */
.features {
  background: var(--color-bg-darker);
}

.features h2 {
  text-align: center;
  margin-bottom: var(--space-md);
}

.features .section-subtitle {
  text-align: center;
  color: var(--color-white-70);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-lg);
  background: var(--color-white-06);
  border: 1px solid var(--color-white-06);
  border-radius: var(--radius-md);
  transition: transform 0.2s, background 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  background: var(--color-white-10);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  margin-bottom: var(--space-xs);
}

.feature-card p {
  color: var(--color-white-70);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* --- How It Works --- */
.how-it-works h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl);
  position: relative;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.step h3 {
  margin-bottom: var(--space-xs);
}

.step p {
  color: var(--color-white-70);
  font-size: 0.9375rem;
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.cta-section h2 {
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
  margin: 0 auto var(--space-lg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(114, 47, 55, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(114, 47, 55, 0.4);
}

.btn-white {
  background: var(--color-white);
  color: var(--color-accent);
}

.btn-white:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white-50);
}

.btn-outline:hover {
  border-color: var(--color-white);
  background: var(--color-white-10);
}

/* --- Footer --- */
.footer {
  background: var(--color-bg-darker);
  border-top: 1px solid var(--color-white-06);
  padding: var(--space-xl) 0;
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-col p {
  color: var(--color-white-50);
  font-size: 0.875rem;
  max-width: 280px;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-sm);
  color: var(--color-white-70);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-social:hover {
  color: var(--color-white);
  opacity: 1;
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-col h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-white-50);
  margin-bottom: var(--space-sm);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-links a {
  color: var(--color-white-70);
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-white);
  opacity: 1;
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-white-06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--color-white-50);
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* --- Feature Page --- */
.feature-hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
}

.feature-hero .badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-hero h1 {
  margin-bottom: var(--space-md);
}

.feature-hero p {
  color: var(--color-white-70);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.125rem;
}

.feature-content {
  background: var(--color-bg-darker);
}

.feature-content .container {
  max-width: 800px;
}

.feature-block {
  margin-bottom: var(--space-2xl);
}

.feature-block h2 {
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}

.feature-block p {
  color: var(--color-white-70);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.feature-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.feature-block ul li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--color-white-70);
  line-height: 1.5;
}

.feature-block ul li::before {
  content: '✦';
  color: var(--color-accent);
  font-size: 0.75rem;
  margin-top: 4px;
  flex-shrink: 0;
}

.feature-screenshot {
  text-align: center;
  padding: var(--space-xl) 0;
}

.feature-screenshot img {
  max-width: 300px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-white-06);
}

.feature-screenshot .placeholder {
  width: 300px;
  height: 540px;
  margin: 0 auto;
  background: var(--color-white-06);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--color-white-10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white-50);
  font-size: 0.875rem;
}

/* --- Legal Pages --- */
.legal-content {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
}

.legal-content h1 {
  margin-bottom: var(--space-lg);
}

.legal-content p {
  color: var(--color-white-70);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.legal-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* --- 404 Page --- */
.page-404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.page-404 h1 {
  font-size: 6rem;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.page-404 p {
  color: var(--color-white-70);
  margin-bottom: var(--space-lg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(45, 25, 30, 0.98);
    backdrop-filter: blur(20px);
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--color-white-06);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: var(--space-2xl) 0;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .screenshot-item img {
    width: 200px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer .container {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding: var(--space-2xl) 0;
  }
}

@media (max-width: 480px) {
  .hero-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .screenshot-item img {
    width: 180px;
  }
}

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