/* Semi Sippin' — Docket, the Opus sheet.
   Leather first, then paper. The only red is the ring, stamped once.
   Review build. Not the till. */

:root {
  --paper: #e7e1d6;
  --ink: #1c140e;
  --muted: #5a5046;
  --rule: rgba(28, 20, 14, 0.22);
  --stamp: #843325;
  --leather: #0b0a09;
  --pad: clamp(1.1rem, 4vw, 3.5rem);
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: clamp(16px, 0.35vw + 14.5px, 18px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

.skip {
  position: absolute; left: -999px; top: 0.6rem; z-index: 5;
  background: var(--paper); color: var(--ink); padding: 0.4rem 0.7rem;
  font-family: var(--mono); font-size: 0.8rem;
}
.skip:focus { left: 0.6rem; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ── the leather: header column, then the plate ── */
.leather {
  background: var(--leather);
  color: #d9d2c6;
  display: grid;
  grid-template-columns: minmax(13rem, 0.95fr) 1.05fr;
  min-height: 100svh;
}
.masthead {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.4rem var(--pad) 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}
.masthead .mark { font-weight: 500; font-size: 0.8rem; }
.masthead nav { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
.masthead nav a::before { content: "— "; color: #6f675d; }
.masthead a:hover { color: #fff; }

.plate { position: relative; display: grid; grid-template-rows: 1fr auto; }
.plate img {
  width: 100%; height: 100%; min-height: 0;
  object-fit: cover;
  object-position: 100% 38%;
}
.plate figcaption,
.hand figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding-top: 0.6rem;
}
.plate figcaption { padding: 0.65rem 0 1.4rem; color: #9a9185; }
.ex { color: inherit; font-weight: 500; }

/* ── exhibit B and the one sentence ── */
.call {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: end;
  padding: clamp(3rem, 10vh, 6.5rem) var(--pad) clamp(3rem, 9vh, 6rem);
}
.hand img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 62% 40%; }
.hand figcaption { color: var(--muted); }
.entry {
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-width: 17ch;
  padding-bottom: 1.9rem;
}
.ring {
  display: block;
  width: 3.1rem; height: 3.1rem;
  color: var(--stamp);
  margin-bottom: 1.1rem;
}

/* ── the register ── */
.register { padding: 0 var(--pad) clamp(2.5rem, 7vh, 4.5rem); }
.head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 2rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.6rem;
}
.head h2 {
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.meta {
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted);
  max-width: 44ch;
}

.ledger li {
  display: grid;
  grid-template-columns: 3rem 9.5rem minmax(0, 1fr) 6.5rem;
  grid-template-areas:
    "no fig name price"
    "no fig dl   price"
    "no fig sizes price";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(1rem, 2.4vw, 2rem);
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.ledger { counter-reset: entry; }
.closed .ledger { counter-reset: entry 4; }
.ledger li { counter-increment: entry; }
.ledger li::before {
  content: counter(entry, decimal-leading-zero);
  grid-area: no; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 0.35rem;
}
.thumb { grid-area: fig; align-self: start; background: #d8d0c2; overflow: hidden; }
.thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.thumb img.chest { transform: scale(2.1); transform-origin: 52% 79%; }
.thumb img.hanger { object-fit: contain; background: #f4f2ee; object-position: center 55%; }
.thumb.none {
  aspect-ratio: 4 / 5;
  background: transparent;
  border: 1px dashed var(--rule);
  display: grid; place-items: center;
  padding: 0.6rem;
}
.thumb.none p { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); text-align: center; line-height: 1.4; }
.ledger h3 { grid-area: name; font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.2; }
.ledger dl {
  grid-area: dl;
  display: grid; grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 0.2rem 0.8rem;
  margin-top: 0.55rem;
  font-size: 0.98rem;
}
.ledger dt { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); padding-top: 0.28rem; }
.price {
  grid-area: price; justify-self: end;
  font-family: var(--mono); font-size: 1.05rem; font-weight: 500;
  padding-top: 0.2rem;
}
.sizes { grid-area: sizes; align-self: start; display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.9rem; }
.sizes button {
  min-width: 2.6rem; padding: 0.32rem 0.6rem;
  font-family: var(--mono); font-size: 0.78rem;
  background: transparent; border: 1px solid var(--rule); border-radius: 0;
  cursor: pointer;
}
.sizes button:hover { border-color: var(--ink); }
.sizes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.closed { padding-top: clamp(1rem, 4vh, 2.5rem); }

/* ── the yard: a contact strip, dated ── */
.yard { padding: clamp(1rem, 4vh, 2.5rem) var(--pad) clamp(3rem, 8vh, 5rem); }
.sheet {
  display: grid; grid-template-columns: 0.72fr 1fr; gap: 0.7rem;
  margin-top: 1.4rem;
  align-items: end;
}
.sheet img { width: 100%; height: clamp(18rem, 52vh, 34rem); object-fit: cover; }
.sheet figure:first-child img { object-position: center 40%; }
.sheet figcaption { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 0.4rem; }

/* ── note and colophon ── */
.note {
  margin: 0 var(--pad) clamp(2.5rem, 7vh, 4rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 3rem minmax(0, 36rem); column-gap: clamp(1rem, 2.4vw, 2rem);
}
.note h2 { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--muted); padding-top: 0.25rem; }
.note p { font-size: 0.98rem; color: #3b332b; }

.colophon {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.7rem 1.5rem;
  padding: 1.1rem var(--pad) 1.5rem;
  background: var(--leather); color: #9a9185;
  font-family: var(--mono); font-size: 0.72rem;
}
.versions { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.versions a:hover, .versions a[aria-current="page"] { color: #e7e1d6; }

/* ── narrow ── */
@media (max-width: 820px) {
  .leather { grid-template-columns: 1fr; min-height: 0; }
  .masthead {
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    gap: 0.7rem;
    padding: 1rem var(--pad) 0.9rem;
  }
  .masthead nav { flex-direction: row; flex-wrap: wrap; width: 100%; gap: 0.35rem 0.9rem; }
  .masthead nav a::before { content: none; }
  .plate img { height: auto; aspect-ratio: 4 / 5; max-height: 86svh; }
  .plate figcaption { padding: 0.6rem var(--pad) 1.2rem; }

  .call { grid-template-columns: 1fr; gap: 1.6rem; }
  .entry { max-width: 20ch; padding-bottom: 0; }

  .ledger li {
    grid-template-columns: 6.8rem minmax(0, 1fr);
    grid-template-areas:
      "fig no"
      "fig name"
      "fig price"
      "dl  dl"
      "sizes sizes";
    grid-template-rows: auto auto 1fr auto auto;
  }
  .ledger li::before { padding-top: 0; }
  .price { justify-self: start; align-self: end; }
  .ledger dl { margin-top: 1rem; grid-template-columns: 6rem minmax(0, 1fr); }

  .sheet { grid-template-columns: 1fr; }
  .sheet img { height: auto; aspect-ratio: 4 / 5; }
  .note { grid-template-columns: 1fr; }
  .note h2 { margin-bottom: 0.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
