/* Vegan Living Hub — Apple.com-inspired
   Minimal, airy, huge confident type, generous whitespace.
   Glass used precisely (not everywhere): the sticky nav bar is a
   translucent blurred pane, exactly like Apple's own header —
   everything else is quiet, high-contrast, on a near-white canvas.

   Canvas   #FBFBFD (near-white)     Ink   #1D1D1F (near-black)
   Accent   #2D8A46 (leaf green)     Ink-2 #6E6E73 (Apple's own gray)
   Display  "SF Pro"-style stack (system-ui) at huge, tight-tracked sizes
   Glass    nav bar + modal-style panels: blur(20px) + 70% white
*/

:root {
    --canvas: #F6F4EC;
    --panel: #FFFFFF;
    --ink: #1D1D1F;
    --ink-2: #6E6E73;
    --ink-3: #86868B;
    --leaf: #2D8A46;
    --leaf-dark: #1F6B34;
    --line: rgba(0, 0, 0, 0.08);
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --radius-lg: 22px;
    --radius-md: 16px;
    --font-display: -apple-system, "SF Pro Display", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100%;
    color: var(--ink);
    font-family: var(--font-display);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background:
        radial-gradient(1100px circle at 12% -10%, rgba(45, 138, 70, 0.10), transparent 55%),
        radial-gradient(900px circle at 100% 10%, rgba(255, 179, 71, 0.14), transparent 50%),
        radial-gradient(1000px circle at 8% 90%, rgba(45, 138, 70, 0.08), transparent 55%),
        linear-gradient(180deg, #FAF8F2 0%, var(--canvas) 45%, #F1EEE3 100%);
    background-attachment: fixed;
}

a { color: var(--leaf); text-decoration: none; }
a:hover { color: var(--leaf-dark); text-decoration: underline; }

h1, h2, h3 {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
}
h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.05rem, 2.4vw, 1.25rem); letter-spacing: -0.015em; }
p { line-height: 1.6; font-size: clamp(1rem, 2vw, 1.0625rem); color: var(--ink-2); }

.content-wrap { max-width: 980px; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* --- Header: the one true glass surface, exactly like Apple's own nav --- */
.site-header {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--line);
    padding: 0.55rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .logo-wrap { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
.site-header .logo-wrap img { max-height: 38px; width: auto; object-fit: contain; }
.header-logo { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0; white-space: nowrap; }
.header-logo span { color: var(--leaf); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.15rem; justify-content: flex-end; }
.site-nav button {
    font-size: 0.8rem; padding: 0.5rem 0.85rem; white-space: nowrap;
    background: transparent; color: var(--ink-2);
    border: none;
    font-weight: 500; border-radius: 980px; cursor: pointer; min-height: 34px;
    transition: background 0.15s ease, color 0.15s ease;
}
.site-nav button:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.site-nav button.active { background: var(--ink); color: #fff; }

/* Hero */
.hero-wrap {
    width: 100%;
    padding: 5.5rem 1.5rem 3.5rem;
    text-align: center;
    background:
        radial-gradient(900px circle at 50% -10%, rgba(45, 138, 70, 0.08), transparent 60%);
}
.hero { text-align: center; padding: 0 0 0.5rem; max-width: 720px; margin: 0 auto; }
.hero h1 { margin-bottom: 0.6rem; }
.hero .subtitle { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 600; color: var(--leaf); margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.hero .tagline { font-size: 1.05rem; color: var(--ink-2); max-width: 480px; margin: 0 auto; line-height: 1.6; }

.section-title { font-size: clamp(1.5rem, 3vw, 1.9rem); color: var(--ink); margin-bottom: 1.25rem; font-weight: 700; letter-spacing: -0.025em; }
.text-secondary { color: var(--ink-2); }

/* --- Surfaces: crisp white panels, not frosted — glass is reserved for the nav --- */
.site-card, .featured-card, .journey-card,
.news-card, .recipe-list-card,
.resource-card, .product-section,
details.guide-section, .metric-box {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Cards */
.site-card, .featured-card, .journey-card {
    padding: 1.75rem; margin-bottom: 1rem;
    transition: box-shadow 0.3s cubic-bezier(.2,.8,.2,1), transform 0.3s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease;
}
.featured-card:hover, .resource-card:hover, .site-card:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
}
.site-card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.site-card-meta { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 0.5rem; }
.site-card-content { font-size: 0.98rem; line-height: 1.6; color: var(--ink-2); }

.featured-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.featured-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; letter-spacing: -0.015em; }
.featured-card p { font-size: 0.95rem; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* Footer */
.site-footer {
    text-align: center; padding: 3rem 1rem; margin-top: 3rem;
    border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.85rem;
}

/* News */
.news-card { padding: 1.5rem 1.75rem; margin-bottom: 1rem; transition: box-shadow 0.3s ease, transform 0.3s ease; }
.news-card:hover { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1); transform: translateY(-3px); }
.news-card a { font-weight: 600; color: var(--ink); font-size: 1.08rem; letter-spacing: -0.01em; }
.news-card a:hover { color: var(--leaf); }

/* Recipes */
.recipe-list-card {
    display: flex; gap: 1.5rem; align-items: flex-start;
    padding: 1.25rem; margin-bottom: 1.25rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.recipe-list-card:hover { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1); transform: translateY(-3px); }
.recipe-list-pic { flex: 0 0 260px; min-width: 200px; border-radius: var(--radius-md); overflow: hidden; background: #F5F5F7; }
.recipe-list-pic img { width: 100%; height: 200px; object-fit: cover; display: block; }
.recipe-list-pic-placeholder { height: 200px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #D2D2D7; }
.recipe-list-body { flex: 1; min-width: 0; }
.recipe-card-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; letter-spacing: -0.015em; }
.recipe-card-preview { font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; margin-top: 0.3rem; }

/* Resources / Products */
.resource-card, .product-section {
    padding: 1.75rem; margin-bottom: 1rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.resource-card:hover, .product-section:hover { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1); transform: translateY(-3px); }
.resource-card h3 { margin-bottom: 0.6rem; }
.resource-card p, .product-section p { color: var(--ink-2); line-height: 1.6; font-size: 0.95rem; }

/* Beginner guide expanders */
details.guide-section { margin-bottom: 0.65rem; padding: 0; overflow: hidden; }
details.guide-section summary {
    cursor: pointer; padding: 1.1rem 1.5rem; font-weight: 600; font-size: 1rem; list-style: none;
    letter-spacing: -0.01em;
}
details.guide-section summary::-webkit-details-marker { display: none; }
details.guide-section summary::before { content: "› "; color: var(--leaf); font-weight: 700; }
details.guide-section[open] summary::before { content: "⌄ "; }
details.guide-section .guide-body { padding: 0 1.5rem 1.5rem; line-height: 1.65; color: var(--ink-2); }
details.guide-section table { border-collapse: collapse; width: 100%; margin-top: 0.5rem; }
details.guide-section th, details.guide-section td { border: 1px solid var(--line); padding: 0.55rem 0.75rem; text-align: left; font-size: 0.9rem; }
details.guide-section th { background: #F5F5F7; }

/* Ingredient checker */
.checker-form label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.75rem 0 0.35rem; color: var(--ink); }
.checker-form select, .checker-form textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem 0.85rem;
    font-size: 0.95rem; font-family: inherit; background: #F5F5F7; color: var(--ink);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.checker-form select:focus, .checker-form textarea:focus { background: #fff; border-color: var(--leaf); }
.checker-form textarea { resize: vertical; min-height: 160px; }
.checker-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.25rem; }
.metric-box { padding: 1.1rem; }
.metric-value { font-size: 1.65rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.metric-label { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 0.25rem; }
.metric-box ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--ink-2); }

/* Focus visibility */
a:focus-visible, button:focus-visible, summary:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--leaf);
    outline-offset: 2px;
}

