:root {
  --paper: #f2eee3;
  --paper-light: #f8f5ed;
  --paper-deep: #e5ddcd;
  --ink: #1e1d19;
  --ink-soft: #5f5b52;
  --ink-faint: #8a8478;
  --vermilion: #c4452d;
  --vermilion-dark: #973421;
  --rule: rgba(30, 29, 25, 0.24);
  --rule-light: rgba(30, 29, 25, 0.12);
  --white: #fffdf7;
  --success: #345d45;
  --danger: #a33b29;
  --display: "Iowan Old Style", "Bodoni 72", Didot, "Noto Serif KR", "Batang", serif;
  --body: "Avenir Next", Avenir, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --section-space: clamp(4.5rem, 7vw, 7rem);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--vermilion);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 99;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: multiply;
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  border-radius: 1px;
  outline: 0;
  box-shadow: var(--focus);
}

::selection {
  background: var(--vermilion);
  color: var(--white);
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(-160%);
  transition: opacity 120ms ease, transform 120ms ease;
}

.skip-link:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-frame {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  border-bottom: 1px solid var(--ink);
  column-gap: 2rem;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  min-height: 44px;
  justify-content: center;
  text-decoration: none;
}

.wordmark__name {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.wordmark__edition {
  margin-top: 0.38rem;
  color: var(--vermilion);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-nav a,
.header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.site-nav a::after,
.header-link::after {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 1px;
  background: var(--vermilion);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.site-nav a:hover::after,
.header-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.8rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-price strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  text-transform: none;
}

.header-controls,
.language-switch,
.account-signed-in,
.account-person {
  display: flex;
  align-items: center;
}

.header-controls {
  justify-content: flex-end;
  gap: clamp(0.8rem, 2vw, 1.8rem);
}

.language-switch {
  gap: 0.32rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.language-switch button {
  min-width: 32px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: var(--vermilion-dark);
}

.account-sign-in,
.account-sign-out {
  min-height: 44px;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-signed-in {
  gap: 0.9rem;
}

.account-person {
  gap: 0.6rem;
  min-height: 46px;
  text-decoration: none;
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-deep);
  font-family: var(--display);
  font-size: 0.86rem;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-person__copy {
  display: flex;
  max-width: 8.5rem;
  flex-direction: column;
  line-height: 1.1;
}

.account-person__copy strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-person__copy small {
  margin-top: 0.28rem;
  color: var(--vermilion);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-sign-out {
  border-color: var(--rule);
  color: var(--ink-soft);
  font-size: 0.61rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.hero__index {
  position: absolute;
  z-index: 4;
  top: 2.1rem;
  left: clamp(2.5rem, 5vw, 5rem);
  display: flex;
  gap: 0.8rem;
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__copy {
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding: clamp(5.8rem, 7vw, 7rem) clamp(2.5rem, 5vw, 5rem) clamp(2.2rem, 3vw, 3rem);
}

.eyebrow {
  margin: 0 0 1.45rem;
  color: var(--vermilion);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 43rem;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.8rem, 4.8vw, 5.75rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.055em;
  word-break: keep-all;
}

.hero h1 em {
  color: var(--vermilion);
  font-weight: 400;
}

.hero__dek {
  max-width: 34rem;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: clamp(1rem, 1.2vw, 1.16rem);
  line-height: 1.75;
  word-break: keep-all;
}

.hero__cta {
  display: grid;
  grid-template-columns: 1fr auto auto;
  width: min(100%, 31rem);
  min-height: 56px;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
  padding: 0.85rem 1.1rem;
  background: var(--ink);
  color: var(--paper-light);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, transform 180ms ease;
}

.hero__cta strong {
  color: var(--paper-light);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.hero__cta:hover {
  background: var(--vermilion-dark);
  transform: translateY(-2px);
}

.hero__note {
  z-index: 2;
  display: flex;
  grid-column: 1;
  grid-row: 2;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem clamp(2.5rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 0.86rem;
  line-height: 1.55;
}

.hero__note p {
  margin: 0;
}

.proof-mark {
  color: var(--vermilion);
  font-family: var(--body);
  font-size: 1.15rem;
}

.hero__visual {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 620px;
  overflow: hidden;
  border-left: 1px solid var(--ink);
  background:
    radial-gradient(circle at 22% 14%, rgba(196, 69, 45, 0.34), transparent 34%),
    linear-gradient(155deg, #35322c 0%, #171713 58%, #0f0f0d 100%);
}

.hero__visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%);
  content: "";
  pointer-events: none;
}

.hero__cover {
  position: absolute;
  height: auto;
  border: 1px solid rgba(255, 253, 247, 0.42);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.48);
}

.hero__cover--korean {
  z-index: 1;
  top: 9%;
  left: 10%;
  width: 51%;
  transform: rotate(-3deg);
}

.hero__cover--english {
  z-index: 2;
  right: 8%;
  bottom: 8%;
  width: 41%;
  transform: rotate(4deg);
}

.hero__price {
  position: absolute;
  z-index: 5;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  width: 108px;
  height: 108px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.hero__price span {
  margin-bottom: 0.2rem;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero__price strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 3.1rem;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.07em;
  transform: translateX(-0.04em);
}

.books-section,
.about-section,
.library-section {
  padding: var(--section-space) 0;
  border-bottom: 1px solid var(--ink);
}

.library-section {
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.6), transparent 54%);
}

.library-heading {
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.library-loading {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--display);
}

.library-loading__mark {
  color: var(--vermilion);
  font-size: 1.3rem;
  animation: slow-turn 2.8s linear infinite;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.library-book {
  display: grid;
  min-width: 0;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.2rem);
  padding: clamp(1.25rem, 2.8vw, 2.5rem);
  background: var(--paper-light);
}

.library-book__cover {
  position: relative;
  width: 112px;
  aspect-ratio: 3 / 4.15;
  overflow: hidden;
  background: var(--paper-deep);
  box-shadow: 7px 8px 0 rgba(30, 29, 25, 0.08);
}

.library-book__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-book__cover .cover-placeholder {
  padding: 0.7rem;
}

.library-book__cover .cover-placeholder strong {
  font-size: 1rem;
}

.library-book__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.library-book__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--vermilion);
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-book h3 {
  margin: 0.8rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 2.55rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.library-book__author,
.library-book__purchase {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 0.78rem;
}

.library-book__author {
  font-style: italic;
}

.library-book__purchase {
  margin-top: 1.1rem;
  color: var(--ink-faint);
  font-family: var(--body);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.library-book__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.3rem;
}

.library-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}

.library-action--primary {
  min-width: 90px;
  background: var(--ink);
  color: var(--paper-light);
}

.library-action--receipt {
  border-color: var(--rule);
  color: var(--ink-soft);
}

.library-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.library-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  padding: 2.2rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.library-empty > span {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 2.8rem;
}

.library-empty h3,
.library-empty p {
  margin: 0;
}

.library-empty h3 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 400;
}

.library-empty p {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(3rem, 5vw, 5rem);
}

.section-heading h2,
.about-section h2,
.panel-heading h2,
.checkout-panel h3,
.login-panel h1,
.dashboard-heading h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.section-heading h2 {
  max-width: 43rem;
  font-size: clamp(2.5rem, 3.8vw, 4.4rem);
  line-height: 1.04;
  word-break: keep-all;
}

.section-heading__note {
  margin: 0;
  padding-left: 2.5rem;
  border-left: 1px solid var(--vermilion);
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
}

.store-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: -1rem 0 2.5rem;
  padding: 1.15rem 1.25rem;
  border-top: 1px solid var(--vermilion);
  border-bottom: 1px solid var(--vermilion);
}

.store-notice__mark {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--vermilion);
  color: var(--white);
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 700;
}

.store-notice strong {
  font-family: var(--display);
  font-size: 1.03rem;
}

.store-notice p {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(2rem, 4vw, 4.5rem);
}

.book-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1fr);
  gap: clamp(1.3rem, 2.2vw, 2.2rem);
  height: 100%;
  padding: clamp(1.2rem, 1.8vw, 1.65rem);
  border: 1px solid var(--rule);
  background: rgba(255, 253, 247, 0.58);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.book-card:nth-child(even) {
  margin-top: 0;
}

.book-card:hover {
  border-color: var(--ink);
  box-shadow: 0 18px 44px rgba(30, 29, 25, 0.09);
  transform: translateY(-3px);
}

.book-card::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 3rem;
  height: 3px;
  background: var(--vermilion);
  content: "";
}

