/* CalMate.app — match Android app greens */
:root {
  --bg: #F6F6F6;
  --bg-2: #FFFFFF;
  --ink: #2C3E50;
  --muted: #6C7A89;
  --line: rgba(44, 62, 80, 0.1);
  --green: #00C853;
  --green-dark: #388E3C;
  --green-deep: #2E7D32;
  --green-soft: #E0F4F2;
  --accent: #FFB347;
  --orange: #FE8139;
  --dark: #1B5E20;
  --card: #ffffff;
  --shadow: 0 18px 50px rgba(0, 200, 83, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --max: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

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

.bg-orb {
  position: fixed;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}
.bg-orb-a {
  top: -12vw; right: -10vw;
  background: radial-gradient(circle, rgba(0, 200, 83, 0.22), transparent 70%);
}
.bg-orb-b {
  bottom: 10vh; left: -16vw;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.28), transparent 70%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 0.85rem 1rem;
  min-height: var(--header-h);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(14px);
  background: rgba(246, 246, 246, 0.9);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  color: var(--ink);
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 200, 83, 0.1);
}
.brand-badge-sm { padding: 0.3rem 0.85rem 0.3rem 0.3rem; font-size: 0.95rem; }
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: transparent;
  display: block;
}
.brand-badge-sm .brand-logo { width: 28px; height: 28px; border-radius: 8px; }
.brand-text { font-size: 1.02rem; }

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}
.header-search-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.9rem;
}
.header-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  outline: none;
  color: var(--ink);
}
.header-search input:focus {
  border-color: rgba(0, 200, 83, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.12);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  justify-self: end;
}
.site-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  transition: color 0.2s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--green-dark); }
.site-nav .nav-cta {
  background: var(--green);
  color: #fff !important;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.site-nav .nav-cta:hover { background: var(--green-dark); color: #fff !important; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: transparent;
  padding: 0; cursor: pointer;
  color: var(--ink);
  font-size: 1.25rem;
}
.nav-toggle [data-nav-close] { display: none; }
.nav-toggle[aria-expanded="true"] [data-nav-open] { display: none; }
.nav-toggle[aria-expanded="true"] [data-nav-close] { display: inline-block; }

main { padding: 0 1.25rem 4rem; }

/* Type */
.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.display-sm { font-size: clamp(1.9rem, 4vw, 3rem); }
.display em {
  font-style: normal;
  color: var(--green);
}
.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;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
}
.lede-center { margin-left: auto; margin-right: auto; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 200, 83, 0.28);
}
.btn-dark:hover { background: var(--green-dark); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: rgba(0, 200, 83, 0.35); background: rgba(255,255,255,0.7); }
.btn-wide { width: 100%; max-width: 280px; }
.btn-icon { flex-shrink: 0; }
.btn .fa-brands,
.btn .fa-solid { margin-right: 0.15rem; }

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.hero-meta { color: var(--muted); font-size: 0.92rem; margin: 0; }

.hero-stage {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}
.phone-mock {
  width: min(280px, 70%);
  aspect-ratio: 9 / 19;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: relative;
  z-index: 2;
  overflow: visible;
}
.phone-mock > .placeholder-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  border-radius: inherit;
  overflow: hidden;
  background: inherit;
}
.phone-mock-back {
  position: absolute;
  right: 8%;
  top: 8%;
  transform: rotate(8deg) translateX(18%);
  z-index: 1;
  opacity: 0.92;
  width: min(250px, 62%);
}

.placeholder-hero,
.placeholder-thumb {
  background:
    linear-gradient(135deg, rgba(0, 200, 83, 0.14), rgba(255,255,255,0.92) 45%, rgba(44, 62, 80, 0.04)),
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(44, 62, 80, 0.03) 10px, rgba(44, 62, 80, 0.03) 20px);
  display: grid;
  place-items: center;
}
.placeholder-inner {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}
.placeholder-label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.placeholder-hint { font-size: 0.82rem; }
.placeholder-icon {
  display: block;
  font-size: 1.6rem;
  color: var(--green);
  margin-bottom: 0.4rem;
  opacity: 0.85;
}
.placeholder-thumb-lg .placeholder-icon { font-size: 2.4rem; }

.float-chip,
.float-card {
  position: absolute;
  z-index: 3;
  box-shadow: 0 14px 32px rgba(44, 62, 80, 0.16);
}
.float-chip {
  background: var(--green-deep);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}
