/* ===========================================================================
   Fonts — mirrors assets/fonts used in the Flavi app
   =========================================================================== */

@font-face {
  font-family: 'BDO Grotesk';
  src: url('assets/fonts/BDOGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'BDO Grotesk';
  src: url('assets/fonts/BDOGrotesk-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'BDO Grotesk';
  src: url('assets/fonts/BDOGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/Inter-VariableFont.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* ===========================================================================
   Brand tokens — dark premium theme. kDeepOverlay/kSurface are kept verbatim
   for the recipe-card component, which mirrors the app's own widget exactly.
   =========================================================================== */

:root {
  --black: #000000;
  --charcoal: #0C0C0C;
  --surface: #F4F2ED;       /* kSurface — recipe-card fallback bg, from the app */
  --deep-overlay: #181512;  /* kDeepOverlay — recipe-card scrim/badge, from the app */
  --neon: #39FF14;
  --white: #FFFFFF;
  --gray-100: rgba(255, 255, 255, 0.88);
  --gray-300: rgba(255, 255, 255, 0.64);
  --gray-500: rgba(255, 255, 255, 0.44);
  --border: rgba(255, 255, 255, 0.10);

  /* Light sections — the app's own light theme (lib/models/constants.dart) */
  --app-bg: #FFFEFC;
  --app-ink: #171511;
  --app-ink-secondary: #6F675C;
  --app-olive-dark: #75845F;
  --app-border: #E7DED2;
  --carrot: #E7552F; /* kCarrotAccent, from the app */

  --font-display: 'BDO Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--gray-100);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--white);
}

p { margin: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0 0 14px;
}

/* ===========================================================================
   Light sections — interwoven with the black sections so the page alternates
   dark-premium / light-app-style rhythm. Reuses the app's own light palette.
   =========================================================================== */

.theme-light {
  background: var(--app-bg);
  color: var(--app-ink-secondary);
}

.theme-light h1,
.theme-light h2,
.theme-light h3 {
  color: var(--app-ink);
}

.theme-light .eyebrow {
  color: var(--carrot);
}

.theme-light .benefit-card p {
  color: var(--app-ink-secondary);
}

.theme-light .benefit-card:hover {
  background: rgba(23, 21, 17, 0.04);
}

.theme-light .carousel-arrow {
  background: #fff;
  border-color: var(--app-border);
  color: var(--app-ink);
}

.theme-light .signup-sub {
  color: var(--app-ink-secondary);
}

.theme-light .signup-form input[type="email"] {
  background: #fff;
  border-color: var(--app-border);
  color: var(--app-ink);
}

.theme-light .signup-form input[type="email"]::placeholder {
  color: var(--app-ink-secondary);
  opacity: 0.6;
}

.theme-light .signup-form input[type="email"]:focus {
  border-color: var(--app-olive-dark);
}

.theme-light .btn-primary {
  background: var(--app-ink);
  color: #fff;
}

.theme-light .signup-status.is-success { color: var(--app-olive-dark); }
.theme-light .signup-status.is-error { color: #C0442A; }

/* ===========================================================================
   Scroll-reveal (see script.js)
   =========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.benefits-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.benefits-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.benefits-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.benefits-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.benefits-grid .reveal:nth-child(6) { transition-delay: 0.30s; }

.steps-grid .reveal:nth-child(2) { transition-delay: 0.07s; }
.steps-grid .reveal:nth-child(3) { transition-delay: 0.14s; }
.steps-grid .reveal:nth-child(4) { transition-delay: 0.21s; }
.steps-grid .reveal:nth-child(5) { transition-delay: 0.28s; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--neon);
  color: #07210C;
}

.btn-primary:disabled {
  background: var(--gray-500);
  cursor: default;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--white);
}

.nav-cta {
  font-weight: 800;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--neon);
  color: #07210C;
}

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

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  background: var(--black);
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 40px;
  text-align: left;
}

.hero-copy {
  max-width: 620px;
  position: relative;
  z-index: 2;
  padding-left: 158px;
}

.hero .eyebrow { display: block; text-align: left; }

.hero-title {
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 26px 0 0;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--gray-300);
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-highlights {
  grid-column: 1 / -1;
  margin-top: 56px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.hero-visual-frame {
  position: relative;
  display: inline-block;
}

.hero-visual-frame img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
}

.hero-float-card {
  position: absolute;
  left: -48px;
  top: 34%;
  width: 250px;
  background: #fff;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
  z-index: 3;
}

.hero-float-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-float-card-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-float-card-logo img { width: 17px; height: 17px; object-fit: contain; }

.hero-float-card-title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.hero-float-card-title strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--app-ink);
}

.hero-float-card-title span {
  font-size: 11px;
  font-weight: 700;
  color: var(--app-ink-secondary);
}

.hero-float-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--app-ink);
}

@media (max-width: 1100px) {
  .hero-chip { font-size: 12.5px; padding: 9px 13px; }
  .hero-float-card { left: -24px; width: 220px; padding: 14px 16px; }
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-copy { max-width: none; margin: 0 auto; padding-left: 0; }
  .hero .eyebrow { text-align: center; }
  .hero-sub { margin: 26px auto 0; }
  .hero-actions { justify-content: center; }
  .hero-highlights { flex-wrap: wrap; }
  /* Image keeps its natural DOM order — below all text on small screens */
  .hero-visual { justify-content: center; margin-top: 56px; }
  .hero-visual-frame img { max-width: 380px; }
  .hero-float-card { left: 6px; top: 16px; width: 190px; padding: 12px 14px; }
}

@media (max-width: 480px) {
  .hero-float-card { display: none; }
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gray-100);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ===========================================================================
   Section heads (shared)
   =========================================================================== */

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  padding: 0 24px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.08;
}

/* ===========================================================================
   Carousel
   =========================================================================== */

.carousel-section { padding: 80px 0 96px; }

.carousel-viewport {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.carousel-fallback-message {
  display: none;
  width: 100%;
  padding: 48px 24px;
  text-align: center;
  color: var(--app-ink-secondary);
  font-size: 15px;
}

.carousel-track[data-state="fallback"] .carousel-fallback-message {
  display: block;
}

/* Mirrors _TrendingRecipeHeroCard in lib/views/home_view.dart exactly */

.recipe-card {
  position: relative;
  flex: 0 0 auto;
  width: 300px;
  aspect-ratio: 1.02;
  border-radius: 26px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.recipe-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(24, 21, 18, 0.12) 0%,
    rgba(24, 21, 18, 0.22) 28%,
    rgba(24, 21, 18, 0.42) 58%,
    rgba(24, 21, 18, 0.74) 82%,
    rgba(24, 21, 18, 0.94) 100%
  );
}

.recipe-card-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(109, 99, 85, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #F7F1E7;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.recipe-card-body {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
}

.recipe-card-body h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1.3px;
  line-height: 1.12;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-ingredients {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.96);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipe-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.14);
  padding: 15px 22px 15px 18px;
  color: var(--deep-overlay);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.recipe-card-cta svg { width: 19px; height: 19px; flex-shrink: 0; }

.recipe-card-check {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-card-check svg { width: 24px; height: 24px; color: #171511; }

.carousel-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  font-size: 20px;
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.carousel-arrow-prev { left: 4px; }
.carousel-arrow-next { right: 4px; }

@media (min-width: 900px) {
  .carousel-arrow { display: flex; }
}

/* ===========================================================================
   Food matters
   =========================================================================== */

.food-matters {
  position: relative;
  padding: 110px 24px;
  background: var(--black);
  overflow: hidden;
}

.ecosystem-graphic {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 120%);
  height: auto;
  opacity: 0.16;
  filter: blur(0.3px);
  pointer-events: none;
}

.food-matters-inner {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.food-matters-inner h2 {
  font-size: clamp(30px, 4.2vw, 46px);
  margin-bottom: 28px;
}

.food-matters-inner p {
  color: var(--gray-300);
  font-size: 17px;
  line-height: 1.65;
  margin-top: 10px;
}

.food-matters-emphasis {
  margin-top: 22px !important;
  color: var(--white) !important;
  font-weight: 700;
  font-size: 19px !important;
}

/* ===========================================================================
   Benefits ("Why Flavi exists")
   =========================================================================== */

.benefits {
  padding: 96px 24px 104px;
}

.benefits-title {
  font-size: clamp(32px, 4.4vw, 48px);
}

.benefits-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.benefit-card {
  text-align: center;
  padding: 28px 20px;
  border-radius: 20px;
  transition: transform 0.25s ease, background 0.25s ease;
}

.benefit-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.035);
}

.benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--neon);
  margin-bottom: 18px;
}

