:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --ink: #171717;
  --muted: #6d685f;
  --accent: #7f1d1d;
  --line: #d8d0c2;
  --card: #fffdf8;
  --header: rgba(245,240,230,.94);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171716;
  --ink: #f3eee5;
  --muted: #b9b1a5;
  --accent: #e4a29a;
  --line: #393733;
  --card: #211f1c;
  --header: rgba(23,23,22,.94);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #171716;
    --ink: #f3eee5;
    --muted: #b9b1a5;
    --accent: #e4a29a;
    --line: #393733;
    --card: #211f1c;
    --header: rgba(23,23,22,.94);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  transition: background-color .18s ease, color .18s ease;
}

a { color: inherit; }

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--header);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.site-header .wrap {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  text-decoration: none;
  color: var(--muted);
}

.theme-toggle {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--card);
}

.hero {
  padding: 96px 0 78px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  line-height: 1.08;
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  letter-spacing: -.04em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h3 {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.lede {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.25rem;
}

.lede a {
  color: var(--ink);
  text-underline-offset: .18em;
}

.books,
.about {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.book-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 36px;
}

.cover-link {
  display: block;
  line-height: 0;
}

.cover-frame {
  width: 280px;
  height: 280px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.004);
}

.book-copy p:not(.eyebrow),
.about p {
  max-width: 680px;
  font-size: 1.15rem;
}

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: .95rem;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

.site-footer {
  padding: 36px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: .9rem;
}

.book-page .hero {
  padding-bottom: 42px;
}

.book-meta {
  max-width: 760px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  text-decoration: none;
}

@media (max-width: 760px) {
  .site-header .wrap {
    align-items: flex-start;
    padding: 18px 0;
  }

  nav {
    gap: 10px;
  }

  nav a {
    white-space: nowrap;
    font-size: .95rem;
  }

  h1 {
    font-size: 2.4rem;
    line-height: 1.04;
  }

  .hero {
    padding: 68px 0 56px;
  }

  .theme-toggle {
    width: 1.85rem;
    height: 1.85rem;
  }

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

  .cover-link,
  .cover-frame {
    width: min(260px, 100%);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .cover-image {
    width: 100%;
    height: 100%;
  }
}


.about-image-frame {
  width: 280px;
  height: 280px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.about-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-copy p {
  max-width: 680px;
  font-size: 1.15rem;
}

@media (max-width: 760px) {
  .about-image-frame {
    width: min(260px, 100%);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .about-image {
    width: 100%;
    height: 100%;
  }
}


.language-switcher {
  display: inline-flex;
  align-items: center;
}

.language-select {
  appearance: none;
  min-width: 3.4rem;
  padding: .38rem 1.35rem .38rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 12px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 8px) 50% / 4px 4px no-repeat,
    transparent;
  color: var(--ink);
  font-family: system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}

.language-select:hover,
.language-select:focus {
  background-color: var(--card);
}

.language-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .language-select {
    min-width: 3rem;
    padding: .32rem 1.15rem .32rem .45rem;
  }
}


.book-details {
  margin-top: 34px;
  max-width: 680px;
}

.book-details h3 {
  margin-bottom: 14px;
  font-size: 1.45rem;
}

.book-details-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.book-details-list > div {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(0, 1.6fr);
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.book-details-list dt,
.book-details-list dd {
  margin: 0;
}

.book-details-list dt {
  font-family: system-ui, sans-serif;
  font-weight: 700;
}

.book-details-list dd {
  color: var(--muted);
}

@media (max-width: 520px) {
  .book-details-list > div {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
  }
}
