:root {
  color-scheme: light;
  --bg: #f6f2ec;
  --panel: #fffaf3;
  --ink: #181512;
  --muted: #6c6258;
  --line: #ded3c5;
  --accent: #7a4e2d;
  --accent-dark: #4b2b19;
  --good: #24745a;
  --shadow: 0 24px 70px rgba(45, 31, 18, 0.13);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(122, 78, 45, 0.18), transparent 34rem),
    linear-gradient(180deg, #fbf6ef, var(--bg));
  color: var(--ink);
}

body,
button,
input {
  font: inherit;
}

.hero,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 28px 0 18px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 52px;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
}

.pill {
  border: 1px solid rgba(36, 116, 90, 0.3);
  background: rgba(36, 116, 90, 0.1);
  color: var(--good);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-grid,
.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 22px;
  align-items: stretch;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.8rem, 7vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: -0.045em;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.65;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel,
.trust-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 243, 0.86);
  box-shadow: var(--shadow);
}

.trust-card {
  align-self: end;
  padding: 24px;
}

.trust-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.8;
}

main {
  display: grid;
  gap: 22px;
  padding: 20px 0 56px;
}

.form-panel,
.learning-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 24px;
  padding: 28px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input[type="file"],
input[type="number"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
}

input:focus-visible,
button:focus-visible {
  outline: 4px solid rgba(122, 78, 45, 0.28);
  outline-offset: 3px;
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.45;
}

.consent input {
  margin-top: 4px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: var(--accent-dark);
  color: #fffaf3;
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  background: #31190d;
}

.preview-panel,
.result-panel {
  padding: 24px;
}

.preview-box {
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.preview-box img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.confidence {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  font-weight: 800;
}

meter {
  width: 100%;
  height: 16px;
}

.measurements {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.measurements div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.measurements span {
  color: var(--muted);
}

.why {
  border-radius: 20px;
  background: rgba(122, 78, 45, 0.08);
  color: #47392f;
  padding: 16px;
  line-height: 1.6;
}

.why p:last-child {
  margin-bottom: 0;
}

.learning-panel output {
  display: block;
  align-self: center;
  border-radius: 20px;
  background: #fff;
  padding: 18px;
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .hero-grid,
  .results-grid,
  .form-panel,
  .learning-panel {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 32px;
  }

  h1 {
    font-size: clamp(2.45rem, 16vw, 4rem);
  }
}
