/* Drinki — the house bar ledger.
 *
 * One material: ink on paper. Rules, leaders, tabular figures, stamps.
 * No cards, no pills, no gradients. The design system is a bar book's:
 *   - double rules open a section, hairlines divide entries
 *   - dotted leaders carry the eye from name to measure
 *   - red ink means "short" and marks the margin notes
 *   - green ink is the stamp: pourable, in stock, done
 */

:root {
  --paper: #f5efe2;
  --paper-2: #ede5d2;
  --ink: #211d16;
  --ink-2: #6b6355;
  --hair: rgba(33, 29, 22, 0.28);
  --hair-soft: rgba(33, 29, 22, 0.14);
  --red: #9c2b23;
  --green: #33603f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(880px, 100% - 2.2rem); margin-inline: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 100; transition: top 0.15s;
}
.skip:focus { top: 1rem; }

/* ---------- shared voices ---------- */

.label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.red { color: var(--red); }
.green { color: var(--green); }

h1, h2, h3 { font-weight: 500; margin: 0; line-height: 1.15; }

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

.masthead {
  text-align: center;
  padding: 2.6rem 0 0;
}

.masthead .plate {
  border-top: 4px double var(--ink);
  border-bottom: 4px double var(--ink);
  padding: 1.8rem 0 1.6rem;
}

.masthead .over {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1rem;
}

