/* RatePeas — deliberately serious design for a deliberately unserious idea. */
:root {
  --bg: #f6f8f4;
  --surface: #ffffff;
  --surface-2: #eef3ea;
  --text: #0f1a12;
  --muted: #5d6b60;
  --line: rgba(15, 26, 18, .10);
  --pea: #5cc43c;
  --pea-dark: #2d8a1d;
  --pea-deep: #17561a;
  --pea-soft: #e3f5dc;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(15, 26, 18, .05), 0 8px 24px rgba(15, 26, 18, .06);
  --shadow-lg: 0 2px 4px rgba(15, 26, 18, .06), 0 18px 48px rgba(15, 26, 18, .12);
  --radius: 18px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a100b;
    --surface: #121a14;
    --surface-2: #17211a;
    --text: #eef5ee;
    --muted: #93a496;
    --line: rgba(238, 245, 238, .10);
    --pea-soft: #173a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 40px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.03em; }
.brand b { color: var(--pea-dark); font-weight: 800; }
@media (prefers-color-scheme: dark) { .brand b { color: var(--pea); } }
.mark { width: 34px; height: 34px; }
.mark .pod { fill: var(--pea-dark); }
.mark .pea { fill: var(--pea); stroke: color-mix(in srgb, var(--pea-deep) 70%, transparent); stroke-width: 1; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; border: 0;
  background: var(--pea-dark); color: #fff; font: inherit; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 18px rgba(45, 138, 29, .30);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: #34981f; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 24px rgba(45, 138, 29, .38); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-small { padding: 8px 16px; font-size: .9rem; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-danger:hover { background: #a93226; box-shadow: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 520px; z-index: -1;
  background:
    radial-gradient(520px 320px at 20% 20%, color-mix(in srgb, var(--pea) 26%, transparent), transparent 70%),
    radial-gradient(480px 300px at 80% 0%, color-mix(in srgb, #b6f08c 30%, transparent), transparent 70%);
  filter: blur(20px);
}
.hero-inner { text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 500; color: var(--muted);
  box-shadow: var(--shadow); margin-bottom: 26px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pea); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pea) 25%, transparent); }
