/* ============================================
   Spin & Dine — Landing Page Styles
   Design tokens from iOS Design+Tokens.swift
   ============================================ */

/* --- Custom Properties (Design Tokens) --- */
:root {
  /* Core */
  --color-bg: #262626;
  --color-bg-darker: #141414;
  --color-bg-card: #1f1f1f;
  --color-rim-stroke: #595959;
  --color-text: #e6e6e6;
  --color-text-secondary: rgba(255, 255, 255, 0.78);
  --color-text-tertiary: rgba(255, 255, 255, 0.65);
  --color-accent: #ff9500;

  /* Brand Gradients */
  --gradient-spin: linear-gradient(to right, #00e5ff, #00ffcc);
  --gradient-dine: linear-gradient(to right, #ffd600, #ff9500);
  --gradient-fab: linear-gradient(135deg, #ff9500, #ffd600);

  /* Wheel Colors */
  --wheel-1: #6b5b8c;
  --wheel-2: #b53e46;
  --wheel-3: #1e6b73;
  --wheel-4: #9b8244;
  --wheel-5: #4a567e;
  --wheel-6: #8a7a9b;
  --wheel-7: #5c8a56;
  --wheel-8: #c65d3c;

  /* Mode Colors */
  --mode-quick: #ff9500;
  --mode-date: #ff2d55;
  --mode-cheap: #34c759;
  --mode-new: #af52de;
  --mode-treat: #ffd700;

  /* Award Colors */
  --award-michelin: #b53e46;
  --award-beard: #ffd700;
  --award-eater: #4a567e;
  --award-local: #c65d3c;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --space-5xl: 80px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-round: 9999px;

  /* Shadows */
  --shadow-sm: 2px 3px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 4px 6px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 6px 8px 15px rgba(0, 0, 0, 0.5);

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-xl));
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -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.85;
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.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;
}

/* --- Gradient Text --- */
.text-gradient-spin {
  background: var(--gradient-spin);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-round);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--gradient-fab);
  color: var(--color-bg-darker);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-rim-stroke);
}

.btn-outline:hover {
  border-color: var(--color-text);
}

/* App Store badge */
.app-store-badge {
  height: 48px;
  width: auto;
  transition: transform 0.2s;
}

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(38, 38, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(89, 89, 89, 0.3);
  height: var(--nav-height);
}

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

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  gap: 2px;
}

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

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-cta {
  height: 40px;
}

/* --- Hero --- */
.hero {
  padding: var(--space-5xl) 0 var(--space-4xl);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xl);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: 0 auto var(--space-xxl);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-4xl);
}

.hero-screenshot {
  max-width: 300px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* --- Section Common --- */
.section {
  padding: var(--space-5xl) 0;
}

.section-alt {
  background: var(--color-bg-darker);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* --- How It Works (3 Steps) --- */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xxl);
  max-width: 900px;
  margin: 0 auto;
}

.step-card {
  text-align: center;
  padding: var(--space-xxl);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-fab);
  color: var(--color-bg-darker);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}

.step-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.step-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* --- Feature Cards --- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid rgba(89, 89, 89, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xxl);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(89, 89, 89, 0.5);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Spin Modes --- */
.modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.mode-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xxl);
  border-left: 4px solid;
  transition: transform 0.2s;
}

.mode-card:hover {
  transform: translateX(4px);
}

.mode-card--quick { border-color: var(--mode-quick); }
.mode-card--date { border-color: var(--mode-date); }
.mode-card--cheap { border-color: var(--mode-cheap); }
.mode-card--new { border-color: var(--mode-new); }
.mode-card--treat { border-color: var(--mode-treat); }

.mode-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.mode-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.mode-card p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* --- Pro Feature Cards --- */
.pro-feature-card {
  border-top: 3px solid var(--color-accent);
}

/* --- Pricing Section --- */
.pricing-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 600px;
  margin: var(--space-4xl) auto 0;
  align-items: stretch;
}

.pricing-card {
  background: var(--color-bg-card);
  border: 1px solid rgba(89, 89, 89, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xxl);
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(89, 89, 89, 0.5);
}

