/* ============ EverythingEats marketing site ============
   Brand palette mirrors the mobile app theme:
   primary #10b981 · text #1f2937 · secondary #6b7280
   background #f3f4f6 · surface #ffffff · border #d1d5db  */

:root {
    --primary: #10b981;
    --primary-dark: #0d9668;
    --primary-soft: #d1fae5;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --border: #d1d5db;
    --error: #ef4444;
    --dark: #111827;
    --radius: 14px;
    --shadow: 0 4px 18px rgba(17, 24, 39, 0.08);
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

img { max-width: 100%; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ Header ============ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
}

.brand em {
    color: var(--primary);
    font-style: normal;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover { color: var(--primary); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* ============ Buttons ============ */

.btn {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 12px 26px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-ghost:hover { background: var(--primary-soft); }

.btn-small { padding: 8px 18px; }

.btn:active { transform: scale(0.98); }

.btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ============ Hero ============ */

.hero {
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(16, 185, 129, 0.28), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(16, 185, 129, 0.18), transparent 60%),
        var(--dark);
    color: #fff;
    padding: 96px 0 110px;
    text-align: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 14px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 600;
    margin: 0 0 18px;
    line-height: 1.1;
}

.hero-sub {
    max-width: 620px;
    margin: 0 auto 34px;
    color: #d1d5db;
    font-size: 1.08rem;
}

.hero-scroll {
    display: inline-block;
    margin-top: 28px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.95rem;
}

.hero-scroll:hover { color: var(--primary); }

/* ============ Store badges ============ */

.store-badges {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: #000;
    color: #fff;
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 9px 20px 9px 15px;
    text-decoration: none;
    text-align: left;
    min-width: 178px;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.store-badge:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.store-badge svg {
    width: 27px;
    height: 27px;
    flex-shrink: 0;
    fill: #fff;
}

.store-badge .badge-text small {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: #d1d5db;
    line-height: 1.2;
}

.store-badge .badge-text strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.25;
    font-weight: 600;
    white-space: nowrap;
}

.store-badge.badge-soon {
    cursor: default;
    opacity: 0.82;
}

.store-badge.badge-soon:hover { transform: none; border-color: #4b5563; }

.badge-soon-pill {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--primary);
    color: #052e22;
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 4px;
    align-self: flex-start;
}

/* ============ Sections ============ */

.section { padding: 76px 0; }

.section-alt { background: var(--surface); }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    font-weight: 600;
    margin: 0 0 10px;
    text-align: center;
}

.section-sub {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 auto 40px;
    max-width: 560px;
}

/* ============ Recipes ============ */

.recipe-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
}

#recipeSearch {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    display: block;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
}

#recipeSearch:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
}

.tag-chip {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 16px;
    font-family: var(--font-body);
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s ease;
}

.tag-chip:hover { border-color: var(--primary); color: var(--primary); }

.tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.recipe-count {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    min-height: 1.2em;
    margin: 0 0 22px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}

.recipes-status {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 48px 16px;
}

.recipes-status .btn { margin-top: 16px; }

.recipe-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    border: none;
    padding: 0;
    text-align: left;
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.14);
}

.recipe-card-img {
    aspect-ratio: 4 / 3;
    background: var(--bg);
    width: 100%;
    object-fit: cover;
    display: block;
}

.recipe-card-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-card-img.placeholder img {
    width: 56px;
    height: 56px;
    opacity: 0.45;
    border-radius: 12px;
}

.recipe-card-body { padding: 14px 16px 16px; }

.recipe-card-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.recipe-more-wrap {
    text-align: center;
    margin-top: 34px;
}

/* ============ Features ============ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.feature-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 26px 24px;
}

.feature-icon { font-size: 1.9rem; margin-bottom: 10px; }

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.feature-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
}

/* ============ Download ============ */

.download {
    background:
        radial-gradient(800px 400px at 50% 120%, rgba(16, 185, 129, 0.3), transparent 65%),
        var(--dark);
    color: #fff;
}

.download .section-sub { color: #9ca3af; }

.download-inner { text-align: center; }

.download-logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    margin-bottom: 18px;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.35);
}

/* ============ Contact & feedback ============ */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
}

.contact-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 34px 30px;
}

.contact-card .section-title { text-align: left; font-size: 1.5rem; }

.contact-card p { color: var(--text-secondary); }

.contact-email-note {
    font-size: 0.88rem;
    margin-top: 12px;
}

#feedbackForm label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 16px 0 6px;
}

#feedbackForm label .optional {
    color: var(--text-secondary);
    font-weight: 400;
}

#feedbackForm label .required { color: var(--error); }

#feedbackForm input,
#feedbackForm textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    resize: vertical;
}

#feedbackForm input:focus,
#feedbackForm textarea:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

#feedbackForm .btn { margin-top: 18px; }