.book-card__cover {
  position: relative;
  align-self: start;
  aspect-ratio: 3 / 4.15;
  background: var(--paper-deep);
  box-shadow: 9px 10px 0 rgba(30, 29, 25, 0.07);
}

.book-card__cover::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(30, 29, 25, 0.18);
  content: "";
  pointer-events: none;
}

.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  overflow: hidden;
  padding: 1.2rem;
  background: var(--paper-deep);
  color: var(--ink);
}

.cover-placeholder::before {
  position: absolute;
  top: 32%;
  right: -22%;
  width: 82%;
  aspect-ratio: 1;
  border: 1px solid var(--vermilion);
  border-radius: 50%;
  content: "";
}

.cover-placeholder::after {
  position: absolute;
  top: 8%;
  right: 14%;
  height: 56%;
  border-right: 1px solid var(--vermilion);
  content: "";
  transform: rotate(22deg);
  transform-origin: bottom;
}

.cover-placeholder span,
.cover-placeholder strong {
  position: relative;
  z-index: 1;
}

.cover-placeholder span {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cover-placeholder strong {
  max-width: 90%;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.3vw, 2.3rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.04em;
  word-break: keep-all;
}

.book-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-self: stretch;
  padding: 0.3rem 0 0;
}

.book-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  color: var(--vermilion);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.book-card__number {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.book-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 2.35vw, 2.8rem);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.05em;
  overflow-wrap: normal;
  word-break: keep-all;
}

.book-card__author {
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 0.92rem;
  font-style: italic;
}

