/* ============================================================
   Food AI — UI Redesign v1 (Prototype)
   Design tokens → component layer → sections → responsive
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
    /* Brand — keep the existing green, re-tune for depth and contrast */
    --brand-900: #05371C;
    --brand-800: #065E2C;
    --brand-700: #067A3C;
    --brand-600: #079447;
    --brand-500: #0BA653;
    --brand-100: #E4F4E8;
    --brand-50:  #F2FAF4;

    /* Accent — the app's lemon yellow, demoted from "fill" to "accent" */
    --lemon-600: #E0A800;
    --lemon-500: #FFC400;
    --lemon-100: #FFF3C4;
    --lemon-50:  #FFFBEB;

    /* Ink */
    --ink-900: #10140F;
    --ink-800: #1B211A;
    --ink-700: #2C352C;
    --ink-500: #5C6660;
    --ink-400: #7E8881;
    --ink-300: #A6AEA8;

    /* Surfaces */
    --surface:    #FFFFFF;
    --surface-2:  #F6F9F6;
    --surface-3:  #EFF4F0;
    --canvas:     #FFFDF7;
    --line:       #E4EDE6;
    --line-soft:  #EFF4F0;

    /* Semantic */
    --protein: #F5A524;
    --carbs:   #35A7E8;
    --fat:     #E8637F;

    /* Type scale — 1.25 ratio, 4 clear steps */
    --fs-display: clamp(2.75rem, 1.6rem + 4.4vw, 4.5rem);
    --fs-h1:      clamp(2.125rem, 1.45rem + 2.6vw, 3.25rem);
    --fs-h2:      clamp(1.75rem, 1.3rem + 1.7vw, 2.5rem);
    --fs-h3:      clamp(1.125rem, 1.03rem + 0.4vw, 1.375rem);
    --fs-lead:    clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    --fs-body:    1rem;
    --fs-sm:      0.9375rem;
    --fs-xs:      0.8125rem;

    /* Space — 8px base */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 40px; --s-8: 48px;
    --s-9: 64px; --s-10: 80px; --s-11: 96px; --s-12: 128px;

    /* Radius */
    --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-full: 999px;

    /* Elevation — one light source, top-down */
    --sh-1: 0 1px 2px rgba(16, 32, 20, .04), 0 4px 12px rgba(16, 32, 20, .05);
    --sh-2: 0 2px 6px rgba(16, 32, 20, .05), 0 14px 34px rgba(16, 32, 20, .08);
    --sh-3: 0 4px 10px rgba(16, 32, 20, .06), 0 28px 60px rgba(16, 32, 20, .12);
    --sh-green: 0 8px 24px rgba(7, 148, 71, .22);

    /* Motion */
    --ease: cubic-bezier(.22, .8, .24, 1);
    --t-fast: 150ms;
    --t-mid: 260ms;
    --t-slow: 520ms;

    --shell: 1152px;
    --header-h: 76px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: var(--fs-body);
    line-height: 1.65;
    color: var(--ink-800);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
}

img, svg { display: block; max-width: 100%; }
button { border: 0; padding: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
dl, dd { margin: 0; }

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

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

.shell {
    width: min(var(--shell), calc(100% - 48px));
    margin-inline: auto;
}

/* ---------- 3. Type helpers ---------- */
.t-display {
    font-size: var(--fs-display);
    line-height: 1.04;
    letter-spacing: -.035em;
    font-weight: 700;
    color: var(--ink-900);
}
.t-h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -.028em; font-weight: 700; color: var(--ink-900); }
.t-h2 { font-size: var(--fs-h2); line-height: 1.16; letter-spacing: -.022em; font-weight: 700; color: var(--ink-900); }
.t-h3 { font-size: var(--fs-h3); line-height: 1.32; letter-spacing: -.014em; font-weight: 650; color: var(--ink-900); }
.t-lead {
    font-size: var(--fs-lead);
    line-height: 1.68;
    color: var(--ink-500);
    letter-spacing: -.005em;
}
.t-body { font-size: var(--fs-body); line-height: 1.68; color: var(--ink-500); }
.t-sm { font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-500); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Eyebrow: small, sentence case, prefixed with a rule — not shouty ALL CAPS */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--brand-700);
    letter-spacing: -.005em;
}
.eyebrow::before {
    content: '';
    width: 22px; height: 2px;
    background: var(--brand-600);
    border-radius: 2px;
}
.eyebrow--muted { color: var(--ink-400); }
.eyebrow--muted::before { background: var(--ink-300); }

