:root {
  --bg: #f5f4f0;
  --ink: #161616;
  --mute: #5a5a5a;
  --line: #161616;
  --fill: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 80;
  width: auto;
  height: auto;
  clip: auto;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand span {
  font-weight: 400;
  color: var(--mute);
  margin-left: 6px;
  font-size: 0.8rem;
}

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.nav-pills a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}
.nav-pills a:hover { text-decoration: underline; }

.browse {
  margin-left: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.browse:hover { background: var(--bg); color: var(--ink); }

.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--fill);
  padding: 20px;
}
.drawer.open { display: block; }

.drawer-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}
.drawer-col h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.drawer-col a {
  display: block;
  padding: 7px 0;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  min-height: 40px;
}
.drawer-col a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 0.78rem;
  color: var(--mute);
}
.crumb a { color: var(--mute); }
.crumb li + li::before {
  content: "/";
  margin-right: 6px;
}

.hero-bento {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 0;
}
.hero-main, .hero-side {
  padding: 28px 24px;
  background: var(--fill);
}
.hero-main { border-right: 1px solid var(--line); }
.mono-tag {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.hero-main h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.grad { color: inherit; }
.hero-main p, .hero-side p {
  margin: 0;
  color: var(--mute);
  max-width: 48ch;
}
.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--ink);
  text-decoration: none;
}
.hero-side:hover { background: var(--ink); color: var(--bg); }
.hero-side:hover p { color: #c8c8c8; }
.hero-side h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
}
.tile {
  min-height: 156px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--fill);
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.wall .tile:nth-child(4n) { border-right: 0; }
.tile:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.tile .code {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.tile:hover .code { color: #bdbdbd; }
.tile strong {
  font-size: 1.2rem;
  font-weight: 700;
}
.tile-lead {
  display: block;
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--mute);
  font-weight: 400;
}
.tile:hover .tile-lead { color: #c8c8c8; }
.t-kindle, .t-kobo, .t-apple-books, .t-google-play,
.t-libby, .t-epub, .t-pdf, .t-calibre { --accent: var(--ink); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.section-head .mono-tag { margin: 0; }

.feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.card {
  display: block;
  padding: 16px;
  background: var(--fill);
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 148px;
}
.feed .card:nth-child(3n) { border-right: 0; }
.card:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.card .meta {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.card:hover .meta { color: #bdbdbd; }
.card strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.card-sum {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--mute);
  font-weight: 400;
}
.card:hover .card-sum { color: #c8c8c8; }

.home-intro {
  padding: 24px 0 4px;
  max-width: 68ch;
}
.home-intro p { margin: 0 0 12px; color: var(--ink); }

.start {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  margin: 0 0 8px;
}
.start a {
  padding: 16px 18px;
  text-decoration: none;
  background: var(--fill);
  color: var(--ink);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.start a:nth-child(2n) { border-right: 0; }
.start a:nth-last-child(-n+2) { border-bottom: 0; }
.start a:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.start .q {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.start a:hover .q { color: #bdbdbd; }
.start strong { font-size: 1rem; font-weight: 600; line-height: 1.3; }

.compare-wrap { margin: 0 0 12px; overflow-x: auto; }
.compare-wrap table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.compare-wrap th, .compare-wrap td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  background: var(--fill);
}
.compare-wrap thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compare-wrap tbody th { width: 8.5rem; font-weight: 700; }

.facts { margin: 8px 0 24px; overflow-x: auto; }
.facts table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.facts th, .facts td {
  border-bottom: 1px solid #ccc;
  padding: 8px 12px 8px 0;
  text-align: left;
  vertical-align: top;
}
.facts th {
  width: 9.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 700;
}

.band-blurb {
  margin: 8px 0 12px;
  color: var(--mute);
  max-width: 62ch;
  font-size: 0.95rem;
}

.shelf-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.shelf-hero p { color: var(--mute); max-width: 62ch; }

.band { margin-top: 32px; }
.band h2 {
  margin: 0 0 0;
  font-size: 0.95rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.article {
  max-width: 680px;
}
.article h1 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.take,
.one-do {
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin: 0 0 20px;
  background: var(--fill);
}
.take h2,
.one-do h2,
.article .take h2,
.article .one-do h2 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.take p, .one-do p { margin: 0; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.toc a {
  font-size: 0.85rem;
  color: var(--mute);
}

.article section { margin: 28px 0; }
.article h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}
.article h3 { font-size: 1rem; margin: 16px 0 6px; }
.article li { margin-bottom: 6px; }
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.article th, .article td {
  border-bottom: 1px solid #ccc;
  text-align: left;
  padding: 8px 10px 8px 0;
}
.article th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.9rem;
}
.ng-section h2 { text-decoration: underline; }

.also { display: grid; gap: 0; border-top: 1px solid var(--line); }
.also h2 { margin: 16px 0 8px; }
.also a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  text-decoration: none;
}
.also a:hover { text-decoration: underline; }

.site-foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.88rem;
}
.site-foot .name { color: var(--ink); font-weight: 700; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.site-foot a { color: var(--mute); }

@media (max-width: 900px) {
  .hero-bento { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .wall { grid-template-columns: 1fr 1fr; }
  .wall .tile:nth-child(4n) { border-right: 1px solid var(--line); }
  .wall .tile:nth-child(2n) { border-right: 0; }
  .feed { grid-template-columns: 1fr; }
  .feed .card { border-right: 0; }
  .nav-pills { display: none; }
  .topbar-inner { justify-content: space-between; }
  .browse { flex-shrink: 0; }
  .drawer-grid { grid-template-columns: 1fr 1fr; }
  .start { grid-template-columns: 1fr; }
  .start a { border-right: 0; }
  .start a:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .start a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 56px; }
  .wall { grid-template-columns: 1fr 1fr; }
  .drawer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