h1 { font-size: clamp(2.7rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.04em; }
.grad { background: linear-gradient(95deg, var(--pea-dark), #7ad24f 60%, #b0e85a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 640px; margin: 22px auto 0; font-size: 1.2rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 34px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 64px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow); }
.stat .num { font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 750; letter-spacing: -0.03em; }
.stat .lbl { color: var(--muted); font-size: .9rem; margin-top: 2px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-head { margin-bottom: 30px; }
.section-head.row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 750; }
.section-head p { margin-top: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- upload ---------- */
.upload { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding: 28px; }
@media (max-width: 820px) { .upload { grid-template-columns: 1fr; } }
.dropzone {
  position: relative; display: grid; place-items: center; min-height: 280px; border-radius: 14px; overflow: hidden;
  border: 2px dashed color-mix(in srgb, var(--pea-dark) 45%, transparent); background: var(--pea-soft);
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--pea-dark); transform: translateY(-1px); }
.drop-hint { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 20px; color: var(--pea-deep); }
@media (prefers-color-scheme: dark) { .drop-hint { color: #bfe9b0; } }
.drop-hint svg { width: 44px; height: 44px; margin-bottom: 6px; }
.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fields { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.field { display: grid; gap: 8px; font-weight: 600; font-size: .95rem; }
.field input {
  font: inherit; font-weight: 400; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); outline: none; transition: box-shadow .15s, border-color .15s;
}
.field input:focus { border-color: var(--pea-dark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pea) 28%, transparent); }
.status { min-height: 1.4em; font-size: .95rem; color: var(--muted); }
.status.err { color: var(--danger); }
.status.ok { color: var(--pea-dark); font-weight: 600; }

/* ---------- gallery ---------- */
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tab { text-decoration: none; padding: 7px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.tab.on { background: var(--pea-dark); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.pea-card {
  display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
a.pea-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.thumb { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.pea-card:hover .thumb img { transform: scale(1.04); }
.pea-body { padding: 16px 18px 18px; }
.pea-body h3 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 4px; align-items: baseline; padding: 4px 11px; border-radius: 999px; background: var(--pea-soft); color: var(--pea-deep); font-weight: 700; font-size: .9rem; }
.chip i { font-style: normal; font-weight: 500; opacity: .85; }
@media (prefers-color-scheme: dark) { .chip { color: #bfe9b0; } }
.chip-empty { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.empty { text-align: center; padding: 56px 20px; display: grid; gap: 12px; justify-items: center; }

/* ---------- methodology ---------- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.feat { padding: 26px; }
.feat h3 { font-size: 1.15rem; margin-bottom: 10px; }
.feat p { color: var(--muted); font-size: .98rem; }

/* ---------- detail page ---------- */
.detail { padding-top: 40px; }
.detail-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; align-items: start; }
@media (max-width: 880px) { .detail-grid { grid-template-columns: 1fr; } }
.photo { overflow: hidden; padding: 0; }
.photo img { width: 100%; height: auto; }
.back { text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.pea-title { font-size: clamp(1.9rem, 4vw, 2.8rem); overflow-wrap: anywhere; }
.notice { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--pea-soft); color: var(--pea-deep); font-size: .95rem; }
@media (prefers-color-scheme: dark) { .notice { color: #bfe9b0; } }
.score { margin: 26px 0 22px; }
.score-big { display: flex; align-items: baseline; gap: 10px; font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.04em; flex-wrap: wrap; }
.score-of { font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 600; color: var(--muted); letter-spacing: -0.02em; }
.rate { padding: 24px; }
.rate h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; line-height: 1.35; }
.noun-roll { font: inherit; font-weight: 800; color: var(--pea-dark); background: none; border: 0; padding: 0; cursor: pointer; border-bottom: 2px dotted currentColor; }
@media (prefers-color-scheme: dark) { .noun-roll { color: var(--pea); } }
.scale { display: grid; grid-template-columns: repeat(4, 1fr) 2fr; gap: 10px; }
@media (max-width: 480px) { .scale { grid-template-columns: repeat(4, 1fr); } .rate-max { grid-column: 1 / -1; } }
.rate-btn {
  font: inherit; font-weight: 700; font-size: 1.15rem; padding: 16px 8px; border-radius: 14px; cursor: pointer;
  background: var(--bg); color: var(--text); border: 1.5px solid var(--line);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.rate-btn:hover { transform: translateY(-2px); border-color: var(--pea-dark); box-shadow: var(--shadow); }
.rate-btn.sel { background: var(--pea-dark); border-color: var(--pea-dark); color: #fff; box-shadow: 0 6px 18px rgba(45,138,29,.35); }
.rate-max { font-size: 1rem; overflow-wrap: anywhere; }
.rate .status { margin-top: 14px; }

/* ---------- reviews + names ---------- */
.by { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.pea-card .by { margin-top: 3px; }
textarea {
  font: inherit; font-weight: 400; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); outline: none; resize: vertical; width: 100%; min-height: 96px;
  transition: box-shadow .15s, border-color .15s;
}
textarea:focus { border-color: var(--pea-dark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pea) 28%, transparent); }
.review-form { padding: 24px; margin-top: 18px; display: grid; gap: 14px; }
.review-form[hidden] { display: none; }
.review-form h2 { font-size: 1.15rem; font-weight: 700; }
.reviews-sec { padding-top: 24px; }
.rev-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; margin-bottom: 18px; }
.reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.review { padding: 20px 22px; display: grid; gap: 8px; align-content: start; }
.review p { font-size: 1rem; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sample-panel { margin: 8px 0 24px; }

/* ---------- pea of the day ---------- */
:root { --gold: #b7791f; --gold-soft: #fbf0d4; }
@media (prefers-color-scheme: dark) { :root { --gold: #f0b94d; --gold-soft: #3a2f12; } }
.pill-gold { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 35%, transparent); color: var(--gold); font-weight: 600; margin-bottom: 0; }
.dot-gold { background: var(--gold) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent) !important; }
.potd-sec { padding: 8px 0 0; }
.potd { display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; box-shadow: var(--shadow-lg); }
@media (max-width: 820px) { .potd { grid-template-columns: 1fr; } }
.potd-photo { display: block; background: var(--surface-2); }
.potd-photo img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.potd-body { padding: 34px; display: grid; gap: 12px; align-content: center; }
.potd-body h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; }
.potd-blurb { font-size: 1.08rem; }
.cta-left { justify-content: flex-start; margin-top: 8px; }
.badge-potd { position: absolute; top: 10px; left: 10px; background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; box-shadow: var(--shadow); }
.thumb { position: relative; }
.potd-pill { display: inline-flex; margin-bottom: 8px; }
.hall { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 14px; }
.hall-item { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 12px; align-items: center; }
.hall-thumb img { width: 150px; height: 108px; object-fit: cover; border-radius: 10px; }
.hall-title { font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.hall-title:hover { text-decoration: underline; }
.gold { color: var(--gold); }

/* ---------- credits ---------- */
.credits-title { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
.credits { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 12px; }
.credit { padding: 16px 20px; display: grid; gap: 4px; }
.credit a, .foot-link { color: var(--pea-dark); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .credit a, .foot-link { color: var(--pea); } }

/* ---------- admin ---------- */
.admin-form { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: start; }
.brand-foot { font-size: 1.1rem; margin-bottom: 6px; }
.footer p.small { max-width: 460px; text-align: right; }
@media (max-width: 640px) { .footer p.small { text-align: left; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
