:root {

    --green: #079447;
    --green-dark: #056b34;

    --ink: #082b20;
    --muted: #667b73;

    --line: #e4ebe5;
    --soft: #f4f8f3;

    --white: #ffffff;

    --red: #a63d31;
    --red-soft: #fff1ee;

}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    margin: 0;

    color: var(--ink);

    background: var(--white);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

}


button {

    font: inherit;

    cursor: pointer;

}


.hidden {
    display: none !important;
}



/* =========================================
   NAVBAR
========================================= */

.navbar {

    height: 78px;

    display: flex;

    align-items: center;

    background: rgba(255,255,255,.97);

    border-bottom:
        1px solid
        #edf1ed;

}


.navbar-inner {

    width:
        min(
            1240px,
            calc(100% - 48px)
        );

    margin: auto;

    display: flex;

    justify-content:
        space-between;

    align-items: center;

}


.brand {

    border: 0;

    background: transparent;

    display: flex;

    align-items: center;

    gap: 12px;

    color: var(--ink);

    font-family: Georgia, serif;

    font-size: 25px;

    font-weight: 700;

}


.brand-icon {

    width: 42px;

    height: 42px;

    border-radius: 12px;

    display: grid;

    place-items: center;

    background: var(--green);

    color: white;

    font-size: 27px;

    transform: rotate(-8deg);

}


.brand-name span {

    color: var(--green);

    margin-left: 5px;

}


.back-button {

    border: 0;

    background: transparent;

    color: var(--green);

    font-weight: 800;

}



/* =========================================
   BUTTONS
========================================= */

.primary-button {

    border: 0;

    background: var(--green);

    color: white;

    padding:
        16px 28px;

    border-radius: 8px;

    font-weight: 800;

    transition: .2s ease;

}


.primary-button:hover {

    background: var(--green-dark);

    transform:
        translateY(-1px);

}


.secondary-button {

    border:
        1px solid
        #c8d8ca;

    background: white;

    color: var(--green);

    padding:
        13px 20px;

    border-radius: 8px;

    font-weight: 700;

}


.secondary-button:hover {

    background: #f3f8f1;

}



/* =========================================
   HOME
========================================= */

.hero {

    min-height:
        calc(100vh - 78px);

    width:
        min(
            1240px,
            calc(100% - 48px)
        );

    margin: auto;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    align-items: center;

    gap: 75px;

    padding:
        55px 0 70px;

}


.hero-content {
    max-width: 650px;
}


.hero h1 {

    margin: 0;

    font-size:
        clamp(
            58px,
            6vw,
            90px
        );

    line-height: .96;

    letter-spacing: -.055em;

}


.hero h1 span {

    color: var(--green);

}


.hero p {

    margin-top: 30px;

    max-width: 600px;

    color: var(--muted);

    font-size: 18px;

    line-height: 1.7;

}


.hero-image {

    height: 600px;

    border-radius: 28px;

    overflow: hidden;

    box-shadow:
        0 25px 60px
        rgba(8,43,32,.13);

}


.hero-image img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}



/* =========================================
   ANALYSE
========================================= */

.analyse-page {

    min-height: 100vh;

    background: var(--soft);

}


.analyse-container {

    width:
        min(
            900px,
            calc(100% - 40px)
        );

    margin: auto;

    padding:
        75px 0 100px;

}


.analyse-heading {

    text-align: center;

    margin-bottom: 40px;

}


.eyebrow {

    color: var(--green);

    font-size: 12px;

    font-weight: 800;

    letter-spacing: .18em;

    text-transform: uppercase;

}


.analyse-heading h1 {

    margin:
        15px 0 12px;

    font-size:
        clamp(
            38px,
            5vw,
            52px
        );

    letter-spacing: -.045em;

}


.analyse-heading p {

    margin: 0;

    color: var(--muted);

}


.upload-card {

    background: white;

    border:
        1px solid
        var(--line);

    border-radius: 18px;

    padding: 12px;

    box-shadow:
        0 18px 50px
        rgba(8,43,32,.06);

}


.drop-zone {

    min-height: 420px;

    border:
        1.5px dashed
        #b9cfbd;

    border-radius: 13px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    padding: 30px;

    transition: .2s ease;

}


.drop-zone.dragging {

    border-color: var(--green);

    background: #f0f8ed;

}


.upload-icon {

    width: 72px;

    height: 72px;

    border-radius: 50%;

    display: grid;

    place-items: center;

    background: #edf8eb;

    color: var(--green);

    font-size: 31px;

}


.drop-zone h2 {

    margin:
        18px 0 8px;

    font-size: 23px;

}


.drop-zone p {

    margin:
        0 0 25px;

    color: var(--muted);

    font-size: 13px;

}


.upload-actions {

    display: flex;

    gap: 10px;

}


input[type="file"] {
    display: none;
}



/* =========================================
   PREVIEW
========================================= */

.preview {

    display: none;

    width: 100%;

    max-width: 600px;

    margin-top: 25px;

    border:
        1px solid
        var(--line);

    border-radius: 12px;

    overflow: hidden;

    background: white;

}


.preview img {

    width: 100%;

    height: 270px;

    object-fit: cover;

    display: block;

}


.preview-footer {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        11px 14px;

}


.file-name {

    font-size: 12px;

    color: var(--muted);

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}



/* =========================================
   ANALYSE BUTTON
========================================= */

.analyse-submit {

    width: 100%;

    border: 0;

    margin-top: 15px;

    padding: 17px;

    border-radius: 9px;

    background: var(--green);

    color: white;

    font-weight: 800;

    font-size: 15px;

}


