:root {
  --green-900: #0f2e1d;
  --green-700: #1f5c3a;
  --green-500: #2f8f5b;
  --green-100: #e6f3ea;
  --cream: #f7f5ee;
  --ink: #17231c;
  --muted: #5b6b61;
  --line: #e2e8e3;
  --healthy: #2f8f5b;
  --powdery: #8a94a6;
  --rust: #c2622d;
  --radius: 20px;
  --shadow: 0 18px 40px -22px rgba(15, 46, 29, .45);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: #fff; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
p { margin: 0 0 1em; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

.header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; text-decoration: none; color: var(--green-900); }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; background: var(--green-700); color: #d9f2c4; display: grid; place-items: center; }
.brand__mark svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 1.4rem; font-size: .93rem; font-weight: 500; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--green-700); }
.nav__gh { color: var(--green-700) !important; }

.hero { background: radial-gradient(900px 400px at 90% 0%, #d7efd9, transparent 70%), var(--cream); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.pill { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35em 1em; font-size: .82rem; font-weight: 600; color: var(--green-700); margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); color: var(--green-900); }
.hero h1 em { color: var(--green-500); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 32em; }
.hero__stats { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; gap: 2.4rem; flex-wrap: wrap; }
.hero__stats strong { display: block; font-family: "DM Serif Display", serif; font-size: 2rem; font-weight: 400; color: var(--green-900); line-height: 1; }
.hero__stats span { font-size: .85rem; color: var(--muted); }
.hero__img { border-radius: 28px; box-shadow: var(--shadow); width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transform: rotate(2deg); }

.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section--tint { background: var(--cream); }
.section__title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); color: var(--green-900); margin-bottom: 1.6rem; }

.detect { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.5rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: 1.6rem; color: var(--green-900); }
.drop { display: grid; place-items: center; min-height: 320px; border: 2px dashed #bcd8c4; border-radius: 16px; background: #fbfdfb; cursor: pointer; text-align: center; padding: 1rem; transition: border-color .2s, background .2s; overflow: hidden; }
.drop:hover, .drop.is-over { border-color: var(--green-500); background: var(--green-100); }
.drop.has-image { padding: 0; border-style: solid; }
.drop__empty { display: grid; gap: .4rem; justify-items: center; }
.drop__icon { font-size: 2.4rem; }
.drop small { color: var(--muted); }
#preview { width: 100%; height: 320px; object-fit: cover; }
.samples { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.sample { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: none; transition: border-color .2s, transform .2s; }
.sample:hover, .sample:focus-visible { border-color: var(--green-500); transform: translateY(-2px); outline: none; }
.sample img { width: 64px; height: 48px; object-fit: cover; }

.result { display: flex; flex-direction: column; justify-content: center; }
.result__status { display: grid; justify-items: center; gap: .9rem; text-align: center; color: var(--muted); padding: 2rem 0; }
.result__status.is-idle .spinner { display: none; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--green-100); border-top-color: var(--green-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: 70%; height: 6px; background: var(--green-100); border-radius: 6px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--green-500); transition: width .2s; }
.result__eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.result__label { font-size: 2.4rem; margin: .1em 0; }
.is-healthy .result__label { color: var(--healthy); }
.is-powdery .result__label { color: #5d6678; }
.is-rust .result__label { color: var(--rust); }
.result__conf { color: var(--muted); font-weight: 600; }
.bars { display: grid; gap: .7rem; margin: 1.2rem 0 1.4rem; }
.bar { display: grid; grid-template-columns: 130px 1fr 52px; align-items: center; gap: .7rem; font-size: .9rem; color: var(--muted); }
.bar.is-best { color: var(--ink); font-weight: 600; }
.bar__name { display: flex; align-items: center; gap: .45rem; }
.bar__track { height: 10px; background: #eef2ef; border-radius: 10px; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 10px; transition: width .6s ease; }
.bar__fill--healthy { background: var(--healthy); }
.bar__fill--powdery { background: var(--powdery); }
.bar__fill--rust { background: var(--rust); }
.bar__pct { text-align: right; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--healthy { background: var(--healthy); }
.dot--powdery { background: var(--powdery); }
.dot--rust { background: var(--rust); }
.advice { background: var(--cream); border-radius: 14px; padding: 1rem 1.2rem; font-size: .93rem; }
.advice p { margin: .3rem 0 0; color: var(--muted); }
.disclaimer { font-size: .85rem; color: var(--muted); margin-top: 1.2rem; text-align: center; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card__body { padding: 1.3rem 1.4rem 1.5rem; }
.card h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; }

.how { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.steps { padding-left: 1.2rem; display: grid; gap: .9rem; color: var(--muted); }
.steps b { color: var(--ink); }
.arch { display: grid; gap: .45rem; }
.arch__row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: 12px; background: var(--green-100); font-size: .92rem; font-weight: 500; }
.arch__row code { font-family: ui-monospace, Consolas, monospace; color: var(--green-700); }
.arch__row--out { background: var(--green-700); color: #fff; }
.arch__row--out code { color: #d9f2c4; }

.footer { background: var(--green-900); color: #b9d3c1; padding: 1.6rem 0; font-size: .9rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer a { color: #fff; }

@media (max-width: 860px) {
  .hero__inner, .detect, .how { grid-template-columns: 1fr; }
  .hero__img { transform: none; }
  .cards { grid-template-columns: 1fr; }
  .nav a:not(.nav__gh) { display: none; }
}
@media (max-width: 480px) {
  .brand span:last-child { font-size: .95rem; }
  .bar { grid-template-columns: 96px 1fr 46px; font-size: .82rem; }
  .drop, #preview { min-height: 240px; height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation: none; }
}
