/* PantryWeave — product story components (landing pages).
   Motion follows the brand vocabulary: one restrained emphasis per stage,
   profiles → kitchen → plan → cook → shop, then the sequence settles.
   No infinite loops; prefers-reduced-motion shows the settled state. */

/* Phone frame */
.phone {
    position: relative;
    width: 300px;
    max-width: 100%;
    aspect-ratio: 300 / 610;
    margin: 0 auto;
    background: var(--pw-surface);
    border: 10px solid var(--pw-text);
    border-radius: 46px;
    overflow: hidden;
}
.phone::before {
    content: "";
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 86px; height: 24px; border-radius: 999px; background: var(--pw-text); z-index: 3;
}
.screen {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    opacity: 0; transition: opacity .36s ease;
}
.screen.is-active { opacity: 1; }
/* Stage rail under the hero phone */
.stage-rail { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.stage-rail button {
    font: inherit; font-size: 12px; font-weight: 600; color: var(--pw-text-secondary);
    background: transparent; border: 1px solid var(--pw-border); border-radius: 999px; padding: 6px 12px; cursor: pointer;
    transition: background .24s ease, color .24s ease, border-color .24s ease;
}
.stage-rail button[aria-pressed="true"] { background: var(--pw-action); border-color: var(--pw-action); color: var(--pw-on-action); }

/* Problem → answer strip */
.problems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.problem { background: var(--pw-surface); border: 1px solid var(--pw-border); border-radius: var(--pw-radius-md); padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.problem q { quotes: "“" "”"; font-family: var(--pw-font-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; color: var(--pw-text); line-height: 1.35; }
.problem p { color: var(--pw-text-secondary); font-size: 0.95rem; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--pw-border); }
.problem p strong { color: var(--pw-action); font-weight: 600; }

/* Scroll story: sticky phone + steps */
.story { display: grid; grid-template-columns: 1fr 360px; gap: 72px; align-items: start; }
.story-steps { display: flex; flex-direction: column; }
.story-step { padding: 40px 0; border-top: 1px solid var(--pw-border); opacity: .45; transition: opacity .36s ease; }
.story-step:first-child { border-top: none; padding-top: 0; }
.story-step.is-active { opacity: 1; }
.story-step .step-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pw-warm); }
.story-step h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 12px 0 12px; }
.story-step p { color: var(--pw-text-secondary); font-size: 1.02rem; max-width: 520px; }
.story-step ul { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.story-step li { padding-left: 22px; position: relative; color: var(--pw-text); font-size: .98rem; }
.story-step li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 2px; background: var(--pw-accent); }
.story-step .more { display: inline-block; margin-top: 16px; font-weight: 600; color: var(--pw-accent); text-decoration: none; }
.story-step .more:hover { color: var(--pw-action); text-decoration: underline; }
.story-phone { position: sticky; top: 96px; }
.story-step .step-phone { display: none; }

/* Waste section */
.waste { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.waste-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.figure-card { background: var(--pw-surface); border: 1px solid var(--pw-border); border-radius: var(--pw-radius-md); padding: 24px; }
.figure-card strong { display: block; font-family: var(--pw-font-display); font-size: 2.2rem; font-weight: 600; letter-spacing: -0.03em; color: var(--pw-action); line-height: 1.1; }
.figure-card span { display: block; margin-top: 8px; color: var(--pw-text-secondary); font-size: .92rem; }
.figure-source { grid-column: 1 / -1; font-size: 12px; color: var(--pw-text-secondary); }
.figure-source a { color: inherit; }
.waste-points { list-style: none; display: grid; gap: 18px; margin-top: 28px; }
.waste-points li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; color: var(--pw-text-secondary); }
.waste-points li b { display: block; color: var(--pw-text); font-weight: 600; margin-bottom: 2px; }
.waste-points .dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--pw-accent); display: inline-flex; align-items: center; justify-content: center; color: var(--pw-accent); font-size: 12px; font-weight: 700; }

/* Tables: persona cards */
.tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.table-card { display: flex; flex-direction: column; gap: 10px; background: var(--pw-surface); border: 1px solid var(--pw-border); border-radius: var(--pw-radius-md); padding: 26px 24px; text-decoration: none; color: inherit; transition: border-color .24s ease, transform .24s ease; }
.table-card:hover { border-color: var(--pw-accent); transform: translateY(-2px); }
.table-card h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.table-card p { color: var(--pw-text-secondary); font-size: .95rem; }
.table-card .go { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: .92rem; color: var(--pw-accent); }
.table-card .go::after { content: " →"; }

