/* ============================================
   FavDish - Design System & Styles
   Aesthetic: Warm, appetite-friendly, playful yet refined
   ============================================ */

/* --- Tokens --- */
:root {
  /* Colors - Warm, food-inspired palette */
  --color-cream: #FFF8F0;
  --color-cream-dark: #F5EBE0;
  --color-warm-white: #FFFCF9;
  --color-orange-50: #FFF7ED;
  --color-orange-100: #FFEDD5;
  --color-orange-200: #FED7AA;
  --color-orange-400: #FB923C;
  --color-orange-500: #F97316;
  --color-orange-600: #EA580C;
  --color-orange-700: #C2410C;
  --color-brown-800: #44403C;
  --color-brown-900: #292524;
  --color-brown-950: #1C1917;
  --color-green-500: #22C55E;
  --color-green-600: #16A34A;
  --color-red-400: #F87171;
  --color-red-500: #EF4444;
  
  /* Semantic */
  --bg-primary: var(--color-cream);
  --bg-secondary: var(--color-warm-white);
  --bg-card: white;
  --text-primary: var(--color-brown-950);
  --text-secondary: var(--color-brown-800);
  --text-muted: #78716C;
  --accent: var(--color-orange-500);
  --accent-dark: var(--color-orange-600);
  --accent-light: var(--color-orange-100);
  
  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.15);
  
  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { max-width: 65ch; }

em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(249, 115, 22, 0.3);
}

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.btn--small:hover {
  background: var(--color-orange-200);
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(255, 248, 240, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__icon {
  font-size: 1.5rem;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__link:hover {
  color: var(--accent);
}

.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__mobile span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__mobile { display: flex; }
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  padding: calc(80px + var(--space-3xl)) var(--space-xl) var(--space-3xl);
  max-width: 1400px;
  margin: 0 auto;
}

.hero__content {
  animation: fadeInUp 0.8s var(--ease-out);
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-light);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.hero__title {
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.hero__accent {
  color: var(--accent);
  position: relative;
}

.hero__accent::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: 0;
  right: 0;
  height: 0.2em;
  background: var(--color-orange-200);
  z-index: -1;
  border-radius: 4px;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 500px;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero__note {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero__phone {
  position: relative;
  z-index: 2;
  width: 280px;
  height: 580px;
  background: var(--text-primary);
  border-radius: 40px;
  padding: 12px;
  box-shadow: var(--shadow-xl);
}

.phone__screen {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border-radius: 32px;
  overflow: hidden;
}

.phone__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
}

.phone__status {
  display: flex;
  gap: var(--space-xs);
}

.phone__content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Dish Cards */
.dish-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.dish-card--featured {
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.dish-card__image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dish-card__emoji {
  font-size: 2rem;
}

.dish-card__info {
  flex: 1;
  min-width: 0;
}

.dish-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.dish-card__restaurant {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.dish-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.stars {
  color: var(--color-orange-400);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.badge--top {
  background: var(--color-green-500);
  color: white;
}

/* Hero Blobs */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 1;
}

.hero__blob--1 {
  width: 300px;
  height: 300px;
  background: var(--color-orange-200);
  top: -50px;
  right: -50px;
  animation: float 8s ease-in-out infinite;
}

.hero__blob--2 {
  width: 200px;
  height: 200px;
  background: var(--color-orange-100);
  bottom: 50px;
  left: -50px;
  animation: float 10s ease-in-out infinite reverse;
}

@media (max-width: 968px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(80px + var(--space-2xl));
  }
  
  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero__cta {
    align-items: center;
  }
  
  .hero__visual {
    order: -1;
  }
  
  .hero__phone {
    width: 240px;
    height: 480px;
  }
}

/* --- Problem/Solution --- */
.problem {
  padding: var(--space-4xl) var(--space-xl);
  background: var(--bg-secondary);
}

.problem__container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.problem__card {
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  text-align: center;
}

.problem__card--bad {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
}

.problem__card--good {
  background: linear-gradient(135deg, var(--color-orange-50) 0%, var(--color-orange-100) 100%);
  box-shadow: var(--shadow-lg);
}

.problem__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.problem__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
}

.problem__list {
  list-style: none;
  text-align: left;
}

.problem__list li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.problem__card--bad .problem__list li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: var(--color-red-500);
  font-weight: bold;
}

.problem__card--good .problem__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-green-600);
  font-weight: bold;
}

.problem__divider {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .problem__container {
    grid-template-columns: 1fr;
  }
  
  .problem__divider {
    padding: var(--space-md) 0;
  }
}

/* --- Features --- */
.features {
  padding: var(--space-4xl) var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

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

.features__eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.features__title {
  color: var(--text-primary);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.feature {
  padding: var(--space-xl);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  position: relative;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature--highlight {
  background: linear-gradient(135deg, var(--color-orange-50) 0%, var(--color-orange-100) 100%);
  border: 2px solid var(--color-orange-200);
}

.feature__badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-full);
}

.feature__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.feature__title {
  font-family: var(--font-display);
  margin-bottom: var(--space-sm);
}

.feature__desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

@media (max-width: 968px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .features__grid {
    grid-template-columns: 1fr;
  }
}

/* --- How It Works --- */
.how {
  padding: var(--space-4xl) var(--space-xl);
  background: var(--bg-secondary);
}

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

.how__eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.how__steps {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
}

.step {
  text-align: center;
}

.step__number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-orange-200);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.step__title {
  font-family: var(--font-display);
  margin-bottom: var(--space-sm);
}

.step__desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

@media (max-width: 768px) {
  .how__steps {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }
}

/* --- CTA --- */
.cta {
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta__content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}

.cta__title {
  margin-bottom: var(--space-lg);
}

.cta__accent {
  color: var(--accent);
}

.cta__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  margin-left: auto;
  margin-right: auto;
}

.cta__form {
  display: flex;
  gap: var(--space-sm);
  max-width: 400px;
  margin: 0 auto var(--space-md);
}

.cta__input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid var(--color-cream-dark);
  border-radius: var(--radius-full);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cta__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.cta__privacy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cta__decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.cta__emoji {
  position: absolute;
  font-size: 3rem;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.cta__emoji--1 { top: 10%; left: 10%; animation-delay: 0s; }
.cta__emoji--2 { top: 20%; right: 15%; animation-delay: 1s; }
.cta__emoji--3 { bottom: 20%; left: 15%; animation-delay: 2s; }
.cta__emoji--4 { bottom: 10%; right: 10%; animation-delay: 3s; }
.cta__emoji--5 { top: 50%; left: 5%; animation-delay: 4s; }

@media (max-width: 500px) {
  .cta__form {
    flex-direction: column;
  }
}

/* --- Footer --- */
.footer {
  padding: var(--space-2xl) var(--space-xl);
  background: var(--color-brown-950);
  color: white;
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.footer .nav__brand {
  color: white;
}

.footer__tagline {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.footer__copy {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: white;
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  text-align: center;
  max-width: 400px;
  margin: var(--space-md);
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform 0.3s var(--ease-out);
}

.modal.is-active .modal__content {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.modal__title {
  font-family: var(--font-display);
  margin-bottom: var(--space-sm);
}

.modal__text {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.modal__btn {
  width: 100%;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* --- Utilities --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