/* ---------- 4. Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 26px;
    border-radius: var(--r-full);
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -.01em;
    white-space: nowrap;
    transition: transform var(--t-mid) var(--ease),
                background-color var(--t-fast) ease,
                box-shadow var(--t-mid) var(--ease),
                border-color var(--t-fast) ease,
                color var(--t-fast) ease;
}
.btn--primary {
    background: var(--brand-700);
    color: #fff;
    box-shadow: var(--sh-green);
}
.btn--primary:hover { background: var(--brand-800); transform: translateY(-2px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
    background: transparent;
    color: var(--ink-800);
    border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--ink-300); background: var(--surface-2); }
.btn--onDark { background: #fff; color: var(--brand-800); }
.btn--onDark:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.btn--onDarkGhost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.32); }
.btn--onDarkGhost:hover { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); }

.btn__arrow { transition: transform var(--t-mid) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Store badges */
.store-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.store-badge {
    display: inline-flex;
    align-items: center;
    height: 52px;
    padding: 0 20px;
    border-radius: var(--r-md);
    background: var(--ink-900);
    color: #fff;
    transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,20,15,.2); }
.store-badge img { height: 44px; width: auto; }
.store-badge--outline {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-700);
}
.store-badge--outline:hover { background: var(--surface-2); border-color: var(--ink-300); }

/* ---------- 5. Header ---------- */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-mid) ease, background-color var(--t-mid) ease,
                box-shadow var(--t-mid) ease;
}
.header.is-scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 1px 20px rgba(16, 32, 20, .05);
}
.header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-6);
    width: min(var(--shell), calc(100% - 48px));
    margin-inline: auto;
}
.header__logo {
    display: block;
    width: 168px; height: 44px;
    background: url('../image/redesign-logo.webp') left center / contain no-repeat;
    text-indent: -99em;
    overflow: hidden;
}
.header__nav { justify-self: center; }
.header__nav ul { display: flex; align-items: center; gap: 34px; }
.header__nav a,
.header__nav button {
    position: relative;
    font-size: 1rem;
    font-weight: 550;
    color: var(--ink-700);
    padding: 6px 0;
    transition: color var(--t-fast) ease;
}
.header__nav a::after,
.header__nav button::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--brand-600);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-mid) var(--ease);
}
.header__nav a:hover, .header__nav button:hover { color: var(--brand-700); }
.header__nav a:hover::after, .header__nav button:hover::after { transform: scaleX(1); }
.header__nav .is-current a,
.header__nav .is-current button { color: var(--brand-700); }
.header__nav .is-current a::after,
.header__nav .is-current button::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: var(--s-3); justify-self: end; }
.header__cta {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 20px;
    border-radius: var(--r-full);
    background: var(--brand-700);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 650;
    transition: background-color var(--t-fast) ease, transform var(--t-mid) var(--ease);
}
.header__cta:hover { background: var(--brand-800); transform: translateY(-1px); }

.lang {
    position: relative;
    font-size: .875rem;
}
.lang summary {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--ink-700);
    font-weight: 600;
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--t-fast) var(--ease);
}
.lang summary:hover, .lang[open] summary {
    background: var(--brand-50);
    color: var(--brand-800);
}
.lang[open] summary::after { transform: translateY(2px) rotate(225deg); }
.lang__options {
    position: absolute;
    z-index: 2;
    top: calc(100% + 8px);
    right: 0;
    width: 156px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--sh-2);
}
.lang__options a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
}
.lang__options a:hover, .lang__options a[aria-current] {
    background: var(--brand-50);
    color: var(--brand-800);
}
.lang__options a[aria-current] { font-weight: 700; }
.lang__options a[aria-current]::after { content: '✓' / ''; }