/* Guides hub */
.guides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--pw-border); border-radius: var(--pw-radius-lg); overflow: hidden; background: var(--pw-surface); }
.guide { padding: 28px 26px; border-right: 1px solid var(--pw-border); border-bottom: 1px solid var(--pw-border); }
.guide:nth-child(4n) { border-right: none; }
.guide:nth-last-child(-n+4) { border-bottom: none; }
.guide h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 4px; }
.guide h3 a { text-decoration: none; color: var(--pw-text); }
.guide h3 a:hover { color: var(--pw-action); text-decoration: underline; }
.guide p { color: var(--pw-text-secondary); font-size: .9rem; margin-bottom: 12px; }
.guide ul { list-style: none; display: grid; gap: 6px; }
.guide li a { color: var(--pw-accent); text-decoration: none; font-size: .92rem; }
.guide li a:hover { color: var(--pw-action); text-decoration: underline; }

@media (max-width: 1080px) {
    .problems { grid-template-columns: repeat(2, 1fr); }
    .guides { grid-template-columns: repeat(2, 1fr); }
    .guide:nth-child(4n) { border-right: 1px solid var(--pw-border); }
    .guide:nth-child(2n) { border-right: none; }
    .guide:nth-last-child(-n+4) { border-bottom: 1px solid var(--pw-border); }
    .guide:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 900px) {
    .story { grid-template-columns: 1fr; gap: 0; }
    .story-phone { display: none; }
    .story-step { opacity: 1; }
    .story-step .step-phone { display: block; margin-top: 28px; }
    .story-step .step-phone .phone { width: 260px; }
    .story-step .step-phone .screen { opacity: 1; }
    .waste { grid-template-columns: 1fr; gap: 40px; }
    .tables { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .problems, .guides { grid-template-columns: 1fr; }
    .guide { border-right: none !important; border-bottom: 1px solid var(--pw-border) !important; }
    .guide:last-child { border-bottom: none !important; }
    .waste-figures { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .screen, .story-step, .table-card { transition: none !important; }
    .table-card:hover { transform: none; }
}

.ui-start { align-self: flex-start; }
.waste .lede { margin-top: 16px; }
.waste-img { grid-column: 1 / -1; width: 100%; border-radius: var(--pw-radius-md); }
.tables-img { width: 100%; border-radius: var(--pw-radius-lg); margin-bottom: 56px; aspect-ratio: 5 / 2; object-fit: cover; }

/* Real app screenshot */
.waste-figures { grid-template-columns: 220px 1fr; align-items: center; }
.figure-stack { display: grid; gap: 16px; }
.app-shot { margin: 0; }
.app-shot img { width: 100%; height: auto; border-radius: 30px; border: 8px solid var(--pw-text); display: block; }
.app-shot figcaption { font-size: 12px; color: var(--pw-text-secondary); margin-top: 10px; text-align: center; }
@media (max-width: 560px) { .waste-figures { grid-template-columns: 1fr; } .app-shot { max-width: 240px; margin: 0 auto; } }


/* Real-device frame: screenshots already contain the status bar and island */
.phone-real { background: var(--pw-canvas); border-width: 9px; aspect-ratio: 600 / 1298; }
.phone-real::before { display: block; width: 32%; height: auto; aspect-ratio: 126 / 37; top: 1.4%; z-index: 4; }

/* Hero: real app screen surrounded by the app's own food images */
.hero-visual { position: relative; min-height: 640px; display: flex; align-items: center; justify-content: center; }
.hero-visual::before { content: ""; position: absolute; width: 470px; height: 470px; border-radius: 50%; background: var(--pw-accent-soft); top: 50%; left: 50%; transform: translate(-50%, -54%); }
.hero-device { position: relative; z-index: 2; }
.hero-device .phone { width: 290px; }
.food { position: absolute; z-index: 1; height: auto; }
.food-1 { width: 96px; top: 6%; left: 4%; }
.food-2 { width: 150px; top: 2%; right: 0; }
.food-3 { width: 86px; top: 46%; left: -2%; }
.food-4 { width: 160px; bottom: 6%; right: -4%; }
.food-5 { width: 70px; bottom: 16%; left: 10%; }
.food-6 { width: 128px; bottom: 0; left: 18%; }

/* Onboarding mechanisms (web port of the app's previews) */
.start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.start-card { background: var(--pw-surface); border: 1px solid var(--pw-border); border-radius: var(--pw-radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.start-card h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; margin-top: 10px; }
.start-card p { color: var(--pw-text-secondary); }
.start-note { margin-top: 16px; font-size: 13px; color: var(--pw-text-secondary); }
.mech { background: color-mix(in srgb, var(--pw-accent-soft) 72%, transparent); border-radius: var(--pw-radius-md); min-height: 236px; display: flex; align-items: center; justify-content: center; padding: 24px; }
.mech-cook { gap: 20px; }
.mech-ingredients { flex: none; display: grid; grid-template-columns: 84px 84px; gap: 8px; }
.mech-ingredient { width: 84px; height: 84px; padding: 6px; border-radius: 50%; background: color-mix(in srgb, var(--pw-surface) 88%, transparent); transition: transform .68s cubic-bezier(.3,1.3,.5,1); }
.mech-ingredient.is-on { transform: scale(1.07); }
.mech-link { position: relative; width: 72px; height: 32px; }
.mech-link::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--pw-border) 72%, transparent); }
.mech-dot { --step: 0; position: absolute; top: 9px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--pw-warm); transform: translateX(calc(var(--step) * 19px)); transition: transform .68s cubic-bezier(.3,1.3,.5,1); }
.mech-plate { flex: none; aspect-ratio: 1; position: relative; width: 192px; height: 192px; border-radius: 50%; background: color-mix(in srgb, var(--pw-surface-raised) 94%, transparent); border: 1px solid color-mix(in srgb, var(--pw-border) 72%, transparent); }
.mech-dish { position: absolute; inset: 8px; width: calc(100% - 16px); height: auto; opacity: 0; transform: scale(.92); transition: opacity .68s ease, transform .68s cubic-bezier(.3,1.3,.5,1); }
.mech-dish.is-on { opacity: 1; transform: none; }
.mech-plan { flex-direction: column; align-items: stretch; gap: 16px; }
.mech-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.mech-day { position: relative; aspect-ratio: .82; border-radius: 14px; background: color-mix(in srgb, var(--pw-surface) 92%, transparent); border: 1px solid var(--pw-border); display: flex; align-items: center; justify-content: center; transition: border-color .68s ease; }
.mech-day.is-on { border-color: var(--pw-accent); }
.mech-day > img:first-child { width: 88%; height: auto; opacity: 0; transform: scale(.72); transition: opacity .68s ease, transform .68s cubic-bezier(.3,1.3,.5,1); }
.mech-day.is-on > img:first-child { opacity: 1; transform: none; }
.mech-day i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--pw-border) 65%, transparent); }
.mech-day.is-on i { display: none; }
.mech-extra { position: absolute; width: 44%; right: -8%; bottom: -6%; opacity: 0; transition: opacity .68s ease; }
.mech-extra.is-on { opacity: 1; }
.mech-shop { display: flex; align-items: center; gap: 16px; }
.mech-basket { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 52px; border-radius: 999px; background: color-mix(in srgb, var(--pw-surface) 92%, transparent); color: var(--pw-accent); }
.mech-count { position: absolute; top: -6px; right: -8px; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--pw-action); color: var(--pw-on-action); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.mech-lines { display: grid; gap: 8px; }
.mech-line { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--pw-border) 58%, transparent); transition: background .68s ease; }
.mech-line-0 { width: 84px; } .mech-line-1 { width: 124px; } .mech-line-2 { width: 164px; }
.mech-line.is-on { background: var(--pw-accent); }