.book-card__description {
  display: -webkit-box;
  margin: 1.5rem 0 1.8rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: clamp(0.82rem, 1vw, 0.93rem);
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.book-card__action {
  margin-top: auto;
}

.buy-button,
.primary-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.15rem;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper-light);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.buy-button::before,
.primary-button::before {
  position: absolute;
  inset: 0;
  background: var(--vermilion);
  content: "";
  transform: translateX(-102%);
  transition: transform 260ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.buy-button > *,
.primary-button > * {
  position: relative;
  z-index: 1;
}

.buy-button:hover::before,
.primary-button:hover::before {
  transform: translateX(0);
}

.buy-button:active,
.primary-button:active {
  transform: translateY(1px);
}

.buy-button:disabled,
.primary-button:disabled {
  background: #aaa397;
  color: #f5f1e8;
  cursor: not-allowed;
}

.buy-button:disabled::before,
.primary-button:disabled::before {
  display: none;
}

.buy-button strong,
.primary-button strong {
  color: inherit;
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}

.skeleton-block,
.skeleton-line {
  display: block;
  background: rgba(30, 29, 25, 0.09);
  animation: paper-pulse 1.35s ease-in-out infinite alternate;
}

.skeleton-line {
  width: 100%;
  height: 0.72rem;
  margin-bottom: 0.8rem;
}

.skeleton-line--short {
  width: 35%;
  margin-bottom: 1.7rem;
}

.skeleton-line--title {
  height: 2.5rem;
}

.skeleton-line--medium {
  width: 68%;
}

@keyframes paper-pulse {
  to {
    background-color: rgba(30, 29, 25, 0.16);
  }
}

.empty-state {
  max-width: 42rem;
  margin: 0 auto;
  padding: 5rem 2rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
}

.empty-state > span {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 2.8rem;
}

.empty-state h3 {
  margin: 1rem 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
}

.text-button,
.recover-button,
.icon-button {
  min-height: 44px;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.text-button:hover,
.recover-button:hover {
  border-color: var(--vermilion);
  color: var(--vermilion);
}

.empty-state .text-button {
  margin-top: 1.5rem;
}

.about-section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(3rem, 6vw, 6rem);
}

.about-section h2 {
  font-size: clamp(2.8rem, 4.4vw, 4.8rem);
  line-height: 1.05;
  word-break: keep-all;
}

.about-section__body {
  align-self: center;
}

.about-section__body > p {
  margin: 0 0 3rem;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.9;
  word-break: keep-all;
}

.edition-facts {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.edition-facts div {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.edition-facts dt {
  color: var(--ink-faint);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.edition-facts dd {
  margin: 0;
  font-family: var(--display);
  font-size: 0.95rem;
}

.site-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  min-height: 130px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

.site-footer p:nth-child(2) {
  text-align: center;
}

.site-footer a {
  justify-self: end;
  min-height: 44px;
  align-content: center;
  text-decoration-color: var(--vermilion);
  text-underline-offset: 4px;
}

.footer-contact {
  display: grid;
  justify-self: end;
  gap: 0.45rem;
  text-align: right;
}

.footer-contact nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
}

.footer-contact a {
  min-height: auto;
}

.checkout-dialog {
  width: min(1050px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(820px, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(15, 14, 12, 0.35);
}

.checkout-dialog::backdrop {
  background: rgba(20, 19, 16, 0.68);
  backdrop-filter: blur(3px);
}

.checkout-dialog[open] {
  animation: dialog-in 240ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
}

.checkout-dialog__surface {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.14fr);
  min-height: min(710px, calc(100dvh - 2rem));
}

.dialog-close {
  position: absolute;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-light);
  color: var(--ink);
  cursor: pointer;
}

.dialog-close span {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-1px);
}

.dialog-close:hover {
  border-color: var(--vermilion);
  color: var(--vermilion);
}

.checkout-summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 4vw, 4rem);
  border-right: 1px solid var(--ink);
  background: var(--paper-deep);
}

.checkout-summary__cover-wrap {
  position: relative;
  width: min(75%, 260px);
  aspect-ratio: 3 / 4.15;
  margin: 0 auto 3rem;
  background: #d8cfbd;
  box-shadow: 13px 15px 0 rgba(30, 29, 25, 0.1);
}

.checkout-summary__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder--dialog {
  position: relative;
}

.checkout-summary h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.05em;
  word-break: keep-all;
}

.checkout-summary__author {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 0.95rem;
  font-style: italic;
}

.checkout-summary__price {
  margin: 1.8rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 1.2rem;
}

.checkout-panel {
  display: grid;
  overflow-y: auto;
  padding: clamp(3.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem) 2.5rem;
  background: var(--paper-light);
}

.checkout-panel > div {
  align-self: center;
}

.checkout-panel__step,
.payment-label {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--vermilion);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.checkout-panel h3 {
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1.06;
  word-break: keep-all;
}

.checkout-panel__intro {
  max-width: 30rem;
  margin: 1rem 0 2rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  word-break: keep-all;
}

.field-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  outline: 0;
  background: transparent;
  font-family: var(--display);
  font-size: 1.12rem;
  transition: border-color 160ms ease;
}

.text-input:focus {
  border-color: var(--vermilion);
}

.text-input::placeholder {
  color: var(--ink-faint);
  opacity: 0.7;
}

.text-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error,
.field-hint {
  min-height: 1.2rem;
  margin: 0.4rem 0 0;
  color: var(--danger);
  font-size: 0.7rem;
}

.field-hint {
  color: var(--ink-faint);
}

.payment-unavailable {
  margin-top: 1.6rem;
  padding: 1rem;
  border-left: 3px solid var(--vermilion);
  background: rgba(196, 69, 45, 0.07);
}

.payment-unavailable strong {
  font-family: var(--display);
}

.payment-unavailable p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.wallet-section {
  margin-top: 1.6rem;
}

.wallet-method + .wallet-method {
  margin-top: 0.65rem;
}

#google-pay-button,
#google-pay-button > div {
  min-height: 48px;
}

.apple-pay-button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border-radius: 0;
  background: #000;
  cursor: pointer;
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-style: black;
  -apple-pay-button-type: buy;
}

.payment-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.25rem 0;
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.payment-divider::before,
.payment-divider::after {
  height: 1px;
  flex: 1;
  background: var(--rule-light);
  content: "";
}

.card-container {
  min-height: 92px;
  margin: 0.25rem 0 1rem;
}

.card-section .primary-button {
  margin-top: 0.45rem;
}

.recover-button {
  width: 100%;
  margin-top: 1rem;
  border-color: var(--rule);
  color: var(--ink-soft);
  letter-spacing: 0;
  text-transform: none;
}

.checkout-fine-print {
  margin: 1.25rem 0 0;
  color: var(--ink-faint);
  font-size: 0.63rem;
  line-height: 1.55;
  word-break: keep-all;
}

.payment-status,
.form-status {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.75rem;
}

.payment-status[data-state="working"],
.form-status[data-state="working"] {
  color: var(--ink-soft);
}

.payment-status[data-state="success"],
.form-status[data-state="success"] {
  color: var(--success);
}

.checkout-success {
  text-align: left;
}

.success-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 2rem;
  place-items: center;
  border: 1px solid var(--success);
  border-radius: 50%;
  color: var(--success);
  font-family: var(--display);
  font-size: 1.35rem;
}

.checkout-success > p:not(.checkout-panel__step) {
  margin: 1rem 0 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.primary-button--download {
  margin-bottom: 1rem;
}

.receipt-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-underline-offset: 4px;
}

