/* AUTOMATIC: How the ATM Changed the World. Colors and type follow the dust jacket:
   charcoal field, cream capitals in Montserrat, serif body text, and the blue, red and green cassette stripes. */
:root {
  --bg: #1f2020;
  --bg-2: #262828;
  --bg-3: #2e3131;
  --steel: #3a3e3e;
  --ink: #f8f3e5;
  --ink-2: #e4ddcc;
  --muted: #aaa497;
  --line: rgba(248, 243, 229, .14);
  --line-strong: rgba(248, 243, 229, .28);
  --blue: #3663a3;
  --red: #e64032;
  --green: #358567;
  --green-lit: #4fc08f;
  --paper: #f8f3e5;
  --paper-ink: #1f2020;

  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --text-xs: clamp(.78rem, .76rem + .1vw, .84rem);
  --text-sm: clamp(.9rem, .88rem + .12vw, .98rem);
  --text-base: clamp(1.05rem, 1rem + .2vw, 1.16rem);
  --text-lg: clamp(1.2rem, 1.1rem + .45vw, 1.45rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.2vw, 3.3rem);
  --text-hero: clamp(2.35rem, 1.3rem + 3.5vw, 4.6rem);

  --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-6: 1.5rem; --space-8: 2rem;
  --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;
  --radius: 10px;
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text-base)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; max-width: 68ch; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.title { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-size: .92em; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: var(--bg); padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

/* Stripes, as on the spine */
.s { display: inline-block; width: 28px; height: 4px; border-radius: 2px; }
.s--b { background: var(--blue); } .s--r { background: var(--red); } .s--g { background: var(--green); }

/* Ticker */
.ticker { background: #161717; border-bottom: 1px solid var(--line); overflow: hidden; font: 600 var(--text-xs)/1 var(--font-display);
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ticker__track { display: flex; width: max-content; animation: tick 48s linear infinite; }
.ticker__group { display: flex; align-items: center; gap: 1.4rem; padding: .7rem .7rem; white-space: nowrap; }
.ticker__group i { width: 18px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--blue) 0 33%, var(--red) 33% 66%, var(--green) 66%); }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker:hover .ticker__track { animation-play-state: paused; }

/* Header */
.header { position: sticky; top: 0; z-index: 40; background: rgba(31, 32, 32, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; }
.wordmark { display: inline-flex; flex-direction: column; text-decoration: none; font: 800 1.02rem/.86 var(--font-display); letter-spacing: .02em;
  text-transform: uppercase; color: var(--ink); }
.wordmark span + span { margin-top: 1px; }
.nav { margin-left: auto; }
.nav__list { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem; text-decoration: none;
  font: 600 var(--text-sm)/1 var(--font-display); color: var(--ink-2); border-bottom: 2px solid transparent; }
.nav__list a:hover { color: var(--ink); }
.nav__list a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 8px; width: 44px; height: 44px;
  align-items: center; justify-content: center; cursor: pointer; }

/* Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem; border-radius: 999px;
  font: 700 var(--text-sm)/1 var(--font-display); letter-spacing: .02em; text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.btn--cream { background: var(--ink); color: var(--bg); }
.btn--cream:hover { background: #fffaf0; transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: var(--text-xs); }
.btn--block { width: 100%; }
.header .btn--sm { white-space: nowrap; }
.link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted);
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); }
.link:hover { text-decoration-color: var(--ink); }

/* Sections */
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; border-top: 1px solid var(--line); }
.section--top { border-top: 0; padding-top: clamp(2.5rem, 5vw, 4.5rem); }
.eyebrow { font: 700 var(--text-xs)/1.4 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-4); }
.eyebrow .title { font-size: 1em; color: var(--ink); letter-spacing: .14em; }
.section__title { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -.01em; margin-bottom: var(--space-6); max-width: 22ch; }
.section__title--sm { font-size: var(--text-xl); }
.section__title .title { font-size: .96em; letter-spacing: .02em; font-weight: 800; }
.section__lede { color: var(--ink-2); font-size: var(--text-lg); margin-bottom: var(--space-8); }
.lead { font-size: var(--text-lg); color: var(--ink); }

