:root {
    --pine: #173c33;
    --pine-deep: #0e2923;
    --sage: #a9c6a1;
    --cream: #f4efe5;
    --paper: #fbf8f1;
    --coral: #ed7555;
    --ink: #1e2c28;
    --muted: #708078;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: white;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.hero-shell {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    background: #a8794c url("kitchen-storage-desktop.png") center center / cover no-repeat;
}

.scene-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 30, 25, .94) 0%, rgba(12, 37, 30, .86) 28%, rgba(11, 28, 24, .33) 54%, rgba(6, 16, 14, .06) 100%),
        linear-gradient(0deg, rgba(7, 20, 17, .48), transparent 33%);
    pointer-events: none;
}

.topbar {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px clamp(24px, 4vw, 70px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -.04em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    font-family: inherit;
    font-size: 1rem;
}

.topbar-note {
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,.23);
    border-radius: 99px;
    background: rgba(8, 25, 21, .23);
    backdrop-filter: blur(8px);
    font-size: .75rem;
    font-weight: 650;
    letter-spacing: .04em;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b8ed96;
    box-shadow: 0 0 0 4px rgba(184,237,150,.16);
}

.hero-content { position: relative; z-index: 5; }

.command-column { padding: 100px clamp(24px, 4vw, 70px) 60px; }
.command-panel { width: min(100%, 560px); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #c4d7b9;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .19em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
}

.command-panel h1,
.recipes-header h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 5.2vw, 5.6rem);
    line-height: .92;
    letter-spacing: -.065em;
}

.command-panel h1 em,
.recipes-header h2 em {
    color: var(--sage);
    font-weight: 400;
}

.lead-copy {
    max-width: 520px;
    margin: 24px 0 25px;
    color: rgba(255,255,255,.72);
    font-size: clamp(.98rem, 1.2vw, 1.08rem);
    line-height: 1.62;
}

.upload-zone {
    position: relative;
    width: 100%;
    min-height: 112px;
    border: 1px dashed rgba(255,255,255,.36);
    border-radius: 18px;
    background: rgba(255,255,255,.095);
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: .25s ease;
    outline: none;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.dragover {
    border-color: rgba(196, 224, 178, .92);
    background: rgba(255,255,255,.15);
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(4, 21, 16, .2);
}

.upload-empty {
    min-height: 112px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: rgba(255,255,255,.12);
    color: #d9e8ce;
}

.upload-empty strong,
.upload-empty span { display: block; }
.upload-empty strong { margin-bottom: 5px; font-size: .98rem; }
.upload-empty div > span { color: rgba(255,255,255,.56); font-size: .76rem; }

.browse-pill {
    padding: 9px 13px;
    border-radius: 99px;
    background: rgba(255,255,255,.12);
    color: white !important;
    font-size: .72rem !important;
    font-weight: 750;
    white-space: nowrap;
}

.upload-preview {
    min-height: 112px;
    padding: 12px;
    cursor: default;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.preview-meta { min-width: 0; }
.preview-meta strong,
.preview-meta span { display: block; }
.preview-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta span { margin-top: 4px; color: rgba(255,255,255,.55); font-size: .78rem; }

.add-images-button {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 99px;
    background: rgba(255,255,255,.12);
    color: white;
    font-size: .7rem;
    font-weight: 800;
}

.add-images-button:disabled { opacity: .42; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.preview-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
}

.preview-card img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 30, 25, .82);
    color: white;
    font-size: 1rem;
    line-height: 1;
}

.analyze-button {
    width: 100%;
    min-height: 58px;
    margin-top: 14px;
    border: 0;
    border-radius: 15px;
    background: var(--coral);
    color: white;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(183, 63, 31, .25);
    transition: .2s ease;
}

.analyze-button:not(:disabled):hover { transform: translateY(-2px); background: #f07d5e; }
.analyze-button:disabled { opacity: .42; cursor: not-allowed; }
.button-label { display: inline-flex; gap: 9px; align-items: center; justify-content: center; }

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    color: rgba(255,255,255,.43);
    font-size: .72rem;
}

.demo-notice {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 214, 119, .22);
    border-radius: 10px;
    background: rgba(255, 204, 92, .09);
    color: rgba(255,255,255,.68);
    font-size: .72rem;
    line-height: 1.45;
}