.header__burger { display: none; width: 42px; height: 42px; border-radius: var(--r-md); }
.header__burger span {
    display: block; width: 20px; height: 2px; margin: 0 auto;
    background: var(--ink-800); border-radius: 2px;
    transition: transform var(--t-mid) var(--ease), opacity var(--t-fast) ease;
}
.header__burger span + span { margin-top: 5px; }

/* ---------- 6. Reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 7. Hero ---------- */
.hero {
    position: relative;
    padding: calc(var(--header-h) + 88px) 0 var(--s-11);
    background:
        radial-gradient(900px 520px at 78% 8%, var(--lemon-50) 0%, rgba(255,251,235,0) 62%),
        radial-gradient(760px 480px at 6% 88%, var(--brand-50) 0%, rgba(242,250,244,0) 60%),
        var(--surface);
    overflow: hidden;
}
.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: var(--s-9);
    align-items: center;
}
.hero__title { margin-top: var(--s-5); }
.hero__title em {
    font-style: normal;
    color: var(--brand-700);
    position: relative;
    white-space: nowrap;
    display: inline-block;
}
/* The underline sits behind the glyphs but must not be clipped by the
   .fx-word overflow box created by the word-by-word reveal. */
.hero__title em::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0.04em;
    height: 0.26em;
    background: var(--lemon-100);
    border-radius: 2px;
    z-index: 0;
    pointer-events: none;
}
.hero__title em .fx-word { position: relative; z-index: 1; }
.hero__title em .fx-word__i { position: relative; z-index: 1; }
.hero__lead { margin-top: var(--s-5); max-width: 30em; }
.hero__actions {
    margin-top: var(--s-7);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.hero__note {
    margin-top: var(--s-4);
    font-size: var(--fs-sm);
    color: var(--ink-400);
}
/* Bridge note for the store listing name mismatch (App Store: "Lifooda",
   website: "Food AI"). Shown next to the download CTA so users know it is
   the same app before they tap through. */
.hero__note-alt {
    display: block;
    margin-top: 4px;
    font-size: var(--fs-xs);
    color: var(--ink-300);
}

/* Hero visual: real photo + floating result card */
.hero__visual { position: relative; padding-bottom: 34px; }
.hero__photo {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    aspect-ratio: 4 / 3.35;
    background: var(--surface-3) url('../image/redesign-scenes/real-life-moments.webp') left center / 300% 100% no-repeat;
    box-shadow: var(--sh-3);
}
.hero__photo::after {
    content: '';
    position: absolute; inset: 0;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(8, 22, 12, .5) 0%, rgba(8, 22, 12, .04) 40%, rgba(8,22,12,0) 66%);
}
.hero__photo-caption {
    position: absolute;
    left: 26px; right: 26px; top: 22px;
    z-index: 7;
    color: #fff;
}
.hero__photo-caption strong { display: block; font-size: 1.125rem; font-weight: 650; letter-spacing: -.015em; text-shadow: 0 1px 12px rgba(8,22,12,.4); }
.hero__photo-caption span { font-size: var(--fs-sm); color: rgba(255,255,255,.82); text-shadow: 0 1px 10px rgba(8,22,12,.4); }

.hero__card {
    position: absolute;
    left: -40px; bottom: -30px;
    z-index: 3;
    width: 268px;
    padding: 18px 20px 20px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}
.hero__card-head {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line-soft);
}
.hero__card-thumb {
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--surface-3) url('../image/redesign-scenes/real-life-moments.webp') left center / 300% 100% no-repeat;
    flex-shrink: 0;
}
.hero__card-title { font-size: 0.875rem; font-weight: 650; color: var(--ink-900); line-height: 1.3; }
.hero__card-sub { font-size: 0.75rem; color: var(--ink-400); }
.hero__card-kcal {
    display: flex; align-items: baseline; gap: 6px;
    padding: 13px 0 4px;
}
.hero__card-kcal b { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; color: var(--ink-900); }
.hero__card-kcal span { font-size: 0.875rem; font-weight: 600; color: var(--ink-400); }
.hero__macros { display: grid; gap: 7px; margin-top: 8px; }
.hero__macro {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--ink-500);
}
.hero__macro-track { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.hero__macro-fill { display: block; height: 100%; border-radius: 3px; transform-origin: left; }
.hero__macro b { color: var(--ink-800); font-weight: 650; }

.hero__chips {
    position: absolute;
    right: -20px; top: 28px;
    z-index: 3;
    display: grid;
    gap: 8px;
}
.hero__chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    border-radius: var(--r-full);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--sh-1);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-700);
    white-space: nowrap;
}
.hero__chip i { width: 7px; height: 7px; border-radius: 50%; display: block; }

