/* ============================================================
   GROCERIES — Website
   Editorial / magazine aesthetic, matched to the iOS app.
   ============================================================ */

:root {
    --bg:           #121212;
    --ink:          #f4f4f3;
    --ink-soft:     rgba(244, 244, 243, 0.58);
    --ink-faint:    rgba(244, 244, 243, 0.34);
    --hairline:     rgba(244, 244, 243, 0.11);
    --card:         rgba(255, 255, 255, 0.04);
    --card-stroke:  rgba(255, 255, 255, 0.09);
    --red-1:        rgb(242, 64, 64);
    --red-2:        rgb(191, 38, 38);
    --radius:       22px;
    --serif:        "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
                    Palatino, Georgia, "Times New Roman", serif;
    --rounded:      ui-rounded, "SF Pro Rounded", -apple-system,
                    "Segoe UI", system-ui, sans-serif;
    --mono:         ui-monospace, "SF Mono", "JetBrains Mono",
                    "Roboto Mono", Menlo, Consolas, monospace;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--rounded);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
::selection { background: var(--red-1); color: #fff; }
a { color: inherit; text-decoration: none; }
ol { list-style: none; }

.wrap {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ── Navigation ── */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(18, 18, 18, 0.68);
    border-bottom: 0.6px solid var(--hairline);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 9px;
}
.brand .mark {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.4px;
}
.brand .dot  { color: var(--red-1); }
.brand .est {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--ink-faint);
}

.tabs { display: flex; align-items: center; gap: 4px; }
.tab {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding: 8px 14px;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}
.tab:hover { color: var(--ink); }
.tab.active {
    color: #fff;
    background: linear-gradient(180deg, var(--red-1), var(--red-2));
}

/* ── Splash — magazine masthead ── */

.splash {
    display: flex;
    flex-direction: column;
    border-bottom: 0.6px solid var(--hairline);
}

/* ruled bars — top & bottom of splash */
.mast-bar {
    border-top: 0.6px solid var(--hairline);
    flex-shrink: 0;
}
.mast-top { animation: fadeUp 0.8s ease both; }
.mast-bot { margin-top: auto; animation: fadeUp 0.8s 0.35s ease both; }

.mast-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    gap: 12px;
}

.mast-left, .mast-right {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 10px;
}
.mast-name { color: var(--ink-soft); }
.mast-sep  { color: var(--hairline); font-size: 14px; }
.mast-tag  { color: var(--ink-faint); }

/* central title block — grows to fill */
.splash-body {
    display: flex;
    align-items: center;
    padding: 28px 0;
    animation: fadeUp 0.9s 0.12s ease both;
}

.splash-title {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(72px, 14vw, 140px);
    line-height: 0.96;
    letter-spacing: -3px;
    color: var(--ink);             /* clean white — no gradient */
    margin-bottom: 28px;
}
.splash-dot { color: var(--red-1); }

.splash-lede {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(18px, 2.4vw, 24px);
    color: var(--ink-soft);
    line-height: 1.5;
}

/* scroll nudge inside the bottom bar */
.splash-scroll {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    transition: color 0.2s;
    animation: bob 2.8s 1.8s ease-in-out infinite;
}
.splash-scroll:hover { color: var(--ink-soft); }

/* ── TOC / Features ── */

main {
    padding: 80px 0 48px;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
}
.toc-rule {
    flex: 1;
    height: 0.6px;
    background: var(--hairline);
}
.toc-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.toc {
    margin-top: 0;
}

.toc-row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: start;
    gap: 24px;
    padding: 36px 0;
    border-top: 0.6px solid var(--hairline);
    transition: background 0.22s;
    transition-delay: var(--d, 0s);
}

.toc-row:first-child { border-top: none; }
.toc-row:last-child  { border-bottom: 0.6px solid var(--hairline); }

/* subtle hover — full-width tint */
.toc-row:hover { background: rgba(255,255,255,0.018); }

.toc-num {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--red-1);
    padding-top: 5px;
}

