@font-face {
  font-family: "Norwester";
  src: local("Norwester"), local("norwester"), url("./fonts/norwester.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Norwester", "Arial Narrow", "Franklin Gothic Condensed", "Impact", sans-serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --bg-forest: #123f36;
  --bg-forest-deep: #0f322b;
  --bg-paper: #f3edda;
  --text-ink: #1c2422;
  --text-soft: #5e6a66;
  --accent-rust: #c14e1f;
  --accent-sage: #839a68;
  --accent-mist: #a8c5d0;
  --map-studio-blue: #3e709d;
  --map-indigo: #5368b6;
  --map-amenity-green: #5a9a62;
  --map-classroom-pink: #8a5ea7;
  --map-office-orange: #d39a3a;
  --map-lab-red: #c85045;
  --map-gallery-yellow: #e4b146;
  --map-legend-slate: #4d5058;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 30px rgba(16, 44, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, #eff4ef 0%, #f8f3e8 70%, #f3efe2 100%);
  color: var(--text-ink);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

p {
  margin: 0;
  line-height: 1.55;
}

.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

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

.hero-card {
  background: radial-gradient(circle at top right, #33554e 0%, var(--bg-forest) 45%, var(--bg-forest-deep) 100%);
  color: var(--bg-paper);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 5vw, 48px);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(243, 239, 226, 0.2);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.hero .subtitle {
  margin-top: 12px;
  max-width: 66ch;
  color: #d5e2dd;
}

.grid {
  display: grid;
  gap: 18px;
}

.section {
  margin: 22px auto 0;
}

.card {
  background: #fffdf8;
  border: 1px solid #e4dfd1;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 4px 12px rgba(16, 44, 38, 0.06);
}

.palette-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.palette-title {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.swatch {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dad2c2;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.swatch:hover {
  transform: translateY(-1px);
  border-color: #c7bca7;
  box-shadow: 0 6px 14px rgba(16, 44, 38, 0.12);
}

.swatch:focus-visible {
  outline: 2px solid #2f5b4f;
  outline-offset: 2px;
}

.swatch.is-copied {
  border-color: #2b6455;
  box-shadow: 0 0 0 2px rgba(43, 100, 85, 0.18);
}

.tone {
  height: 88px;
}

.meta {
  padding: 10px;
  background: #fff;
}

.label {
  font-size: 13px;
  color: var(--text-soft);
}

.hex {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
}

.copy-hint {
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #60716b;
}

#copy-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  background: #173e35;
  color: #f3edda;
  border: 1px solid #0f322b;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 999;
}

#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.type-spec {
  display: grid;
  gap: 8px;
  border-left: 4px solid #d6dfd3;
  padding-left: 14px;
}

.display-sample {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.ui-sample {
  font-family: var(--font-ui);
  font-size: 1.06rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-rust);
  color: #fff;
}

.btn-secondary {
  background: #e2e9dd;
  color: #23453d;
}

.btn-dark {
  background: var(--bg-forest-deep);
  color: var(--bg-paper);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e0dacc;
  border-radius: 10px;
  background: #fff;
}

.checklist input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-rust);
}

.checklist strong {
  display: block;
  margin-bottom: 3px;
}

.insights {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.insight-pill {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #d8d1c3;
  background: #fff;
}

.badge-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 14px;
}

.badge-grid.is-hidden {
  display: none;
}

.badge-book {
  display: none;
}

.badge-book.is-active {
  display: grid;
  margin-top: 14px;
  grid-auto-flow: column;
  grid-auto-columns: min(92vw, 440px);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

.book-page {
  scroll-snap-align: start;
  border: 1px solid #d9d1c2;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.book-page h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.book-page p {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.book-page-grid {
  display: grid;
  gap: 10px;
}

.badge {
  border: 1px solid #d9d1c2;
  border-radius: 12px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  box-shadow: 0 4px 0 rgba(16, 44, 38, 0.08);
}

.badge:hover {
  transform: translateY(-2px);
  border-color: #cbbfa9;
  box-shadow: 0 10px 16px rgba(16, 44, 38, 0.14);
}

.badge-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid #e7dfcf;
  background: #fbf8f1;
}

.badge-head h3 {
  font-size: 1.02rem;
  margin: 0;
  line-height: 1.15;
}

.badge-head p {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
}

.badge-body {
  padding: 12px 14px 14px;
}

.logo-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed #d8d0c1;
  border-radius: 10px;
  background: #f5f2e7;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 10px;
}

