:root {
    --brand-red: #c5372f;
    --brand-red-deep: #7f201b;
    --brand-blue: #17295a;
    --brand-blue-soft: #4f5f86;
    --brand-cream: #f7f0e6;
    --brand-white: #ffffff;
    --brand-border: rgba(23, 41, 90, 0.12);
    --brand-success: #2f8f5b;
    --brand-warning: #c56f1d;
    --brand-shadow: 0 24px 60px rgba(21, 31, 62, 0.14);
    --radius-xl: 32px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    color: var(--brand-blue);
    background:
        radial-gradient(circle at top left, rgba(197, 55, 47, 0.09), transparent 30%),
        linear-gradient(180deg, #fff8f1 0%, #fff 22%, #fbf6ee 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.utility-bar {
    background: var(--brand-blue);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
}

.utility-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 11px 0;
}

.utility-bar__copy {
    margin: 0;
}

.utility-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.utility-nav a,
.main-nav a,
.footer-links a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

.utility-nav a:hover,
.main-nav a:hover {
    color: #fff;
}

.masthead-wrap {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(23, 41, 90, 0.08);
    box-shadow: 0 16px 30px rgba(21, 31, 62, 0.06);
}

.masthead {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 166px;
    max-width: 100%;
    height: auto;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-text__eyebrow,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--brand-red);
    font-weight: 700;
}

.brand-text__title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.35rem;
    color: var(--brand-blue);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    font-weight: 700;
    color: var(--brand-blue);
}

.main-site-link,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 12px 20px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.main-site-link {
    background: rgba(197, 55, 47, 0.1);
    color: var(--brand-red);
}

.button:hover,
.main-site-link:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: var(--brand-red);
    color: var(--brand-white);
    box-shadow: 0 16px 28px rgba(197, 55, 47, 0.24);
}

.button--ghost {
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-blue);
    border-color: var(--brand-border);
}

.button--block {
    width: 100%;
}

.hero {
    width: 100%;
    padding: 52px 0 64px;
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.92), rgba(247, 240, 230, 0.88)),
        radial-gradient(circle at right center, rgba(197, 55, 47, 0.12), transparent 30%);
}

.hero__content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 clamp(20px, 4vw, 72px);
}

.hero__content h1,
.section-heading h2 {
    margin: 14px 0 0;
    font-family: 'Libre Baskerville', Georgia, serif;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.hero__content h1 {
    width: 100%;
    max-width: none;
    font-size: clamp(2.75rem, 4.35vw, 4.55rem);
    margin-inline: auto;
    line-height: 1.08;
    text-wrap: balance;
}

.hero__lede {
    max-width: 92ch;
    font-size: 1.12rem;
    line-height: 1.8;
    color: var(--brand-blue-soft);
    margin: 22px auto 0;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 30px 0 34px;
    justify-content: center;
}

.hero__stats,
.flow-grid {
    display: grid;
    gap: 18px;
}

.hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    align-items: stretch;
}

.stat-card,
.workbench-panel,
.analysis-card,
.flow-step {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: var(--radius-lg);
    box-shadow: var(--brand-shadow);
    backdrop-filter: blur(14px);
}

.stat-card {
    padding: 20px 28px 24px;
    text-align: center;
    min-height: 136px;
}

.stat-card h2,
.flow-step h3 {
    margin: 0 0 8px;
}

.stat-card p,
.flow-step p,
.analysis-summary,
.analysis-source,
.ingredients-copy,
.recommendation-copy,
.panel-heading p,
.analysis-panel__header p,
.empty-state p,
.camera-card__copy p,
.camera-preview__status {
    color: var(--brand-blue-soft);
}

.scanner-workbench,
.implementation-flow {
    padding: 68px 0;
}

.section-heading {
    margin-bottom: 28px;
}

.section-heading h2 {
    max-width: 18ch;
    font-size: clamp(2rem, 4vw, 3.3rem);
}

.section-heading--wide h2 {
    max-width: none;
}

.scanner-workbench .section-heading,
.implementation-flow .section-heading {
    max-width: none;
}

.scanner-workbench .section-heading h2,
.implementation-flow .section-heading h2 {
    width: 100%;
    max-width: none;
    font-size: clamp(2.2rem, 3.1vw, 2.95rem);
    line-height: 1.16;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.status-banner {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(47, 143, 91, 0.12);
    border: 1px solid rgba(47, 143, 91, 0.2);
    color: var(--brand-success);
    font-weight: 600;
}

.status-banner--error {
    background: rgba(197, 55, 47, 0.12);
    border-color: rgba(197, 55, 47, 0.2);
    color: var(--brand-red);
}

.scanner-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.scanner-tab {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: rgba(23, 41, 90, 0.08);
    color: var(--brand-blue-soft);
    cursor: pointer;
    font-weight: 700;
}

.scanner-tab.is-active {
    background: var(--brand-blue);
    color: var(--brand-white);
}

.workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 24px;
    align-items: start;
}

