:root {
  --btl-bg: #f7f4ef;
  --btl-bg-rgb: 247, 244, 239;
  --btl-text-primary: #1e1e1e;
  --btl-text-secondary: #9a8f84;
  --btl-stone: #6b6560;
  --btl-dust: #d4cec6;
  --btl-rule: rgba(30, 30, 30, 0.66);
  --btl-soft-rule: rgba(30, 30, 30, 0.18);
  --drr-ink: #1c1c1e;
  --drr-smoke: #4a4a4f;
  --drr-linen: #f8f5f0;
  --drr-stone: #8c8478;
  --site-max: 1180px;
  --bg: var(--btl-bg);
  --text: var(--btl-text-primary);
  --muted: var(--btl-stone);
  --accent: var(--btl-text-secondary);
  --border: var(--btl-dust);
  --cursor: var(--btl-text-primary);
  --max: var(--site-max);
  --section-space: 88px;
  --section-space-mobile: 58px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --btl-bg: #2c2926;
  --btl-bg-rgb: 44, 41, 38;
  --btl-text-primary: #f7f4ef;
  --btl-text-secondary: #b8afa6;
  --btl-stone: #b8afa6;
  --btl-dust: #463f38;
  --btl-rule: rgba(247, 244, 239, 0.56);
  --btl-soft-rule: rgba(247, 244, 239, 0.15);
  --drr-ink: #f7f4ef;
  --drr-smoke: #d4cec6;
  --drr-linen: #2c2926;
  --drr-stone: #b8afa6;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--btl-bg);
  color: var(--btl-text-primary);
  font-family: "Lora", Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  transition: background-color 460ms var(--ease), color 460ms var(--ease);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] body::before {
  opacity: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  color: var(--btl-text-primary);
  font-family: "IM Fell English", Georgia, serif;
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: break-word;
}

body.cursor-ready,
body.cursor-ready a,
body.cursor-ready button {
  cursor: none;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 2000;
  padding: 8px 12px;
  background: var(--btl-text-primary);
  color: var(--btl-bg);
  transform: translateY(-140%);
}

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

.site-header {
  position: relative;
  z-index: 90;
  background: var(--btl-bg);
  border-bottom: 1px solid var(--btl-dust);
  transition: background-color 450ms var(--ease), border-color 450ms var(--ease);
}

.header-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  padding: 10px 44px;
}

.header-logo {
  width: min(264px, 38vw);
  line-height: 0;
}

.logo-img-dark,
:root[data-theme="dark"] .logo-img-light {
  display: none;
}

:root[data-theme="dark"] .logo-img-dark {
  display: block;
}

.header-menu-line {
  position: absolute;
  right: 44px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(-50%);
}

.menu-toggle {
  appearance: none;
  position: absolute;
  right: 16px;
  top: 50%;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--btl-dust);
  border-radius: 50%;
  background: transparent;
  color: var(--btl-text-primary);
  font-size: 0;
  line-height: 0;
  transform: translateY(-50%);
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 1.5px;
  margin: 0 auto;
  background: currentColor;
  border-radius: 999px;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.primary-nav {
  display: flex;
  gap: clamp(12px, 2.2vw, 24px);
}

.primary-nav a {
  position: relative;
  padding-bottom: 3px;
  color: var(--btl-text-primary);
  font-family: "IM Fell English", Georgia, serif;
  font-size: clamp(0.52rem, 0.9vw, 0.7rem);
  text-transform: uppercase;
  opacity: 0.3;
  transition: opacity 240ms var(--ease);
}

.primary-nav a::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--btl-text-secondary);
  content: "";
  transition: width 300ms var(--ease);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  opacity: 0.7;
  text-decoration: none;
}

.primary-nav a.is-active,
.primary-nav a.is-active:hover,
.primary-nav a.is-active:focus-visible {
  opacity: 1;
}

.primary-nav a.is-active::after {
  width: 100%;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--btl-dust);
  border-radius: 50%;
  background: transparent;
  color: var(--btl-text-primary);
}

.theme-toggle svg {
  position: absolute;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}

.icon-sun {
  opacity: 0;
  transform: rotate(35deg);
}

.icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