/* Nutrient tracker */
.nutrient-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.nutrient-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
}
.nutrient-card-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.nutrient-card-label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.nutrient-card-value { font-size: 0.85rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.nutrient-card-unit { font-weight: 400; color: var(--ink-3); font-size: 0.78rem; }
.nutrient-bar { height: 6px; border-radius: 999px; background: #EDEDF0; overflow: hidden; }
.nutrient-bar-fill { height: 100%; border-radius: 999px; background: var(--ink-3); transition: width 0.35s cubic-bezier(.2,.8,.2,1); }
.nutrient-card--near .nutrient-bar-fill { background: #FFB13A; }
.nutrient-card--full .nutrient-bar-fill { background: var(--leaf); }
.nutrient-card--full { border-color: rgba(45, 138, 70, 0.25); }

.food-category { margin-top: 1rem; }
.food-category:first-child { margin-top: 0.5rem; }
.food-category-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 0.5rem; }
.food-chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.food-chip {
    font-size: 0.82rem; padding: 0.45rem 0.8rem; border-radius: 999px;
    background: #F5F5F7; color: var(--ink); border: 1px solid transparent;
    cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.food-chip:hover { background: #EAF4EC; border-color: rgba(45, 138, 70, 0.3); color: var(--leaf-dark); }

.log-entry {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.log-entry:last-child { border-bottom: none; }
.log-entry-remove {
    background: none; border: none; color: var(--ink-3); font-size: 1.1rem; cursor: pointer;
    line-height: 1; padding: 0.2rem 0.4rem; border-radius: 6px;
}
.log-entry-remove:hover { color: #D9455F; background: rgba(217, 69, 95, 0.08); }

.history-strip { display: flex; align-items: flex-end; gap: 0.9rem; height: 90px; padding-top: 0.5rem; }
.history-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex: 1; }
.history-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: var(--leaf); opacity: 0.85; }
.history-bar-label { font-size: 0.72rem; color: var(--ink-3); }

/* Utility */
.hidden { display: none !important; }

/* Mobile */
@media (max-width: 768px) {
    .site-header { flex-direction: column; align-items: flex-start; padding: 0.75rem 1rem; gap: 0.5rem; }
    .site-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 0.25rem; }
    .content-wrap { padding: 0 1rem 2rem; }
    .hero-wrap { padding: 3rem 1.25rem 2rem; }
    .featured-grid { grid-template-columns: 1fr; }
    .recipe-list-card { flex-direction: column; }
    .recipe-list-pic { width: 100%; flex: none; }
    .checker-results { grid-template-columns: 1fr; }
    .nutrient-grid { grid-template-columns: repeat(2, 1fr); }
}
