:root {
  color-scheme: light;
  --paper: #f8f4eb;
  --ink: #1c2830;
  --muted: #4a5255;
  --gold: #f8ca62;
  --line: #d7d0c4;
  --gutter: clamp(16px, 4vw, 48px);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.wrap {
  width: min(100% - var(--gutter) * 2, 1140px);
  margin-inline: auto;
}

.skip {
  position: fixed;
  z-index: 3;
  inset: 12px auto auto 12px;
  transform: translateY(-180%);
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus { transform: none; }
:focus-visible { outline: 3px solid #23638a; outline-offset: 4px; }

.masthead {
  min-height: 65px;
  padding-block: max(8px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px)) 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: clamp(18px, 4.7vw, 23px);
  font-weight: 800;
  letter-spacing: -.08em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark strong {
  border-radius: 5px;
  padding: 4px 5px 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: .64em;
  line-height: 1;
  letter-spacing: -.03em;
}

.masthead nav, .publisher nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px clamp(11px, 3vw, 27px);
}

.masthead nav a, .publisher nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.masthead nav a:hover, .publisher nav a:hover, .outbound-list a:hover {
  text-decoration: underline;
  text-underline-offset: .24em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border-radius: 19px;
  background: #222f38;
  color: #fffaf0;
}

.hero-copy { position: relative; z-index: 1; padding: 30px 21px 0; }

.byline {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  font-size: clamp(38px, 10.1vw, 68px);
  line-height: .96;
  letter-spacing: -.058em;
  text-wrap: balance;
}

.intro {
  max-width: 31rem;
  margin: 14px 0 19px;
  color: #e7e2d9;
  font-size: clamp(15px, 3.8vw, 18px);
  line-height: 1.48;
}

.primary {
  min-height: 46px;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 7px;
  background: var(--ink);
  color: #fffaf0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.primary span { font-size: 17px; line-height: 1; }
.primary:hover { background: #364852; }
.hero .primary { background: var(--gold); color: var(--ink); }
.hero .primary:hover { background: #ffe297; }
.hero :focus-visible { outline-color: #fffaf0; }

.cover-display {
  position: relative;
  min-height: 252px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.cover-display::before {
  position: absolute;
  z-index: -1;
  inset: 15% -33% -52% -22%;
  background: var(--gold);
  content: "";
  --accent-angle: -17deg;
  transform: rotate(var(--accent-angle));
  transform-origin: 60% 100%;
}

.cover-stage {
  width: min(91%, 421px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 24px 23px;
}

.cover-prop {
  height: auto;
  width: clamp(105px, 34vw, 170px);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 13px 20px #19242d64, 3px 1px 0 #f1e6d3;
  transform: translate(var(--book-x), var(--book-y)) rotate(var(--book-angle));
}

.cover-prop-first { --book-x: 1px; --book-y: -1px; --book-angle: -8deg; }
.cover-prop-second { --book-x: -1px; --book-y: 11px; --book-angle: 8deg; }

.section { margin-block-start: clamp(32px, 6vw, 72px); scroll-margin-top: 16px; }
h2 { font-size: clamp(29px, 6vw, 48px); line-height: 1; letter-spacing: -.05em; }
.books h2 { margin-bottom: 15px; }
.book-list { display: grid; align-items: stretch; gap: 12px; }

.book {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(74px, .75fr) minmax(0, 1.25fr);
  gap: clamp(12px, 3vw, 24px);
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffaf0;
}

.book-cover {
  height: auto;
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 8px 14px #2b282322;
}

.book-copy { display: flex; flex-direction: column; min-height: 100%; align-items: flex-start; }
.book h3 { font-size: clamp(17px, 3.8vw, 27px); line-height: 1.08; letter-spacing: -.025em; }
.subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.35; }
.description { margin: 9px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.48; }
.book .primary { margin-top: auto; }

.author {
  display: grid;
  gap: 16px 30px;
  padding: clamp(18px, 5vw, 54px);
  border-radius: 14px;
  background: var(--gold);
}

.section-label { margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.author h2 + p { margin-top: 11px; max-width: 30rem; font-size: 15px; line-height: 1.48; }
.outbound-list { display: grid; align-content: center; }
.outbound-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 49px;
  border-bottom: 1px solid #22303955;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.outbound-list a:first-child { border-top: 1px solid #22303955; }

.publisher {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 24px;
  margin-block: 22px 0;
  padding-block: 18px max(16px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.publisher h2 { font-size: 20px; letter-spacing: -.035em; }

@media (min-width: 670px) {
  .masthead { min-height: 75px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); }
  .hero-copy { padding: clamp(22px, 5vw, 55px) 12px clamp(22px, 5vw, 55px) clamp(22px, 5vw, 55px); }
  h1 { font-size: clamp(44px, 6.8vw, 91px); }
  .cover-display { align-self: stretch; }
  .cover-prop { width: clamp(110px, 17.7vw, 202px); }
  .cover-stage { padding-block: 31px; }
  .cover-display::before { inset: -65% -55% -109% 30%; --accent-angle: 23deg; }
  .book-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .author { grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); }
}

@media (min-width: 930px) {
  .hero { min-height: 425px; }
  .cover-stage { width: min(100%, 461px); }
  .book { grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr); gap: 22px; }
  .subtitle, .description { font-size: 15px; }
}

@media (max-width: 359px) {
  .hero-copy { padding-inline: 16px; }
  h1 { font-size: clamp(32px, 10.3vw, 38px); }
  .masthead nav { gap: 10px; }
  .book .primary { padding-inline: 9px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .intro-motion .hero-copy > :not(:focus-visible) {
    animation: content-rise 600ms cubic-bezier(.22, 1, .36, 1) backwards;
  }
  .intro-motion .hero-copy h1 { animation-delay: 55ms; }
  .intro-motion .hero-copy .intro { animation-delay: 115ms; }
  .intro-motion .hero-copy .primary { animation-delay: 165ms; }

  .intro-motion .cover-display::before {
    animation: gold-sweep 760ms cubic-bezier(.22, 1, .36, 1) 50ms backwards;
  }
  .intro-motion .cover-prop {
    transform-origin: 50% 85%;
    animation: book-settle 820ms cubic-bezier(.22, 1, .36, 1) backwards;
  }
  .intro-motion .cover-prop-first { --book-incoming-angle: -8deg; animation-delay: 100ms; }
  .intro-motion .cover-prop-second { --book-incoming-angle: 8deg; animation-delay: 205ms; }

  [data-reveal="waiting"]:not(:focus-within) { opacity: 0; transform: translateY(14px); }
  [data-reveal="shown"]:not(:focus-within) {
    animation: content-rise 530ms cubic-bezier(.22, 1, .36, 1) backwards;
  }
  .book:nth-child(2)[data-reveal="shown"]:not(:focus-within) { animation-delay: 65ms; }

  .primary { transition: background-color 170ms ease, transform 170ms ease; }
  .primary span { transition: transform 170ms ease; }
  .primary:active { transform: scale(.98); }
  .primary:focus-visible span { transform: translateX(2px); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .primary:hover { transform: translateY(-2px); }
  .primary:hover span { transform: translateX(2px); }
  .hero .primary:hover span, .hero .primary:focus-visible span { transform: translateY(2px); }
}

@keyframes content-rise {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gold-sweep {
  from { opacity: 0; transform: translateX(7%) rotate(var(--accent-angle)); }
  to { opacity: 1; transform: translateX(0) rotate(var(--accent-angle)); }
}

@keyframes book-settle {
  from {
    opacity: 0;
    transform:
      translate(var(--book-x), calc(var(--book-y) + 32px))
      rotate(calc(var(--book-angle) + var(--book-incoming-angle)))
      scale(.93);
  }
  72% {
    opacity: 1;
    transform: translate(var(--book-x), calc(var(--book-y) - 3px)) rotate(var(--book-angle)) scale(1.012);
  }
  to {
    opacity: 1;
    transform: translate(var(--book-x), var(--book-y)) rotate(var(--book-angle)) scale(1);
  }
}
