:root {
  --bone: #f4efe5;
  --ink: #171513;
  --muted: #625c54;
  --line: #cec4b5;
  --gold: #a67a25;
  --red: #b72d2d;
  --surface: #fffaf1;
  --night: #151515;
  --panel: #211f1d;
  --paper: #f1e8da;
  --hairline: rgba(241, 232, 218, .18);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}

html[data-theme="alexander"] { background: var(--night); }
html[data-theme="alexander"] body { background: var(--night); color: var(--paper); }
html[data-theme="alexander"] .site-header,
html[data-theme="alexander"] footer { border-color: var(--hairline); }
html[data-theme="alexander"] .book-card,
html[data-theme="alexander"] .offer,
html[data-theme="alexander"] .takeaways,
html[data-theme="alexander"] .prose,
html[data-theme="alexander"] .success {
  background: var(--panel);
  border-color: var(--hairline);
}
html[data-theme="alexander"] .book-card p,
html[data-theme="alexander"] .offer p,
html[data-theme="alexander"] .prose p,
html[data-theme="alexander"] .detail-copy > p { color: #e0d5c6; }

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--red); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 5;
  padding: .75rem 1rem;
  background: var(--gold);
  color: #171513;
}
.skip-link:focus { top: 1rem; }

.site-header,
footer {
  width: min(100% - 2rem, 84rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 1.05rem 0;
}

.site-header { position: relative; z-index: 2; }
.wordmark { font-weight: 700; letter-spacing: .01em; text-decoration: none; }
.site-header nav { display: flex; gap: .3rem; }
.site-header nav a,
footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .15rem .5rem;
}

.hero,
.books-section,
.offers-section,
.positioning,
.book-detail,
.takeaways,
.prose,
.success {
  width: min(100% - 2rem, 84rem);
  margin-inline: auto;
}

.hero { padding: clamp(4rem, 11vw, 9rem) 0 clamp(3rem, 7vw, 6rem); }
.positioning {
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(4rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--red);
  font: 700 .72rem/1.4 Arial, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero h1,
.positioning h2,
.book-detail h1,
.prose h1,
.success h1 {
  max-width: 14ch;
  margin: .1rem 0 1.4rem;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  line-height: .94;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.positioning h2 { max-width: 18ch; }
.lede { max-width: 42rem; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font: 700 1rem/1.2 Arial, sans-serif; }

/* Catalogue: compact, intentional, and alive. */
.books-section {
  padding: clamp(2.2rem, 4vw, 4.25rem) 0 clamp(4rem, 8vw, 7rem);
  scroll-margin-top: 1.5rem;
}

.catalogue-intro {
  position: relative;
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.4rem, 3vw, 2.6rem) 1rem clamp(1.7rem, 3vw, 2.6rem);
  text-align: center;
}

.catalogue-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 4.5rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  transform: translateX(-50%);
}

.catalogue-intro .eyebrow { margin-bottom: .55rem; }
.catalogue-intro h1 {
  margin: 0 auto;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: .85;
  letter-spacing: -.07em;
  text-wrap: balance;
}

.catalogue-deck {
  max-width: 48rem;
  margin: 1.15rem auto 0;
  color: var(--paper);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.catalogue-note {
  margin: .8rem 0 0;
  color: #a89e92;
  font: 700 .72rem/1.4 Arial, sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.catalogue-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: .75rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: #a89e92;
  font: 700 .7rem/1.3 Arial, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.catalogue-rail span { white-space: nowrap; }
.catalogue-rail strong { color: var(--paper); font-size: 1rem; }
.catalogue-rail a { color: var(--paper); text-decoration: none; }
.catalogue-rail a:hover { color: var(--red); }

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

.book-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glow-x: 50%;
  --glow-y: 50%;
  position: relative;
  display: grid;
  grid-template-columns: minmax(7rem, 30%) 1fr;
  gap: 1rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  container-type: inline-size;
  transform: perspective(1200px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transition: transform .45s cubic-bezier(.2, .75, .25, 1), border-color .3s ease, box-shadow .45s ease;
  will-change: transform;
}

.book-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(183, 45, 45, .23), transparent 38%);
  transition: opacity .4s ease;
}

