/* ---- Change the look here ---- */
:root {
  --bg: #ffffff;
  --ink: #000000;
  --accent: #b8a3cc;       /* slightly darker than the logo lavender (#d9cde3) — about / contact */
  --muted: #777777;
  --rule: #000000;
  --font: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Left column: fixed, 1/3 ---------- */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 33.333vw;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}
.menu { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; }

.side-nav { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; }  /* side by side on desktop */
.side-nav button {
  background: none; border: 0;
  padding: 1px 6px;
  color: var(--accent);
  font-size: 15px;
}
.side-nav button:first-child { margin-left: -6px; }   /* keeps the first word aligned with the edge */
.side-nav button:hover,
.side-nav button:focus-visible,
.side-nav button[aria-expanded="true"] { background: var(--ink); color: var(--bg); outline: none; }

.pane {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--ink);
  max-width: 44ch;
  overflow-y: auto;
  min-height: 0;
}
.pane p { margin: 0 0 1em; }
.pane p.tight { margin-bottom: 0; }
.name-mark { background: var(--ink); color: var(--bg); padding: 0 .25em; }
.pane > :last-child { margin-bottom: 0; }
.epigraph { margin: 1.4em 0 .6em; padding-left: 1.2em; font-style: normal; }
.attr { padding-left: 1.2em; }

.signup { display: flex; gap: 0; }
.signup input {
  flex: 1; min-width: 0;
  border: 1px solid var(--ink); border-right: 0;
  padding: 6px 8px; background: var(--bg);
}
.signup input:focus { outline: none; background: #f4f4f4; }
.signup button { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); padding: 6px 12px; }
.signup button:hover { background: var(--bg); color: var(--ink); }

.logo { margin-top: auto; padding-top: 24px; width: 150px; display: block; flex-shrink: 0; }
.logo img { width: 100%; display: block; }

/* ---------- Right column: scrolling, 2/3 ---------- */
.books {
  margin-left: 33.333vw;
  padding: 28px 6vw 20vh;
}
.book { padding: 0 0 56px; margin-bottom: 56px; }
.book-title { font-size: 14px; font-weight: 400; margin: 0 0 20px; }

.viewer { position: relative; aspect-ratio: 3 / 2; background: var(--bg); overflow: hidden; }
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0;
}
.slide.active { opacity: 1; }
.slide.ph { display: grid; place-items: center; color: var(--muted); border: 1px solid #ddd; }

/* Left / right halves of the image are the click areas; the cursor becomes an arrow. */
.arrow {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1;
  background: none; border: 0; padding: 0;
}
.prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 32 32'%3E%3Cpath d='M26 16H7M14 8l-8 8 8 8' fill='none' stroke='%23fff' stroke-width='5' stroke-linecap='square'/%3E%3Cpath d='M26 16H7M14 8l-8 8 8 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") 4 11, w-resize;
}
.next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 32 32'%3E%3Cpath d='M6 16h19M18 8l8 8-8 8' fill='none' stroke='%23fff' stroke-width='5' stroke-linecap='square'/%3E%3Cpath d='M6 16h19M18 8l8 8-8 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") 18 11, e-resize;
}
.arrow:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }

.info {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(255, 255, 255, .96);
  padding: 48px 8%;
  overflow-y: auto;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.viewer.show-info .info { opacity: 1; pointer-events: auto; }
.viewer.show-info .arrow { display: none; }
.info p { max-width: 56ch; margin-top: 0; }
.info dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 24px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.info a { color: inherit; }

.count { display: none; }

.book-foot { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 14px; }
.info-toggle,
.buy {
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--ink);
  padding: 3px 18px; letter-spacing: .06em;
  font-size: 14px; line-height: 1.55; text-decoration: none;
}
.buy { text-transform: uppercase; }
.info-toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.buy:hover { background: var(--ink); color: var(--bg); }

/* ---------- Newsletter pop-up ---------- */
.nl-popup {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg); border: 1px solid var(--ink);
  padding: 20px 20px 18px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.nl-popup.visible { opacity: 1; transform: none; }
.nl-popup p { margin: 0 24px 12px 0; }
.nl-close {
  position: absolute; top: 6px; right: 8px;
  background: none; border: 0; font-size: 18px; line-height: 1; padding: 4px 6px;
}
.nl-close:hover { background: var(--ink); color: var(--bg); }

/* ---------- Phones / narrow screens: stack ---------- */
@media (max-width: 760px) {
  .side {
    position: relative; width: auto; padding: 16px;
  }
  .logo { position: absolute; top: 14px; right: 16px; margin: 0; padding: 0; width: 80px; }
  .side-nav { flex-direction: column; gap: 2px; height: 80px; margin-top: -2px; justify-content: center; }  /* stacked, centred against the logo */
  .side-nav button { margin-left: -6px; }
  .pane { max-width: none; }
  .books { margin-left: 0; padding: 24px 16px 80px; }
  .signup input { font-size: 16px; }   /* stops iPhones zooming into the email box */
  /* Info on phones: tighter, and the frame grows if the text needs more room */
  .info { padding: 16px; font-size: 13px; line-height: 1.45; }
  .viewer.show-info { aspect-ratio: auto; min-height: calc((100vw - 32px) * 2 / 3); }
  .viewer.show-info .info { position: relative; inset: auto; overflow: visible; min-height: calc((100vw - 32px) * 2 / 3); background: var(--bg); }
  .info dl { gap: 3px 14px; }
  .nl-popup { right: 16px; bottom: 16px; }
}