.checkout-success .text-button {
  display: block;
  margin-top: 1.7rem;
}

.signin-dialog {
  width: min(900px, calc(100vw - 2rem));
  max-height: min(680px, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  color: var(--ink);
}

.signin-dialog::backdrop {
  background: rgba(18, 17, 15, 0.76);
  backdrop-filter: blur(4px);
}

.signin-dialog__surface {
  position: relative;
  display: grid;
  min-height: min(620px, calc(100dvh - 2rem));
  grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1.38fr);
}

.signin-dialog__index {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem;
  background: var(--ink);
  color: var(--paper-light);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.signin-dialog__index strong {
  align-self: center;
  color: var(--vermilion);
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  writing-mode: vertical-rl;
}

.signin-panel {
  align-self: center;
  padding: clamp(3rem, 7vw, 5.5rem);
}

.signin-panel h2 {
  max-width: 30rem;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.signin-panel__intro {
  max-width: 30rem;
  margin: 1.35rem 0 2rem;
  color: var(--ink-soft);
  font-family: var(--display);
  line-height: 1.75;
}

.in-app-browser-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  margin: 0 0 1.4rem;
  padding: 1.15rem;
  border: 1px solid var(--vermilion);
  background: rgba(196, 69, 45, 0.08);
}

.in-app-browser-note__mark {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 1.5rem;
}

.in-app-browser-note strong {
  font-family: var(--display);
}

.in-app-browser-note p {
  margin: 0.25rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.copy-link-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.copy-link-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.2;
}

.copy-link-button {
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  cursor: pointer;
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.google-signin-block {
  min-height: 54px;
}

.google-signin-button {
  width: min(100%, 400px);
  min-height: 44px;
}

.google-signin-loading {
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.google-signin-retry {
  display: block;
  min-height: 44px;
  margin-top: 0.7rem;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signin-privacy {
  max-width: 30rem;
  margin: 1rem 0 0;
  color: var(--ink-faint);
  font-size: 0.63rem;
  line-height: 1.55;
}

.noscript-note {
  position: fixed;
  z-index: 300;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  background: var(--ink);
  color: var(--white);
  text-align: center;
}

.reveal {
  animation: reveal-up 650ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.reveal--one {
  animation-delay: 60ms;
}

.reveal--two {
  animation-delay: 130ms;
}

.reveal--three {
  animation-delay: 210ms;
}

.reveal--four {
  animation-delay: 310ms;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* Admin */

.page-frame--admin {
  width: min(100%, 1500px);
}

.admin-header {
  grid-template-columns: 1fr auto;
}

.header-link {
  gap: 0.55rem;
  justify-self: end;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-main {
  min-height: calc(100dvh - 250px);
}

.admin-loading {
  display: grid;
  min-height: 58vh;
  place-content: center;
  text-align: center;
}

.loading-glyph {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 1.25rem;
  place-items: center;
  border: 1px solid var(--vermilion);
  border-radius: 50%;
  color: var(--vermilion);
  font-family: var(--display);
  animation: slow-turn 2.8s linear infinite;
}

@keyframes slow-turn {
  to {
    transform: rotate(360deg);
  }
}

.admin-loading p {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  min-height: min(680px, calc(100dvh - 250px));
  align-items: center;
  gap: clamp(4rem, 12vw, 13rem);
  padding: 5rem 0;
  border-bottom: 1px solid var(--ink);
}

.login-panel__intro h1 {
  font-size: clamp(3.5rem, 8vw, 8rem);
  line-height: 0.98;
}

.login-panel__intro > p:last-child {
  max-width: 23rem;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
}

.login-form {
  padding: 2rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.login-form .primary-button {
  margin-top: 2rem;
}

.admin-dashboard {
  padding: clamp(4rem, 8vw, 7.5rem) 0 var(--section-space);
  border-bottom: 1px solid var(--ink);
}

.dashboard-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(4rem, 7vw, 7rem);
}

.dashboard-heading h1 {
  font-size: clamp(3rem, 6.5vw, 7rem);
  line-height: 0.98;
}

.dashboard-heading__actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-heading__actions p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.dashboard-heading__actions p strong {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  align-items: start;
  gap: clamp(4rem, 9vw, 9rem);
}

.upload-panel,
.library-panel {
  position: relative;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
}

.panel-number {
  position: absolute;
  top: -0.75rem;
  right: 0;
  padding-left: 0.5rem;
  background: var(--paper);
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 0.82rem;
}

.panel-heading {
  margin-bottom: 2.5rem;
}

.panel-heading h2 {
  font-size: clamp(2rem, 3.8vw, 3.7rem);
  line-height: 1;
}

.panel-heading--library {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 1.2rem;
}

.icon-button:hover {
  border-color: var(--vermilion);
  color: var(--vermilion);
}

.upload-form > * + * {
  margin-top: 2rem;
}

.form-row--split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.text-area {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.6;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 0;
  content: "↓";
  pointer-events: none;
  transform: translateY(-50%);
}

.select-input {
  appearance: none;
  padding-right: 2rem;
  cursor: pointer;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.file-picker {
  position: relative;
  display: flex;
  min-height: 145px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  border: 1px dashed var(--rule);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: var(--vermilion);
  background: rgba(196, 69, 45, 0.04);
}

.file-picker__number {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  color: var(--vermilion);
  font-family: var(--display);
}

.file-picker strong {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
}

.file-picker > span:last-of-type {
  max-width: 100%;
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-picker input:focus-visible + * {
  outline: 0;
}

.check-field {
  display: flex;
  min-height: 52px;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
}

.check-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-field__box {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 0.16rem;
  border: 1px solid var(--ink);
}

.check-field input:checked + .check-field__box {
  border-color: var(--vermilion);
  background: var(--vermilion);
}

.check-field input:checked + .check-field__box::after {
  position: absolute;
  top: 2px;
  left: 6px;
  width: 7px;
  height: 12px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.check-field input:focus-visible + .check-field__box {
  box-shadow: var(--focus);
}

.check-field strong,
.check-field small {
  display: block;
}

.check-field strong {
  font-family: var(--display);
  font-size: 0.95rem;
}

.check-field small {
  color: var(--ink-faint);
  font-size: 0.65rem;
}

.upload-progress {
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.upload-progress__copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.upload-progress progress {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--paper-deep);
  appearance: none;
}

.upload-progress progress::-webkit-progress-bar {
  background: var(--paper-deep);
}

.upload-progress progress::-webkit-progress-value {
  background: var(--vermilion);
}

.upload-progress progress::-moz-progress-bar {
  background: var(--vermilion);
}

.admin-books-list {
  border-top: 1px solid var(--rule);
}

.admin-book {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.admin-book__cover {
  position: relative;
  width: 74px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--paper-deep);
}

.admin-book__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-book__cover span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 1.4rem;
}

.admin-book__copy {
  min-width: 0;
}

.admin-book__copy h3 {
  margin: 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-book__copy p {
  margin: 0.25rem 0 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge--draft {
  border-color: var(--ink-faint);
  color: var(--ink-faint);
}

.list-loading {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.admin-empty {
  padding: 4rem 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--display);
  text-align: center;
}

.admin-empty span {
  color: var(--vermilion);
  font-size: 2rem;
}

.admin-empty p {
  margin: 0.7rem 0 0;
}

.site-footer--admin {
  grid-template-columns: 1fr auto;
}

.site-footer--admin p:nth-child(2) {
  text-align: right;
}

@media (max-width: 1120px) {
  .header-price {
    display: none;
  }

  .library-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(350px, 0.88fr);
  }

  .hero__note {
    display: flex;
  }

  .book-card {
    grid-template-columns: 0.82fr 1fr;
  }

  .book-card__description {
    -webkit-line-clamp: 4;
  }

  .admin-layout {
    gap: 4rem;
  }
}

@media (max-width: 900px) {
  .site-header {
    min-height: 96px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(290px, 0.88fr);
    min-height: 560px;
  }

  .hero__copy {
    padding-right: 2.25rem;
    padding-left: 2.25rem;
  }

  .hero h1 {
    font-size: clamp(3.35rem, 7vw, 4.2rem);
  }

  .hero__note {
    padding-right: 2.25rem;
    padding-left: 2.25rem;
  }

  .hero__visual {
    min-height: 560px;
  }

  .books-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .book-card {
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  }

  .book-card:nth-child(even) {
    margin-top: 0;
  }

  .about-section__grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .about-section__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .checkout-dialog__surface {
    grid-template-columns: minmax(230px, 0.72fr) minmax(390px, 1.28fr);
  }

  .checkout-summary {
    padding: 2rem;
  }

  .checkout-summary__cover-wrap {
    width: 82%;
  }

  .checkout-panel {
    padding-right: 2rem;
    padding-left: 2rem;
  }

  .login-panel {
    gap: 4rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    gap: 6rem;
  }
}

@media (max-width: 680px) {
  :root {
    --section-space: 4rem;
  }

  .page-frame {
    padding-right: 1.2rem;
    padding-left: 1.2rem;
  }

  .site-header {
    grid-template-columns: 1fr;
    min-height: 104px;
    padding: 0.8rem 0;
    row-gap: 0.45rem;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    gap: 0.7rem;
  }

  .account-person__copy {
    display: flex;
    max-width: min(7rem, 28vw);
  }

  .account-sign-out {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
  }

  .account-sign-in {
    font-size: 0.62rem;
  }

  .site-nav {
    display: none;
  }

  .header-price {
    gap: 0.35rem;
  }

  .library-book {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 1rem;
    padding: 1.2rem;
  }

  .library-book__cover {
    width: 78px;
  }

  .library-book__actions {
    margin-top: 1rem;
  }

  .library-action {
    min-height: 40px;
    padding-right: 0.7rem;
    padding-left: 0.7rem;
  }

  .library-empty {
    grid-template-columns: auto 1fr;
    gap: 1rem;
  }

  .library-empty .text-button {
    grid-column: 2;
    justify-self: start;
  }

  .signin-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .signin-dialog__surface {
    display: block;
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
  }

  .signin-dialog__index {
    min-height: 84px;
    flex-direction: row;
    align-items: center;
    padding: 1.2rem 4.2rem 1.2rem 1.2rem;
  }

  .signin-dialog__index strong {
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    writing-mode: initial;
  }

  .signin-panel {
    padding: 2.5rem 1.25rem 1.5rem;
  }

  .signin-panel h2 {
    font-size: clamp(2.35rem, 11vw, 3rem);
  }

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

  .copy-link-button {
    width: 100%;
  }

  .header-price span {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 340px auto;
    min-height: auto;
    overflow: hidden;
    padding: 0;
  }

  .hero__index {
    top: 1.35rem;
    right: auto;
    left: 0;
  }

  .hero__copy {
    grid-column: 1;
    grid-row: 1;
    padding: 5rem 0 3.25rem;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 14vw, 4rem);
    line-height: 0.96;
  }

  .hero__dek {
    max-width: 29rem;
    margin-top: 1.8rem;
    font-size: 0.98rem;
  }

  .hero__cta {
    width: 100%;
    margin-top: 1.8rem;
  }

  .hero__visual {
    grid-column: 1;
    grid-row: 2;
    min-height: 340px;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .hero__cover--korean {
    top: 7%;
    left: 12%;
    width: 49%;
  }

  .hero__cover--english {
    right: 10%;
    bottom: 6%;
    width: 39%;
  }

  .hero__price {
    position: relative;
    top: auto;
    right: auto;
    grid-column: 1;
    grid-row: 2;
    width: 88px;
    height: 88px;
    align-self: start;
    justify-self: end;
    margin: 1rem;
  }

  .hero__price span {
    margin-bottom: 0.1rem;
  }

  .hero__price strong {
    font-size: 2.55rem;
  }

  .hero__note {
    grid-column: 1;
    grid-row: 3;
    padding: 1.1rem 0;
  }

  .section-heading {
    grid-template-columns: 1fr;
    margin-bottom: 2.75rem;
  }

  .section-heading h2 {
    font-size: clamp(2.3rem, 10.5vw, 3.4rem);
  }

  .section-heading__note {
    width: fit-content;
    padding: 0 0 0 1rem;
    text-align: left;
  }

  .store-notice {
    margin: 0 0 2.5rem;
  }

  .book-card,
  .book-card--skeleton {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1rem;
  }

  .book-card__cover {
    width: 92px;
    justify-self: start;
  }

  .cover-placeholder strong {
    font-size: 1rem;
  }

  .book-card__meta {
    margin-bottom: 0.65rem;
  }

  .book-card h3 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .book-card__author {
    margin-top: 0.45rem;
  }

  .book-card__description {
    margin: 0.9rem 0 1.2rem;
    -webkit-line-clamp: 2;
  }

  .about-section h2 {
    font-size: clamp(2.45rem, 10.5vw, 3.55rem);
  }

  .about-section__body {
    display: block;
  }

  .about-section__body > p {
    margin-bottom: 2.5rem;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 2rem 0;
  }

  .site-footer p:nth-child(2) {
    text-align: left;
  }

  .site-footer a {
    justify-self: start;
  }

  .checkout-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .checkout-dialog__surface {
    display: block;
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
  }

  .dialog-close {
    position: fixed;
    top: calc(0.5rem + 10px);
    right: calc(0.5rem + 10px);
  }

  .checkout-summary {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: end;
    gap: 1.3rem;
    padding: 1.25rem 4rem 1.25rem 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .checkout-summary__cover-wrap {
    width: 86px;
    margin: 0;
    box-shadow: 6px 7px 0 rgba(30, 29, 25, 0.1);
  }

  .cover-placeholder--dialog {
    padding: 0.45rem;
  }

  .cover-placeholder--dialog strong {
    font-size: 0.74rem;
  }

  .cover-placeholder--dialog span {
    font-size: 0.3rem;
  }

  .checkout-summary .eyebrow {
    margin-bottom: 0.5rem;
  }

  .checkout-summary h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
  }

  .checkout-summary__author {
    margin-top: 0.25rem;
    font-size: 0.8rem;
  }

  .checkout-summary__price {
    margin-top: 0.65rem;
    padding-top: 0.35rem;
    font-size: 0.92rem;
  }

  .checkout-panel {
    display: block;
    overflow: visible;
    padding: 2.7rem 1.25rem 1.5rem;
  }

  .checkout-panel h3 {
    font-size: 2.35rem;
  }

  .login-panel {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4.5rem 0;
  }

  .login-panel__intro h1 {
    font-size: clamp(3.4rem, 16vw, 5.5rem);
  }

  .dashboard-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-heading h1 {
    font-size: clamp(3.1rem, 14vw, 5rem);
  }

  .dashboard-heading__actions {
    justify-content: space-between;
  }

  .form-row--split,
  .file-grid {
    grid-template-columns: 1fr;
  }

  .admin-book {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .admin-book__cover {
    width: 58px;
  }

  .status-badge {
    grid-column: 2;
    width: fit-content;
  }

  .site-footer--admin {
    grid-template-columns: 1fr;
  }

  .site-footer--admin p:nth-child(2) {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .hero__price,
  .buy-button,
  .primary-button,
  .apple-pay-button {
    border: 1px solid ButtonText;
  }

  .cover-placeholder::before,
  .cover-placeholder::after,
  body::before {
    display: none;
  }
}

/* Editorial legal pages: the same paper-and-ink system, with longer reading measures. */
.legal-page {
  background:
    linear-gradient(90deg, transparent 0 49.94%, rgba(30, 29, 25, 0.035) 50%, transparent 50.06%),
    var(--paper-light);
}

.legal-frame {
  min-height: 100dvh;
}

.legal-header {
  display: grid;
  min-height: 112px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.legal-header .language-switch {
  justify-self: end;
}

.legal-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-nav a {
  min-height: 44px;
  align-content: center;
  text-decoration: none;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  color: var(--vermilion);
}

.legal-main {
  display: grid;
  grid-template-columns: minmax(92px, 0.25fr) minmax(0, 1.75fr);
  border-bottom: 1px solid var(--ink);
}

.legal-index {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.4rem;
  border-right: 1px solid var(--ink);
  color: var(--ink-faint);
  font-size: 0.51rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.legal-index strong {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: clamp(1rem, 2vw, 1.65rem);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.legal-content {
  min-width: 0;
}

.legal-section {
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 7vw, 7.5rem);
  scroll-margin-top: 1rem;
}

.legal-section + .legal-section {
  border-top: 1px solid var(--ink);
}

.legal-section article > h1 {
  max-width: 14ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 7.5vw, 7.8rem);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.065em;
}

.legal-lede {
  max-width: 52rem;
  margin: clamp(2rem, 4vw, 3.8rem) 0 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.65;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(3rem, 7vw, 6.5rem);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.legal-grid > section {
  position: relative;
  min-height: 330px;
  padding: clamp(1.5rem, 3.5vw, 3.2rem);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.legal-number {
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 0.75rem;
}

.legal-grid h2 {
  margin: 1.8rem 0 1.1rem;
  font-family: var(--display);
  font-size: clamp(1.65rem, 3vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.legal-grid p,
.legal-callout p {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.8;
}

.legal-grid a,
.legal-callout a {
  color: var(--ink);
  text-decoration-color: var(--vermilion);
  text-underline-offset: 3px;
}

.legal-callout {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1.65fr);
  gap: 2rem;
  margin-top: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.legal-callout strong {
  font-family: var(--display);
  font-weight: 500;
}

.legal-callout p {
  margin: 0;
}

.legal-section--terms article > h1 {
  max-width: 11ch;
}

.legal-footer {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .legal-header {
    min-height: 132px;
    grid-template-columns: 1fr auto;
    align-content: center;
    row-gap: 0.4rem;
  }

  .legal-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .legal-header .language-switch {
    grid-column: 2;
    grid-row: 1;
  }

  .legal-main {
    grid-template-columns: 1fr;
  }

  .legal-index {
    display: none;
  }

  .legal-section {
    padding: 4.5rem 0;
  }

  .legal-section article > h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
  }

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

  .legal-grid > section {
    min-height: 0;
    padding: 1.6rem;
  }

  .legal-callout {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .footer-contact {
    justify-self: start;
    text-align: left;
  }

  .footer-contact nav {
    justify-content: flex-start;
  }
}

/* Press-room localization fields */

.localization-fields {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.localization-fields summary {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  cursor: pointer;
  list-style: none;
}

.localization-fields summary::-webkit-details-marker {
  display: none;
}

.localization-fields summary::after {
  width: 1.2rem;
  color: var(--vermilion);
  content: "+";
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1;
  text-align: right;
}

.localization-fields[open] summary::after {
  content: "−";
}

.localization-fields summary span {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
}

.localization-fields summary small {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.localization-fields__body {
  padding: 0.8rem 0 2rem;
}

.localization-fields__body > * + * {
  margin-top: 1.6rem;
}

.text-area--compact {
  min-height: 6.5rem;
}

.icon-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

/* Browser reader — a quiet editorial room around the book */

.reader-page {
  --reader-bg: #fbf8f0;
  --reader-panel: #f2eee3;
  --reader-text: #24211d;
  --reader-muted: #716b60;
  --reader-line: rgba(36, 33, 29, 0.2);
  min-height: 100dvh;
  overflow: hidden;
  background: var(--reader-bg);
  color: var(--reader-text);
  transition: background-color 180ms ease, color 180ms ease;
}

.reader-theme-sepia {
  --reader-bg: #eee1c6;
  --reader-panel: #e3d2b1;
  --reader-text: #3d3022;
  --reader-muted: #71604a;
  --reader-line: rgba(61, 48, 34, 0.23);
}

.reader-theme-dark {
  --reader-bg: #1c1b19;
  --reader-panel: #24221f;
  --reader-text: #e6dfd1;
  --reader-muted: #aaa397;
  --reader-line: rgba(230, 223, 209, 0.2);
  color-scheme: dark;
}

.reader-page::before {
  opacity: 0.022;
}

.reader-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.reader-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.6fr) minmax(160px, 0.7fr);
  min-height: 78px;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: max(0.75rem, env(safe-area-inset-top)) clamp(1rem, 3.2vw, 3.5rem) 0.75rem;
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-panel);
}

.reader-brand {
  display: inline-flex;
  width: fit-content;
  flex-direction: column;
  text-decoration: none;
}

.reader-brand > span {
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.reader-brand small {
  margin-top: 0.35rem;
  color: var(--vermilion);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
}

.reader-bookline {
  min-width: 0;
  text-align: center;
}

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

.reader-bookline strong {
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.reader-bookline span {
  margin-top: 0.15rem;
  color: var(--reader-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.reader-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.reader-language {
  display: inline-flex;
  border: 1px solid var(--reader-line);
}

.reader-language__button {
  display: grid;
  min-width: 42px;
  min-height: 38px;
  place-items: center;
  padding: 0.3rem 0.55rem;
  background: transparent;
  color: var(--reader-muted);
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reader-language__button + .reader-language__button {
  border-left: 1px solid var(--reader-line);
}

.reader-language__button[aria-pressed="true"] {
  background: var(--reader-text);
  color: var(--reader-bg);
}

.reader-exit {
  display: inline-grid;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--reader-text);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.reader-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 64px;
  align-items: stretch;
  justify-content: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 0 clamp(1rem, 3.2vw, 3.5rem);
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-panel);
}

.reader-toolbar__cluster {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.25rem;
}

.reader-toolbar__cluster + .reader-toolbar__cluster {
  position: relative;
  padding-left: clamp(1rem, 2vw, 2rem);
}

.reader-toolbar__cluster + .reader-toolbar__cluster::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  border-left: 1px solid var(--reader-line);
  content: "";
}

.reader-tool {
  display: inline-flex;
  min-width: 56px;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  background: transparent;
  color: var(--reader-text);
  cursor: pointer;
}

.reader-tool span {
  font-family: var(--display);
  font-size: 1.15rem;
}

.reader-tool small {
  color: var(--reader-muted);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-tool:hover,
.reader-tool:hover small {
  color: var(--vermilion);
}

.reader-tool:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.reader-tool--compact {
  min-width: 44px;
  padding-right: 0.4rem;
  padding-left: 0.4rem;
}

.reader-position {
  min-width: 94px;
  margin: 0;
  color: var(--reader-muted);
  font-family: var(--display);
  font-size: 0.73rem;
  text-align: center;
}

.reader-font-output {
  min-width: 50px;
  color: var(--reader-muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-align: center;
}

.reader-theme-controls {
  gap: 0.55rem;
}

.reader-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--reader-line);
  border-radius: 50%;
  cursor: pointer;
}

.reader-swatch--light {
  background: #fbf8f0;
}

.reader-swatch--sepia {
  background: #e5d2aa;
}

.reader-swatch--dark {
  background: #24221f;
}

.reader-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--reader-panel), 0 0 0 4px var(--vermilion);
}

.reader-pdf-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  align-self: center;
  gap: 0.75rem;
  padding: 0 0.25rem;
  border-bottom: 1px solid var(--reader-text);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.reader-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--reader-bg);
}

.reader-state {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  background: var(--reader-bg);
  text-align: center;
}

.reader-state__flower {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 2rem;
  place-items: center;
  border: 1px solid var(--vermilion);
  border-radius: 50%;
  color: var(--vermilion);
  font-family: var(--display);
  font-size: 1.8rem;
  animation: reader-breathe 1.8s ease-in-out infinite alternate;
}

@keyframes reader-breathe {
  to {
    opacity: 0.48;
    transform: rotate(20deg) scale(0.93);
  }
}

.reader-state .eyebrow {
  margin-bottom: 0.8rem;
}

.reader-state h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.reader-state--error > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: var(--reader-muted);
  font-family: var(--display);
  font-size: 1rem;
}

.reader-state__mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 2rem;
  place-items: center;
  border: 1px solid var(--vermilion);
  border-radius: 50%;
  color: var(--vermilion);
  font-family: var(--display);
}

.reader-error__button {
  width: min(100%, 320px);
  margin-top: 2rem;
}

.reader-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--reader-bg);
}

.epub-viewer,
.epub-viewer > div,
.epub-viewer iframe,
.pdf-object,
.pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.epub-viewer {
  max-width: 1420px;
  margin: 0 auto;
}

.reader-canvas--pdf {
  padding: clamp(0rem, 1vw, 0.8rem);
}

.pdf-object {
  display: block;
  background: #777;
}

.reader-progress {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: calc(34px + env(safe-area-inset-bottom));
  grid-template-columns: auto minmax(100px, 1fr) 42px;
  align-items: start;
  gap: 1rem;
  padding: 0.62rem clamp(1rem, 3.2vw, 3.5rem) max(0.55rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--reader-line);
  background: var(--reader-panel);
  color: var(--reader-muted);
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.reader-progress progress {
  width: 100%;
  height: 3px;
  margin-top: 0.18rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--reader-line);
  appearance: none;
}

.reader-progress progress::-webkit-progress-bar {
  background: var(--reader-line);
}

.reader-progress progress::-webkit-progress-value {
  background: var(--vermilion);
}

.reader-progress progress::-moz-progress-bar {
  background: var(--vermilion);
}

.reader-progress strong {
  text-align: right;
}

.toc-dialog {
  width: min(530px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  color: var(--ink);
}

.toc-dialog::backdrop {
  background: rgba(18, 17, 15, 0.72);
  backdrop-filter: blur(3px);
}

.toc-dialog__header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1rem;
  padding: 2rem;
  border-bottom: 1px solid var(--ink);
}

.toc-dialog__header .eyebrow {
  margin-bottom: 0.65rem;
}

.toc-dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}

.toc-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: transparent;
  cursor: pointer;
  font-size: 0;
}

.toc-close::after {
  color: var(--ink);
  content: "×";
  font-family: var(--display);
  font-size: 1.7rem;
}

.toc-list {
  max-height: min(570px, calc(100dvh - 180px));
  overflow-y: auto;
  padding: 0 2rem 2rem;
}

.toc-list__item {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 0 0.8rem calc(var(--toc-depth, 0) * 1.15rem);
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--display);
  font-size: calc(1rem - var(--toc-depth, 0) * 0.05rem);
  line-height: 1.35;
  text-align: left;
}

.toc-list__item:hover {
  color: var(--vermilion);
}

.toc-empty {
  margin: 0;
  padding: 3rem 2rem;
  color: var(--ink-soft);
  font-family: var(--display);
  text-align: center;
}

@media (max-width: 820px) {
  .reader-header {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    gap: 0.8rem;
  }

  .reader-bookline {
    position: absolute;
    right: 8.8rem;
    left: 8.8rem;
  }

  .reader-bookline span {
    display: none;
  }

  .reader-exit {
    display: none;
  }

  .reader-toolbar {
    min-height: 58px;
    justify-content: flex-start;
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .reader-toolbar::-webkit-scrollbar {
    display: none;
  }

  .reader-tool {
    min-height: 52px;
  }

  .reader-tool small {
    display: none;
  }

  .reader-position {
    min-width: 72px;
  }
}

@media (max-width: 540px) {
  .localization-fields summary {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding-right: 2rem;
  }

  .localization-fields summary::after {
    position: absolute;
    right: 0;
  }

  .localization-fields summary small {
    margin-left: 0;
  }

  .reader-header {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .reader-brand > span {
    font-size: 1rem;
  }

  .reader-brand small {
    font-size: 0.47rem;
  }

  .reader-bookline {
    right: 6.8rem;
    left: 6.8rem;
  }

  .reader-bookline strong {
    font-size: 0.82rem;
  }

  .reader-header__actions {
    gap: 0;
  }

  .reader-language__button {
    min-width: 38px;
    min-height: 38px;
  }

  .reader-toolbar {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .reader-toolbar__cluster + .reader-toolbar__cluster {
    padding-left: 1rem;
  }

  .reader-tool {
    min-width: 48px;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .reader-position {
    min-width: 64px;
    font-size: 0.64rem;
  }

  .reader-theme-controls {
    padding-right: 0.4rem;
  }

  .reader-canvas--pdf {
    padding: 0;
  }

  .reader-progress {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 0.65rem;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .reader-progress > span {
    display: none;
  }

  .reader-state {
    padding: 1.2rem;
  }

  .reader-state h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .toc-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .toc-dialog__header {
    padding: 1.4rem;
  }

  .toc-list {
    padding: 0 1.4rem 1.4rem;
  }
}

@media (forced-colors: active) {
  .reader-language__button[aria-pressed="true"],
  .reader-swatch[aria-pressed="true"],
  .reader-tool,
  .toc-list__item {
    border: 1px solid ButtonText;
  }
}
