@font-face {
  font-family: "AliensAndCows";
  src: url("./assets/fonts/aliens-and-cows-trial.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Normafixed";
  src: url("./assets/fonts/NORMT___.TTF") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #CF3338;
  --ink: #3D3935;
  --white: #FFFFFF;
  --tan: #BAA783;
  --tan-deep: #645447;
  --sand: #F7F3EC;
  --blue: #628EA9;
  --slate: #919FA8;
  --amber: #FCA426;
  --amber-soft: #FBC475;

  --bg: var(--sand);
  --card: var(--white);
  --muted: #6b6560;
  --line: #e2d9cc;
  --primary: var(--red);
  --primary-soft: #f8e6e7;
  --kindle: #2f6b4f;
  --kindle-bg: #eaf6f0;
  --other: var(--blue);
  --other-bg: #eaf2f6;
  --hold: #9a5b12;
  --hold-bg: #fff4e4;
  --miss: var(--slate);
  --miss-bg: #f1efeb;
  --error: var(--red);
  --error-bg: #fcebec;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(61, 57, 53, 0.08);
  font-size: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.top-bar {
  height: 6px;
  background: var(--red);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.75rem 1.1rem 2.5rem;
}

.header {
  position: relative;
  padding-bottom: 0.25rem;
}

.brand {
  display: inline-block;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
}

.brand-kicker {
  margin: 0.85rem 0 0.35rem;
  font-family: Inter, Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--tan-deep);
}

.header h1 {
  margin: 0 0 0.55rem;
  font-family: Inter, Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  line-height: 1.2;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.search-form {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.9rem;
  background: var(--card);
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--red);
}

.field { display: grid; gap: 0.35rem; }

.label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.optional { font-weight: 400; color: var(--muted); }

input[type="text"] {
  font: inherit;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: 100%;
  color: var(--ink);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(207, 51, 56, 0.18);
}

.find-btn {
  font-family: Inter, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
}

.find-btn:hover { filter: brightness(1.06); }
.find-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.meta, .status {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1rem 0 0;
}

.status { min-height: 1.4em; }

.results { margin-top: 1.35rem; display: grid; gap: 1.6rem; }

.section h2 {
  margin: 0 0 0.25rem;
  font-family: Inter, Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}

.section-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.section-kindle h2 { color: var(--kindle); }
.section-other h2 { color: var(--other); }
.section-hold h2 { color: var(--hold); }
.section-missing h2 { color: var(--miss); }
.section-error h2 { color: var(--error); }

.cards { display: grid; gap: 0.8rem; }

.empty {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.5rem 0;
}

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

.card.kindle { border-left: 5px solid var(--kindle); background: var(--kindle-bg); }
.card.other { border-left: 5px solid var(--other); background: var(--other-bg); }
.card.hold { border-left: 5px solid var(--hold); background: var(--hold-bg); }
.card.missing { border-left: 5px solid var(--slate); background: var(--miss-bg); }
.card.error { border-left: 5px solid var(--error); background: var(--error-bg); }

.card-lib {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.card-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
}

.card-author {
  margin: 0.15rem 0 0.5rem;
  color: var(--muted);
  font-style: italic;
}

.facts {
  font-size: 0.88rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.facts li strong { font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.badge-yes { background: var(--kindle); color: #fff; }
.badge-no { background: var(--slate); color: #fff; }
.badge-hold { background: var(--hold); color: #fff; }

.links {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eligibility {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer {
  background: var(--ink);
  color: #d8d4cf;
  margin-top: 1rem;
  padding: 1.4rem 1.1rem 2rem;
}

.footer-inner {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.footer-seal {
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
}

.footer p { margin: 0; font-size: 0.85rem; }
.footer .fineprint {
  margin-top: 0.45rem;
  color: #b7b1aa;
  font-size: 0.8rem;
}

@media (min-width: 640px) {
  .search-form {
    grid-template-columns: 1fr 1fr;
  }
  .find-btn {
    grid-column: 1 / -1;
  }
  .brand-logo {
    height: 52px;
  }
}