:root[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

:root[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(-35deg);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-weight: 500;
  line-height: 1.2;
}

.button-primary {
  background: var(--btl-text-primary);
  color: var(--btl-bg);
}

.button-secondary {
  background: transparent;
  color: var(--btl-text-primary);
}

.button:hover {
  opacity: 0.78;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--btl-text-secondary);
  font-family: "IM Fell English", Georgia, serif;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.rule-mark {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 220px;
  margin: 0 auto;
}

.rule-line {
  height: 1px;
  background: var(--btl-rule);
  transform-origin: center;
}

.rule-top,
.rule-bottom {
  width: 100%;
}

.rule-mid-left {
  width: 42%;
}

.rule-mid-right {
  width: 42%;
  align-self: flex-end;
  margin-top: -8px;
}

.rule-mark.animate-in .rule-line {
  animation: drawRule 950ms var(--ease) forwards;
}

.rule-mark.animate-in .rule-top,
.rule-mark.animate-in .rule-bottom,
.rule-mark.animate-in .rule-mid-left,
.rule-mark.animate-in .rule-mid-right {
  transform: scaleX(0);
}

.rule-mark.animate-in .rule-mid-left {
  transform-origin: left;
}

.rule-mark.animate-in .rule-mid-right {
  transform-origin: right;
}

.drr-main {
  background: var(--drr-linen);
  color: var(--drr-ink);
}

.drr-hero,
.drr-books {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.drr-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: var(--section-space) 0 var(--section-space-mobile);
  border-bottom: 1px solid rgba(140, 132, 120, 0.25);
  text-align: center;
}

.drr-hero .rule-mark {
  margin-bottom: 56px;
}

.drr-hero h1,
.flip-back h3 {
  color: var(--drr-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
}

.drr-hero h1 {
  width: min(920px, 100%);
  margin-bottom: 22px;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.04;
}

.drr-hero-sub {
  width: min(560px, 100%);
  margin: 0 0 8px;
  color: var(--drr-smoke);
}

.drr-hero-by {
  margin: 0;
  color: var(--drr-stone);
  font-size: 0.9rem;
  font-style: italic;
}

.drr-intro {
  width: min(680px, calc(100% - 28px));
  margin: 0 auto;
  padding: var(--section-space) 14px;
  border-bottom: 1px solid rgba(140, 132, 120, 0.25);
  text-align: center;
}

.drr-intro p {
  margin: 0 0 1.3em;
  color: var(--drr-ink);
  font-size: 1.05rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.drr-intro p:last-child {
  margin-bottom: 0;
}

.drr-books {
  padding: var(--section-space) 0;
}

.drr-series-label {
  margin-bottom: 18px;
  text-align: center;
}

.drr-series-label span {
  display: inline-flex;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(140, 132, 120, 0.35);
  color: var(--drr-stone);
  font-size: 0.7rem;
  text-transform: uppercase;
}

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

@media (min-width: 760px) {
  .drr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .drr-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

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

.flip-card {
  aspect-ratio: 750 / 1203;
  outline: none;
  perspective: 1200px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(28, 28, 30, 0.24);
  border-radius: 4px;
  transform-style: preserve-3d;
  transition: transform 700ms var(--ease);
}

.flip-card:hover .flip-inner,
.flip-card:focus .flip-inner,
.flip-card:focus-within .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  border-radius: 4px;
}

.flip-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  background: var(--book-bg);
  color: #1c1c1e;
  text-align: center;
  transform: rotateY(180deg);
}

.flip-back .eyebrow {
  font-size: 0.55rem;
  line-height: 1.3;
}

.flip-back h3 {
  color: #1c1c1e;
  font-size: 1.25rem;
}

.flip-back p {
  margin: 0;
  color: #4a4a4f;
  font-size: 0.65rem;
}

.flip-back .button {
  min-height: 30px;
  margin-top: 8px;
  padding: 5px 10px;
  background: #1c1c1e;
  color: #f8f5f0;
  font-size: 0.65rem;
}

.drr-shelf-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: var(--section-space) 28px;
  border-top: 1px solid rgba(140, 132, 120, 0.25);
}

.drr-shelf {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  max-width: 100%;
  overflow-x: auto;
  padding: 18px 20px 10px;
  background: var(--drr-linen);
}

.drr-spine {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 150px;
  border: 1px solid rgba(28, 28, 30, 0.1);
}

.drr-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #1c1c1e;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.drr-shelf-caption {
  margin: 0;
  color: var(--drr-stone);
  font-size: 0.74rem;
  text-align: center;
}

.drr-publisher-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: var(--section-space) 20px 8px;
}

.drr-publisher-end img {
  width: min(520px, 82vw);
  height: auto;
  opacity: 0.74;
}

.publisher-logo-dark,
:root[data-theme="dark"] .publisher-logo-light {
  display: none;
}

:root[data-theme="dark"] .publisher-logo-dark {
  display: block;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 720ms var(--ease), transform 720ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quill-cursor,
.quill-follow-dot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1600;
  pointer-events: none;
  color: var(--cursor);
}

.quill-cursor {
  width: 38px;
  height: 38px;
  opacity: 0.96;
  transform: translate3d(-100px, -100px, 0) rotate(0deg);
  transition: opacity 180ms var(--ease);
}