.demo-notice strong { color: #ffe09c; }
.demo-notice code { color: #fff3d2; }

.fridge-column {
    position: relative;
    align-self: stretch;
    min-height: 100svh;
}

.fridge-heading {
    position: absolute;
    top: 12%;
    left: 8%;
    z-index: 8;
    display: flex;
    flex-direction: column;
    padding: 11px 15px;
    border-radius: 12px;
    background: rgba(8, 25, 21, .62);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.fridge-heading span { color: #c5d6c0; font-size: .58rem; letter-spacing: .16em; }
.fridge-heading strong { margin-top: 2px; font-size: .84rem; }

.fridge-cavity {
    position: absolute;
    top: 15%;
    left: 5%;
    width: 92%;
    height: 65%;
    z-index: 4;
    overflow: hidden;
    border-radius: 8px;
    perspective: 800px;
}

.empty-fridge {
    position: absolute;
    left: 43%;
    top: 34%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid rgba(32, 54, 61, .15);
    border-radius: 10px;
    background: rgba(250, 253, 253, .67);
    color: #38534f;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 30px rgba(40,60,65,.12);
}

.empty-fridge span { font-size: 1.1rem; }
.empty-fridge p { margin: 0; font-size: .67rem; font-weight: 750; line-height: 1.25; }

.ingredient-grid {
    position: absolute;
    inset: 12% 4% 4%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 7px 10px;
}

.ingredient-item {
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    min-width: 0;
    animation: stockFridge .5s both cubic-bezier(.2,.8,.2,1);
}

.ingredient-emoji {
    display: grid;
    place-items: center;
    width: clamp(44px, 5vw, 72px);
    height: clamp(44px, 5vw, 72px);
    border-radius: 18px;
    background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.96), rgba(237,243,240,.78));
    box-shadow: 0 10px 23px rgba(33,61,67,.16), inset 0 0 0 1px rgba(255,255,255,.85);
    font-size: clamp(1.7rem, 3vw, 2.8rem);
    filter: saturate(1.08);
}

.ingredient-name {
    max-width: 92px;
    margin-top: 5px;
    padding: 3px 7px;
    border-radius: 99px;
    background: rgba(26, 57, 51, .82);
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .57rem;
    font-weight: 750;
    box-shadow: 0 5px 12px rgba(0,0,0,.12);
}

@keyframes stockFridge {
    from { opacity: 0; transform: translateY(-24px) scale(.82); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: -12%;
    height: 8px;
    opacity: 0;
    background: #8af0cc;
    box-shadow: 0 0 24px 9px rgba(80,235,190,.48);
}

.fridge-cavity.scanning .scan-beam { opacity: 1; animation: scan 1.5s infinite ease-in-out; }
@keyframes scan { 0% { top: 4%; } 50% { top: 89%; } 100% { top: 4%; } }

.inventory-summary {
    position: absolute;
    z-index: 8;
    left: 8%;
    bottom: 7%;
    width: min(84%, 620px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 16px;
    background: rgba(13, 43, 35, .76);
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 40px rgba(0,0,0,.2);
}

.inventory-summary span,
.inventory-summary strong { display: block; }
.inventory-summary div > span { color: #b9c8c2; font-size: .63rem; text-transform: uppercase; letter-spacing: .1em; }
.inventory-summary strong { margin-top: 3px; }
.inventory-summary button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    padding: 10px 13px;
    background: var(--coral);
    color: white;
    font-size: .75rem;
    font-weight: 800;
}

.scroll-cue {
    position: absolute;
    z-index: 8;
    left: 42px;
    bottom: 28px;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.42);
    font-size: .58rem;
    letter-spacing: .16em;
}

.scroll-cue span { display: block; width: 38px; height: 1px; background: currentColor; }

.recipes-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 8%, rgba(168, 198, 161, .33), transparent 23rem),
        var(--paper);
    color: var(--ink);
}

.recipes-section::before {
    content: "";
    position: absolute;
    top: -130px;
    right: -80px;
    width: 310px;
    height: 310px;
    border: 1px solid rgba(24,60,51,.12);
    border-radius: 50%;
}

.recipes-section .container { position: relative; z-index: 1; }

.eyebrow.dark { color: #61836f; }
.recipes-header {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    align-items: end;
    gap: 60px;
    padding: 46px 0 34px;
}

.recipes-header h2 { font-size: clamp(2.8rem, 5vw, 5rem); }
.recipes-header h2 em { color: #6f947c; }
.recipes-header > p { margin: 0 0 8px; color: var(--muted); line-height: 1.65; }

.detected-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 28px;
    scrollbar-width: none;
}

.detected-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #dce4dd;
    border-radius: 99px;
    background: rgba(255,255,255,.72);
    color: #476458;
    font-size: .76rem;
    font-weight: 750;
}

.recipe-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid #e4e8e2;
    border-radius: 22px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 14px 40px rgba(42, 62, 54, .07);
    transition: transform .25s ease, box-shadow .25s ease;
}

.recipe-card:hover { transform: translateY(-5px); box-shadow: 0 20px 50px rgba(42,62,54,.12); }

.recipe-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 178px;
    overflow: hidden;
    background: linear-gradient(135deg, #e6eee3, #f6e6d4);
}

.recipe-visual::before,
.recipe-visual::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(24,60,51,.09);
    border-radius: 50%;
}
.recipe-visual::before { width: 170px; height: 170px; }
.recipe-visual::after { width: 205px; height: 205px; }
.recipe-emoji { position: relative; z-index: 2; font-size: 5rem; filter: drop-shadow(0 12px 8px rgba(43,53,48,.12)); }