.pricing-card--featured {
  border: 2px solid var(--color-accent);
  background: linear-gradient(180deg, rgba(255, 149, 0, 0.08) 0%, var(--color-bg-card) 100%);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-fab);
  color: var(--color-bg-darker);
  font-size: 0.75rem;
  font-weight: 700;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-round);
  white-space: nowrap;
}

.pricing-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.pricing-card-price {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.pricing-card-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.pricing-card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.pro-cta {
  text-align: center;
  margin-top: var(--space-xxl);
}

.pro-cta-note {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  margin-top: var(--space-md);
}

@media (min-width: 640px) {
  .pricing-section {
    flex-direction: row;
  }

  .pricing-card {
    flex: 1;
  }
}

/* --- Screenshot Carousel --- */
.carousel {
  display: flex;
  gap: var(--space-xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md) var(--space-xl);
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 260px;
  scroll-snap-align: center;
}

.carousel-item img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 260px;
  height: auto;
}

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-list details {
  background: var(--color-bg-card);
  border: 1px solid rgba(89, 89, 89, 0.25);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-list summary {
  padding: var(--space-xl);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text-tertiary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 var(--space-xl) var(--space-xl);
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- CTA Section --- */
.cta {
  text-align: center;
  padding: var(--space-5xl) 0;
}

.cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.cta p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xxl);
  font-size: 1.1rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-xxl);
}

.social-links {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
}

.social-links a {
  color: var(--color-text-tertiary);
  font-size: 0.9rem;
  font-weight: 500;
}

.social-links a:hover {
  color: var(--color-text);
}

/* --- Footer --- */
.footer {
  background: var(--color-bg-darker);
  border-top: 1px solid rgba(89, 89, 89, 0.3);
  padding: var(--space-4xl) 0 var(--space-xxl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xxl);
  margin-bottom: var(--space-xxl);
}

.footer-brand .nav-logo {
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}

.footer-links h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
}

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

.footer-links a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid rgba(89, 89, 89, 0.2);
  padding-top: var(--space-xl);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

/* --- Legal Pages --- */
.legal-page {
  padding: calc(var(--nav-height) + var(--space-4xl)) 0 var(--space-5xl);
  min-height: 100vh;
}

.legal-page .container {
  max-width: 800px;
}

.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.legal-page .updated {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  margin-bottom: var(--space-4xl);
}

.legal-page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-md);
}

.legal-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal-page p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.legal-page ul,
.legal-page ol {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
  line-height: 1.7;
}

.legal-page li {
  margin-bottom: var(--space-xs);
}

.legal-page a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Support Page --- */
.support-card {
  background: var(--color-bg-card);
  border: 1px solid rgba(89, 89, 89, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xxl);
  text-align: center;
  max-width: 500px;
  margin: var(--space-xxl) auto;
}

.support-card h2 {
  margin-top: 0;
}

.support-email {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-accent);
  display: inline-block;
  margin: var(--space-md) 0;
}

/* --- 404 Page --- */
.page-404 {
  text-align: center;
  padding: calc(var(--nav-height) + var(--space-5xl)) 0;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.page-404 h1 {
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.page-404 p {
  color: var(--color-text-secondary);
  font-size: 1.15rem;
  margin-bottom: var(--space-xxl);
}

.page-404 .actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* sm: 640px */
@media (min-width: 640px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .carousel-item {
    flex: 0 0 280px;
  }
}

/* md: 1024px */
@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

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

  .modes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4xl);
    text-align: left;
  }

  .hero-content {
    flex: 1;
    max-width: 540px;
  }

  .hero-image {
    flex: 0 0 auto;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-screenshot {
    max-width: 320px;
  }

  .carousel-item {
    flex: 0 0 300px;
  }
}

/* lg: 1280px */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-xxl);
  }

  .hero-screenshot {
    max-width: 360px;
  }

  .features-grid {
    gap: var(--space-xxl);
  }

  .modes-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .mode-card {
    flex-direction: column;
    text-align: center;
    padding: var(--space-xxl) var(--space-xl);
    border-left: none;
    border-top: 4px solid;
  }
}
