/* Landing page. Shared tokens (colours, radii, font) live in styles.css; these match the app (src/ui/theme.ts). */
:root {
  --deep: #123826;
  --deep-2: #1B4D35;
  --bright: #4CAF7D;
  --ink: #171A1B;
  --protein: #C2603D;
  --carbs: #C48A1A;
  --fat: #3B7C96;
  --protein-tint: #FBEDE7;
  --carbs-tint: #FAF0DA;
  --fat-tint: #E4EFF3;
  --shadow-card: 0 1px 2px rgba(23,26,27,.05), 0 6px 20px rgba(23,26,27,.06);
  --shadow-raised: 0 2px 4px rgba(23,26,27,.05), 0 12px 32px rgba(23,26,27,.10);
  --shadow-brand: 0 6px 18px rgba(39,103,71,.32);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --max: 1160px;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body.home { background: var(--bg); overflow-x: hidden; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--bright); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: var(--radius-button);
  font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:active { transform: scale(.98); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.btn-light { background: var(--on-accent); color: var(--deep-2); }
.btn-light:hover { background: #fff; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: #2E7752; }
.btn-block { width: 100%; }

/* Header: clear over the hero, solid once you scroll */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s var(--ease), box-shadow .3s var(--ease); }
.nav.solid { background: rgba(18,56,38,.92); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.nav-row { max-width: var(--max); display: flex; align-items: center; gap: 24px; height: 68px; }
.nav .logo img { height: 36px; width: auto; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { color: rgba(251,248,241,.82); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav nav a:hover { color: #fff; }
.stores-nav { flex-wrap: nowrap; gap: 8px; }
.store.store-sm { flex: none; height: 42px; min-width: 0; padding: 0 12px 0 10px; gap: 7px; border-radius: 11px; }
.store.store-sm svg { width: 20px; height: 20px; }
.store.store-sm span { font-size: 14px; }
.store.store-sm small { font-size: 9px; }
@media (max-width: 820px) { .nav nav { display: none; } .nav .stores-nav { margin-left: auto; } }
@media (max-width: 480px) {
  .store.store-sm { width: 42px; padding: 0; justify-content: center; }
  .store.store-sm span { display: none; }
}

/* Shared section bits */
.wrap { max-width: var(--max); }
.wrap.narrow { max-width: 760px; }
.section { padding: clamp(72px, 10vw, 120px) 0; }
.section.tint { background: #EEF3EF; }
.head { text-align: center; max-width: 640px; margin: 0 auto clamp(40px, 6vw, 64px); }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow-light { color: var(--on-accent-soft); }
h2 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; margin: 0; }
h2 .muted { color: var(--text-secondary); }
.sub { font-size: clamp(17px, 2vw, 19px); color: var(--text-secondary); margin: 16px 0 0; }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: var(--on-accent);
  background: radial-gradient(120% 90% at 85% 10%, #2B7351 0%, var(--deep-2) 45%, var(--deep) 100%);
  padding: 120px 0 clamp(64px, 9vw, 112px);
}
.hero-glow { position: absolute; inset: auto -20% -40% 30%; height: 80%; background: radial-gradient(closest-side, rgba(76,175,125,.35), transparent); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.4vw, 76px); line-height: 1; letter-spacing: -.045em; margin: 0 0 22px; }
.hero h1 span { display: block; color: var(--on-accent-soft); }
.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; max-width: 38ch; margin: 0 0 32px; color: rgba(251,248,241,.86); }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 26px 0 0; font-size: 15px; font-weight: 600; color: rgba(251,248,241,.86); }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--on-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23123826' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Store buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.stores-center { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px; min-width: 186px;
  background: #0B0D0C; color: #fff; text-decoration: none; border-radius: 14px; border: 1px solid rgba(255,255,255,.18);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.store:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.28); }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; font-size: 19px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.store small { font-size: 11px; font-weight: 500; opacity: .8; letter-spacing: 0; }

/* Phone mockup */
.hero-visual { position: relative; text-align: left; display: flex; justify-content: center; padding: 8px 0 24px; }
.phone {
  position: relative; width: 300px; aspect-ratio: 300 / 620; border-radius: 48px; padding: 11px;
  background: linear-gradient(145deg, #2a2f2d, #0c0e0d); box-shadow: 0 40px 80px -20px rgba(0,0,0,.55), inset 0 0 0 1.5px rgba(255,255,255,.12);
}
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; width: 90px; height: 26px; transform: translateX(-50%); background: #000; border-radius: 20px; z-index: 3; }
.screen { position: relative; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg); color: var(--text); }
/* The captures start below the status bar, so leave room for the notch. */
.app-shot { position: absolute; top: 40px; left: 0; display: block; width: 100%; height: calc(100% - 40px); object-fit: cover; object-position: top; }

.brackets { position: absolute; inset: 22% 14% 14%; }
.brackets i { position: absolute; width: 26px; height: 26px; border: 3.5px solid #fff; border-radius: 4px; }
.brackets i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.brackets i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.brackets i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.brackets i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }


.float-widget { position: absolute; width: 190px; height: auto; left: calc(50% - 262px); top: 330px; border-radius: 20px; box-shadow: 0 24px 50px -12px rgba(0,0,0,.5); animation: bob 6s ease-in-out infinite; }
.float-chip { position: absolute; right: max(0px, calc(50% - 250px)); top: 34px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.95); color: var(--text); font-size: 13px; font-weight: 700; padding: 10px 14px; border-radius: 999px; box-shadow: 0 16px 32px -10px rgba(0,0,0,.4); animation: bob 6s ease-in-out -3s infinite; }
.float-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bright); box-shadow: 0 0 0 4px rgba(76,175,125,.25); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (max-width: 900px) {
  .hero { padding-top: 104px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero .stores, .hero-points { justify-content: center; }
  .hero-visual { margin-top: 8px; }
}
@media (max-width: 520px) {
  .phone { width: 264px; }
  .float-widget { display: none; }
  .float-chip { display: none; }
  .store { min-width: 0; flex: 1 1 150px; padding: 0 14px 0 12px; }
  .store span { font-size: 17px; }
}

/* Entrance and reveal motion */
.rise { animation: rise .9s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }
.steps [data-reveal]:nth-child(2), .bento [data-reveal]:nth-child(2) { transition-delay: 90ms; }
.steps [data-reveal]:nth-child(3), .bento [data-reveal]:nth-child(3) { transition-delay: 180ms; }
.bento [data-reveal]:nth-child(4) { transition-delay: 90ms; }
.bento [data-reveal]:nth-child(5) { transition-delay: 180ms; }

/* Dish ticker */
.ticker { background: var(--deep); color: var(--on-accent); overflow: hidden; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.06); }
.ticker-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker li { display: flex; align-items: center; gap: 8px; padding: 0 22px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.ticker li::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--bright); margin-left: 22px; }
.ticker .flag { width: 24px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); object-fit: cover; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* How it works */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { position: relative; background: var(--card); border-radius: 24px; padding: 20px 22px 26px; box-shadow: var(--shadow-card); }
.step .num { position: absolute; top: 18px; left: 18px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.step h3 { font-size: 21px; letter-spacing: -.02em; margin: 20px 0 6px; }
.step p { margin: 0; color: var(--text-secondary); }
.step-art { height: 190px; border-radius: 18px; background: #EEF3EF; display: grid; place-items: center; overflow: hidden; }
.mini-cam { position: relative; width: 150px; height: 150px; border-radius: 22px; background: radial-gradient(circle at 50% 45%, #F6C33B 0 16%, #F4E9D2 17% 30%, #fff 31% 46%, #5B3A22 47%); }
.mini-cam .brackets { inset: 16px; }
.mini-cam .brackets i { width: 20px; height: 20px; border-width: 3px; }
.mini-cam .shutter { position: absolute; left: 50%; bottom: -26px; width: 0; }
.mini-list { width: 82%; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-card); padding: 4px 14px; }
.mini-list div { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.mini-list div:last-child { border: 0; }
.mini-list em { font-style: normal; color: var(--text-secondary); }
.mini-list .edit em { color: var(--accent); background: var(--accent-tint); padding: 0 8px; border-radius: 8px; }
.mini-list div:last-child em { color: var(--accent); }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring-bg { stroke: #D6E4DB; }
.ring-fg { stroke: var(--accent); stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.in .ring-fg { stroke-dashoffset: 120; }
.ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.ring b { font-size: 28px; color: var(--text); letter-spacing: -.03em; line-height: 1; }

.describe { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; background: var(--deep-2); color: var(--on-accent); border-radius: 24px; padding: clamp(24px, 4vw, 40px); }
.describe h3 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; margin: 0 0 8px; }
.describe p { margin: 0; color: rgba(251,248,241,.82); }
.bubble-pair { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 90%; padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.4; }
.bubble.you { align-self: flex-end; background: var(--on-accent); color: var(--text); border-bottom-right-radius: 6px; }
.bubble.eata { align-self: flex-start; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-bottom-left-radius: 6px; }
.bubble.eata b { color: var(--on-accent-soft); }
@media (max-width: 860px) { .steps, .describe { grid-template-columns: 1fr; } }

/* Caribbean split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-copy .sub { margin-bottom: 24px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 34px; color: var(--text-secondary); }
.ticks li::before { content: ''; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; }
.ticks b { color: var(--text); }
.split-visual { display: flex; justify-content: center; }
.phone-sm { width: 290px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split-copy { text-align: left; } }

/* Feature tour: a list of features beside one large screenshot. On phones each feature opens in place with its image. */
.tour { position: relative; display: flex; align-items: center; max-width: 1000px; min-height: 585px; margin: 0 auto; padding-right: 472px; }
.tour-list { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 520px; }
.tour-item { border-bottom: 1px solid var(--border); box-shadow: inset 0 0 0 var(--accent); transition: box-shadow .35s var(--ease); }
.tour-item:last-child { border-bottom: 0; }
.tour-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.tour-tab {
  display: block; width: 100%; padding: 18px 0 18px 20px; border: 0; background: none; cursor: pointer; text-align: left;
  font: 700 clamp(18px, 2vw, 21px)/1.3 var(--font); color: var(--text-secondary); transition: color .2s;
}
.tour-tab:hover, .tour-item.active .tour-tab { color: var(--text); }
.tour-desc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.tour-item.active .tour-desc { grid-template-rows: 1fr; }
.tour-desc p { overflow: hidden; margin: 0; padding: 0 0 0 20px; color: var(--text-secondary); font-size: 17px; }
.tour-item.active .tour-desc p { padding-bottom: 20px; }
.tour-panel img {
  position: absolute; top: 0; right: 0; width: 400px; height: auto; border-radius: 28px; box-shadow: var(--shadow-raised);
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .4s var(--ease), transform .5s var(--ease); pointer-events: none;
}
.tour-item.active .tour-panel img { opacity: 1; transform: none; }
@media (max-width: 960px) { .tour { padding-right: 392px; min-height: 497px; } .tour-panel img { width: 340px; } }
@media (max-width: 860px) {
  .tour { display: block; min-height: 0; padding-right: 0; }
  .tour-list { max-width: 480px; margin: 0 auto; }
  .tour-desc, .tour-desc p { transition: none; }
  .tour-panel img { position: static; display: none; width: 100%; max-width: 420px; margin: 0 auto 24px; opacity: 1; transform: none; }
  .tour-item.active .tour-panel img { display: block; }
}

/* Feature bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.tile { background: var(--card); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-card); overflow: hidden; }
.tile h3 { font-size: 21px; letter-spacing: -.02em; margin: 0 0 6px; }
.tile p { margin: 0; color: var(--text-secondary); }
.tile-target { grid-column: span 3; }
.tile-trend { grid-column: span 3; }
.tile-widget { grid-column: span 2; grid-row: span 2; background: linear-gradient(160deg, #EEF3EF, #DCEBE2); display: flex; flex-direction: column; }
.tile-widget img { width: 100%; height: auto; margin-top: auto; padding-top: 24px; filter: drop-shadow(0 18px 30px rgba(18,56,38,.28)); }
.tile-saved { grid-column: span 4; }
.saved-shot { display: block; width: 100%; max-width: 420px; height: auto; margin-top: 20px; border-radius: 16px; box-shadow: var(--shadow-card); }
.tile-private { grid-column: span 4; background: var(--ink); color: #fff; }
.tile-private p { color: rgba(255,255,255,.75); }
.macro-bars { display: grid; gap: 12px; margin-top: 22px; }
.macro-bars div { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.macro-bars i { height: 10px; border-radius: 6px; background: var(--sunken); position: relative; overflow: hidden; }
.macro-bars i::after { content: ''; position: absolute; inset: 0; width: var(--w); background: var(--c); border-radius: 6px; transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease) .3s; }
.in .macro-bars i::after { transform: scaleX(1); }
.bars { width: 100%; height: auto; margin-top: 22px; }
.bar-g rect { fill: #CFE2D6; }
.bar-g .today { fill: var(--accent); }
.target { stroke: var(--protein); stroke-width: 1.5; stroke-dasharray: 4 5; }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile-target, .tile-trend, .tile-saved, .tile-private { grid-column: span 2; }
  .tile-widget { grid-column: span 2; grid-row: auto; }
  .tile-widget img { max-width: 360px; margin: 0 auto; }
}

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border-radius: 18px; box-shadow: var(--shadow-card); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 22px; font-weight: 700; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: 0; padding: 0 22px 22px; color: var(--text-secondary); }

/* Final CTA */
.cta { background: radial-gradient(90% 120% at 50% 0%, #2B7351, var(--deep-2) 55%, var(--deep)); color: var(--on-accent); padding: clamp(72px, 10vw, 120px) 0; text-align: center; }
.cta-mark { width: 72px; height: auto; margin: 0 auto 20px; }
.cta h2 { max-width: 16ch; margin: 0 auto; }
.cta p { margin: 14px 0 30px; font-size: 18px; color: rgba(251,248,241,.84); }

/* Footer */
.site-footer .foot { max-width: var(--max); display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.foot-logo { height: 32px; width: auto; margin-bottom: 8px; }
.foot-note { max-width: 46ch; }
@media (max-width: 700px) { .site-footer .foot { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
}