.toc-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-name {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1;
    letter-spacing: -0.5px;
}

.toc-desc {
    font-size: 15px;
    color: var(--ink-soft);
    max-width: 52ch;
    line-height: 1.6;
}

.toc-em {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
    padding-top: 8px;
    text-align: right;
}

/* ── Manifesto ── */

.manifesto {
    padding: 52px 0 96px;
}

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

.manifesto-rule {
    width: 100%;
    height: 0.6px;
    background: var(--hairline);
    display: block;
}

.manifesto blockquote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.manifesto-text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.1;
    letter-spacing: -1px;
}

.manifesto-sub {
    font-size: 16px;
    color: var(--ink-soft);
    max-width: 42ch;
}

.manifesto-cta { margin-top: 6px; }

.manifesto-link {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--red-1);
    border-bottom: 1px solid rgba(242, 64, 64, 0.35);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.manifesto-link:hover { border-color: var(--red-1); }

/* ── Privacy policy document (privacy.html) ── */

.doc-hero {
    padding: 32px 0 40px;
}
.doc-hero h1 {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(44px, 8vw, 72px);
    letter-spacing: -1.5px;
    margin: 22px 0 14px;
}
.doc-hero .eyebrow { margin-bottom: 0; }
.doc-hero .meta {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--ink-faint);
}

.doc {
    padding-bottom: 96px;
    max-width: 760px;
}
.doc .intro {
    font-size: 16px;
    color: var(--ink-soft);
    border-left: 2px solid var(--red-1);
    padding-left: 20px;
    margin-bottom: 48px;
    line-height: 1.7;
}
.doc article {
    margin-bottom: 38px;
    padding-bottom: 38px;
    border-bottom: 0.6px solid var(--hairline);
}
.doc article:last-child { border-bottom: 0; }
.doc article h2 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 26px;
    margin-bottom: 16px;
}
.doc article h2 .num {
    font-family: var(--mono);
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--red-1);
}
.doc article h3 {
    font-family: var(--rounded);
    font-size: 15px;
    font-weight: 700;
    margin: 20px 0 6px;
    color: var(--ink);
}
.doc p, .doc li {
    font-size: 15px;
    color: var(--ink-soft);
    margin-bottom: 12px;
}
.doc ul { padding-left: 22px; }
.doc li  { margin-bottom: 8px; }
.doc a {
    color: var(--red-1);
    border-bottom: 1px solid rgba(242, 64, 64, 0.4);
}
.doc a:hover { border-bottom-color: var(--red-1); }

/* ── Eyebrow (shared) ── */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink-soft);
    text-transform: uppercase;
}
.eyebrow::after {
    content: "";
    width: 34px;
    height: 0.6px;
    background: var(--ink-faint);
}

/* ── Footer ── */

footer {
    border-top: 0.6px solid var(--hairline);
    padding: 44px 0 56px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.footer-inner .colophon .est {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink-soft);
}
.footer-inner .colophon .tag {
    font-size: 12px;
    font-style: italic;
    color: var(--ink-faint);
    margin-top: 4px;
}
.footer-inner .links { display: flex; gap: 22px; }
.footer-inner .links a {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
    transition: color 0.2s;
}
.footer-inner .links a:hover { color: var(--ink); }

/* ── Animations ── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

/* scroll-triggered reveal */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.65s ease, transform 0.65s ease;
    transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ── */

@media (max-width: 720px) {
    .wrap { padding: 0 20px; }
    .brand .est { display: none; }
    .tabs { gap: 2px; }
    .tab  { padding: 8px 10px; font-size: 10px; letter-spacing: 1px; }

    .mast-tag { display: none; }
    .mast-inner { height: 38px; }

    .toc-row {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto;
        gap: 12px 16px;
        padding: 28px 0;
    }
    .toc-em {
        grid-column: 2;
        text-align: left;
    }
    .splash-issue { display: none; }
    .manifesto { padding: 40px 0 80px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .mast-top, .mast-bot,
    .splash-body, .splash-scroll { animation: none; opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
