/* ScanWise site: matches the app redesign.
   Ink + off-white ground, one lime "signal" accent, verdicts told apart by colour, shape and word.
   Fonts: Big Shoulders Display (headlines), Hanken Grotesk (body), Martian Mono (labels). */

:root {
    --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Martian Mono', ui-monospace, monospace;

    --bg: #F5F6F1;
    --surface: #FFFFFF;
    --fill: #ECEEE8;
    --line: #DDE0D8;
    --ink: #12161A;
    --ink-2: #4A5159;
    --ink-3: #646B73;
    --signal: #C6F135;
    --signal-ink: #12161A;

    --good: #17704A;
    --good-bg: #E3F3EA;
    --warn: #8A5200;
    --warn-bg: #FBEBCF;
    --bad: #B3261E;
    --bad-bg: #FBE3DE;

    /* Aliases used by the legal pages' inline styles */
    --primary-color: var(--ink);
    --primary-light: var(--ink-2);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --border-color: var(--line);
    --section-bg: var(--fill);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0E1114;
        --surface: #171B20;
        --fill: #1F242A;
        --line: #2A3037;
        --ink: #F2F4EF;
        --ink-2: #B4BBC2;
        --ink-3: #8D959D;

        --good: #5FD39A;
        --good-bg: #12301F;
        --warn: #F2B24A;
        --warn-bg: #3A2A0C;
        --bad: #FF8A7A;
        --bad-bg: #3C1713;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--signal);
    color: var(--signal-ink);
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.mono-label {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* Brand mark */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--signal);
    color: var(--signal-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-mark svg {
    width: 20px;
    height: 20px;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1;
}

/* Sticky header (slides in on scroll) */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.sticky-header.show {
    transform: translateY(0);
}

.sticky-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.nav-downloads {
    display: flex;
    gap: 8px;
}

.nav-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.nav-download-btn:hover {
    transform: translateY(-1px);
}

.nav-btn-icon {
    width: 16px;
    height: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    padding: 0 32px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--signal);
    color: var(--signal-ink);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Hero */
.hero {
    padding: 28px 0 96px;
    position: relative;
    overflow: hidden;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 56px;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 64px;
    align-items: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(4.5rem, 12vw, 9rem);
    line-height: 0.88;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    color: var(--ink);
    animation: fadeInUp 0.8s ease-out both;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 30em;
    margin-top: 28px;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 28px;
    animation: fadeInUp 0.8s ease-out 0.45s both;
}

.verdict-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.verdict-chip svg {
    width: 14px;
    height: 14px;
}

.chip-good { background: var(--good-bg); color: var(--good); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }

/* Phone demo */
.hero-demo {
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.app-mockup {
    position: relative;
}

.phone-frame {
    width: 300px;
    height: 620px;
    background: #12161A;
    border-radius: 48px;
    padding: 10px;
    box-shadow: 0 30px 80px rgba(18, 22, 26, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    position: relative;
}

.screen-content {
    width: 100%;
    height: 100%;
    background: #F5F6F1;
    border-radius: 38px;
    position: relative;
    overflow: hidden;
}

.app-screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
    font-family: var(--font-body);
    color: #12161A;
}

.app-screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Camera screen */
.camera-screen {
    background: #0B0D0F;
    color: #F2F4EF;
}

.cam-label {
    position: absolute;
    left: 34px;
    top: 210px;
    width: 212px;
    height: 190px;
    background: #CFC9BC;
    border-radius: 5px;
    transform: rotate(-2deg);
    padding: 16px;
    color: #2A2823;
    font-size: 10px;
    line-height: 17px;
}

.cam-label b {
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 7px;
    letter-spacing: 0.14em;
    color: #5B574E;
    margin-bottom: 8px;
}

.cam-shade {
    position: absolute;
    background: rgba(11, 13, 15, 0.62);
}

.cam-frame {
    position: absolute;
    left: 18px;
    top: 180px;
    width: 244px;
    height: 250px;
}

.cam-frame i {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 3px solid #C6F135;
}

.cam-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.cam-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.cam-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.cam-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

.cam-hint {
    position: absolute;
    top: 118px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.cam-hint span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(23, 27, 32, 0.9);
    font-size: 10px;
    font-weight: 500;
}

.cam-shutter {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid #F2F4EF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cam-shutter::after {
    content: '';
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #C6F135;
    animation: pulse 2s ease-in-out infinite;
}

/* Analysing screen */
.loading-content {
    padding: 90px 20px 0;
}

.load-card {
    position: relative;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #DDE0D8;
    border-radius: 20px;
    padding: 16px;
}

.load-card b {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 8px;
    letter-spacing: 0.14em;
    color: #646B73;
}

.load-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.load-bars i {
    display: block;
    height: 9px;
    border-radius: 5px;
    background: #ECEEE8;
}

.load-bars i.g { background: #E3F3EA; }
.load-bars i.w { background: #FBEBCF; }

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    height: 3px;
    background: #C6F135;
    box-shadow: 0 0 14px 3px rgba(198, 241, 53, 0.7);
    animation: sweep 2.2s ease-in-out infinite;
}

.load-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 40px;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 28px;
}

.load-tip {
    margin-top: 16px;
    background: #ECEEE8;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.5;
    color: #4A5159;
}

.load-tip b {
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 8px;
    letter-spacing: 0.14em;
    color: #646B73;
    margin-bottom: 4px;
}

/* Results screen */
.results-screen {
    padding: 52px 14px 0;
}

.res-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.res-head .t {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    text-transform: uppercase;
}

.res-head .pill {
    background: #C6F135;
    color: #12161A;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}

.res-head .back {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #DDE0D8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.res-head .back svg {
    width: 14px;
    height: 14px;
}

.res-hero {
    margin-top: 12px;
    background: #12161A;
    color: #F2F4EF;
    border-radius: 20px;
    padding: 14px;
}

.res-hero .l {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 7px;
    letter-spacing: 0.14em;
    color: #B4BBC2;
}

.res-hero .v {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.res-hero .v i {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #F2B24A;
    color: #12161A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.res-hero .v i svg {
    width: 16px;
    height: 16px;
}

.res-hero .v span {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 34px;
    text-transform: uppercase;
    line-height: 1;
}

.res-bar {
    display: flex;
    gap: 3px;
    margin-top: 12px;
}

.res-bar i {
    display: block;
    height: 8px;
    border-radius: 4px;
}

.res-count {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 9px;
    font-weight: 600;
}

.res-group {
    margin-top: 12px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.res-group svg {
    width: 12px;
    height: 12px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 10px;
    background: #FFFFFF;
    border: 1px solid #DDE0D8;
    border-radius: 12px;
}

.health-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.health-icon svg {
    width: 14px;
    height: 14px;
}

.good-icon { background: #E3F3EA; color: #17704A; }
.moderate-icon { background: #FBEBCF; color: #8A5200; }
.bad-icon { background: #FBE3DE; color: #B3261E; }

.ingredient-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.ingredient-description {
    font-size: 9px;
    color: #4A5159;
    line-height: 1.3;
}

.animation-control {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 14px;
    background: #12161A;
    color: #F2F4EF;
    border: 0;
    border-radius: 999px;
    font: 600 11px var(--font-body);
    cursor: pointer;
}

.play-button svg {
    width: 10px;
    height: 10px;
}

/* Sections */
.section-header {
    margin-bottom: 56px;
    max-width: 720px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 0.92;
    text-transform: uppercase;
    color: var(--ink);
    margin-top: 12px;
}

.section-description {
    font-size: 18px;
    color: var(--ink-2);
    margin-top: 16px;
    max-width: 34em;
}

/* Features */
.features {
    padding: 112px 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-index {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--ink-3);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--signal);
    color: var(--signal-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 26px;
    height: 26px;
}

.feature-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 32px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--ink);
}

.feature-description {
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.6;
}

/* How it works */
.how-it-works {
    padding: 112px 0;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.step {
    border-top: 2px solid var(--ink);
    padding-top: 20px;
}

.step-number {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 96px;
    line-height: 0.9;
    color: var(--ink);
}

.step-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 36px;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 12px;
    color: var(--ink);
}

.step-description {
    color: var(--ink-2);
    margin-top: 10px;
    max-width: 22em;
}

/* Download */
.download {
    padding: 112px 0;
    background: #12161A;
    color: #F2F4EF;
}

.download-content {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 64px;
    align-items: center;
}

.download-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.9;
    text-transform: uppercase;
}

.download-description {
    font-size: 18px;
    color: #B4BBC2;
    margin: 24px 0 36px;
    max-width: 30em;
}

.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 28px 0 22px;
    background: #F2F4EF;
    color: #12161A;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.download-btn-icon {
    width: 28px;
    height: 28px;
    flex: none;
}

.download-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.download-btn-label {
    font-size: 12px;
    color: #4A5159;
}

.download-btn-store {
    font-size: 18px;
    font-weight: 700;
}

.download-visual {
    display: flex;
    justify-content: center;
}

.label-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #171B20;
    border: 1px solid #2A3037;
    border-radius: 28px;
    padding: 28px;
    overflow: hidden;
}

.label-card .mono-label {
    color: #8D959D;
}

.label-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.label-words span {
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.w-good { background: #12301F; color: #5FD39A; }
.w-warn { background: #3A2A0C; color: #F2B24A; }
.w-bad { background: #3C1713; color: #FF8A7A; }

.label-card .scan-line {
    top: 90px;
    animation: sweep-wide 3s ease-in-out infinite;
}

/* Footer */
.footer {
    background: #0B0D0F;
    color: #F2F4EF;
    padding: 56px 0 40px;
}

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

.footer .brand-name {
    color: #F2F4EF;
}

.footer-description {
    color: #B4BBC2;
    max-width: 28em;
}

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

.footer-link {
    color: #F2F4EF;
    text-underline-offset: 4px;
    padding: 10px 0;
}

.footer-link:hover {
    color: #C6F135;
}

.footer-credit {
    color: #8D959D;
    font-size: 14px;
}

/* Scroll reveal (only when JS is running) */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* Legal pages */
.legal-title,
.legal-content h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
}

.legal-title {
    font-weight: 800;
    letter-spacing: 0.005em;
}

.legal-content a {
    text-underline-offset: 3px;
}

.back-link {
    min-height: 44px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes sweep {
    0%, 100% { top: 34px; }
    50% { top: 110px; }
}

@keyframes sweep-wide {
    0%, 100% { top: 70px; }
    50% { top: 160px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 1000px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .hero {
        padding-bottom: 64px;
    }

    .hero-top {
        margin-bottom: 36px;
    }

    .hero-content,
    .download-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .steps-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .features,
    .how-it-works,
    .download {
        padding: 72px 0;
    }
}

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

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

    .btn {
        width: 100%;
    }

    .download-btn {
        width: 100%;
    }

    .nav-download-btn {
        padding: 0 12px;
    }

    .app-mockup {
        transform: scale(0.9);
        transform-origin: top center;
        margin-bottom: -60px;
    }
}