/* Hero flow strip */
.flow {
    margin-top: var(--s-10);
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: var(--s-5);
    flex-wrap: wrap;
}
.flow__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-400); }
.flow__steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow__step {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: var(--fs-sm);
    font-weight: 550;
    color: var(--ink-800);
}
.flow__step i {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 0.6875rem;
    font-weight: 700;
    font-style: normal;
}
.flow__sep { width: 18px; height: 1px; background: var(--line); }

/* ---------- 8. Section frame ---------- */
.section { padding: var(--s-12) 0; }
.section--tint { background: var(--surface-2); }
.section--canvas { background: var(--canvas); }

.section__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
    gap: var(--s-8);
    align-items: end;
    margin-bottom: var(--s-9);
}
.section__head p { margin-top: var(--s-4); max-width: 46ch; }
.section__head--center { display: block; text-align: center; }
.section__head--center p { margin-inline: auto; }

/* ---------- 9. How it works ---------- */
.how { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: var(--s-10); align-items: start; }

.how__steps { display: grid; gap: 2px; margin-top: var(--s-8); }
.how__step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--s-4);
    align-items: start;
    width: 100%;
    text-align: left;
    padding: 18px 18px 18px 12px;
    border-radius: var(--r-md);
    border-left: 2px solid var(--line);
    transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.how__step:hover { background: var(--surface-2); }
.how__step.is-active { background: var(--brand-50); border-left-color: var(--brand-600); }
.how__step-num {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-400);
    font-size: 0.8125rem;
    font-weight: 700;
    transition: background-color var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}
.how__step.is-active .how__step-num { background: var(--brand-700); color: #fff; }
.how__step-title { display: block; font-size: 1.0625rem; font-weight: 650; color: var(--ink-900); letter-spacing: -.012em; }
.how__step.is-active .how__step-title { color: var(--brand-800); }
.how__step-desc { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-500); line-height: 1.55; }

.how__stage {
    position: relative;
    display: grid;
    place-items: center;
    padding: var(--s-7) 0 72px;
    background: var(--surface-2);
    border-radius: var(--r-xl);
    border: 1px solid var(--line-soft);
    overflow: hidden;
}
.how__screens { position: relative; width: 252px; height: 500px; }
.how__screen {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: translateY(14px) scale(.985);
    transition: opacity 420ms var(--ease), transform 420ms var(--ease);
    filter: drop-shadow(0 20px 44px rgba(16, 32, 20, .18));
}
.how__screen.is-active { opacity: 1; transform: none; }

.how__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.how__progress span {
    display: block; height: 100%;
    background: var(--brand-600);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform var(--t-slow) var(--ease);
}
.how__caption {
    position: absolute;
    left: 50%; bottom: 22px;
    transform: translateX(-50%);
    max-width: 78%;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--ink-500);
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(8px);
    padding: 7px 15px;
    border-radius: var(--r-full);
    border: 1px solid var(--line-soft);
}

