:root {
  --ink: #223e32;
  --pine: #235640;
  --paper: #fcfaf4;
  --line: #d6d6c6;
  --quiet: #54625a;
  --rust: #95462d;
  font:
    16px/1.5 "DM Sans",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  border-bottom: 1px solid var(--line);
  background: #fffdf7;
}
.bar,
main,
footer {
  max-width: 1160px;
  margin: auto;
  padding: 0 clamp(18px, 5vw, 64px);
}
.bar {
  height: 75px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font:
    700 clamp(21px, 3vw, 29px) Georgia,
    serif;
  letter-spacing: -1.3px;
}
.brand b {
  font: 700 13px system-ui;
  letter-spacing: 0.4px;
  color: var(--rust);
  background: #f5e1cc;
  padding: 4px 8px;
  border-radius: 20px;
}
.mark {
  display: flex;
  gap: 2px;
  align-items: end;
  margin-right: 5px;
}
.mark i {
  display: block;
  height: 23px;
  width: 6px;
  background: var(--pine);
  border-radius: 1px;
}
.mark i:nth-child(2) {
  height: 19px;
  background: #bf7949;
}
.mark i:last-child {
  height: 24px;
  transform: rotate(-12deg);
  background: #bf9a48;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}
h1 {
  font-size: clamp(43px, 6.1vw, 80px);
  font-weight: 500;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: clamp(29px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -0.045em;
}
h3 {
  font-size: 25px;
  letter-spacing: -0.025em;
}
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: center;
  padding: clamp(26px, 5vw, 62px) 0 28px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font: 700 11px/1.4 system-ui;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 10px;
}
.intro {
  max-width: 525px;
  margin: 14px 0;
  color: var(--quiet);
  font-size: 17px;
}
.fox {
  width: 100%;
  height: clamp(185px, 25vw, 315px);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.library-heading {
  margin: 32px 0 18px;
}
.library-heading .eyebrow {
  margin-bottom: 6px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  background: #fffcf5;
  color: var(--ink);
  border: 1px solid #b9c1b2;
  border-radius: 7px;
  padding: 8px 14px;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  background: #eaeedc;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #ab5b2c;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.primary {
  background: var(--pine);
  color: white;
  border-color: var(--pine);
}
.primary:hover {
  background: #153f2c;
}
.sm {
  font-size: 14px;
}
.actions,
#hero-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
#hero-actions {
  margin-top: 22px;
}
.subtle {
  color: var(--quiet);
  font-size: 14px;
}
.tabs,
#tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
#tabs button {
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  color: var(--quiet);
  padding: 10px 14px;
}
#tabs button[aria-current="true"] {
  color: var(--pine);
  border-color: var(--pine);
}
.num {
  font: 600 12px system-ui;
  background: #e9e9dc;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 5px;
}
#toolbar {
  margin: 22px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
input,
textarea,
select {
  background: white;
  color: var(--ink);
  border: 1px solid #afbaaf;
  border-radius: 6px;
  padding: 11px;
  width: 100%;
  min-width: 0;
}
#search {
  max-width: 360px;
}
#results {
  min-height: 160px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(295px, 100%), 1fr));
  gap: 14px;
}
.book,
.series,
.empty {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.book {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.book > div:last-child {
  min-width: 0;
}
.book h3,
.series h3,
.series li {
  overflow-wrap: anywhere;
}
.book h3 {
  font-size: 21px;
}
.spine {
  width: 38px;
  min-width: 38px;
  height: 55px;
  background: #b76d4c;
  border-radius: 2px 5px 5px 2px;
  border-left: 5px solid #88472e;
  box-shadow: inset 0 -4px #e7dcc4;
  display: grid;
  place-items: center;
  color: #fff0c9;
  font: 26px Georgia;
}
.tone1 {
  background: #628575;
  border-color: #47695c;
}
.tone2 {
  background: #977aa1;
  border-color: #6b5274;
}
.tone3 {
  background: #b18740;
  border-color: #8b692f;
}
.book .actions,
.series .actions {
  margin-top: 10px;
}
.series {
  margin-bottom: 12px;
}
.series summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.series summary:after {
  content: "＋";
  color: var(--pine);
}
.series[open] summary:after {
  content: "−";
}
.series summary > div {
  flex: 1;
}
.meter {
  display: block;
  max-width: 240px;
  width: 100%;
  height: 6px;
  accent-color: var(--pine);
  margin-top: 8px;
}
.series ol {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.series li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.series li .actions {
  margin: 0;
}
.status {
  font-weight: 700;
  font-size: 12px;
  color: var(--rust);
}
.empty p {
  color: var(--quiet);
  margin: 6px 0;
}
.empty button {
  margin-top: 8px;
}
#notice:not(:empty),
#dialog-status:not(:empty) {
  background: #f4ead6;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 12px;
}
footer {
  display: flex;
  justify-content: space-between;
  margin-top: 44px;
  padding-top: 20px;
  padding-bottom: 25px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 13px;
}
dialog {
  width: min(490px, 94vw);
  max-height: 90dvh;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop {
  background: #192e25a8;
}
.modal-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-heading h2 {
  font-size: 30px;
}
.close {
  font-size: 23px;
  border: 0;
  padding: 0 10px;
}
label {
  display: grid;
  gap: 4px;
  font-weight: 650;
  margin: 12px 0;
}
label small {
  font-weight: 400;
}
.danger {
  color: #933e29;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.linkbox {
  display: flex;
  gap: 8px;
  margin: 7px 0 16px;
}
.linkbox input {
  font-size: 13px;
}
.book .subtle,
.series .subtle {
  margin: 3px 0;
}
.book button,
.series li button {
  padding: 5px 10px;
}
.empty h3 {
  font-size: 22px;
}
@media (max-width: 650px) {
  .bar {
    height: 60px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) 115px;
    gap: 2px;
    padding: 24px 0;
  }
  .fox {
    height: auto;
  }
  .hero .intro {
    font-size: 15px;
  }
  .hero h1 {
    font-size: 40px;
  }
  #hero-actions {
    margin-top: 12px;
  }
  .library-heading {
    margin-top: 22px;
  }
  #tabs {
    gap: 0;
  }
  #tabs button {
    padding: 9px 7px;
    font-size: 14px;
  }
  .series li {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
  #toolbar button {
    white-space: nowrap;
  }
  .num {
    margin-left: 2px;
  }
  .bar button {
    padding: 6px 10px;
    font-size: 14px;
  }
}
@media (max-width: 390px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 85px;
  }
  .brand {
    font-size: 21px;
  }
  .num {
    display: none;
  }
}
[hidden] {
  display: none !important;
}