.logo-frame.is-wide {
  aspect-ratio: 20 / 8;
  padding: 12px 14px;
}

.logo-frame.is-tall {
  aspect-ratio: 1 / 1;
  padding: 8px;
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f2e7;
}

.logo-fallback {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: #5f6a66;
}

.badge .tag {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.tag.cc {
  background: rgba(46, 126, 203, 0.15);
  color: #1e5c97;
}

.tag.ct {
  background: rgba(206, 110, 159, 0.14);
  color: #9f3d71;
}

.tag.df {
  background: rgba(79, 154, 95, 0.16);
  color: #2d6c3c;
}

.tag.gpm {
  background: rgba(198, 75, 75, 0.14);
  color: #903535;
}

.tag.mt {
  background: rgba(196, 163, 58, 0.18);
  color: #8c6d12;
}

.tag.vsa {
  background: rgba(218, 138, 68, 0.16);
  color: #9b5822;
}

.badge-toggle {
  margin-top: 10px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #e5ece2;
  color: #23453d;
}

.badge-toggle.is-collected {
  background: #244e41;
  color: #f3efe2;
}

.tracker-shell {
  display: grid;
  gap: 14px;
}

.tracker-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: center;
}

.tracker-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.view-btn {
  border: 1px solid #d6cebf;
  background: #fff;
  color: #3a4a46;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.view-btn.is-active {
  background: #264d41;
  color: #f3efe2;
  border-color: #264d41;
}

.mode-reco {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}

.meter {
  height: 12px;
  border-radius: 999px;
  background: #e1ddd0;
  overflow: hidden;
  margin-top: 6px;
}

.meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--map-lab-red) 0%,
    var(--accent-rust) 16%,
    var(--map-office-orange) 32%,
    var(--map-gallery-yellow) 48%,
    var(--map-amenity-green) 64%,
    var(--map-studio-blue) 80%,
    var(--map-indigo) 92%,
    var(--map-classroom-pink) 100%
  );
  transition: width 220ms ease;
}

.save-note {
  font-size: 12px;
  color: var(--text-soft);
}

.qr-wrap {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.qr-wrap img {
  width: 170px;
  height: 170px;
  border-radius: 10px;
  border: 1px solid #d8d0c1;
  background: #fff;
}

.tracker-reset {
  border: 1px solid #d3cabb;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.badge-toggle,
.tracker-reset,
.view-btn {
  min-height: 42px;
}

.footer {
  margin-top: 36px;
  background: linear-gradient(180deg, #1c4138 0%, #112c27 100%);
  color: #dce6e2;
}

.footer .wrap {
  padding: 32px 0;
}

.footer-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.footer h3 {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f3efe2;
  margin-bottom: 10px;
}

.footer p {
  color: #b8ccc6;
  font-size: 14px;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer a {
  color: #dce6e2;
  text-decoration: none;
}

.footer small {
  display: block;
  margin-top: 18px;
  color: #9fb7b0;
}

@media (max-width: 700px) {
  .hero {
    padding-top: 24px;
  }

  .tracker-controls {
    grid-template-columns: 1fr;
  }

  .badge-grid {
    grid-template-columns: 1fr;
  }

  .logo-frame {
    aspect-ratio: 16 / 10;
  }

  .logo-frame.is-wide {
    aspect-ratio: 20 / 8;
  }

  .badge-head h3 {
    font-size: 0.96rem;
  }

  .badge-head p {
    font-size: 12px;
  }

  .badge-toggle {
    font-size: 15px;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