.quill-follow-dot {
  z-index: 1599;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
  transform: translate3d(-100px, -100px, 0);
  filter: blur(0.3px);
}

.quill-cursor svg {
  width: 100%;
  height: 100%;
}

.quill-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quill-fill {
  fill: currentColor;
  opacity: 0.06;
}

.quill-ink-drop {
  position: fixed;
  z-index: 1598;
  width: 6px;
  height: 6px;
  pointer-events: none;
  border-radius: 50%;
  background: var(--cursor);
  transform: translate(-50%, -50%) scale(0.35);
  animation: inkSettle 700ms var(--ease) forwards;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--btl-dust);
  border-radius: 50%;
  background: rgba(var(--btl-bg-rgb), 0.76);
  color: var(--btl-text-primary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease), background-color 240ms var(--ease);
}

.back-to-top.is-visible {
  opacity: 0.78;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top span {
  position: relative;
  width: 9px;
  height: 14px;
  display: block;
}

.back-to-top span::before,
.back-to-top span::after {
  position: absolute;
  content: "";
  display: block;
}

.back-to-top span::before {
  left: 4px;
  top: 2px;
  width: 1px;
  height: 12px;
  background: currentColor;
}

.back-to-top span::after {
  left: 1px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  transform: rotate(45deg);
}

.back-to-top::after {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  color: var(--btl-stone);
  content: "Top";
  font-size: 0.72rem;
  opacity: 0;
  transform: translateY(-50%) translateX(4px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.back-to-top:hover::after,
.back-to-top:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.cookie-consent {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1200;
  width: min(430px, calc(100% - 36px));
  padding: 16px;
  border: 1px solid var(--btl-dust);
  background: rgba(var(--btl-bg-rgb), 0.96);
  color: var(--btl-text-primary);
  box-shadow: 0 18px 40px rgba(30, 30, 30, 0.08);
}

.cookie-consent p {
  margin: 0 0 12px;
  color: var(--btl-stone);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--btl-dust);
  background: transparent;
  color: var(--btl-text-primary);
  cursor: pointer;
  font-size: 0.78rem;
}

.cookie-actions button:first-child {
  background: var(--btl-text-primary);
  color: var(--btl-bg);
}

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

@keyframes drawRule {
  to {
    transform: scaleX(1);
  }
}

@keyframes inkSettle {
  0% {
    opacity: 0.68;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.6);
  }
}

@media (max-width: 780px) {
  .drr-hero {
    width: min(360px, calc(100% - 28px));
    padding: var(--section-space-mobile) 0;
  }

  .drr-hero .rule-mark {
    margin-bottom: 40px;
  }

  .drr-hero h1 {
    width: min(330px, 100%);
    font-size: clamp(2rem, 8vw, 2.55rem);
    line-height: 1.08;
  }

  .drr-hero-sub,
  .drr-intro p {
    max-width: 310px;
    margin-right: auto;
    margin-left: auto;
  }

  .drr-books {
    width: min(360px, calc(100% - 28px));
    padding: var(--section-space-mobile) 0;
  }

}

@media (max-width: 780px) {
  .header-inner {
    min-height: 62px;
    padding: 10px 16px;
  }

  .header-logo {
    width: min(180px, 52vw);
  }

  .menu-toggle {
    display: flex;
  }

  .header-menu-line {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 1px);
    z-index: 120;
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--btl-dust);
    background: var(--btl-bg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  }

  .header-menu-line.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .primary-nav {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .primary-nav a {
    font-size: 0.72rem;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .drr-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .drr-book {
    width: min(230px, 100%);
    justify-self: center;
  }

  .drr-intro {
    width: min(360px, calc(100% - 28px));
    padding: var(--section-space-mobile) 14px;
  }

  .flip-back {
    gap: 5px;
    padding: 8px;
  }

  .flip-back h3 {
    font-size: clamp(0.94rem, 5vw, 1.18rem);
  }

  .flip-back .button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .drr-shelf-section {
    padding: var(--section-space-mobile) 14px;
  }

  .drr-publisher-end img {
    width: min(360px, 86vw);
  }

  .cookie-consent {
    left: 14px;
    bottom: 14px;
    width: min(360px, calc(100% - 28px));
  }
}

@media (hover: none), (pointer: coarse) {
  body.cursor-ready,
  body.cursor-ready a,
  body.cursor-ready button {
    cursor: auto;
  }

  .quill-cursor,
  .quill-follow-dot,
  .quill-ink-drop {
    display: none;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .rule-mark.animate-in .rule-line {
    transform: scaleX(1);
  }

  .flip-inner {
    transition: none;
  }

  .quill-cursor,
  .quill-follow-dot,
  .quill-ink-drop {
    display: none;
  }
}