/* Hero */
.hero { padding: clamp(1.75rem, 4vw, 3.5rem) 0 clamp(3.5rem, 6vw, 5.5rem); }
.hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero__title { font-size: var(--text-hero); font-weight: 800; letter-spacing: -.02em; line-height: 1; margin-bottom: var(--space-4); max-width: 13ch; }
.hero__sub { font-size: var(--text-xl); line-height: 1.3; color: var(--ink-2); margin-bottom: var(--space-8); max-width: 26ch; }
.hero__lede { color: var(--ink-2); max-width: 52ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin: var(--space-6) 0 var(--space-4); }
.hero__formats { font-size: var(--text-sm); color: var(--muted); }

/* The ATM screen line */
.screen { display: inline-flex; align-items: center; gap: .4rem; min-height: 50px; padding: .65rem 1.1rem; margin-bottom: var(--space-6);
  background: #0f1a17; border: 1px solid #2c4a40; border-radius: 8px; box-shadow: inset 0 0 18px rgba(79, 192, 143, .12);
  font: 600 var(--text-sm)/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--green-lit); }
.screen__cursor { width: .62em; height: 1.05em; background: var(--green-lit); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* The machine */
.hero__machine { display: flex; justify-content: center; }
.fascia { width: min(100%, 540px); padding: 16px 22px 16px; border-radius: 22px;
  background: linear-gradient(180deg, #353939 0%, #2a2d2d 55%, #242626 100%);
  border: 1px solid rgba(248, 243, 229, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 70px -30px rgba(0, 0, 0, .8); }
.fascia__top { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.fascia__top .s { width: 22px; height: 3px; }
.fascia__label { margin-left: 10px; font: 700 .66rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fascia__led { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #2b4a3d; box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); transition: background .2s, box-shadow .2s; }
.fascia__led.is-on { background: var(--green-lit); box-shadow: 0 0 10px var(--green-lit), 0 0 0 2px rgba(0, 0, 0, .3); }
.fascia__note { margin: 12px 0 0; text-align: center; font: 600 .72rem/1.3 var(--font-display); letter-spacing: .06em; color: var(--muted); max-width: none; }

.hero__book { position: relative; perspective: 1400px; perspective-origin: 50% 40%; }
/* The presenter clips the book at the slot, so the book can come up out of the machine */
.presenter { position: relative; overflow: hidden; padding: 6% 9% 0; margin: 0 -6px; }
.bookflat { position: relative; width: 100%; aspect-ratio: 900 / 1300; transform-origin: left center; transform-style: preserve-3d;
  transform: translateY(0) rotateY(0deg); transition: transform 1.3s cubic-bezier(.2, .7, .2, 1); }
.bookflat__front { position: absolute; inset: 0; cursor: pointer; }
.bookflat__front::before { content: ""; position: absolute; z-index: 1; pointer-events: none; left: 2.6%; top: 0; bottom: 0; width: 1.4%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .14) 50%, rgba(0, 0, 0, .16)); }
.hero__cover { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px 5px 5px 2px;
  box-shadow: 0 0 0 1px rgba(248, 243, 229, .1), 0 14px 26px -8px rgba(0, 0, 0, .7), 0 30px 50px -20px rgba(0, 0, 0, .6); }
.bookflat__edge { position: absolute; left: calc(100% - 3px); top: 1.2%; bottom: 1.2%; width: 12%; transform-origin: left center; transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f8f2e4 0 1px, #e2d6bf 1px 2px), #efe6d3; box-shadow: inset 0 0 12px rgba(0, 0, 0, .28); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .hero__book:not(.is-dispensing):not(.is-intro) .bookflat__front:hover { }
  .hero__book:not(.is-dispensing):not(.is-intro):hover .bookflat { transform: translateY(0) rotateY(-20deg); }
}
.slot { position: relative; height: 34px; margin: 0 -8px; border-radius: 8px; background: linear-gradient(180deg, #111212, #1b1d1d);
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .06); }
.slot__lip { position: absolute; left: 6%; right: 6%; top: 9px; height: 6px; border-radius: 3px; background: #050606; box-shadow: 0 1px 0 rgba(255, 255, 255, .05); }
.slot__arrows { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); display: flex; gap: 6px; }
.slot__arrows i { width: 12px; height: 4px; border-radius: 2px; background: #24372f; transition: background .2s, box-shadow .2s; }
.hero__book.is-dispensing .slot__arrows i { animation: arrow 0.9s ease-in-out infinite; }
.hero__book.is-dispensing .slot__arrows i:nth-child(2) { animation-delay: .15s; }
.hero__book.is-dispensing .slot__arrows i:nth-child(3) { animation-delay: .3s; }
@keyframes arrow { 0%, 100% { background: #24372f; box-shadow: none; } 50% { background: var(--green-lit); box-shadow: 0 0 8px var(--green-lit); } }

/* Book states: in = inside the machine, out = dispensed */
.hero__book.is-in .bookflat { transform: translateY(104%); transition: transform .55s cubic-bezier(.5, 0, .75, 0); }
.hero__book.is-out .bookflat { transform: translateY(0); transition: transform 2.7s cubic-bezier(.22, .8, .25, 1); }
.hero__book.is-intro .bookflat { animation: rise 1.5s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes rise { from { transform: translateY(104%); } to { transform: translateY(0); } }

/* Receipts */
.receipts__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.receipt { position: relative; background: var(--paper); color: var(--paper-ink); padding: 1.3rem 1.3rem 1.5rem; border-radius: 3px;
  font-family: var(--font-mono); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .8);
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x;
          mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x; padding-bottom: 1.9rem; }
.receipt__head, .receipt__meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0; max-width: none;
  font: 600 .72rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.receipt__head { padding-bottom: .55rem; border-bottom: 1px dashed rgba(31, 32, 32, .35); margin-bottom: .55rem; }
.receipt__meta { color: #575a57; margin-bottom: 1rem; }
.receipt__quote { font: 400 1.04rem/1.5 var(--font-body); color: var(--paper-ink); margin-bottom: 1rem; }
.receipt__foot { margin: 0; padding-top: .6rem; border-top: 1px dashed rgba(31, 32, 32, .35); font: 600 .72rem/1.35 var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase; color: #575a57; }
.receipts__more { margin-top: var(--space-8); }

/* Lanes */
.lanes__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.lane { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; border-top: 4px solid; }
.lane--b { border-top-color: var(--blue); } .lane--r { border-top-color: var(--red); } .lane--g { border-top-color: var(--green); }
.lane h3 { font-size: var(--text-lg); font-weight: 700; margin-bottom: .8rem; }
.lane p { color: var(--ink-2); margin: 0; }

/* Sign-up */
.updates { background: var(--bg-2); }
.updates__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.updates__copy p { color: var(--ink-2); }
.updates__small { font-size: var(--text-sm); color: var(--muted) !important; }
.signup { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font: 600 var(--text-sm)/1.3 var(--font-display); margin-bottom: .45rem; }
.opt { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: .7rem .9rem; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #171818; color: var(--ink); font: 400 1rem/1.4 var(--font-body); }
.field textarea { resize: vertical; min-height: 92px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.4rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field__err { color: #ff8a7f; font: 600 var(--text-xs)/1.4 var(--font-display); margin: .45rem 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup__status { margin: .9rem 0 0; min-height: 1.4em; font: 600 var(--text-sm)/1.45 var(--font-display); color: var(--ink-2); }
.signup__status.is-ok { color: var(--green-lit); }
.signup__status.is-err { color: #ff8a7f; }
.signup.is-done .field, .signup.is-done button { display: none; }

/* Also by */
.also__row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.also__covers { display: flex; gap: 1rem; justify-content: flex-end; }
.also__covers a { display: block; width: min(150px, 40%); transition: transform .25s ease; }
.also__covers a:hover { transform: translateY(-4px); }
.also__covers img { border-radius: 2px 4px 4px 2px; box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .8); }

/* The book page */
.book__grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.book__copy p { color: var(--ink-2); }
.book__copy .lead { color: var(--ink); }
.book__cover { margin: 0; }
.book__cover img { border-radius: 2px 5px 5px 2px; box-shadow: 0 30px 50px -22px rgba(0, 0, 0, .85), 0 0 0 1px rgba(248, 243, 229, .1); }
.problems__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: var(--space-8); }
.problem { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: relative; overflow: hidden; }
.problem::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.problem--b::before { background: var(--blue); } .problem--r::before { background: var(--red); } .problem--g::before { background: var(--green); }
.problem__who { font: 800 var(--text-xs)/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.problem h3 { font: 400 var(--text-lg)/1.4 var(--font-body); }
.problems__after { color: var(--ink-2); font-size: var(--text-lg); max-width: 62ch; }
.quote__wrap { display: flex; justify-content: center; }
.quote blockquote { margin: 0; max-width: 900px; text-align: center; }
.quote blockquote p { font: 400 var(--text-xl)/1.35 var(--font-body); margin: 0 auto 1.2rem; max-width: 36ch; }
.quote footer { font: 600 var(--text-xs)/1.5 var(--font-display); letter-spacing: .06em; color: var(--muted); }
.details__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.slip { margin: 0; background: var(--paper); color: var(--paper-ink); border-radius: 3px; padding: 1.4rem 1.5rem; font-family: var(--font-mono); }
.slip div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed rgba(31, 32, 32, .3); }
.slip div:last-child { border-bottom: 0; }
.slip dt { font: 600 .72rem/1.5 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #575a57; }
.slip dd { margin: 0; font: 500 .92rem/1.5 var(--font-mono); }
.slip .title { font-size: 1em; }

/* Contents: an ATM screen */
.atm { background: #0f1a17; border: 1px solid #2c4a40; border-radius: 16px; box-shadow: inset 0 0 40px rgba(79, 192, 143, .08); overflow: hidden; }
.atm__bar { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.3rem; border-bottom: 1px solid #2c4a40;
  font: 600 var(--text-xs)/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--green-lit); }
.atm__dots { display: flex; gap: 5px; }
.atm__dots .s { width: 18px; height: 3px; }
.toc { list-style: none; margin: 0; padding: .6rem; display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1.2rem; }
.toc__item { border-bottom: 1px solid rgba(79, 192, 143, .14); }
.toc__btn { width: 100%; display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: baseline; gap: .6rem; padding: .85rem .7rem; min-height: 48px;
  background: none; border: 0; color: #d9f2e6; text-align: left; cursor: pointer; border-radius: 6px; font: 500 var(--text-sm)/1.35 var(--font-mono); }
.toc__btn:hover, .toc__btn[aria-expanded="true"] { background: rgba(79, 192, 143, .1); }
.toc__num { color: var(--green-lit); font-weight: 600; letter-spacing: .06em; }
.toc__title { font: 600 var(--text-base)/1.3 var(--font-display); color: #eef8f2; }
.toc__page { color: #8fbfa8; font-size: var(--text-xs); white-space: nowrap; }
.toc__first { padding: .2rem .7rem 1rem 3.9rem; }
.toc__first p { margin: 0 0 .5rem; color: #cfe6da; font: 400 var(--text-base)/1.55 var(--font-body); max-width: 60ch; }
.toc__first .toc__where { font: 500 var(--text-xs)/1.4 var(--font-mono); color: #8fbfa8; letter-spacing: .04em; }

/* Author */
.author__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.author__photo { margin: 0; }
.author__photo img { border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.author__copy p { color: var(--ink-2); }
.author__copy .lead { color: var(--ink); }
.press__grid { display: grid; grid-template-columns: 220px 220px 1fr; gap: 1.25rem; align-items: start; }
.press__item { display: block; text-decoration: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; transition: border-color .2s; }
.press__item:hover { border-color: var(--ink); }
.press__item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 25%; border-radius: 4px; margin-bottom: .7rem; }
.press__item span { display: block; font: 500 var(--text-xs)/1.4 var(--font-display); color: var(--muted); }
.press__item strong { display: block; font-size: var(--text-sm); color: var(--ink); margin-bottom: .2rem; }
.press__blurb { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.press__blurb p { color: var(--ink-2); font-size: var(--text-sm); }
.press__label { font: 700 var(--text-xs)/1 var(--font-display) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) !important; margin-bottom: .6rem; }

/* Other books */
.shelf { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.shelf__book { display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; align-items: start; }
.shelf__book img { border-radius: 2px 4px 4px 2px; box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .8); }
.shelf__book h3 { font-size: var(--text-xl); font-weight: 800; margin-bottom: .4rem; }
.shelf__book h3 .title { font-size: 1em; letter-spacing: .03em; }
.shelf__sub { font: 600 var(--text-sm)/1.4 var(--font-display); color: var(--ink-2); }
.shelf__book p { color: var(--ink-2); }
.shelf__links { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.2rem; margin: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: var(--space-12) 0 calc(var(--space-16) + 40px); background: #191a1a; }
.footer__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; }
.footer p { color: var(--muted); font-size: var(--text-sm); }
.wordmark--foot { font-size: 1.4rem; margin-bottom: 1rem; }
.footer__stripes { display: flex; gap: 6px; }
.footer__nav { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.5rem; }
.footer__nav a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; font: 600 var(--text-sm)/1 var(--font-display); color: var(--ink-2); }
.footer__nav a:hover { color: var(--ink); }
.footer__copy { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs) !important; }

/* Pages (pages.js) */
.js-pages main > .page { display: none; }
.js-pages[data-page="home"] main > .page[data-page="home"],
.js-pages[data-page="book"] main > .page[data-page="book"],
.js-pages[data-page="shop"] main > .page[data-page="shop"],
.js-pages[data-page="author"] main > .page[data-page="author"],
.js-pages[data-page="books"] main > .page[data-page="books"] { display: block; }
.page.page-in { animation: page-in .32s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Sound button (sound.js) */
.snd { position: fixed; z-index: 45; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 1rem 0 .8rem; border-radius: 999px;
  background: rgba(38, 40, 40, .94); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
  font: 600 var(--text-xs)/1 var(--font-display); letter-spacing: .04em; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.snd:hover { border-color: var(--ink); }
.snd svg { flex: none; }
.snd b { font-weight: 700; color: var(--green-lit); }
.snd[aria-pressed="false"] b { color: var(--muted); }
.snd .snd__x { opacity: 0; }
.snd[aria-pressed="false"] .snd__x { opacity: 1; }
.snd[aria-pressed="false"] .snd__waves { opacity: 0; }
.snd.is-playing .snd__waves path { animation: snd-wave 1.1s ease-in-out infinite; }
.snd.is-playing .snd__waves path + path { animation-delay: .22s; }
@keyframes snd-wave { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media print { .snd, .ticker { display: none; } }

/* Responsive */
@media (max-width: 1020px) {
  .receipts__grid { grid-template-columns: 1fr 1fr; }
  .press__grid { grid-template-columns: 1fr 1fr; }
  .press__blurb { grid-column: 1 / -1; }
  .shelf { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }
  .nav__list { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem;
    background: rgba(31, 32, 32, .98); border-bottom: 1px solid var(--line); }
  .nav__list.is-open { display: flex; }
  .nav__list a { width: 100%; border-bottom: 1px solid var(--line); min-height: 50px; }
  .nav__list a[aria-current="page"] { border-bottom-color: var(--line); color: var(--ink); font-weight: 800; }
  .header__row { position: relative; }
  .nav { margin-left: auto; order: 2; }
  .header .btn--sm { order: 1; margin-left: auto; }
  .hero__grid, .updates__grid, .book__grid, .details__grid, .author__grid, .also__row { grid-template-columns: 1fr; }
  .hero__machine { order: -1; }
  .fascia { width: min(100%, 420px); }
  .hero__title { max-width: 13ch; }
  .lanes__grid, .problems__grid { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }
  .book__cover { max-width: 320px; }
  .author__photo { max-width: 420px; }
  .also__covers { justify-content: flex-start; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .receipts__grid { grid-template-columns: 1fr; }
  .header .btn--sm { padding: 0 .85rem; }
  .wordmark { font-size: .92rem; }
  .shelf__book { grid-template-columns: 96px 1fr; padding: 1.1rem; gap: 1rem; }
  .press__grid { grid-template-columns: 1fr 1fr; }
  .slip div { grid-template-columns: 1fr; gap: .1rem; }
  .toc__first { padding-left: .7rem; }
  .fascia { width: min(100%, 300px); padding: 12px 16px; }
  .fascia__note { display: none; }
  .screen { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track { animation: none; }
  .page.page-in, .snd.is-playing .snd__waves path, .screen__cursor, .hero__book.is-intro .bookflat { animation: none; }
  .bookflat, .hero__book.is-in .bookflat, .hero__book.is-out .bookflat { transition: none; }
  .hero__book.is-dispensing .slot__arrows i { animation: none; }
}

/* Excerpt: one passage from the book, set like a page */
.excerpt { background: var(--paper); color: var(--paper-ink); }
.excerpt .eyebrow { color: #575a57; }
.excerpt__wrap { max-width: 760px; }
.excerpt__date { font: 800 var(--text-2xl)/1.05 var(--font-display); letter-spacing: -.01em; margin-bottom: var(--space-8); }
.excerpt__text { margin: 0 0 var(--space-8); padding-left: 1.4rem; border-left: 4px solid var(--paper-ink); }
.excerpt__text p { font: 400 clamp(1.12rem, 1.04rem + .35vw, 1.32rem)/1.65 var(--font-body); color: var(--paper-ink); max-width: 62ch; }
.excerpt__text footer { font: 600 var(--text-xs)/1.4 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: #575a57; }
.excerpt__after { color: #3b3d3b; font-size: var(--text-base); }
.excerpt .link { color: var(--paper-ink); }

/* Merch */
.merch-teaser__head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: var(--space-8); }
.merch-teaser__head .section__title { margin-bottom: 0; }
.merch-grid { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.merch-grid--teaser { margin-top: 0; grid-template-columns: repeat(4, 1fr); }
.merch-card { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.merch-card__img { display: block; background: #fff; aspect-ratio: 1 / 1; }
.merch-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.merch-card__img:hover img { transform: scale(1.03); }
.merch-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.2rem 1.2rem; }
.merch-card h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: .5rem; }
.merch-card p { color: var(--ink-2); font-size: var(--text-sm); margin-bottom: 1rem; }
.merch-card__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: auto 0 0 !important; }
.merch-card__price { font: 600 var(--text-sm)/1 var(--font-display); color: var(--ink); }
.merch-note { margin-top: var(--space-8); font-size: var(--text-sm); color: var(--muted); }
@media (max-width: 1000px) { .merch-grid--teaser { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .merch-grid--teaser, .merch-grid { grid-template-columns: 1fr 1fr; gap: .75rem; } .merch-card__body { padding: .85rem; } .merch-card__row { flex-direction: column; align-items: flex-start; gap: .6rem; } }

/* ATM Check: the free phone app, promoted on the home page */
.app-promo { background: var(--bg-2); }
.app-promo__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.app-promo__copy .section__lede { margin-bottom: var(--space-4); }
.app-promo__fine { color: var(--muted); font-size: var(--text-sm); }
.app-promo__ctas { margin: var(--space-6) 0 0; }
.app-promo__qr { display: flex; gap: 1rem; align-items: center; margin-top: var(--space-8); }
.app-promo__qr img { background: #fff; padding: 6px; border-radius: 8px; width: 112px; height: 112px; flex: none; }
.app-promo__qr p { font-size: var(--text-sm); color: var(--muted); margin: 0; max-width: 34ch; }
.app-promo__phone { margin: 0; justify-self: center; width: 100%; max-width: 330px; }
.app-promo__phone img { width: 100%; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); }
@media (max-width: 900px) {
  .app-promo__grid { grid-template-columns: 1fr; }
  .app-promo__phone { max-width: 270px; }
  .app-promo__qr { display: none; }
}
@media (pointer: coarse) { .app-promo__qr { display: none; } }
