/* Cart to Shelf — cloth-bound library spines on paper stock. */

@font-face { font-family: 'x'; src: local('x'); } /* no-op guard */

:root {
  --paper: #e6e7de;
  --paper-deep: #d8dad0;
  --ink: #1b1d1a;
  --ink-soft: #55594f;
  --rule: #c3c6b9;

  /* Spine cloth. The multi-hue set is the identity; nothing else is coloured. */
  --oxblood: #7a2e2e;
  --moss: #47593a;
  --mustard: #b8821b;
  --navy: #2a3b5c;
  --rose: #a3604c;
  --slate: #4c5560;

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --data: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17191a;
    --paper-deep: #101112;
    --ink: #e7e8e0;
    --ink-soft: #a0a496;
    --rule: #2f322d;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.06rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 0;
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead nav { display: flex; gap: 1.25rem; }
.masthead a { text-decoration: none; }
.masthead a:hover { color: var(--ink); }

/* -------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 3.75rem) 0 clamp(2rem, 4vw, 3rem);
}

@media (max-width: 62rem) {
  .hero { grid-template-columns: 1fr; }
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  font-variation-settings: 'SOFT' 30, 'WONK' 1, 'opsz' 100;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--oxblood);
}

.lede {
  max-width: 34ch;
  margin: 0 0 2rem;
  font-size: 1.12rem;
  color: var(--ink-soft);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}

.btn:hover { transform: translateY(-2px); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn.ghost:hover { border-color: var(--ink); }

.note {
  margin: 1.5rem 0 0;
  font-family: var(--data);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ------------------------------------------------------ the shelf apparatus */

/* --drop is measured in app.js from the live layout. */
.rack { --spine-h: 150px; --gap: 2.5rem; --drop: 0px; }

.shelf { position: relative; }

.shelf + .shelf { margin-top: var(--gap); }

.shelf-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.books {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: var(--spine-h);
  padding: 0 0.6rem;
  border-bottom: 3px solid var(--rule);
}

.shelf.target .books {
  border-bottom-color: var(--ink);
}

.spine {
  position: relative;
  width: 34px;
  height: var(--spine-h);
  border-radius: 1px 1px 0 0;
  background: var(--cloth);
  color: #f2efe6;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.7rem 0.25rem;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.16), inset 3px 0 0 rgba(255, 255, 255, 0.1);
  transform: translateY(0);
  transition: transform 620ms cubic-bezier(0.22, 0.9, 0.3, 1);
  transition-delay: calc(var(--i) * 260ms);
}

/* Two gilt rules near the head of the spine, as on a cloth binding. */
.spine::before {
  content: '';
  position: absolute;
  inset: 1.6rem 4px auto 4px;
  height: 1px;
  background: rgba(242, 239, 230, 0.55);
  box-shadow: 0 3px 0 rgba(242, 239, 230, 0.35);
}

.spine:hover { transform: translateY(-10px); }

.rack.running .spine { transform: translateY(var(--drop)); }
.rack.running .spine:hover { transform: translateY(calc(var(--drop) - 10px)); }

.ghosts {
  position: absolute;
  inset: auto 0 3px;
  display: flex;
  gap: 4px;
  padding: 0 0.6rem;
  pointer-events: none;
}

.ghost-spine {
  width: 34px;
  height: var(--spine-h);
  border: 1px dashed var(--rule);
  border-bottom: none;
  border-radius: 1px 1px 0 0;
}

.replay {
  margin-top: 1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--data);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.replay:hover { color: var(--ink); border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .spine { transition: none; }
}

/* ---------------------------------------------------------------- sections */

.band { padding: clamp(2rem, 4vw, 3rem) 0 0; border-top: 1px solid var(--rule); }

.lede.wide { max-width: var(--measure); }

.band h2 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-variation-settings: 'SOFT' 20, 'WONK' 1;
  letter-spacing: -0.015em;
  line-height: 1.08;
}

/* --------------------------------------------------------------- no server */

@media (max-width: 46rem) {
  }

/* --------------------------------------------------------------- two paths */

@media (max-width: 46rem) { }

/* --------------------------------------------------------------------- faq */

.faq { max-width: var(--measure); margin-top: 2rem; }
.faq h3 {
  margin: 2rem 0 0.4rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}
.faq p { margin: 0; color: var(--ink-soft); }
.faq code {
  font-family: var(--data);
  font-size: 0.85em;
  background: var(--paper-deep);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ------------------------------------------------------------------ footer */

.footer {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
}

.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ------------------------------------------------------- standalone notice */

.notice {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: var(--gutter);
  text-align: center;
}

.notice-card { max-width: 34rem; }

.notice h1 {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.notice p { margin: 0 auto 1.5rem; max-width: 46ch; color: var(--ink-soft); }

.reasons {
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.reasons h2 {
  margin: 0 0 0.35rem;
  font-family: var(--data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.reason-lede { margin: 0 0 1.25rem !important; font-size: 0.95rem; }

.reasons dl { margin: 0; }
.reasons dt {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}
.reasons dd {
  margin: 0.15rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.reasons dd:last-child { margin-bottom: 0; }

.notice-actions { justify-content: center; margin-bottom: 1.5rem; }

.notice .addr {
  font-family: var(--data);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper-deep);
  padding: 0.15em 0.45em;
  border-radius: 2px;
  word-break: break-all;
}

/* A single spine, closed and shelved: the visual for "that's done". */
.closed-spine {
  width: 36px;
  height: 132px;
  margin-inline: auto;
  border-radius: 1px 1px 0 0;
  background: var(--moss);
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.16), inset 3px 0 0 rgba(255, 255, 255, 0.1);
  border-bottom: 3px solid var(--rule);
}
