:root {
  --paper: #f4f0e8;
  --paper-2: #ebe5db;
  --ink: #171714;
  --muted: #6f6b62;
  --line: rgba(23, 23, 20, 0.13);
  --card: rgba(255, 255, 255, 0.56);
  --white: #fffdf8;
  --coral: #f4774c;
  --green: #24463e;
  --shadow: 0 20px 60px rgba(31, 29, 24, 0.1);
  --sidebar: 232px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(244, 119, 76, 0.1), transparent 28rem),
    var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(244, 119, 76, 0.55);
  outline-offset: 3px;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 30px 22px 26px;
  border-right: 1px solid var(--line);
  background: rgba(244, 240, 232, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 180ms ease;
}

.nav-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
}

.nav-button.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 6px 20px rgba(34, 31, 25, 0.06);
  font-weight: 650;
}

.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: var(--muted);
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-foot {
  margin-top: auto;
}

.library-note {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.38);
}

.library-note strong,
.library-note span {
  display: block;
}

.library-note strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.library-note span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 28px clamp(28px, 4.4vw, 74px) 80px;
}

.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.topbar-copy {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-trigger,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
}

.search-trigger {
  min-width: 210px;
  gap: 10px;
  justify-content: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.search-trigger kbd {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.install-button {
  display: none;
}

.install-button.ready {
  display: inline-flex;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  min-height: 430px;
  margin: 0 auto 74px;
  max-width: 1260px;
}

.hero h1 {
  max-width: 670px;
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(52px, 6.7vw, 102px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

.hero h1 em {
  color: var(--coral);
  font-weight: inherit;
}

.hero-copy {
  max-width: 565px;
  margin: 0 0 29px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.6;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-button {
  padding: 13px 20px;
  border: 1px solid var(--ink);
  color: var(--white);
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: #34342f;
}

.primary-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: var(--paper-2);
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  padding: 13px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 650;
}

.secondary-button:hover {
  transform: translateY(-2px);
  background: var(--white);
}

.text-button {
  padding: 9px 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.hero-stack {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.stack-card {
  position: absolute;
  width: min(255px, 72%);
  aspect-ratio: 0.72;
  border-radius: 4px 18px 18px 4px;
  box-shadow: 0 28px 65px rgba(28, 25, 21, 0.18);
}

.stack-card:nth-child(1) {
  transform: translate(-60px, 17px) rotate(-9deg);
  background: #233e39;
}

.stack-card:nth-child(2) {
  transform: translate(42px, 23px) rotate(8deg);
  background: #dba89a;
}

.stack-card.featured-cover {
  transform: translate(0, -12px) rotate(-1deg);
  z-index: 3;
}

.book-cover {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border-radius: 3px 13px 13px 3px;
  color: var(--cover-ink);
  background: var(--cover);
  isolation: isolate;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: rgba(0, 0, 0, 0.13);
  z-index: -1;
}

.book-cover::after {
  content: attr(data-mark);
  position: absolute;
  right: -10%;
  bottom: -24%;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.52;
  z-index: -1;
}

.cover-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cover-title {
  max-width: 90%;
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.2vw, 31px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.book-cover.long-title .cover-title {
  font-size: clamp(16px, 1.65vw, 23px);
  line-height: 1;
}

.book-cover.very-long-title .cover-title {
  font-size: clamp(13px, 1.35vw, 19px);
  line-height: 1.04;
}

.cover-author {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.featured-cover .cover-title {
  font-size: 36px;
}

.featured-cover {
  width: min(260px, 74%);
  aspect-ratio: 0.72;
  padding: 24px;
}

.featured-cover .cover-author,
.featured-cover .cover-topline {
  font-size: 9px;
}

.section {
  max-width: 1260px;
  margin: 0 auto 74px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.section-heading p,
.page-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.continue-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow);
}

.continue-card .book-cover {
  width: 138px;
  aspect-ratio: 0.72;
  justify-self: center;
  box-shadow: 0 16px 30px rgba(25, 23, 19, 0.15);
}

.continue-card h3 {
  margin: 4px 0 7px;
  font-family: var(--font-serif);
  font-size: 31px;
  letter-spacing: -0.035em;
}

.continue-card p {
  max-width: 620px;
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-2);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 300ms ease;
}

.continue-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 9px 0 19px;
  color: var(--muted);
  font-size: 11px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 34px);
}

.book-card {
  min-width: 0;
}

.book-card-cover-wrap {
  position: relative;
  margin-bottom: 17px;
  cursor: pointer;
}

.book-card-cover-wrap:hover .book-cover {
  transform: translateY(-7px) rotate(-1deg);
  box-shadow: 0 20px 38px rgba(34, 31, 25, 0.18);
}

.book-card .book-cover {
  width: 100%;
  aspect-ratio: 0.72;
  box-shadow: 0 13px 25px rgba(34, 31, 25, 0.12);
  transition: 220ms ease;
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 7px 16px rgba(25, 23, 19, 0.12);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.favorite-button.active .icon {
  fill: var(--coral);
  stroke: var(--coral);
}

.status-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 7px 16px rgba(25, 23, 19, 0.1);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.status-pill.ready {
  color: var(--green);
}

.status-pill .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.book-card h3 {
  overflow: hidden;
  margin: 0 0 5px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-card-author {
  overflow: hidden;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 25px 0 30px;
}

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.status-filter span {
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 9px;
}

.status-filter.active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.status-filter.active span {
  color: var(--ink);
  background: var(--white);
}

.filter-button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.filter-button.active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.page-heading {
  max-width: 1260px;
  margin: 30px auto 44px;
}

.empty-state {
  padding: 70px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 25px;
}

.book-detail {
  max-width: 1120px;
  margin: 25px auto 80px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 30px;
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.detail-hero {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(40px, 7vw, 90px);
  align-items: center;
  padding: clamp(30px, 5vw, 70px);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.48);
}

.detail-hero .book-cover {
  width: 100%;
  aspect-ratio: 0.72;
  padding: 26px;
  box-shadow: 0 24px 55px rgba(31, 29, 24, 0.18);
}

.detail-hero .cover-title {
  font-size: 38px;
}

.detail-hero .book-cover.long-title .cover-title {
  font-size: 28px;
}

.detail-hero .book-cover.very-long-title .cover-title {
  font-size: 22px;
}

.detail-copy h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(45px, 6vw, 78px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.detail-subtitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 18px;
}

.detail-author {
  margin: 0 0 25px;
  font-size: 12px;
  font-weight: 750;
}

.detail-description {
  max-width: 600px;
  margin: 0 0 25px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.65;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 70px;
  padding: 60px 25px 0;
}

.detail-body h2 {
  margin: 0 0 25px;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.idea-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: idea;
}

.idea-list li {
  counter-increment: idea;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 15px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.idea-list li::before {
  content: counter(idea, decimal-leading-zero);
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.idea-list strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.idea-list span {
  color: var(--muted);
  font-size: 11px;
}

.action-card {
  position: sticky;
  top: 30px;
  padding: 25px;
  border-radius: 22px;
  color: var(--white);
  background: var(--green);
}

.action-card h3 {
  margin: 0 0 17px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
}

.action-card ol {
  display: grid;
  gap: 15px;
  margin: 0;
  padding-left: 18px;
}

.action-card li {
  padding-left: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.55;
}

.processing-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: clamp(45px, 8vw, 100px);
  align-items: start;
  margin: 58px 25px 0;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.46);
}

.processing-card h2 {
  max-width: 600px;
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(33px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.processing-card > div > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.65;
}

.processing-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.processing-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  min-height: 67px;
}

.processing-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 0;
  left: 16px;
  width: 1px;
  background: var(--line);
}

.processing-steps li > span {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  font-weight: 800;
}

.processing-steps li.complete > span {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.processing-steps .icon {
  width: 15px;
  height: 15px;
}

.processing-steps strong,
.processing-steps small {
  display: block;
}

.processing-steps strong {
  margin: 3px 0 4px;
  font-family: var(--font-serif);
  font-size: 16px;
}

.processing-steps small {
  overflow: hidden;
  max-width: 320px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader {
  --reader-size: 19px;
  min-height: 100vh;
  background: var(--white);
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 70px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(18px);
}

.reader-close {
  justify-self: start;
}

.reader-title {
  text-align: center;
}

.reader-title strong,
.reader-title span {
  display: block;
}

.reader-title strong {
  font-family: var(--font-serif);
  font-size: 16px;
}

.reader-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reader-controls {
  justify-self: end;
  display: flex;
  gap: 7px;
}

.reader-layout {
  display: grid;
  grid-template-columns: 275px minmax(0, 760px) 275px;
  justify-content: center;
  min-height: calc(100vh - 70px);
}

.reader-toc {
  padding: 42px 26px;
  border-right: 1px solid var(--line);
}

.reader-toc h2 {
  margin: 0 0 20px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc-item {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.toc-item.active {
  color: var(--ink);
}

.toc-number {
  color: var(--coral);
  font-size: 9px;
  font-weight: 800;
}

.toc-label {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.2;
}

.reader-content {
  min-width: 0;
  padding: 70px clamp(35px, 5vw, 80px) 120px;
}

.reader-content .eyebrow {
  margin-bottom: 20px;
}

.reader-content h1 {
  margin: 0 0 35px;
  font-family: var(--font-serif);
  font-size: clamp(45px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.reader-content p {
  margin: 0 0 1.3em;
  color: #34332e;
  font-family: var(--font-serif);
  font-size: var(--reader-size);
  line-height: 1.78;
}

.takeaway {
  margin: 45px 0;
  padding: 29px 31px;
  border-left: 4px solid var(--coral);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-serif);
  font-size: calc(var(--reader-size) + 2px);
  line-height: 1.5;
}

.takeaway span {
  display: block;
  margin-bottom: 7px;
  color: var(--coral);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.reader-next {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 55px;
  padding: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.reader-next span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-next strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 20px;
}

.reader-aside {
  padding: 42px 26px;
  border-left: 1px solid var(--line);
}

.reader-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reader-quote {
  margin-top: 35px;
  padding-top: 27px;
  border-top: 1px solid var(--line);
}

.reader-quote p {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.35;
}

.reader-quote span {
  color: var(--muted);
  font-size: 10px;
}

.audio-bar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 299px;
  z-index: 30;
  max-width: 700px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  color: var(--white);
  background: rgba(23, 23, 20, 0.94);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.23);
  backdrop-filter: blur(18px);
}

.audio-play {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--coral);
  cursor: pointer;
}

.audio-copy {
  min-width: 0;
  flex: 1;
}

.audio-copy strong,
.audio-copy span {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-copy strong {
  font-family: var(--font-serif);
  font-size: 13px;
}

.audio-copy span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
}

.speed-button {
  width: 41px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 8vh 20px 20px;
  background: rgba(21, 20, 17, 0.52);
  backdrop-filter: blur(12px);
}

.search-panel {
  max-width: 680px;
  max-height: 82vh;
  overflow: auto;
  margin: 0 auto;
  border-radius: 25px;
  background: var(--white);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
}

.search-input-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.search-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-serif);
  font-size: 23px;
}

.search-close {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.search-results {
  padding: 12px;
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 57px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.search-result:hover {
  background: var(--paper);
}

.search-result .book-cover {
  width: 57px;
  aspect-ratio: 0.72;
  padding: 7px;
}

.search-result .cover-title {
  font-size: 9px;
}

.search-result .cover-author,
.search-result .cover-topline {
  font-size: 4px;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result strong {
  margin-bottom: 4px;
  font-family: var(--font-serif);
  font-size: 17px;
}

.search-result span {
  color: var(--muted);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 250ms ease;
}

.mobile-nav {
  display: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 1160px) {
  .books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-layout {
    grid-template-columns: 220px minmax(0, 720px);
  }

  .reader-aside {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 20px 22px 105px;
  }

  .topbar {
    margin-bottom: 25px;
  }

  .topbar-copy {
    display: none;
  }

  .topbar::before {
    content: "Gabriel's Library";
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
  }

  .search-trigger {
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    margin-bottom: 64px;
    text-align: center;
  }

  .hero-copy {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stack {
    min-height: 330px;
    order: -1;
  }

  .detail-body {
    gap: 35px;
  }

  .reader-layout {
    display: block;
  }

  .reader-toc {
    display: none;
  }

  .reader-content {
    max-width: 760px;
    margin: auto;
  }

  .audio-bar {
    left: 24px;
  }

  .mobile-nav {
    position: fixed;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 50;
    height: 66px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 22px;
    color: rgba(255, 255, 255, 0.62);
    background: rgba(23, 23, 20, 0.94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-button {
    justify-content: center;
    gap: 5px;
    padding: 8px 3px;
    color: inherit;
    background: transparent;
    font-size: 9px;
    flex-direction: column;
  }

  .mobile-nav .nav-button.active {
    color: var(--white);
    box-shadow: none;
  }

  .mobile-nav .nav-count {
    display: none;
  }
}

@media (max-width: 680px) {
  .main {
    padding-inline: 17px;
  }

  .hero h1 {
    font-size: clamp(49px, 17vw, 74px);
  }

  .hero-copy {
    font-size: 17px;
  }

  .hero-stack {
    min-height: 285px;
  }

  .stack-card,
  .featured-cover {
    width: 180px;
  }

  .featured-cover {
    padding: 18px;
  }

  .featured-cover .cover-title {
    font-size: 27px;
  }

  .section {
    margin-bottom: 58px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 15px;
  }

  .book-card h3 {
    font-size: 18px;
  }

  .book-cover {
    padding: 13px;
  }

  .cover-title {
    font-size: 18px;
  }

  .continue-card {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .continue-card .book-cover {
    width: 100px;
  }

  .continue-card h3 {
    font-size: 23px;
  }

  .continue-card p {
    display: none;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 27px;
  }

  .detail-hero .book-cover {
    width: 180px;
    justify-self: center;
  }

  .detail-copy {
    text-align: center;
  }

  .detail-description {
    font-size: 16px;
  }

  .detail-meta,
  .detail-copy .button-row {
    justify-content: center;
  }

  .detail-body {
    grid-template-columns: 1fr;
    padding: 45px 5px 0;
  }

  .processing-card {
    grid-template-columns: 1fr;
    gap: 35px;
    margin-inline: 0;
  }

  .action-card {
    position: static;
  }

  .reader-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 62px;
    padding: 0 12px;
  }

  .reader-title strong {
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reader-title span {
    display: none;
  }

  .reader-content {
    padding: 48px 24px 115px;
  }

  .reader-content h1 {
    font-size: 47px;
  }

  .audio-bar {
    right: 13px;
    bottom: 13px;
    left: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
