@font-face {
  font-family: Figtree;
  src: url("assets/chapters-0.ttf");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url("assets/chapters-1.ttf");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("assets/long-view-0.ttf");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f7f4ed;
  --birch: #e8decf;
  --blue: #dbe6ed;
  --navy: #173a5c;
  --ink: #1a2d40;
  --muted: #43566a;
  --line: #bcbcb6;
  --gold: #eccf96;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --display: "Bodoni Moda", Georgia, serif;
  --gutter: clamp(20px, 5.3vw, 84px);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 Figtree, sans-serif; }
::selection { color: var(--ink); background: var(--gold); }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.035em; line-height: 1; text-wrap: balance; }
h1 { font-size: clamp(64px, 7.55vw, 96px); }
h2 { font-size: clamp(37px, 4.35vw, 62px); }
a { color: inherit; text-underline-offset: .24em; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(100% - 2 * var(--gutter), 1280px); margin-inline: auto; }
.skip { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 10px 15px; background: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.masthead, .footer { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; }
.masthead { min-height: 81px; }
.signature { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; white-space: nowrap; }
a.signature { text-decoration: none; min-height: 44px; }
.signature img {
  width: 36px;
  height: 40px;
  object-fit: contain;
  padding: 7px 9px;
  background: var(--navy);
}
nav { display: flex; flex-wrap: wrap; gap: 4px clamp(16px, 3.1vw, 44px); font-size: 15px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
nav a:hover, .signature:hover { text-decoration: underline; }
.intro { max-width: 31ch; font-size: clamp(19px, 2.05vw, 27px); line-height: 1.35; text-wrap: pretty; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 18px;
  background: var(--navy);
  color: var(--paper);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: #244c70; }
.button:focus-visible { outline-color: var(--ink); }
.muted { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; font-weight: 600; }
.section { padding-block: clamp(40px, 5vw, 72px); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 29px; }
.section-heading > a { flex-shrink: 0; font-size: 15px; }
.bookshelf, .book-list { list-style: none; padding: 0; margin: 0; }
.bookshelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 38px clamp(15px, 2.4vw, 34px); }
.bookshelf a, .book-list a { display: block; text-decoration: none; }
.shelf-cover {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: end start;
  height: clamp(171px, 18vw, 241px);
}
.shelf-cover img {
  width: auto;
  height: auto;
  max-height: 100%;
  filter: drop-shadow(3px 5px 5px rgba(40, 30, 15, .18));
}
.book-name { display: block; font-weight: 600; line-height: 1.24; text-wrap: pretty; }
.bookshelf .book-name { max-width: 25ch; margin: 15px 0 3px; }
.book-detail { display: block; font-size: 14px; }
.bookshelf a:hover .book-name, .book-list a:hover .book-name { text-decoration: underline; text-underline-offset: .19em; }
.press { background: var(--birch); }
.press-inner, .birch-press { display: grid; grid-template-columns: 1fr .83fr; align-items: start; gap: clamp(25px, 8vw, 125px); padding-block: clamp(42px, 6vw, 86px); }
.press p { margin: 16px 0 6px; max-width: 56ch; }
.press img { width: min(100%, 310px); }
figcaption { margin-top: 10px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.footer { min-height: 100px; padding-block: 20px; }

/* Open spread */
.spread {
  display: grid;
  grid-template-columns: .74fr 1.26fr;
  align-items: center;
  gap: clamp(14px, 3vw, 42px);
  padding-block: clamp(24px, 4vw, 57px) clamp(24px, 3.1vw, 44px);
  border-top: 1px solid var(--line);
}
.spread-intro { display: flex; flex-direction: column; justify-content: center; align-items: start; }
.spread-intro h1 { line-height: .91; }
.spread .intro { margin: 27px 0 24px; }
.feature-stage { position: relative; }
.feature-stage::before, .jacket-book::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 47%;
  background: #e5ddcd;
  mask: url("assets/mark.png") center / contain no-repeat;
  pointer-events: none;
}
.feature-stage::before { inset-inline-start: -3%; }
.featured-book {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(20px, 3.4vw, 50px);
  align-items: center;
  min-height: clamp(298px, 29vw, 412px);
  padding: 10px 0;
}
.featured-book[hidden], .feature-controls[hidden] { display: none; }
.hero-cover { display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; height: clamp(278px, 27vw, 392px); }
.hero-cover img {
  width: auto;
  height: auto;
  max-height: 100%;
  filter: drop-shadow(9px 13px 11px rgba(29, 41, 53, .22));
}
.spread-caption h2 { font-size: clamp(25px, 2.55vw, 40px); text-wrap: wrap; }
.spread-caption p { margin-top: 11px; }
.spread-caption .text-link { margin-top: 6px; font-size: 15px; }
.feature-controls { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; margin-inline-start: 53%; }
.feature-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  cursor: pointer;
}
.feature-controls button:hover { background: var(--blue); }
.feature-controls button:active { background: #c8d9e5; }
.feature-previous .row-arrow { transform: rotate(180deg); }
.feature-position { padding-inline: 6px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.open-spread #catalogue { border-top: 1px solid var(--line); }

/* Blue jacket */
.jacket-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px 30px;
  padding-block: 19px 23px;
  border-top: 1px solid var(--line);
}
.jacket-header h1 { font-size: clamp(32px, 4vw, 53px); }
.jacket-header p { max-width: 49ch; font-size: 18px; text-wrap: pretty; }
.jacket-band { background: var(--navy); color: var(--paper); }
.jacket-feature {
  display: grid;
  grid-template-columns: 1.32fr .68fr;
  min-height: clamp(410px, 36vw, 525px);
}
.jacket-caption { align-self: center; padding: clamp(32px, 5vw, 72px) clamp(16px, 2.6vw, 36px) clamp(32px, 5vw, 72px) 0; }
.jacket-caption::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-bottom: 20px;
  background: var(--gold);
}
.jacket-caption h2 { font-size: clamp(36px, 5.15vw, 76px); text-wrap: wrap; max-width: 15ch; }
.jacket-caption p { color: #dbe6ed; margin: 15px 0 24px; }
.jacket-caption .button { color: var(--ink); background: var(--gold); }
.jacket-caption .button:hover { background: #f5dfb7; }
.jacket-caption .button:focus-visible { outline-color: var(--paper); }
.jacket-book { position: relative; display: grid; place-items: center; padding: clamp(32px, 4.3vw, 64px); }
.jacket-book::before { width: 100%; background: #315778; }
.jacket-book img {
  position: relative;
  width: min(100%, 244px);
  transform: rotate(-5deg);
  filter: drop-shadow(11px 15px 10px rgba(6, 21, 36, .45));
}

/* Reading list */
.reading-list { background: #faf8f2; }
.index-layout {
  display: grid;
  grid-template-columns: .68fr 1.32fr;
  gap: clamp(26px, 5vw, 72px);
  border-top: 1px solid var(--line);
  padding-block: clamp(35px, 5.45vw, 77px) 64px;
}
.index-intro { padding: 0 clamp(0px, 2vw, 24px) 0 0; }
.index-intro h1 { font-size: clamp(45px, 4vw, 56px); }
.index-intro .intro { margin: 18px 0 13px; font-size: clamp(19px, 1.6vw, 23px); }
.index-books { padding-top: 4px; }
.index-books h2 { margin-bottom: 19px; font-size: clamp(37px, 4.25vw, 59px); }
.book-list { border-top: 1px solid var(--line); }
.book-list li { border-bottom: 1px solid var(--line); }
.book-list a {
  display: grid;
  grid-template-columns: 48px 1fr 17px;
  gap: clamp(13px, 2vw, 27px);
  align-items: center;
  min-height: 78px;
  padding: 10px 13px 10px 7px;
}
.book-list a:hover { background: var(--blue); }
.list-cover { display: grid; place-items: center; }
.list-cover img { width: auto; max-width: 44px; height: 56px; object-fit: contain; }
.book-list .book-name { font-size: clamp(17px, 1.73vw, 24px); }
.book-list .book-detail { margin-top: 4px; }
.row-arrow { width: 15px; height: 1px; background: currentColor; position: relative; }
.row-arrow::after { content: ""; position: absolute; width: 6px; height: 6px; top: -3px; right: 1px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.index-books > .text-link { margin-top: 13px; }
.reading-list .press { background: var(--blue); }

/* Birch and ink */
.birch-opening { background: var(--birch); }
.birch-masthead {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: clamp(20px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(32px, 5.6vw, 80px);
}
.birch-masthead h1 { font-size: clamp(58px, 7.4vw, 96px); text-wrap: wrap; }
.birch-masthead .intro { margin-top: 14px; }
.birch-masthead figure { justify-self: end; width: min(100%, 280px); }
.birch-masthead figcaption { color: var(--ink); }
.birch-selected { padding-block: clamp(30px, 4.4vw, 65px); }
.birch-selected .bookshelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.birch-selected li a { display: grid; justify-items: center; text-align: center; }
.birch-selected .shelf-cover { height: clamp(152px, 19vw, 271px); }
.birch-more { border-top: 1px solid var(--line); }
.birch-press { grid-template-columns: .66fr 1.34fr; }
.birch-press p { margin-top: 0; }

@media (min-width: 1080px) {
  .open-spread .bookshelf, .blue-jacket .bookshelf { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .open-spread .shelf-cover, .blue-jacket .shelf-cover { height: clamp(169px, 14vw, 203px); }
}
@media (max-width: 950px) {
  .spread-intro h1 { font-size: clamp(60px, 9vw, 83px); }
}
@media (max-width: 700px) {
  .masthead { min-height: 66px; }
  .spread { grid-template-columns: 1fr; gap: 24px; padding-top: 29px; }
  .spread-intro h1 br { display: none; }
  .spread-intro h1 { font-size: clamp(47px, 10vw, 75px); }
  .spread .intro { margin: 16px 0 18px; }
  .featured-book { min-height: auto; }
  .hero-cover { height: clamp(177px, 38vw, 255px); }
  .spread-caption h2 { font-size: clamp(26px, 5.7vw, 36px); }
  .jacket-header { flex-wrap: wrap; padding-block: 17px; gap: 5px; }
  
  .jacket-feature { min-height: 0; grid-template-columns: 1.2fr .8fr; }
  .jacket-caption { padding: 26px 20px 26px 0; }
  .jacket-caption h2 { font-size: clamp(27px, 5.1vw, 36px); }
  .jacket-book { padding: 28px 20px; }
  .index-layout, .press-inner, .birch-press { grid-template-columns: 1fr; }
  .index-layout { gap: 28px; }
  .index-intro h1 { font-size: clamp(47px, 10vw, 75px); }
  .index-intro .intro { margin-block: 13px 5px; }
  .birch-masthead h1 { font-size: clamp(44px, 8.3vw, 58px); }
  .bookshelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf-cover { height: clamp(143px, 44vw, 210px); }
}
@media (max-width: 570px) {
  .jacket-feature { grid-template-columns: 1fr; }
  .jacket-book { grid-row: 1; padding-block: 32px 20px; }
  .jacket-book img { width: min(100%, 151px); }
  .jacket-caption { padding: 18px 0 30px; }
  .jacket-caption::before { margin-bottom: 14px; }
  .jacket-caption h2 { max-width: 23ch; font-size: clamp(26px, 8vw, 39px); }
  .jacket-caption p { margin: 10px 0 14px; }
}
@media (max-width: 430px) {
  .masthead, .footer { gap: 4px 10px; flex-wrap: wrap; }
  .masthead { padding-block: 9px; }
  .signature { gap: 8px; font-size: 16px; }
  .signature img { width: 31px; height: 34px; padding: 6px 8px; }
  nav { gap: 4px 13px; font-size: 14px; }
  .featured-book { grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); gap: 18px; }
  .feature-controls { margin-inline-start: 45%; }
  .spread-caption h2 { font-size: clamp(20px, 5.9vw, 25px); }
  .spread-caption p { margin-top: 7px; font-size: 15px; }
  .spread-caption .text-link { margin-top: 2px; }
  .birch-masthead { grid-template-columns: 1fr; gap: 18px; }
  .birch-masthead figure { display: flex; justify-self: start; align-items: center; gap: 12px; }
  .birch-masthead figure img { width: 105px; flex-shrink: 0; }
  .birch-masthead figcaption { margin: 0; }
  .birch-selected .bookshelf { gap: 15px 11px; }
  .birch-selected .shelf-cover { height: clamp(111px, 32vw, 135px); }
  .birch-selected .book-name { font-size: 15px; }
  .birch-selected .book-detail { font-size: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .featured-book:not([hidden]) .hero-cover img { animation: cover-arrival 440ms var(--ease-out) both; }
  .featured-book:not([hidden]) .spread-caption { animation: caption-arrival 280ms var(--ease-out) both; }
  .jacket-book img { animation: jacket-arrival 500ms var(--ease-out) both; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .shelf-cover img, .book-list .row-arrow { transition: transform 160ms var(--ease-out); }
  .bookshelf a:hover .shelf-cover img { transform: translateY(-5px); }
  .book-list a:hover .row-arrow { transform: translateX(3px); }
}
@keyframes cover-arrival {
  from { opacity: .42; transform: translateY(14px) rotate(-3deg); }
}
@keyframes caption-arrival {
  from { opacity: .58; transform: translateX(6px); }
}
@keyframes jacket-arrival {
  from { opacity: .5; transform: translateY(14px) rotate(-8deg); }
}
