/* ============================================================
   FoodFlip Marketing Site
   Tokens shared with support site + extension popup
   ============================================================ */

:root {
  --accent: #0f766e;
  --accent-dark: #0a5c56;
  --accent-light: #14a89e;
  --accent-hover: #0d6960;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --accent-glow: rgba(15, 118, 110, 0.05);
  --warm: #c4841d;
  --bg: #fffbf6;
  --bg-warm: #f8f5ef;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #203245;
  --text-muted: #5a6a79;
  --border: rgba(32, 50, 69, 0.10);
  --shadow: 0 24px 60px rgba(26, 36, 50, 0.08);
  --shadow-lg: 0 40px 80px rgba(26, 36, 50, 0.10);
  --radius-pill: 9999px;
  --radius-card: 20px;
  --radius-xl: 28px;
  --font-heading: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---- Reset ---- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout ---- */

.page-width {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 246, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.nav-brand-mark {
  width: 40px;
  height: auto;
  flex-shrink: 0;
}

.nav-wordmark {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

/* ============================================================
   Buttons
   ============================================================ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.button-sm {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

.button-lg {
  height: 52px;
  padding: 0 28px;
  font-size: 16px;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15, 118, 110, 0.25);
}
.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
}
.button-secondary:hover {
  border-color: rgba(32, 50, 69, 0.2);
  box-shadow: 0 2px 12px rgba(26, 36, 50, 0.06);
  transform: translateY(-1px);
}

.button-nav {
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  height: 38px;
}
.button-nav:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding: 80px 0 32px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(44px, 5.5vw, 68px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-subhead {
  margin: 24px 0 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---- Flip card demo ---- */

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 800px;
  position: relative;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: -48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.09) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.flip-card {
  width: 300px;
  height: 380px;
  perspective: 800px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: auto-flip 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes auto-flip {
  0%, 30%  { transform: rotateY(0deg); }
  38%, 88% { transform: rotateY(180deg); }
  96%      { transform: rotateY(360deg); }
  100%     { transform: rotateY(360deg); }
}

.flip-card:hover .flip-card-inner {
  animation-play-state: paused;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.flip-card-front {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.flip-card-back {
  background: linear-gradient(145deg, var(--accent-dark) 0%, var(--accent-light) 100%);
  color: #fff;
  transform: rotateY(180deg);
  box-shadow: var(--shadow-lg);
}

.flip-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.flip-card-front .flip-label { color: var(--text-muted); }
.flip-card-back .flip-label { color: rgba(255, 255, 255, 0.7); }

.flip-ingredient {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.flip-meta {
  margin-top: auto;
  padding-top: 20px;
  font-size: 14px;
  line-height: 1.6;
}
.flip-card-front .flip-meta { color: var(--text-muted); }
.flip-card-back .flip-meta { color: rgba(255, 255, 255, 0.85); }

.flip-tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-top: 12px;
}
.flip-card-front .flip-tag {
  background: rgba(196, 132, 29, 0.10);
  color: var(--warm);
}
.flip-card-back .flip-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.flip-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
  text-align: center;
  align-self: center;
}

/* ============================================================
   Section shared styles
   ============================================================ */

.section {
  padding: 80px 0;
}

.section-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.section-heading {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-subhead {
  margin: 0 0 48px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 560px;
}

/* ============================================================
   How it works
   ============================================================ */

.how-it-works {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 72px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 48px;
  position: relative;
}

/* Connecting line behind step numbers */
.steps::before {
  content: '';
  position: absolute;
  top: 26px;
  left: calc(100% / 6);
  right: calc(100% / 6);
  height: 2px;
  background: rgba(15, 118, 110, 0.18);
}

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

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 6px var(--bg-warm), 0 4px 12px rgba(15, 118, 110, 0.25);
}

.step h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-dark);
}

.step p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ============================================================
   Features
   ============================================================ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  padding: 28px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(26, 36, 50, 0.04);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(15, 118, 110, 0.20);
}

/* Lead feature — full-width, horizontal layout */
.feature-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 4px;
  padding: 36px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, var(--surface-strong) 0%, rgba(15, 118, 110, 0.04) 100%);
  align-items: start;
}

.feature-card:first-child .feature-icon {
  grid-row: 1 / -1;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--accent);
}

.feature-card:first-child .feature-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.feature-card:first-child h3 {
  font-size: 22px;
  align-self: end;
}

.feature-card:first-child p {
  max-width: 540px;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Lead feature icon doesn't need bottom margin (grid handles gap) */
.feature-card:first-child .feature-icon {
  margin-bottom: 0;
}

/* ============================================================
   Screenshot section
   ============================================================ */

.screenshots {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.screenshot-frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-strong);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
}

.screenshot-caption {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Trust section
   ============================================================ */

.trust {
  padding: 96px 0;
}

.trust-card {
  margin-top: 0;
  padding: 56px 48px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.10) 0%, rgba(15, 118, 110, 0.04) 100%);
  border: 1px solid rgba(15, 118, 110, 0.20);
  text-align: center;
}

.trust-card h2 {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.trust-card > p {
  margin: 0 auto 40px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
}

.trust-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.trust-badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 20px;
  border-radius: var(--radius-card);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}

.trust-badge strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-dark);
}

.trust-badge span {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   CTA banner
   ============================================================ */

.cta-banner {
  padding: 88px 0 100px;
  text-align: center;
  background: var(--accent);
  color: #fff;
}

.cta-banner h2 {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.04em;
  color: #fff;
}

.cta-banner p {
  margin: 0 auto 36px;
  max-width: 460px;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.cta-banner .button-primary {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.cta-banner .button-primary:hover {
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.footer-brand svg {
  width: 28px;
  height: 28px;
}

.footer-brand span {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--accent-light);
}

/* ============================================================
   Background decoration
   ============================================================ */

.bg-glow {
  position: absolute;
  top: -200px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================================
   Hero entrance
   ============================================================ */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content {
  animation: fade-up 0.7s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.hero-visual {
  animation: fade-up 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.15s both;
}

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

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-subhead {
    max-width: none;
  }

  .hero-actions {
    justify-content: center;
  }

  .pill-row {
    justify-content: center;
  }

  .hero-visual::before {
    inset: -24px;
  }

  .flip-card {
    width: 260px;
    height: 340px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Hide connecting line on mobile — steps stack vertically */
  .steps::before {
    display: none;
  }

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

  /* Lead feature reverts to standard vertical layout on mobile */
  .feature-card:first-child {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    padding: 28px 24px;
    border-left: 3px solid var(--accent);
  }

  .feature-card:first-child .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-bottom: 20px;
  }

  .feature-card:first-child .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-card:first-child h3 {
    font-size: 18px;
  }

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

  .trust-badges {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a:not(.button-nav) {
    display: none;
  }
}

@media (max-width: 480px) {
  .page-width {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero { padding: 48px 0 24px; }
  .section { padding: 56px 0; }
  .trust { padding: 64px 0; }
  .cta-banner { padding: 64px 0 72px; }
  .how-it-works { padding: 48px 0 56px; }

  .hero h1 {
    font-size: 36px;
  }

  .flip-card {
    width: 240px;
    height: 300px;
  }

  .flip-ingredient {
    font-size: 28px;
  }

  .trust-card {
    padding: 36px 20px;
  }
}

/* ---- Touch devices ---- */

@media (hover: none) {
  .flip-hint { display: none; }
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flip-card-inner { animation: none; }
  .feature-card { transition: none; }
  .button { transition: none; }
  .hero-content,
  .hero-visual {
    animation: none;
  }
}
