:root {
  /* Vintage Topps — aged cream paper, faded teal, tomato red */
  --bg: #ece0c8;
  --bg-glow-1: rgba(44, 131, 120, 0.08);
  --bg-glow-2: rgba(201, 58, 46, 0.08);
  --panel: #faf3e1;
  --panel-2: #f3e8cf;
  --inset: #fffbf0;
  --line: rgba(52, 42, 30, 0.15);
  --line-strong: rgba(52, 42, 30, 0.28);
  --gold: #e0a637;
  --gold-deep: #b9832a;
  --gold-soft: rgba(224, 166, 55, 0.16);
  --text: #2f2820;
  --muted: #6a5c49;
  --faint: #9b8a70;
  --green: #3f9e63;
  --green-deep: #2c7d4b;
  --red: #cf4436;
  --red-deep: #a8362b;
  --teal: #2c8378;
  --teal-deep: #1f6b61;
  --teal-soft: rgba(44, 131, 120, 0.15);
  --shadow: 0 14px 30px rgba(70, 50, 25, 0.18);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  /* handwriting-note accent */
  --hand: "Caveat", "Segoe Print", cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60vw 40vh at 12% -5%, var(--bg-glow-1), transparent 60%),
    radial-gradient(55vw 40vh at 92% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.15rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Anton", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  height: 34px;
}
.brand-mark svg {
  height: 100%;
  width: auto;
  display: block;
}

.brand-accent { color: var(--gold); }

.topnav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.topnav a { color: var(--muted); transition: color 0.15s; }
.topnav a:hover { color: var(--text); }

.btn-ghost {
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text) !important;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 780px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: var(--gold-soft);
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero h1 span {
  color: var(--teal);
  text-shadow: 0 2px 0 var(--teal-deep);
}

.lede {
  max-width: 580px;
  margin: 1.1rem auto 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
}

.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--text);
  line-height: 1;
}
.hero-stats span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--faint);
  margin-top: 0.35rem;
}

/* ---------- App grid ---------- */
.app {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.panel {
  position: relative;
  background: linear-gradient(165deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

/* thin foil accent along the top edge of each panel */
.panel::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--green), transparent);
  opacity: 0.7;
}

.panel--results { position: sticky; top: 1.25rem; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-soft);
}

/* ---------- Form ---------- */
#cardInput { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: 0.45rem; }

.field label,
.grades legend {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

input {
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: var(--text);
  padding: 0.72rem 0.9rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--inset);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--faint); }
input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.grades {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.015);
}
.grades legend { padding: 0 0.5rem; }
.grades legend span { color: var(--faint); font-weight: 500; }

.grade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
}

/* ---------- Submit button ---------- */
#btn-Submit {
  margin-top: 0.3rem;
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--bg);
  cursor: pointer;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, #ffe487, var(--gold) 48%, var(--gold-deep));
  box-shadow: 0 8px 22px rgba(245, 196, 81, 0.28);
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#btn-Submit:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(245, 196, 81, 0.4); }
#btn-Submit:active { transform: translateY(2px); box-shadow: 0 4px 12px rgba(245, 196, 81, 0.3); }
#btn-Submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold-soft), 0 8px 22px rgba(245, 196, 81, 0.28); }

.field-hint {
  font-size: 0.82rem;
  color: var(--faint);
  text-align: center;
}
.field-hint span { color: var(--muted); }

/* ---------- Results ---------- */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 260px;
  text-align: center;
  color: var(--faint);
  padding: 1rem;
}
.results-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1.3rem;
  color: var(--gold);
  background: var(--gold-soft);
}
.results-empty p { max-width: 240px; font-size: 0.95rem; }
.results-empty strong { color: var(--muted); }

/* verdict banner (JS sets .is-good / .is-bad on #results) */
.verdict {
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.3rem;
  animation: dealIn 0.35s ease-out;
}
#results.is-good .verdict {
  background: linear-gradient(150deg, rgba(56, 229, 196, 0.16), rgba(56, 229, 196, 0.04));
  border: 1px solid rgba(56, 229, 196, 0.4);
}
#results.is-bad .verdict {
  background: linear-gradient(150deg, rgba(255, 93, 125, 0.16), rgba(255, 93, 125, 0.04));
  border: 1px solid rgba(255, 93, 125, 0.4);
}
.verdict-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
#results.is-good .verdict-tag { color: var(--bg); background: var(--green); }
#results.is-bad .verdict-tag { color: #fff; background: var(--red); }
.verdict-msg {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
#results.is-good .verdict-msg { color: var(--green); }
#results.is-bad .verdict-msg { color: var(--red); }

/* stat rows */
.stat-grid { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1.3rem; }
.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--line);
}
.stat:last-child { border-bottom: none; }
.stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.stat-value {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.stat--hero {
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--r-sm);
  border-bottom: none;
  background: var(--inset);
}
.stat--hero .stat-value { font-size: 1.5rem; }
.stat--hero.pos .stat-value { color: var(--green); }
.stat--hero.neg .stat-value { color: var(--red); }