/* ---------- 10. Result / data section ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: var(--s-10); align-items: center; }
.result__copy p { margin-top: var(--s-4); max-width: 44ch; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-2);
    overflow: hidden;
}
.panel__top {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    padding: 18px 24px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-2);
}
.panel__dish { display: flex; align-items: center; gap: 12px; }
.panel__dish-thumb {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--surface-3) url('../image/redesign-scenes/real-life-moments.webp') center center / 300% 100% no-repeat;
}
.panel__dish-name { font-size: 1rem; font-weight: 650; color: var(--ink-900); letter-spacing: -.015em; }
.panel__dish-sub { font-size: 0.8125rem; color: var(--ink-400); }
.panel__badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    border-radius: var(--r-full);
    background: var(--brand-100);
    color: var(--brand-800);
    font-size: 0.75rem;
    font-weight: 650;
}
.panel__badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-600); }

.panel__body { padding: 24px; }
.panel__kcal { display: flex; align-items: center; gap: var(--s-7); }
.ring { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__center {
    position: absolute; inset: 0;
    display: grid; place-content: center; text-align: center;
}
.ring__val { font-size: 2.125rem; font-weight: 700; letter-spacing: -.035em; color: var(--ink-900); line-height: 1; }
.ring__unit { font-size: 0.75rem; font-weight: 600; color: var(--ink-400); margin-top: 4px; }

.macros { flex: 1; display: grid; gap: 16px; }
.macro__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.macro__name { font-size: 0.875rem; font-weight: 600; color: var(--ink-700); }
.macro__val { font-size: 0.875rem; font-weight: 650; color: var(--ink-900); }
.macro__val small { color: var(--ink-400); font-weight: 500; }
.macro__track { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.macro__fill { height: 100%; border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 900ms var(--ease); }

.panel__ingredients {
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line-soft);
    display: grid;
    gap: 12px;
}
.panel__ing-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.875rem; font-weight: 650; color: var(--ink-900); }
.panel__ing-head span { font-size: 0.75rem; font-weight: 550; color: var(--brand-700); }
.panel__ing-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s-4); align-items: center; font-size: 0.875rem; }
.panel__ing-row span:first-child { color: var(--ink-700); }
.panel__ing-row span:nth-child(2) { color: var(--ink-400); font-size: 0.8125rem; }
.panel__ing-row b { font-weight: 650; color: var(--ink-900); }
.panel__ing-row.is-edited b { color: var(--brand-700); }

.panel__cta { display: flex; gap: var(--s-3); margin-top: var(--s-6); flex-wrap: wrap; }

/* ---------- 11. Tabs (day / tools) ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-full); width: fit-content; flex-wrap: wrap; }
.tab {
    padding: 10px 20px;
    border-radius: var(--r-full);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink-500);
    transition: background-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-mid) var(--ease);
}
.tab:hover { color: var(--ink-900); }
.tab.is-active { background: var(--surface); color: var(--brand-800); box-shadow: var(--sh-1); }

.day { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-10); align-items: center; }
.day__media { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 124px; gap: var(--s-4); align-items: stretch; height: 520px; }
.day__main {
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--line-soft);
    box-shadow: var(--sh-2);
    height: 100%;
}
.day__main img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.day__thumbs { display: grid; grid-template-rows: repeat(3, 1fr); gap: var(--s-3); min-height: 0; }
.day__thumb {
    border-radius: var(--r-md);
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--surface-3);
    min-height: 0;
    transition: border-color var(--t-fast) ease, transform var(--t-mid) var(--ease), opacity var(--t-fast) ease;
    opacity: .62;
}
.day__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.day__thumb:hover { opacity: 1; transform: translateY(-2px); }
.day__thumb.is-active { border-color: var(--brand-600); opacity: 1; }

.day__list { display: grid; gap: 0; margin-top: var(--s-6); }
.day__item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: var(--s-4);
    padding: 20px 0;
    border-top: 1px solid var(--line);
    text-align: left;
    width: 100%;
    transition: opacity var(--t-fast) ease;
}
.day__item:last-child { border-bottom: 1px solid var(--line); }
.day__item-num { font-size: 0.8125rem; font-weight: 700; color: var(--ink-300); transition: color var(--t-fast) ease; }
.day__item.is-active .day__item-num { color: var(--brand-600); }
.day__item-title { display: block; font-size: 1.0625rem; font-weight: 650; color: var(--ink-900); letter-spacing: -.012em; }
.day__item.is-active .day__item-title { color: var(--brand-800); }
.day__item p { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-500); }

/* ---------- 12. Tools list ---------- */
.tools { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: var(--s-10); align-items: start; }
.tools__list { display: grid; gap: 10px; }
.tool {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: var(--s-4);
    align-items: center;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease,
                transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.tool:hover {
    border-color: var(--brand-600);
    background: var(--brand-50);
    transform: translateX(4px);
    box-shadow: var(--sh-1);
}
.tool__icon {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: var(--brand-100);
    color: var(--brand-700);
}
.tool:hover .tool__icon { background: var(--brand-700); color: #fff; }
.tool__icon svg { width: 22px; height: 22px; }
.tool__name { display: block; font-size: 1.0625rem; font-weight: 650; color: var(--ink-900); letter-spacing: -.012em; }
.tool__desc { display: block; margin-top: 3px; font-size: var(--fs-sm); color: var(--ink-500); }
.tool__arrow { color: var(--ink-300); transition: transform var(--t-mid) var(--ease), color var(--t-fast) ease; }
.tool:hover .tool__arrow { transform: translateX(4px); color: var(--brand-600); }

/* ---------- 13. Moments ---------- */
.moments { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.moment {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    aspect-ratio: 4 / 3.2;
    isolation: isolate;
}
/* The source is a 3-up contact sheet; each card crops one third of it. */
.moment__img {
    position: absolute;
    inset: 0;
    background-image: url('../image/redesign-scenes/real-life-moments.webp');
    background-size: 300% 100%;
    background-repeat: no-repeat;
    transition: transform 700ms var(--ease);
}
.moment:hover .moment__img { transform: scale(1.045); }
.moment--lunch .moment__img { background-position: left center; }
.moment--home  .moment__img { background-position: center center; }
.moment--busy  .moment__img { background-position: right center; }
.moment__veil {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(8, 22, 12, .78) 0%, rgba(8,22,12,.16) 52%, rgba(8,22,12,0) 78%);
}
.moment__body { position: absolute; left: 22px; right: 22px; bottom: 20px; color: #fff; }
.moment__body h3 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.015em; }
.moment__body p { margin-top: 4px; font-size: var(--fs-sm); color: rgba(255,255,255,.8); }
.moment__tag {
    position: absolute; top: 16px; left: 16px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: rgba(255,255,255,.92);
    color: var(--ink-800);
    font-size: 0.75rem;
    font-weight: 650;
    backdrop-filter: blur(6px);
}

/* ---------- 14. FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: var(--s-10); align-items: start; }
.faq__list { display: grid; gap: 8px; }
.faq__item {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
    transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.faq__item.is-open { border-color: var(--brand-600); background: var(--brand-50); }
.faq__q {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    width: 100%;
    padding: 19px 22px;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -.01em;
}
.faq__icon {
    position: relative;
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-2);
    transition: background-color var(--t-fast) ease, transform var(--t-mid) var(--ease);
}
.faq__icon::before, .faq__icon::after {
    content: ''; position: absolute; inset: 50% 7px auto 7px;
    height: 2px; background: var(--ink-700); border-radius: 2px;
    transform: translateY(-50%);
}
.faq__icon::after { transform: translateY(-50%) rotate(90deg); transition: opacity var(--t-fast) ease, transform var(--t-mid) var(--ease); }
.faq__item.is-open .faq__icon { background: var(--brand-700); }
.faq__item.is-open .faq__icon::before { background: #fff; }
.faq__item.is-open .faq__icon::after { opacity: 0; transform: translateY(-50%) rotate(0deg); }

.faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease); }
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p { padding: 0 22px 20px; font-size: var(--fs-sm); color: var(--ink-500); line-height: 1.7; }
.faq__a p + p { padding-top: 0; }

/* ---------- 15. CTA ---------- */
.cta { position: relative; padding: var(--s-12) 0; background: var(--brand-900); overflow: hidden; }
.cta::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(680px 400px at 22% 12%, rgba(11, 166, 83, .34) 0%, rgba(5,55,28,0) 62%),
                radial-gradient(520px 340px at 84% 88%, rgba(255, 196, 0, .16) 0%, rgba(5,55,28,0) 60%);
}
.cta__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-9); align-items: center; }
.cta__title { color: #fff; }
.cta__lead { margin-top: var(--s-4); color: rgba(255,255,255,.72); max-width: 46ch; }
.cta__mail { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s-5); color: var(--lemon-100); font-weight: 600; }
.cta__mail:hover { color: #fff; }
.cta__actions { display: grid; gap: var(--s-3); justify-items: stretch; }
.cta__actions .btn { justify-content: center; }

/* ---------- 16. Footer ---------- */
.footer { background: var(--brand-900); color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.09); padding: var(--s-8) 0 var(--s-6); }
.footer__top { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .7fr)); gap: var(--s-8); padding-bottom: var(--s-8); }
.footer__logo { width: 152px; height: 40px; background: url('../image/redesign-footer-logo.webp') left center / contain no-repeat; text-indent: -99em; overflow: hidden; }
.footer__blurb { margin-top: var(--s-4); font-size: var(--fs-sm); max-width: 34ch; }
.footer__title { font-size: 0.8125rem; font-weight: 700; color: rgba(255,255,255,.42); letter-spacing: .04em; margin-bottom: var(--s-4); }
.footer__links { display: grid; gap: 12px; }
.footer__links a, .footer__links button { font-size: 0.9375rem; color: rgba(255,255,255,.68); transition: color var(--t-fast) ease; }
.footer__links a:hover, .footer__links button:hover { color: #fff; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,.09); font-size: 0.875rem; flex-wrap: wrap; }
.footer__legal { display: flex; gap: var(--s-5); }
.footer__legal a:hover { color: #fff; }

/* ---------- 17. Responsive ---------- */
@media (max-width: 1080px) {
    .hero__grid { grid-template-columns: 1fr; gap: var(--s-8); }
    .hero__visual { max-width: 560px; }
    .hero__card { left: -14px; }
    .hero__chips { right: -8px; }
    .section__head { grid-template-columns: 1fr; align-items: start; }
    .how { grid-template-columns: 1fr; gap: var(--s-8); }
    .result { grid-template-columns: 1fr; gap: var(--s-8); }
    .day { grid-template-columns: 1fr; gap: var(--s-8); }
    .tools { grid-template-columns: 1fr; gap: var(--s-7); }
    .faq { grid-template-columns: 1fr; gap: var(--s-7); }
    .cta__inner { grid-template-columns: 1fr; gap: var(--s-7); }
    .cta__actions { justify-items: start; }
    .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (861px <= width <= 1000px) {
    .header__inner { gap: 20px; }
    .header__nav ul { gap: 20px; }
    .header__nav a, .header__nav button { white-space: nowrap; }
}

@media (max-width: 860px) {
    /* A backdrop-filter on .header would become the containing block for the
       fixed-position nav panel, shrinking it to the header's box. Solid header
       on small screens keeps the panel anchored to the viewport. */
    .header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--surface);
    }
    .header__nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        width: 100%;
        justify-self: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        padding: var(--s-5) 24px var(--s-6);
        box-shadow: var(--sh-2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease),
                    visibility var(--t-mid) linear;
    }
    .header__nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .header__nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .header__nav li { border-bottom: 1px solid var(--line-soft); }
    .header__nav a, .header__nav button { display: block; width: 100%; text-align: left; padding: 15px 0; font-size: 1.0625rem; }
    .header__nav a::after, .header__nav button::after { display: none; }
    .header__burger { display: block; }
    .header__cta { display: none; }
    .header__inner { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
    .header__logo { width: min(168px, 100%); }
    .header__actions { gap: 8px; }
    .section { padding: var(--s-11) 0; }
    .moments { grid-template-columns: 1fr; }
    .moment { aspect-ratio: 16 / 10; }
    .footer__top { grid-template-columns: 1fr; gap: var(--s-7); }
}

@media (max-width: 560px) {
    .shell, .header__inner { width: calc(100% - 40px); }
    .hero { padding-top: calc(var(--header-h) + 56px); }
    .hero__actions .btn, .hero__actions .store-badge { width: 100%; justify-content: center; }
    .store-row { width: 100%; }
    .hero__card { position: static; width: auto; margin-top: var(--s-4); animation: none; }
    .hero__chips { position: static; margin-top: var(--s-4); display: flex; flex-wrap: wrap; }
    .hero__photo { aspect-ratio: 4 / 3; }
    .flow { gap: var(--s-3); }
    .panel__kcal { flex-direction: column; align-items: flex-start; gap: var(--s-5); }
    .day__media { grid-template-columns: minmax(0,1fr) 96px; height: 420px; }
    .tool { grid-template-columns: 40px 1fr auto; padding: 16px 16px; }
    .tool__icon { width: 40px; height: 40px; }
}

/* ---------- 18. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}


/* Legacy homepage links remain valid for existing pages. */
.legacy-anchor { display: block; height: 0; scroll-margin-top: calc(var(--header-h) + 16px); }

/* Original homepage intro, below the fixed redesign header. */
.hero.home-intro {
    --intro-width: min(1152px, calc(100% - 48px));
    padding: var(--header-h) 0 clamp(24px, 4vw, 48px);
    background: linear-gradient(180deg, #f7fbf4, #edf7ed);
    color: #171a18;
}
.home-intro .banner {
    display: grid;
    grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
    align-items: center;
    gap: clamp(24px, 4vw, 56px);
    width: var(--intro-width);
    margin: 0 auto;
    padding-top: clamp(32px, 4.5vw, 68px);
    padding-bottom: clamp(24px, 3vw, 40px);
}
.home-intro .title {
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.08;
    letter-spacing: -.045em;
    font-weight: 700;
}
.home-intro .intro-title-line { display: block; text-wrap: balance; }
.home-intro .intro-title-accent { color: var(--brand-700); }
html[lang="zh-CN"] .home-intro .title { letter-spacing: -.02em; line-height: 1.18; }
.home-intro .text {
    max-width: 49ch;
    margin-top: 20px;
    color: var(--ink-700);
    font-size: clamp(16px, 1.35vw, 19px);
    line-height: 1.65;
    text-wrap: pretty;
}
.home-intro .link {
    display: flex;
    gap: clamp(12px, 1.4vw, 20px);
    margin-top: clamp(24px, 3vw, 36px);
}
.home-intro .link a {
    display: block;
    width: 214px;
    min-width: 0;
    border-radius: var(--r-sm);
    transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .home-intro .link a:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(16, 20, 15, .16);
    }
}
.home-intro .link img { width: 100%; height: auto; }
.home-intro .link a:active { opacity: .78; }
.home-intro .link a:focus-visible { outline-offset: 5px; }
.home-intro .banner-image {
    padding: clamp(12px, 2vw, 28px);
    border-radius: clamp(24px, 4vw, 52px);
    background: radial-gradient(ellipse at 75% 16%, #fff3c9, transparent 62%), #dff0e1;
}
.home-intro .banner-image img { width: 100%; height: auto; }
.home-intro .foodai-hero-result-inner {
    width: var(--intro-width);
    margin: 0 auto;
    padding: clamp(18px, 2vw, 28px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .64);
}
.home-intro .foodai-result-label {
    margin-bottom: 10px;
    color: #067a3c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
}
.home-intro .foodai-result-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    counter-reset: intro-step;
    font-size: 15px;
    font-weight: 600;
}
.home-intro .foodai-result-steps li {
    display: flex;
    align-items: center;
    gap: 9px;
    counter-increment: intro-step;
}
.home-intro .foodai-result-steps li::before {
    content: counter(intro-step);
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    height: 25px;
    border-radius: 50%;
    background: #e1f0e4;
    color: var(--brand-700);
    font-size: 12px;
}
.home-intro .foodai-result-note { margin-top: 9px; color: #66706a; font-size: 13px; line-height: 1.45; }
@media (prefers-reduced-motion: no-preference) {
    .home-intro .title.is-in .intro-title-line {
        animation: intro-title-in 440ms var(--ease) both;
    }
    .home-intro .title.is-in .intro-title-accent { animation-delay: 85ms; }
}
@keyframes intro-title-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
    .hero.home-intro { --intro-width: calc(100% - 40px); }
    .home-intro .banner { grid-template-columns: 1fr; gap: 20px; padding-top: 32px; }
    .home-intro .title { font-size: clamp(32px, 7.5vw, 48px); }
    .home-intro .banner-image { width: min(100%, 480px); justify-self: center; }
    .home-intro .foodai-result-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 14px; }
}