.masthead h1 {
  font-size: clamp(3rem, 11vw, 5.4rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-indent: 0.14em; /* optically recentre the tracked caps */
  line-height: 1;
}

.masthead .under {
  margin-top: 0.9rem;
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  color: var(--ink-2);
}

.lede {
  max-width: 34rem;
  margin: 1.6rem auto 0;
  font-size: 1.05rem;
  text-wrap: pretty;
}

.masthead .acts {
  margin: 1.5rem 0 2.4rem;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- actions: square stamp-buttons ---------- */

.act {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 0.6rem 1rem 0.55rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.act:hover { background: var(--ink); color: var(--paper); }
.act:active { transform: translateY(1px); }

.act-red { border-color: var(--red); color: var(--red); }
.act-red:hover { background: var(--red); color: var(--paper); }

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

section { padding: 2.6rem 0 0.6rem; scroll-margin-top: 3.4rem; }

.sec-head {
  border-top: 3px solid var(--ink);
  padding-top: 0.5rem;
  margin-bottom: 1.3rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
}

.sec-head h2 {
  font-size: 0.82rem;
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.sec-head h2 .sig { color: var(--ink-2); margin-right: 0.6ch; }

.sec-head .aside {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* ---------- §1 stocktake ---------- */

.stock-tools {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.find {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.35rem 0.1rem;
  border-radius: 0;
}
.find::placeholder { color: var(--ink-2); opacity: 1; }
.find:focus-visible { outline: none; border-bottom-width: 2px; border-bottom-color: var(--red); }

.shelf { margin-bottom: 1.5rem; break-inside: avoid; }

.shelf h3 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 0.35rem;
  margin: 0 0 0.5rem;
}

.stock-cols { columns: 2; column-gap: 2.6rem; }
@media (min-width: 700px) { .stock-cols { columns: 3; } }
@media (max-width: 420px) { .stock-cols { columns: 1; } }

.tick {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.22rem 0;
  cursor: pointer;
  break-inside: avoid;
}

.tick input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.tick .box {
  flex: none;
  width: 0.82em;
  height: 0.82em;
  border: 1.5px solid var(--ink);
  position: relative;
  top: 0.08em;
}

.tick input:checked ~ .box { background: var(--ink); }
.tick input:checked ~ .box::after {
  content: "";
  position: absolute;
  inset: 1px 2px 3px;
  border-right: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(40deg) scale(0.72);
}

.tick input:focus-visible ~ .box { outline: 2px solid var(--red); outline-offset: 2px; }

.tick .t-name { font-size: 0.98rem; }
.tick input:checked ~ .t-name { font-weight: 600; }

.tick .dag { color: var(--red); font-size: 0.85em; }

.stock-legend {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin-top: 0.4rem;
}
.stock-legend .dag { color: var(--red); font-style: normal; }

.no-match { font-style: italic; color: var(--ink-2); padding: 0.5rem 0; }

/* ---------- running tally ---------- */

.tally {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  margin-top: 2rem;
}

.tally-in {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-x: auto;
}

.tally-in .fig {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  margin-right: 0.35ch;
}

.tally-in a { color: var(--red); }

@keyframes stamp-in {
  0% { transform: scale(1.7) rotate(-8deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.fig.stamped { display: inline-block; animation: stamp-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

/* the section stamp */
.stamp {
  position: absolute;
  right: 0;
  top: -0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.35rem 0.6rem 0.3rem;
  transform: rotate(-5deg);
  opacity: 0.85;
  pointer-events: none;
}
.stamp.re { animation: stamp-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

/* ---------- ledger entries ---------- */

.ledger { list-style: none; margin: 0; padding: 0; }

.entry { border-bottom: 1px solid var(--hair-soft); }
.entry:first-child { border-top: 1px solid var(--hair-soft); }

.entry-line {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 0.62rem 0.1rem;
  cursor: pointer;
}
.entry-line:hover .e-name { text-decoration: underline; text-underline-offset: 0.18em; }

.e-no {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  flex: none;
  width: 1.9ch;
  font-variant-numeric: tabular-nums;
}
.entry.ok .e-no { color: var(--green); }
.entry.short .e-no { color: var(--red); }

.e-name { font-size: 1.08rem; flex: none; max-width: 62%; }

.e-lead {
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--hair);
  align-self: flex-end;
  margin-bottom: 0.42em;
}

.e-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  flex: none;
}
.e-tag .miss { color: var(--red); letter-spacing: 0.04em; }

.entry-body { padding: 0.2rem 0 1.1rem 2.6ch; }

.spec { list-style: none; margin: 0 0 0.8rem; padding: 0; max-width: 30rem; }
.spec li { display: flex; align-items: baseline; gap: 0.6ch; padding: 0.13rem 0; }
.spec .s-i { font-size: 0.98rem; }
.spec .s-lead { flex: 1; min-width: 1rem; border-bottom: 1px dotted var(--hair); align-self: flex-end; margin-bottom: 0.4em; }
.spec .s-m { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.spec li.is-missing .s-i { color: var(--red); }
.spec li.is-missing .s-i::after { content: " — not in stock"; font-style: italic; font-size: 0.82em; }
.spec li.is-opt .s-i::after { content: " (optional)"; font-style: italic; font-size: 0.82em; color: var(--ink-2); }

.e-note { font-size: 0.96rem; max-width: 36rem; margin: 0 0 0.35rem; }
.e-note i { color: var(--ink-2); }
.e-note b { font-weight: 600; }

.e-order { margin-top: 0.6rem; font-size: 0.95rem; }
.e-order a { color: var(--red); }

/* ---------- §4 order sheet ---------- */

.nb {
  border: 1.5px solid var(--red);
  padding: 1.1rem 1.2rem 1.2rem;
  margin-bottom: 1.6rem;
  position: relative;
}
.nb::before {
  content: "N.B.";
  position: absolute;
  top: -0.72em;
  left: 0.9rem;
  background: var(--paper);
  padding: 0 0.5ch;
  font-style: italic;
  color: var(--red);
  font-size: 0.95rem;
}

.nb .nb-line { font-size: 1.12rem; max-width: 38rem; }
.nb .nb-line b { font-weight: 600; }
.nb .nb-line .u { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.94em; }

.nb-foot {
  margin-top: 0.8rem;
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.nb-alt { font-size: 0.92rem; font-style: italic; color: var(--ink-2); }
.nb-alt button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}
.nb-alt button:hover { color: var(--ink); }

.sheet { border-top: 1px solid var(--ink); }

.row {
  display: grid;
  grid-template-columns: 2ch 1fr auto auto;
  gap: 0.35rem 0.9rem;
  align-items: baseline;
  padding: 0.6rem 0.1rem;
  border-bottom: 1px solid var(--hair-soft);
}

.row .r-no { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row .r-item { font-size: 1.04rem; }
.row .r-why { grid-column: 2 / -1; font-style: italic; font-size: 0.9rem; color: var(--ink-2); }
.row .r-gain { font-family: var(--mono); font-size: 0.78rem; color: var(--green); font-variant-numeric: tabular-nums; }
.row .r-buy { font-size: 0.95rem; white-space: nowrap; }
.row .r-buy a { color: var(--red); }
.row .r-buy .na { color: var(--ink-2); font-style: italic; }

.sheet-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 2px solid var(--ink);
  padding: 0.7rem 0.1rem;
  margin-top: -1px;
}
.sheet-total .sum { font-size: 1.15rem; }
.sheet-total .sum b { font-weight: 600; }
.sheet-total .label { letter-spacing: 0.14em; }

.small-print {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-2);
  max-width: 44rem;
  margin-top: 0.9rem;
}

/* ---------- §5 opening orders / §6 equipment ---------- */

.book { border-top: 1px solid var(--ink); }

.book-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1.2rem;
  padding: 0.85rem 0.1rem 0.95rem;
  border-bottom: 1px solid var(--hair-soft);
  align-items: baseline;
}

.book-row h3 { font-size: 1.12rem; font-weight: 500; }
.book-row .b-pitch { grid-column: 1; font-style: italic; font-size: 0.93rem; color: var(--ink-2); max-width: 34rem; }
.book-row .b-fig {
  grid-column: 2; grid-row: 1;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); text-align: right;
  font-variant-numeric: tabular-nums;
}
.book-row .b-fig .green { letter-spacing: 0; }
.book-row .b-act { grid-column: 2; grid-row: 2 / span 2; align-self: end; text-align: right; font-size: 0.95rem; white-space: nowrap; }
.book-row .b-act a, .book-row .b-act button {
  font: inherit; font-size: 0.95rem; color: var(--red); background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}
.book-row .b-own { grid-column: 1; font-family: var(--mono); font-size: 0.7rem; color: var(--green); letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 560px) {
  .book-row { grid-template-columns: 1fr; }
  .book-row .b-fig, .book-row .b-act { grid-column: 1; grid-row: auto; text-align: left; }
}

/* ---------- §7 index ---------- */

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
  font-size: 0.95rem;
}
@media (min-width: 700px) { .index-list { columns: 2; column-gap: 3rem; } }

.index-list li {
  break-inside: avoid;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--hair-soft);
}
.index-list .no {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-2);
  margin-right: 0.8ch;
  font-variant-numeric: tabular-nums;
}
.index-list b { font-weight: 600; }
.index-list i { color: var(--ink-2); }

/* ---------- FAQ ---------- */

.faq { max-width: 44rem; }
.faq dt { font-weight: 600; font-size: 1.05rem; margin-top: 1.1rem; }
.faq dd { margin: 0.3rem 0 0; font-size: 0.98rem; }

/* ---------- subscribe ---------- */

.subscribe {
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 1.6rem 0 1.8rem;
  margin-top: 2.6rem;
}

.subscribe h2 { font-size: 1.5rem; font-style: italic; font-weight: 500; }
.subscribe .sub-pitch { max-width: 36rem; margin: 0.5rem 0 1rem; font-size: 0.98rem; color: var(--ink-2); }

.subscribe form { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 30rem; }
.subscribe input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.45rem 0.1rem;
  border-radius: 0;
}
.subscribe input[type="email"]::placeholder { color: var(--ink-2); font-style: italic; opacity: 1; }
.subscribe input[type="email"]:focus-visible { outline: none; border-bottom-width: 2px; border-bottom-color: var(--red); }

.hp { position: absolute; left: -9999px; }

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

footer { padding: 2rem 0 3.4rem; }
footer .cols { font-size: 0.88rem; color: var(--ink-2); max-width: 44rem; }
footer .cols p + p { margin-top: 0.55rem; }
footer .sig-off {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 1.6rem;
  color: var(--ink);
}

/* ---------- print: the ledger prints like a ledger ---------- */

@media print {
  .tally, .acts, .stock-tools, .subscribe, .skip { display: none !important; }
  body { font-size: 11pt; }
  a { text-decoration: none; color: inherit; }
}