.form-status {
    min-height: 1.3em;
    font-size: 0.9rem;
    margin: 12px 0 0;
}

.form-status.ok { color: var(--primary-dark); }
.form-status.err { color: var(--error); }

/* ============ Footer ============ */

.site-footer {
    background: var(--dark);
    color: #9ca3af;
    padding: 44px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.brand-footer { color: #f3f4f6; }

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-links a:hover { color: var(--primary); }

.footer-copy { font-size: 0.85rem; margin: 0; }

/* ============ Recipe modal ============ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: sticky;
    top: 14px;
    float: right;
    margin: 14px 14px 0 0;
    z-index: 5;
    background: rgba(17, 24, 39, 0.55);
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
}

.modal-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.modal-content { padding-bottom: 8px; }

.modal-body { padding: 22px 28px 28px; }

.modal-body h2 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    margin: 0 0 8px;
}

.modal-desc { color: var(--text-secondary); margin: 0 0 16px; }

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.meta-pill {
    background: var(--bg);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.modal-tag {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.modal-body h3 {
    font-size: 1.05rem;
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-soft);
}

.modal-body ul, .modal-body ol { margin: 0; padding-left: 22px; }

.modal-body li { margin-bottom: 7px; font-size: 0.95rem; }

.nutrition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.nutrition-table td {
    padding: 7px 4px;
    border-bottom: 1px solid var(--bg);
}

.nutrition-table td:last-child { text-align: right; font-weight: 600; }

.nutrition-basis {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 6px;
}

.modal-cta {
    margin-top: 26px;
    background: var(--primary-soft);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.modal-cta p { margin: 0; font-weight: 600; color: var(--primary-dark); }

/* ============ Install app popup ============ */

.install-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 130; /* above the recipe modal */
    padding: 20px;
}

.install-popup {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    padding: 32px 28px 24px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.35);
    animation: popup-in 0.22s ease;
}

@keyframes popup-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.install-popup-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.install-popup h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.install-popup p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin: 0 0 20px;
}

.install-popup .store-badges { margin-bottom: 8px; }

.install-popup-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 10px;
    padding: 6px;
}

.install-popup-dismiss:hover { color: var(--text); }

/* ============ Legal page ============ */

.legal-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.legal-wrap h1 {
    font-family: var(--font-display);
    font-size: 2rem;
}

.legal-meta { color: var(--text-secondary); font-size: 0.88rem; }

.legal-content { background: var(--surface); border-radius: var(--radius); padding: 34px; }

.legal-content h2 { font-size: 1.25rem; margin-top: 28px; }
.legal-content h3 { font-size: 1.05rem; }

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

/* ============ Responsive ============ */

@media (max-width: 760px) {
    .container {
        width: 100%;
        padding: 0 20px;
    }

    .nav {
        min-width: 0;
    }

    .nav-toggle {
        align-items: center;
        display: flex;
        flex: 0 0 44px;
        height: 44px;
        justify-content: center;
        margin-left: 12px;
        width: 44px;
    }

    .brand {
        min-width: 0;
    }

    .brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 18px 20px;
        gap: 16px;
    }

    .nav-links.open { display: flex; }

    .hero { padding: 68px 0 78px; }

    .hero-copy,
    .store-badges,
    .recipe-controls,
    .recipe-count,
    .recipe-grid {
        max-width: calc(100vw - 40px);
        margin-left: auto;
        margin-right: auto;
    }

    .eyebrow {
        letter-spacing: 0.14em;
        font-size: 0.68rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 8.8vw, 2.35rem);
        max-width: calc(100vw - 40px);
        margin-left: auto;
        margin-right: auto;
    }

    .hero-sub,
    .section-sub {
        width: min(100%, calc(100vw - 40px));
        max-width: calc(100vw - 40px);
        overflow-wrap: anywhere;
    }

    .store-badges {
        align-items: center;
        flex-direction: column;
    }

    .store-badge {
        width: min(100%, 230px);
        min-width: 0;
    }

    .tag-chips {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .tag-chip {
        flex: 0 0 auto;
    }

    .recipe-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-grid { grid-template-columns: 1fr; }

    .modal-body { padding: 18px 20px 24px; }
}

@media (max-width: 420px) {
    .container {
        padding: 0 16px;
    }

    .hero-copy,
    .store-badges,
    .recipe-controls,
    .recipe-count,
    .recipe-grid {
        max-width: calc(100vw - 32px);
    }

    .eyebrow {
        letter-spacing: 0.1em;
        font-size: 0.62rem;
    }

    .hero h1 {
        font-size: 2rem;
        max-width: calc(100vw - 32px);
    }

    .hero-sub {
        font-size: 1rem;
    }

    .store-badge {
        width: min(100%, 220px);
    }

    .hero-sub,
    .section-sub {
        width: min(100%, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
    }
}