.match-badge {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    padding: 7px 9px;
    border-radius: 99px;
    background: var(--pine);
    color: white;
    font-size: .64rem;
    font-weight: 800;
}

.recipe-content { padding: 21px; }
.recipe-kicker { color: var(--coral); font-size: .65rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.recipe-content h3 { margin: 8px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; line-height: 1.05; letter-spacing: -.035em; }
.recipe-content p { min-height: 43px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.recipe-meta {
    display: flex;
    gap: 15px;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid #e9ede8;
    color: #62726b;
    font-size: .72rem;
    font-weight: 720;
}

.recipe-button {
    width: 100%;
    margin-top: 17px;
    padding: 11px;
    border: 1px solid #cfd9d2;
    border-radius: 11px;
    background: transparent;
    color: var(--pine);
    font-size: .78rem;
    font-weight: 850;
    transition: .2s ease;
}
.recipe-button:hover { color: white; background: var(--pine); border-color: var(--pine); }

.recipes-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 44px 0 25px;
}

.secondary-button {
    padding: 12px 18px;
    border: 0;
    border-radius: 11px;
    background: var(--pine);
    color: white;
    font-size: .8rem;
    font-weight: 800;
}

.text-link { color: #5e756a; font-size: .78rem; font-weight: 800; text-decoration: none; }

.recipe-modal { overflow: hidden; border: 0; border-radius: 24px; background: var(--paper); color: var(--ink); }
.modal-close { position: absolute; z-index: 5; top: 18px; right: 18px; padding: 10px; border-radius: 50%; background-color: rgba(255,255,255,.82); }
.modal-recipe-head { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 24px; padding: 34px; background: linear-gradient(135deg, #dbe9dc, #f8ead8); }
.modal-recipe-emoji { text-align: center; font-size: 6rem; }
.modal-recipe-head h2 { margin: 5px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; line-height: 1; }
.modal-recipe-head p { margin: 0; color: #63736d; }
.modal-recipe-body { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; padding: 30px 34px 36px; }
.modal-recipe-body h3 { margin: 0 0 14px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.ingredient-list, .steps-list { margin: 0; padding-left: 1.2rem; color: #586a63; font-size: .88rem; line-height: 1.6; }
.ingredient-list li, .steps-list li { margin-bottom: 6px; }
.missing-note { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #fff2dc; color: #8b5b26; font-size: .76rem; }

.app-toast { border: 0; border-radius: 12px; background: #fff; color: #263832; box-shadow: 0 14px 45px rgba(0,0,0,.2); }

@media (max-width: 991.98px) {
    .hero-shell { background: #203a31; }
    .scene-shade { background: radial-gradient(circle at 80% 0%, rgba(116, 83, 52, .58), transparent 42%), linear-gradient(180deg, #173c33 0%, #102c25 100%); }
    .command-column { padding-top: 120px; padding-bottom: 36px; }
    .command-panel { margin-inline: auto; }
    .command-panel h1 { font-size: clamp(3.2rem, 11vw, 5.6rem); }
    .fridge-column { min-height: min(178vw, 760px); isolation: isolate; }
    .fridge-column::before,
    .fridge-column::after { content: ""; position: absolute; inset: 0; }
    .fridge-column::before { z-index: 0; background: url("kitchen-storage-mobile.png") center center / cover no-repeat; }
    .fridge-column::after { z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(12, 31, 26, .72) 0%, transparent 24%, transparent 78%, rgba(8, 22, 18, .42) 100%); }
    .fridge-heading { top: 31%; left: 6%; }
    .fridge-cavity { top: 36%; left: 6%; width: 89%; height: 49%; }
    .inventory-summary { left: 6%; bottom: 3%; width: 88%; }
    .recipes-header { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 575.98px) {
    .topbar { padding: 22px; }
    .brand { font-size: 1.08rem; }
    .command-column { padding-inline: 18px; }
    .command-panel h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
    .upload-empty { grid-template-columns: auto 1fr; }
    .browse-pill { display: none !important; }
    .preview-grid { gap: 6px; }
    .fridge-heading { top: 30%; left: 5%; }
    .fridge-cavity { top: 36%; left: 5%; width: 91%; height: 48%; }
    .ingredient-grid { gap: 5px; }
    .ingredient-emoji { width: 44px; height: 44px; border-radius: 13px; font-size: 1.65rem; }
    .ingredient-name { max-width: 70px; font-size: .5rem; }
    .inventory-summary { left: 5%; bottom: 3%; width: 90%; }
    .recipes-header { padding-top: 24px; }
    .recipes-header h2 { font-size: 2.8rem; }
    .recipes-actions { flex-direction: column; gap: 14px; }
    .modal-recipe-head { grid-template-columns: 1fr; text-align: center; padding: 30px 24px 24px; }
    .modal-recipe-emoji { font-size: 4.5rem; }
    .modal-recipe-body { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
}

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