.float-card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  min-width: 118px;
  display: grid;
  gap: 0.1rem;
}
.float-card-icon {
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 0.15rem;
}
.float-card-accent .float-card-icon,
.float-card-warm .float-card-icon { color: inherit; opacity: 0.9; }
.float-card strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.float-card span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
.float-card-accent {
  background: var(--green);
  color: #fff;
  border-color: transparent;
}
.float-card-accent span { color: rgba(255,255,255,0.82); }
.float-card-warm {
  background: var(--accent);
  color: var(--ink);
  border-color: transparent;
}
.float-card-warm span { color: rgba(44, 62, 80, 0.7); }
.float-chip-a,
.float-card-a { top: 12%; left: -4%; }
.float-chip-b,
.float-card-b { top: 42%; right: -6%; }
.float-chip-c,
.float-card-c { bottom: 16%; left: -2%; }
.float-card-d { bottom: 8%; right: 4%; }

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 0;
}
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.section-head { text-align: center; margin-bottom: 2rem; }
.section-cta { text-align: center; margin-top: 1.75rem; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: grid;
  gap: 1.1rem;
}
.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
}
.feature-list strong { display: block; margin-bottom: 0.15rem; }
.feature-list li > div > span { color: var(--muted); font-size: 0.95rem; }
.feature-icon {
  width: 2.25rem; height: 2.25rem; margin-top: 0.05rem;
  display: grid; place-items: center;
  background: rgba(0, 200, 83, 0.12);
  color: var(--green-deep);
  border-radius: 12px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.bowl-frame {
  position: relative;
  width: min(100%, 380px);
  margin: 0 auto;
  overflow: visible;
}
.bowl-media {
  border-radius: 50%;
  aspect-ratio: 1;
  width: 100%;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kcal-card {
  position: absolute;
  top: 6%;
  right: -4%;
  background: var(--card);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  box-shadow: 0 14px 32px rgba(44, 62, 80, 0.16);
  width: 158px;
  display: grid;
  gap: 0.2rem;
  z-index: 3;
  border: 1px solid var(--line);
}
.kcal-card strong { font-size: 1.2rem; }
.kcal-card span { font-size: 0.78rem; color: var(--muted); }
.kcal-card .float-card-icon { color: var(--green); }
.float-card-bowl-b {
  position: absolute;
  bottom: 10%;
  left: -6%;
  z-index: 3;
}
.float-card-bowl-c {
  position: absolute;
  top: 42%;
  right: -10%;
  z-index: 3;
}
.mini-bar, .bar {
  height: 6px;
  background: rgba(44, 62, 80, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.mini-bar i, .bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-carbs i { background: var(--accent); }
.bar-fats i { background: #5b8def; }
.bar-protein i { background: var(--green); }
.bar.is-on i, .mini-bar.is-on i { width: var(--w); }

.macro-stack {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.macro-row {
  display: grid;
  grid-template-columns: 64px 1fr 48px;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 500;
}

/* Food cards */
.food-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.food-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11,11,11,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.food-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.food-card-thumb {
  aspect-ratio: 4 / 3;
}
.placeholder-thumb-lg {
  aspect-ratio: 1;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.food-card-body { padding: 1rem 1.05rem 1.15rem; }
.food-card-title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  line-height: 1.3;
  font-weight: 600;
}
.food-card-kcal { margin: 0 0 0.25rem; font-size: 0.92rem; }
.food-card-macros { margin: 0; color: var(--muted); font-size: 0.82rem; }

.section-cta-band { padding-top: 1rem; }
.cta-band {
  background: linear-gradient(135deg, var(--green-deep), var(--green-dark) 55%, #1B5E20);
  color: #fff;
  border-radius: 32px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.cta-band .display { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.78); margin: 0 0 1.25rem; }
.cta-band .btn-dark {
  background: #fff;
  color: var(--green-deep);
  box-shadow: none;
}
.cta-band .btn-dark:hover { background: var(--green-soft); color: var(--green-deep); }

.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

/* Foods page */
.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 0 1rem;
}
.foods-toolbar {
  max-width: var(--max);
  margin: 0 auto 1.5rem;
}
.search-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.search-form input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  outline: none;
}
.search-form input:focus { border-color: rgba(0, 200, 83, 0.45); box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.12); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  font-weight: 500;
}
.chip.is-active { background: var(--green); color: #fff; border-color: var(--green); }
.results-meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.food-grid-page { max-width: var(--max); margin: 0 auto; }
.pager {
  max-width: var(--max);
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.pager-status { color: var(--muted); font-size: 0.9rem; }

/* Food detail */
.food-detail {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 1.25rem;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.crumbs a:hover { color: var(--green-dark); }
.food-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}
.food-serving { color: var(--muted); margin: -0.4rem 0 1.25rem; }
.food-serving .dot { margin: 0 0.35rem; }
.kcal-hero {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}
.kcal-number {
  font-family: var(--display);
  font-size: clamp(3.2rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.kcal-unit { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.macro-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.macro-pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}
.macro-pill span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.2rem; }
.macro-pill strong { font-size: 1.15rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.25rem; }
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 200, 83, 0.12);
  color: var(--green-deep);
}
.food-blurb {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
}
.food-blurb p { margin: 0; color: var(--muted); }
.food-cta .cta-note { color: var(--muted); font-size: 0.88rem; margin: 0.75rem 0 0; }
.sticky-cta {
  position: sticky;
  bottom: 1rem;
  background: rgba(246, 246, 246, 0.94);
  backdrop-filter: blur(10px);
  padding: 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.aside-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(11,11,11,0.04);
}
.aside-title { margin: 0 0 0.85rem; font-size: 1.05rem; }
.facts { margin: 0; display: grid; gap: 0.65rem; }
.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.related-section { padding-top: 2.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.25rem 3rem;
  background: rgba(255,255,255,0.35);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}
.footer-tag { margin: 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-links a:hover { color: var(--green-dark); }
.footer-copy { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--muted); }

/* Motion */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
[data-stagger] > *.is-in {
  transition-delay: calc(var(--i, 0) * 60ms);
}

@media (max-width: 960px) {
  .hero,
  .section-grid,
  .food-detail-grid { grid-template-columns: 1fr; }
  .food-grid { grid-template-columns: repeat(2, 1fr); }
  .phone-mock-back { display: none; }
  .hero-stage { min-height: 340px; }
  .macro-pills { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand toggle"
      "search search";
    --header-h: auto;
  }
  .brand-badge { grid-area: brand; justify-self: start; }
  .header-search {
    grid-area: search;
    max-width: none;
    justify-self: stretch;
  }
  .nav-toggle {
    display: inline-block;
    grid-area: toggle;
    justify-self: end;
  }
  .site-nav {
    position: fixed;
    inset: 7.5rem 1rem auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .nav-cta { text-align: center; }
  .float-card-b,
  .float-card-bowl-c { right: 0; }
  .float-card-a,
  .float-card-bowl-b { left: 0; }
  .food-grid { grid-template-columns: 1fr; }
  .search-form { flex-direction: column; }
  .sticky-cta { bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