.analyse-submit:hover:not(:disabled) {

    background: var(--green-dark);

}


.analyse-submit:disabled {

    opacity: .45;

    cursor: not-allowed;

}



/* =========================================
   STATUS
========================================= */

.status {

    display: none;

    margin-top: 14px;

    padding: 13px;

    border-radius: 8px;

    text-align: center;

    font-size: 13px;

}


.status.loading {

    display: block;

    background: #edf8eb;

    color: #276449;

    border: 1px solid #cae4ce;

}


.status.error {

    display: block;

    background: var(--red-soft);

    color: var(--red);

    border: 1px solid #f0c9c2;

}



/* =========================================
   RESULT PAGE
========================================= */

.result-container {

    width:
        min(
            1100px,
            calc(100% - 40px)
        );

    margin: auto;

    padding:
        65px 0 90px;

}


.result-container .analyse-heading {

    text-align: left;

}


.result-grid {

    display: grid;

    grid-template-columns:
        360px 1fr;

    gap: 24px;

}


.image-card {

    background: white;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    overflow: hidden;

}


.image-card img {

    width: 100%;

    height: 350px;

    object-fit: cover;

    display: block;

}


.image-caption {

    padding:
        15px 17px;

    font-size: 13px;

    color: var(--muted);

}


.result-card {

    background: white;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    padding: 30px;

}


.result-status {

    display: inline-flex;

    padding:
        7px 11px;

    border-radius: 20px;

    background: #edf8eb;

    color: var(--green);

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .08em;

}


.result-card h2 {

    margin:
        20px 0 5px;

    font-size: 36px;

    letter-spacing: -.04em;

}


.scientific {

    color: var(--muted);

    font-style: italic;

}


.prediction-meta {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    margin-top: 28px;

}


.meta {

    padding: 16px;

    background: var(--soft);

    border-radius: 10px;

}


.meta-label {

    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 5px;

}


.meta-value {

    font-size: 18px;

    font-weight: 800;

}



/* =========================================
   CONFIDENCE
========================================= */

.confidence {

    margin-top: 22px;

}


.confidence-top {

    display: flex;

    justify-content: space-between;

    margin-bottom: 8px;

}


.confidence-label {

    color: var(--muted);

    font-size: 13px;

}


.confidence-value {

    color: var(--green);

    font-weight: 800;

}


.confidence-bar {

    width: 100%;

    height: 9px;

    border-radius: 20px;

    background: #e5ece6;

    overflow: hidden;

}


.confidence-fill {

    height: 100%;

    width: 0;

    background: var(--green);

    border-radius: inherit;

    transition: width .8s ease;

}



/* =========================================
   INFORMATION
========================================= */

.information-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;

    margin-top: 24px;

}


.info-card {

    background: white;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    padding: 25px;

}


.info-card.full {

    grid-column: 1 / -1;

}


.info-card h3 {

    margin:
        0 0 15px;

    font-size: 20px;

}


.info-card p {

    color: var(--muted);

    line-height: 1.7;

    margin: 0;

}


.info-card ul {

    margin: 0;

    padding-left: 20px;

}


.info-card li {

    margin-bottom: 10px;

    color: #455b53;

    line-height: 1.55;

}



/* =========================================
   TOP PREDICTIONS
========================================= */

.prediction-row {

    display: grid;

    grid-template-columns:
        35px 1fr 80px;

    align-items: center;

    gap: 12px;

    padding: 14px 0;

    border-bottom:
        1px solid
        var(--line);

}


.prediction-row:last-child {
    border-bottom: 0;
}


.prediction-rank {

    width: 28px;

    height: 28px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background: var(--soft);

    color: var(--green);

    font-weight: 800;

    font-size: 12px;

}


.prediction-name {
    font-weight: 700;
}


.prediction-plant {

    color: var(--muted);

    font-size: 12px;

    margin-top: 3px;

}


.prediction-confidence {

    text-align: right;

    font-weight: 800;

    color: var(--green);

}



/* =========================================
   JSON
========================================= */

.json-section {

    margin-top: 24px;

    background: #082b20;

    color: #dceee3;

    border-radius: 16px;

    overflow: hidden;

}


.json-header {

    padding:
        17px 20px;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.json-header h3 {
    margin: 0;
}


.json-toggle {

    border:
        1px solid
        rgba(255,255,255,.2);

    background: transparent;

    color: white;

    border-radius: 6px;

    padding: 6px 10px;

}


#jsonOutput {

    display: none;

    margin: 0;

    padding: 20px;

    overflow-x: auto;

    font-family: monospace;

    font-size: 12px;

    line-height: 1.6;

}



/* =========================================
   MOBILE
========================================= */

@media(max-width: 900px) {

    .hero {

        grid-template-columns: 1fr;

        gap: 45px;

    }


    .hero-image {

        height: 460px;

    }


    .result-grid {

        grid-template-columns: 1fr;

    }

}


@media(max-width: 600px) {

    .navbar-inner,
    .hero,
    .analyse-container,
    .result-container {

        width:
            calc(100% - 32px);

    }


    .hero h1 {

        font-size: 50px;

    }


    .hero-image {

        height: 350px;

        border-radius: 20px;

    }


    .upload-actions {

        width: 100%;

        flex-direction: column;

    }


    .upload-actions button {

        width: 100%;

    }


    .drop-zone {

        min-height: 370px;

        padding: 20px;

    }


    .information-grid {

        grid-template-columns: 1fr;

    }


    .info-card.full {

        grid-column: auto;

    }


    .prediction-meta {

        grid-template-columns: 1fr;

    }

}