/* net-by-grade ladder */
.ladder h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}
.ladder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.4rem;
}
.ladder-grade {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.ladder-value { font-weight: 600; color: var(--text); }
.ladder-value.neg { color: var(--red); }

@keyframes dealIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.footer-brand {
  font-family: "Anton", sans-serif;
  color: var(--muted);
  letter-spacing: 1px;
}

.footer-note { flex: 1; text-align: right; min-width: 200px; }

.footer-support {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--gold);
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: var(--gold-soft);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.footer-support:hover {
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.22);
  transform: translateY(-1px);
}

/* support link inside the results output */
.support-note {
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.support-note a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--gold);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-soft);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.support-note a:hover {
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.22);
  transform: translateY(-1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .panel--results { position: static; }
  .topnav a:not(.btn-ghost) { display: none; }
}
@media (max-width: 480px) {
  .hero-stats { gap: 1.4rem; }
  .field-row { grid-template-columns: 1fr; }
}

/* =========================================================
   HUMAN TOUCH LAYER
   Everything below is an additive "personality" pass — grain,
   handwriting, slight tilt, washi tape, hand-drawn underline.
   Delete this whole block to return to the clean look.
   ========================================================= */

/* Subtle paper grain over the whole page — kills the flat "digital" feel */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Handwriting accents — instantly reads "a person made this" */
.hand-note {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--red);
  transform: rotate(-1.5deg);
}
.hero .hand-note { margin-top: 1.6rem; opacity: 0.92; }

.eyebrow {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
}


/* Drop the sterile foil accent bar on panels */
.panel::before { display: none; }

/* Give the support links personality too */
.support-note a,
.footer-support { font-family: var(--hand); font-size: 1.1rem; font-weight: 700; }

/* =========================================================
   VINTAGE TOPPS THEME
   Light "wax-pack" pass: flattens the glossy gradients and
   maps accents to faded teal + tomato red on aged cream.
   Delete this block to drop the vintage recolor.
   ========================================================= */

/* Flat printed panels with a card-stock border instead of gloss */
.panel {
  background: var(--panel);
  border: 2px solid var(--line-strong);
  box-shadow: 0 10px 22px rgba(70, 50, 25, 0.16);
}

/* Tri-color wordmark: Should = red, I = gold, Slab = teal (matches the mark) */
.brand-should { color: var(--red); }
.brand-i { color: var(--text); }
.brand-accent { color: var(--teal); }

.btn-ghost:hover { border-color: var(--teal); background: var(--teal-soft); }

/* Eyebrow: plain red-pen scrawl, no pill */
.eyebrow {
  padding: 0;
  border: none;
  background: none;
  color: var(--teal-deep);
}

/* Chips + small accents go teal */
.chip { color: var(--teal-deep); background: var(--teal-soft); }
.results-empty-icon { color: var(--teal-deep); background: var(--teal-soft); }

/* Inputs: warm focus ring */
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }

/* Primary action: flat tomato "stamp" button */
#btn-Submit {
  background: var(--red);
  color: #fdf6e6;
  box-shadow: 0 4px 0 var(--red-deep);
}
#btn-Submit:hover { filter: brightness(1.04); box-shadow: 0 4px 0 var(--red-deep); }
#btn-Submit:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }
#btn-Submit:focus-visible { box-shadow: 0 4px 0 var(--red-deep), 0 0 0 3px var(--teal-soft); }

/* Verdict banners recolored to the vintage green / red */
#results.is-good .verdict {
  background: rgba(63, 158, 99, 0.13);
  border: 1px solid rgba(63, 158, 99, 0.42);
}
#results.is-bad .verdict {
  background: rgba(207, 68, 54, 0.13);
  border: 1px solid rgba(207, 68, 54, 0.42);
}
#results.is-good .verdict-tag { color: #fdf6e6; }

/* Net-by-grade rows: faint ink tint + teal grade labels */
.ladder-row { background: rgba(47, 40, 32, 0.05); }
.ladder-grade { color: var(--teal-deep); }
.stat--hero { border: 1px solid var(--line); }

/* Support links in teal */
.support-note a,
.footer-support {
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-color: var(--teal-soft);
}
.support-note a:hover,
.footer-support:hover {
  border-color: var(--teal);
  background: rgba(44, 131, 120, 0.22);
}
