:root {
    --bg-main: #f3f9f4;
    --bg-card: rgba(255, 255, 255, 0.78);
    --ink-strong: #133127;
    --ink-soft: #43655b;
    --brand-1: #1f8c56;
    --brand-2: #2ac288;
    --accent: #ff9d3c;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Sora", sans-serif;
    color: var(--ink-strong);
}

body {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 16% 20%, #d8f5df 0%, transparent 42%),
        radial-gradient(circle at 84% 16%, #c8efe3 0%, transparent 45%),
        linear-gradient(130deg, #eaf7ee 0%, #edf8ff 50%, #e9f4f0 100%);
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(1px);
    opacity: 0.55;
    animation: floatOrb 8s ease-in-out infinite;
}

.orb-1 {
    width: 260px;
    height: 260px;
    background: #8de6b8;
    top: -70px;
    right: -20px;
}

.orb-2 {
    width: 190px;
    height: 190px;
    background: #fbcf9d;
    bottom: 9%;
    left: -40px;
    animation-delay: 0.8s;
}

.orb-3 {
    width: 130px;
    height: 130px;
    background: #89d8ee;
    top: 44%;
    right: 10%;
    animation-delay: 1.6s;
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    width: min(1200px, 92vw);
    margin: 0 auto;
    padding: 44px 0 24px;
    display: grid;
    gap: 28px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 28px;
    align-items: stretch;
}

.hero-copy {
    padding: 24px 6px;
}

.chip {
    display: inline-block;
    margin: 0 0 14px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffffffb5;
    border: 1px solid #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
}

.subtitle {
    margin: 14px 0 0;
    max-width: 58ch;
    font-size: 1.03rem;
    line-height: 1.65;
    color: var(--ink-soft);
}

.stats-row {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    background: #ffffffb8;
    border: 1px solid #ffffff;
    border-radius: 16px;
    padding: 14px 12px;
    display: grid;
    gap: 6px;
}

.stat-value {
    font-size: 0.92rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.76rem;
    color: #5c7b72;
}

.analyzer-card {
    background: var(--bg-card);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 45px rgba(36, 102, 70, 0.14);
    backdrop-filter: blur(7px);
    padding: 24px;
    text-align: center;
}

.preview-wrap {
    position: relative;
    width: min(100%, 330px);
    display: grid;
    place-items: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
}

#preview {
    width: min(100%, 330px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px;
    border: 2px dashed #58b189;
    background: #edf3ee;
    box-shadow: 0 14px 24px rgba(27, 79, 54, 0.15);
}

.camera-btn {
    position: absolute;
    right: 12px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 0;
    background: linear-gradient(145deg, var(--brand-1), var(--brand-2));
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(29, 130, 80, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 24px rgba(29, 130, 80, 0.38);
}

.camera-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

#analyzeBtn {
    width: min(100%, 330px);
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(125deg, var(--brand-1), var(--brand-2));
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

#analyzeBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: saturate(1.08);
}

#analyzeBtn:disabled {
    cursor: not-allowed;
    background: #99bfac;
}

.hint-text {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: #5a7a70;
}

.result {
    margin: 16px auto 0;
    max-width: 330px;
    min-height: 76px;
    border-radius: 14px;
    background: #ecf8f0;
    border: 1px solid #d1ead9;
    padding: 12px 12px 10px;
    text-align: left;
}

.result-status {
    margin: 0;
    font-weight: 600;
    color: #1f6d46;
    line-height: 1.45;
}

.result.is-loading .result-status {
    color: #2f7c57;
}

.result.is-error {
    background: #fff1ef;
    border-color: #f6c8c1;
}

.result.is-error .result-status {
    color: #a43a2d;
}

.nutrition-panel {
    display: grid;
    gap: 10px;
}

.result-title {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #4f7267;
    font-weight: 700;
}

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

.nutrition-item {
    margin: 0;
    border-radius: 10px;
    background: #ffffffc7;
    border: 1px solid #d8ecdf;
    padding: 8px;
}

.nutrition-label {
    margin: 0;
    font-size: 0.72rem;
    color: #5f7d73;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.nutrition-value {
    margin: 4px 0 0;
    color: #1a6641;
    font-size: 0.95rem;
    font-weight: 700;
}

.serving-note {
    margin: 0;
    font-size: 0.76rem;
    color: #5c7a70;
    text-align: center;
}

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

.feature-card {
    background: #ffffffb8;
    border: 1px solid #ffffff;
    border-radius: 18px;
    padding: 18px;
}

.feature-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.feature-card p {
    margin: 10px 0 0;
    color: #56776d;
    line-height: 1.55;
}

.footer {
    text-align: center;
    padding: 6px 0 12px;
    color: #3f5f55;
    font-size: 0.9rem;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: revealUp 0.7s ease forwards;
}

.delay {
    animation-delay: 0.18s;
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatOrb {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 960px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .page-shell {
        width: 93vw;
        padding-top: 24px;
    }

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

    .analyzer-card {
        padding: 18px 14px;
    }

    .camera-btn {
        width: 44px;
        height: 44px;
        right: 10px;
    }
}