.benefit-icon svg { width: 100%; height: 100%; }

.benefit-card h3 {
  font-size: 19px;
  margin-bottom: 10px;
}

.benefit-card p {
  color: var(--gray-300);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 280px;
  margin: 0 auto;
}

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

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

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

.how-it-works {
  padding: 96px 24px 104px;
  background: var(--black);
}

.steps-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.step-card {
  padding: 30px 24px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 255, 20, 0.35);
}

.step-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--neon);
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 18px;
  line-height: 1.3;
}

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

/* ===========================================================================
   Signup / Final CTA
   =========================================================================== */

.signup {
  padding: 120px 24px 140px;
  /* Matches the sampled background of assets/img/hero2.png for a seamless blend */
  background: #FEFEFE;
}

.signup-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 56px;
}

.signup-visual { display: flex; justify-content: center; }

.signup-visual img {
  width: 100%;
  max-width: 340px;
  height: auto;
}

.signup-card {
  max-width: 480px;
  text-align: left;
}

.signup-card .eyebrow { text-align: left; }

.signup-card h2 {
  font-size: clamp(30px, 4.2vw, 44px);
  margin-bottom: 14px;
  line-height: 1.08;
}

.signup-sub {
  color: var(--gray-300);
  font-size: 16.5px;
  max-width: 460px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .signup-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .signup-card {
    max-width: none;
    margin: 0 auto;
    text-align: center;
  }
  .signup-card .eyebrow { text-align: center; }
  .signup-sub { margin: 0 auto; }
  .signup-visual img { max-width: 280px; }
}

.signup-form {
  margin-top: 36px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .signup-form { justify-content: center; }
}

.signup-form input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 320px;
  height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
}

.signup-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--neon);
}

.signup-status {
  margin-top: 16px;
  min-height: 20px;
  font-size: 14px;
  font-weight: 700;
}

.signup-status.is-success { color: var(--neon); }
.signup-status.is-error { color: #FF8A65; }

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

.footer {
  padding: 56px 24px 72px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13.5px;
  background: var(--charcoal);
}

.brand-mark-footer {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
}

.footer p { margin: 4px 0; }
.footer-fine { color: var(--gray-500); }

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

@media (max-width: 640px) {
  .signup-form { flex-direction: column; align-items: stretch; }
  .signup-form input[type="email"] {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    height: 52px;
  }
  .signup-form .btn-primary { width: 100%; }
}

@media (max-width: 560px) {
  .hero { padding: 100px 20px 64px; }
  .signup { padding: 96px 20px 112px; }
}

/* ===========================================================================
   Reduced motion
   =========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .recipe-card, .benefit-card, .step-card, .btn {
    transition: none;
  }
}