.panel-stack {
    display: grid;
    gap: 18px;
}

.workbench-panel {
    padding: 28px;
}

.workbench-panel[hidden] {
    display: none;
}

.panel-heading h3,
.analysis-panel__header h3,
.result-card h4,
.analysis-card h4,
.empty-state h4 {
    margin: 0;
    font-size: 1.3rem;
}

.scanner-form {
    display: grid;
    gap: 18px;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field--full {
    grid-column: 1 / -1;
}

.field span,
.analysis-group h5 {
    font-weight: 700;
}

.field input,
.field textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--brand-border);
    background: rgba(255, 255, 255, 0.94);
    padding: 13px 14px;
    color: var(--brand-blue);
}

.field textarea {
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.field-error {
    color: var(--brand-red);
}

.camera-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(197, 55, 47, 0.08), rgba(247, 240, 230, 0.96));
    border: 1px solid rgba(197, 55, 47, 0.14);
}

.camera-preview {
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(160deg, #091224, #1d2c50);
    padding: 18px;
}

.scanner-reader {
    width: 100%;
    min-height: 280px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.scanner-reader video,
.scanner-reader canvas {
    border-radius: 16px;
}

.camera-preview__status {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.84);
}

.search-results {
    display: grid;
    gap: 14px;
}

.result-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--brand-border);
    background: rgba(255, 255, 255, 0.88);
}

.result-card__header,
.analysis-card__top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
}

.result-card__header p,
.analysis-card__top p,
.result-card__meta {
    margin: 6px 0 0;
    color: var(--brand-blue-soft);
}

.result-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 18px;
    font-size: 0.95rem;
}

.source-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: capitalize;
}

.source-pill--internal {
    background: rgba(23, 41, 90, 0.08);
    color: var(--brand-blue);
}

.source-pill--manual {
    background: rgba(47, 143, 91, 0.12);
    color: var(--brand-success);
}

.source-pill--open_food_facts {
    background: rgba(197, 55, 47, 0.12);
    color: var(--brand-red);
}

.empty-state {
    padding: 22px;
    border-radius: 18px;
    border: 1px dashed rgba(23, 41, 90, 0.18);
    background: rgba(255, 255, 255, 0.8);
}

.analysis-panel {
    position: sticky;
    top: 132px;
}

.analysis-panel__header {
    margin-bottom: 16px;
}

.analysis-panel__header p {
    margin-top: 8px;
}

.analysis-card {
    padding: 24px;
}

.analysis-card--placeholder {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 240, 230, 0.94)),
        var(--brand-white);
}

.analysis-card--placeholder .positive-list {
    margin-top: 12px;
    gap: 8px;
}

.warning-summary-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 12px;
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, var(--brand-blue), #111928);
    color: var(--brand-white);
    box-shadow: 0 18px 28px rgba(17, 25, 40, 0.24);
    text-align: center;
}

.analysis-card--placeholder .warning-summary-card {
    margin-top: 20px;
    padding: 14px 22px 16px;
    border-radius: 22px;
}

.warning-summary-card span {
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.warning-summary-card strong {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1.7rem, 2.8vw, 2.4rem);
    line-height: 1.08;
}

.warning-summary-card small {
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.45;
    text-align: center;
}

.warning-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.warning-chip-row--compact {
    margin: 0 0 16px;
}

.warning-chip-row--hero {
    justify-content: center;
    margin-top: 0;
}

.warning-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.warning-chip--warning {
    background: rgba(197, 55, 47, 0.16);
    color: var(--brand-red);
}

.warning-chip--watch {
    background: rgba(197, 111, 29, 0.14);
    color: var(--brand-warning);
}

.warning-chip--positive {
    background: rgba(47, 143, 91, 0.16);
    color: var(--brand-success);
}

.analysis-group + .analysis-group {
    margin-top: 22px;
}