.book-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: .55;
}

.book-card:hover {
  border-color: rgba(241, 232, 218, .42);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .25);
}
.book-card:hover::before { opacity: 1; }
.book-card > * { position: relative; z-index: 1; }

.js .book-card {
  opacity: 0;
  transform: perspective(1200px) translateY(1.1rem) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
}
.js .book-card.is-visible {
  opacity: 1;
  transform: perspective(1200px) translateY(0) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transition-delay: var(--reveal-delay, 0ms);
}

.cover-link { align-self: start; display: block; overflow: hidden; background: #0d0d0d; }
.book-card img,
.detail-cover img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 12px 25px #0003;
}

.book-card img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .75, .25, 1), filter .5s ease;
}
.book-card:hover img { transform: scale(1.035); filter: saturate(1.08) contrast(1.03); }
.book-card h2,
.offer h2 {
  margin: .1rem 0 .5rem;
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  line-height: 1;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.book-card h2 a { text-decoration: none; }
.book-card p { margin: .5rem 0; color: var(--muted); font-size: .95rem; }
.book-card .subtitle { color: var(--paper); font-style: italic; }
.book-card > div { display: flex; min-width: 0; flex-direction: column; }
.book-card .actions { margin-top: auto; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1rem; }
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem 1rem;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font: 700 .85rem/1.2 Arial, sans-serif;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.button:hover { background: transparent; color: var(--red); transform: translateY(-2px); }
.button:disabled { border-color: var(--line); color: var(--muted); background: transparent; cursor: not-allowed; }

.offers { display: grid; gap: 1rem; }
.offer,
.takeaways,
.prose,
.success {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  background: var(--surface);
}
.offer p { max-width: 50rem; color: var(--muted); }
.offer-price strong { color: var(--ink); font-size: 2rem; }
.offer-price span { font: .85rem/1.5 Arial, sans-serif; }

.book-detail {
  display: grid;
  gap: clamp(2rem, 7vw, 6rem);
  padding: clamp(3rem, 9vw, 8rem) 0;
}
.detail-cover { max-width: 30rem; }
.detail-copy { max-width: 44rem; }
.detail-copy .button { margin: 1rem 0; }
.fine-print { color: var(--muted) !important; font: .85rem/1.5 Arial, sans-serif; }
.takeaways { margin-bottom: clamp(3rem, 8vw, 7rem); }
.takeaways ul { padding-left: 1.2rem; }
.takeaways li { padding: .5rem 0; border-top: 1px solid var(--line); }
.prose,
.success { max-width: 52rem; margin-top: clamp(3rem, 9vw, 8rem); margin-bottom: clamp(3rem, 9vw, 8rem); }
.prose h1,
.success h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
.prose p { max-width: 42rem; }
.download-list { display: grid; gap: .75rem; margin: 1.5rem 0; }

footer {
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font: .78rem/1.5 Arial, sans-serif;
}
footer p { margin: 0; }
footer p:nth-child(2) { display: flex; flex-wrap: wrap; gap: .25rem; }
.cross { margin-left: auto; }

@media (min-width: 48rem) {
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .book-card { grid-template-columns: 9rem 1fr; }
  .offers { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
  .book-detail { grid-template-columns: minmax(16rem, 30rem) minmax(0, 1fr); align-items: start; }
}

@media (min-width: 75rem) {
  .books { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
  .book-card { grid-template-columns: 1fr; padding: 1.15rem; }
  .book-card .cover-link { width: 100%; }
  .book-card > div { min-height: 14.5rem; padding: .25rem .15rem 0; }
}

@media (max-width: 47.99rem) {
  .catalogue-rail { align-items: flex-start; flex-wrap: wrap; }
  .catalogue-rail a { width: 100%; order: 3; }
  .catalogue-intro h1 { font-size: clamp(3.2rem, 18vw, 5.2rem); }
  .catalogue-deck { font-size: 1.15rem; }
  .book-card { gap: .85rem; padding: .8rem; }
  .book-card .actions { margin-top: .8rem; }
  .book-card .button { flex: 1 1 auto; }
  footer { align-items: flex-start; flex-direction: column; }
  .cross { margin-left: 0; }
}

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