@media (max-width: 900px) {
    .hero-visual { min-height: 560px; }
    .start-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .hero-visual { min-height: 520px; }
    .hero-visual::before { width: 340px; height: 340px; }
    .hero-device .phone { width: 230px; }
    .food-1 { width: 70px; } .food-2 { width: 104px; } .food-3 { width: 62px; left: 0; } .food-4 { width: 112px; right: 0; } .food-5 { display: none; } .food-6 { width: 92px; left: 6%; }
    .mech-cook { gap: 10px; } .mech-ingredients { grid-template-columns: 52px 52px; gap: 6px; } .mech-ingredient { width: 52px; height: 52px; padding: 4px; }
    .mech { padding: 16px; min-height: 0; }
    .mech-week { gap: 4px; }
    .mech-plate { width: 120px; height: 120px; } .mech-link { flex: none; width: 40px; } .mech-dot { transform: translateX(calc(var(--step) * 10px)); }
}
@media (prefers-reduced-motion: reduce) {
    .mech-ingredient, .mech-dot, .mech-dish, .mech-day, .mech-day > img:first-child, .mech-extra, .mech-line { transition: none !important; }
}


/* Inside the app — real screenshot strip */
.shot-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; scrollbar-width: thin; }
.shot-card { margin: 0; scroll-snap-align: start; }
.shot-card img { width: 100%; height: auto; display: block; border-radius: 30px; border: 7px solid var(--pw-text); background: var(--pw-canvas); }
.shot-card figcaption { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--pw-text); line-height: 1.35; }
.gallery-sec { background: var(--pw-surface); }
@media (min-width: 1121px) { .shot-strip { grid-auto-columns: calc((100% - 100px) / 6); overflow: visible; } }
.hero-device .stage-rail { position: relative; z-index: 6; }
.food-6 { bottom: 9%; left: 6%; }
@media (max-width: 560px) { .food-6 { bottom: 12%; left: 0; } .hero-device .stage-rail { gap: 4px; } .stage-rail button { padding: 5px 9px; font-size: 11px; } }