.message-list,
.positive-list {
    margin: 12px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.message-list li,
.positive-list li {
    display: grid;
    gap: 4px;
}

.message-list--warning strong {
    color: var(--brand-red);
}

.message-list--watch strong {
    color: var(--brand-warning);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.metric-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(23, 41, 90, 0.05);
}

.metric-card span {
    display: block;
    font-size: 0.9rem;
    color: var(--brand-blue-soft);
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.5rem;
}

.metric-card p {
    margin: 12px 0 0;
    color: var(--brand-blue-soft);
    line-height: 1.55;
    font-size: 0.96rem;
}

.metric-card--high {
    background: rgba(197, 55, 47, 0.12);
}

.metric-card--moderate {
    background: rgba(197, 111, 29, 0.14);
}

.metric-card--low {
    background: rgba(47, 143, 91, 0.12);
}

.metric-card--unknown {
    background: rgba(23, 41, 90, 0.06);
}

.implementation-flow {
    background: rgba(23, 41, 90, 0.04);
}

.report-hero {
    padding: 54px 0 44px;
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.95), rgba(247, 240, 230, 0.92)),
        radial-gradient(circle at right center, rgba(23, 41, 90, 0.08), transparent 30%);
}

.report-hero__content {
    max-width: none;
}

.report-hero__title-row {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
    align-items: start;
    gap: 36px;
}

.report-hero__title-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.report-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--brand-red);
}

.report-back-link::before {
    content: "\2190";
}

.report-hero__content h1 {
    margin: 14px 0 0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.report-hero__lede {
    max-width: 62ch;
    margin: 20px 0 0;
    font-size: 1.12rem;
    line-height: 1.75;
    color: var(--brand-blue-soft);
}

.report-warning-card {
    min-width: 0;
    max-width: none;
    min-height: 178px;
    padding: 28px 34px;
    border-radius: 34px;
    align-self: stretch;
    gap: 16px;
    justify-content: center;
}

.report-warning-card em {
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.84rem;
    opacity: 0.82;
}

.report-warning-card strong {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    letter-spacing: -0.03em;
}

.report-warning-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    font-size: 0.96rem;
    text-align: center;
    max-width: 42ch;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.report-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(23, 41, 90, 0.08);
    color: var(--brand-blue);
    font-weight: 700;
}

.report-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.report-body {
    padding: 52px 0 68px;
}

.report-layout {
    display: block;
}

.report-main--full {
    width: 100%;
}

.report-main__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.report-panel {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: var(--brand-shadow);
}

.report-panel--full {
    grid-column: 1 / -1;
}

.report-panel h3 {
    margin: 0 0 14px;
    font-size: 1.3rem;
}

.report-panel h4 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.panel-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--brand-red);
}

.report-section-copy,
.report-list-intro {
    margin: 14px 0 0;
    color: var(--brand-blue-soft);
    line-height: 1.7;
}

.report-panel--recommendation {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(247, 240, 230, 0.92)),
        var(--brand-white);
    border-color: rgba(197, 55, 47, 0.16);
}

.report-panel--flagged {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(23, 41, 90, 0.03)),
        var(--brand-white);
    border-color: rgba(23, 41, 90, 0.14);
}

.recommendation-callout {
    margin-top: 6px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(197, 55, 47, 0.08);
    border: 1px solid rgba(197, 55, 47, 0.12);
}

.alternative-grid,
.flagged-reason-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.alternative-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.alternative-grid li {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(23, 41, 90, 0.1);
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(21, 31, 62, 0.06);
}

.flagged-reason-list {
    display: grid;
    gap: 12px;
}

.flagged-reason-list li {
    position: relative;
    padding: 14px 16px 14px 46px;
    border-radius: 16px;
    background: rgba(23, 41, 90, 0.05);
    border: 1px solid rgba(23, 41, 90, 0.1);
    font-weight: 700;
}

.flagged-reason-list li::before {
    content: "!";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(197, 55, 47, 0.14);
    color: var(--brand-red);
    font-size: 0.82rem;
    font-weight: 700;
}

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

.flow-step {
    padding: 24px;
}

.flow-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(197, 55, 47, 0.12);
    color: var(--brand-red);
    font-weight: 700;
}

.site-footer {
    background: #121a29;
    color: rgba(255, 255, 255, 0.82);
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    font-size: 0.95rem;
}

.footer-meta--solo {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links a:hover {
    color: #fff;
}

@media (max-width: 1120px) {
    .masthead,
    .workbench-grid,
    .flow-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        justify-content: start;
    }

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

    .analysis-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .utility-bar__inner,
    .camera-card,
    .field-row,
    .result-card__header,
    .analysis-card__top,
    .footer-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .brand-lockup {
        flex-wrap: wrap;
    }

    .scanner-form--grid,
    .report-main__grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .hero__content h1 {
        max-width: none;
    }

    .report-hero__title-row {
        grid-template-columns: 1fr;
    }

    .report-warning-card {
        min-height: auto;
        align-self: flex-start;
    }

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

    .warning-chip-row--hero {
        justify-content: flex-start;
    }

    .brand-logo {
        width: 144px;
    }
}
