:root {
    --accent: #16eeff;
    --accent-soft: rgba(22, 238, 255, 0.14);
    --accent-strong: rgba(22, 238, 255, 0.28);
    --bg: #000000;
    --bg-deep: #02080a;
    --panel: rgba(5, 16, 20, 0.9);
    --panel-strong: rgba(7, 24, 30, 0.96);
    --border: rgba(22, 238, 255, 0.36);
    --text: #dffcff;
    --muted: rgba(223, 252, 255, 0.72);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Courier New", Courier, monospace;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(22, 238, 255, 0.15), transparent 26%),
        radial-gradient(circle at top right, rgba(22, 238, 255, 0.09), transparent 22%),
        linear-gradient(180deg, #010708 0%, #000000 48%, #031115 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(22, 238, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 238, 255, 0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 88%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.eyebrow,
.panel-label,
.card-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.button-primary,
.button-secondary,
.toolbar-button,
.toolbar-link,
.meal-switch a,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    cursor: pointer;
}

.button-primary,
.toolbar-button,
input[type="submit"] {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 12px 28px rgba(22, 238, 255, 0.2);
}

.button-secondary,
.toolbar-link,
.meal-switch a {
    background: rgba(0, 0, 0, 0.32);
    color: var(--accent);
}

.button-primary:hover,
.button-secondary:hover,
.toolbar-button:hover,
.toolbar-link:hover,
.meal-switch a:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(22, 238, 255, 0.24);
}

.text-link {
    color: var(--text);
    opacity: 0.84;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(18px);
}

.brand-mark {
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-links,
.hero-actions,
.card-links,
.footer-links,
.meal-switch,
.toolbar-actions,
.section-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar-links a,
.footer-links a {
    color: var(--muted);
}

.home-hero,
.meal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 24px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(22, 238, 255, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(8, 28, 34, 0.96), rgba(2, 8, 10, 0.96));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-copy h1,
.section-heading h2,
.meal-card h3,
.feature-card h3,
.meal-hero-copy h1 {
    margin: 0;
    line-height: 1.05;
}

.home-hero h1,
.meal-hero h1 {
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(22, 238, 255, 0.2);
}

.meal-hero h1 {
    padding: 0;
    color: var(--text);
    text-align: left;
}

.hero-text,
.panel-note,
.meal-card p,
.feature-card p,
.lead-text {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.hero-panel,
.feature-card,
.meal-card,
.calculator-toolbar,
.totals-section,
.section-heading,
.site-footer {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
    backdrop-filter: blur(18px);
}

.hero-panel {
    padding: 24px;
}

.hero-stats,
.summary-grid,
.feature-grid,
.meal-grid,
.totals-grid,
.macro-grid {
    display: grid;
    gap: 16px;
}

.hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.macro-card,
.summary-grid > div,
.total-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(22, 238, 255, 0.06);
}

.stat-card strong,
.summary-grid span,
.macro-card strong {
    display: block;
    color: var(--accent);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 6px;
}

.stat-card span,
.summary-grid small,
.macro-card span {
    color: var(--muted);
}

.meal-grid-section,
.feature-grid-section {
    margin-top: 32px;
}

.section-heading {
    padding: 24px;
    margin-bottom: 18px;
}

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

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

.meal-card,
.feature-card,
.site-footer {
    padding: 24px;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
}

.site-footer p {
    margin: 0;
    color: var(--text);
}

.calculator-page .container {
    max-width: 1360px;
}

.calculator-page .meal-hero {
    margin-bottom: 22px;
}

.meal-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.meal-hero-copy h1 {
    font-size: clamp(2.3rem, 4.8vw, 4.2rem);
}

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

.calculator-toolbar {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
    gap: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.search-block label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.92rem;
}

.search-block input[type="search"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.46);
    color: var(--text);
}

.search-block p,
.helper-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.meal-switch a.is-active {
    background: var(--accent);
    color: var(--bg);
}

.section-pills {
    margin-bottom: 24px;
    padding-bottom: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.section-pills a {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(22, 238, 255, 0.06);
    color: var(--muted);
}

.section-pills a.is-active {
    background: var(--accent);
    color: var(--bg);
}

#food-sections > .nav-links {
    display: none;
}

#food-sections > h2 {
    margin: 0;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: linear-gradient(180deg, rgba(22, 238, 255, 0.12), rgba(22, 238, 255, 0.04));
    color: var(--accent);
    text-align: left;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: none;
}

.table-wrapper {
    margin: 0 0 20px;
    padding: 14px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--panel-strong);
    overflow-x: auto;
}

.food-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
}

.food-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 10px;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.food-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(22, 238, 255, 0.14);
    color: var(--text);
    background: rgba(3, 10, 12, 0.82);
}

.food-table tr:hover td {
    background: rgba(22, 238, 255, 0.08);
}

.food-name {
    min-width: 220px;
    font-weight: 700;
}

.food-table input[type="text"],
.food-table select,
.total-item input[type="text"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(22, 238, 255, 0.24);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.58);
    color: var(--text);
    padding: 8px 10px;
}

.food-table input[readonly],
.total-item input[readonly] {
    background: rgba(22, 238, 255, 0.06);
}

.totals-section {
    padding: 24px;
    margin-top: 12px;
}

.totals-section h2 {
    margin: 0 0 10px;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    color: var(--accent);
    text-shadow: none;
    font-size: 1.6rem;
}

.totals-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 18px;
}

.total-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.meal-footer {
    margin-top: 24px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.meal-footer p {
    margin: 0;
    color: var(--muted);
}

.hidden-section {
    display: none !important;
}

@media (max-width: 1080px) {
    .home-hero,
    .meal-hero,
    .calculator-toolbar {
        grid-template-columns: 1fr;
    }

    .meal-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        padding: 18px;
    }

    .topbar,
    .site-footer,
    .meal-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-hero,
    .meal-hero,
    .hero-panel,
    .meal-card,
    .feature-card,
    .section-heading,
    .calculator-toolbar,
    .totals-section {
        padding: 20px;
    }

    .hero-stats,
    .macro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-hero h1,
    .meal-hero h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }

    #food-sections > h2 {
        font-size: 0.98rem;
    }

    .food-table {
        min-width: 760px;
    }
}
