/* The Daily Ink — website. Newsprint palette; Ink purple only for the weekly comic. */
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Variable.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #f3eee2;
  --paper-2: #ebe4d4;
  --ink: #17150f;
  --ink-2: #3b372e;
  --ink-3: #6d675a;
  --hair: #cfc7b4;
  --purple: #7132F5;
  --light: #9E70FF;
  --serif: "Libre Caslon Text", Georgia, serif;
  --head: "Playfair Display", Georgia, serif;
  --label: "Libre Franklin", Arial, sans-serif;
  --mast: "Satoshi", "Libre Franklin", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.5;
  background-image: radial-gradient(rgba(0,0,0,.03) 1px, transparent 1px); background-size: 3px 3px;
}
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; }

/* ---------- masthead ---------- */
.mast { max-width: 1120px; margin: 0 auto; padding: 22px 16px 0; }
.mast-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.mast-meta { font-family: var(--label); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.mast-meta.right { text-align: right; }
.mast-meta a { text-decoration: none; border-bottom: 1px solid var(--hair); }
.mast-name { font-family: var(--mast); font-weight: 900; font-size: clamp(44px, 9vw, 92px); letter-spacing: -.045em; line-height: 1; text-decoration: none; white-space: nowrap; }
.mast-nav {
  margin-top: 14px; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); padding: 8px 0;
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.mast-nav a { text-decoration: none; }
.mast-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.wallet { margin-left: auto; font-family: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.banner { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--ink); font-family: var(--label); font-size: 13px; background: var(--paper-2); }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding: 34px 0 10px; border-bottom: 1px solid var(--hair); }
.kicker { font-family: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 12px; }
.lede { color: var(--ink-2); max-width: 680px; margin-bottom: 18px; }

/* ---------- drops ---------- */
.drops { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; }
.drop { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 20px; }
.drop + .drop { border-left: 1px solid var(--hair); padding-left: 28px; }
.drop-cover { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--ink); background: #fff center/cover no-repeat; cursor: zoom-in; padding: 0; }
.drop.weekly .drop-cover { border-color: var(--purple); }
.drop-label { font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.drop.weekly .drop-label { color: var(--purple); }
.drop h3 { font-family: var(--head); font-weight: 900; font-size: clamp(24px, 3vw, 34px); line-height: 1.08; letter-spacing: -.01em; }
.drop .meta { font-family: var(--label); font-size: 13px; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; }
.drop .meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.drop-cover.soon { position: relative; overflow: hidden; cursor: default; display: grid; place-items: center; }
.drop-cover.soon::before { content: ""; position: absolute; inset: -20px; background: inherit; filter: blur(16px) saturate(.8); }
.drop-cover.soon span, .pop-img.soon span {
  position: relative; font-family: var(--label); font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  background: var(--paper); color: var(--purple); border: 2px solid var(--purple); border-radius: 999px; padding: 10px 18px;
}
.soon-text { color: var(--ink-2); }
.drop .empty { font-family: var(--head); font-style: italic; font-size: 22px; color: var(--ink-3); padding: 40px 0; }

.mint-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.qty { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.qty button { width: 38px; border: 0; background: transparent; cursor: pointer; font-family: var(--label); font-weight: 800; font-size: 16px; }
.qty input { width: 44px; border: 0; background: transparent; text-align: center; font-family: var(--label); font-weight: 800; font-size: 15px; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
  font-family: var(--label); font-size: 14px; font-weight: 800; letter-spacing: .02em;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.drop.weekly .btn.primary { background: var(--purple); border-color: var(--purple); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .4; pointer-events: none; }
.btn.small { padding: 8px 12px; font-size: 12px; }
.mint-note { font-family: var(--label); font-size: 12px; color: var(--ink-3); }
.tx-status { font-family: var(--label); font-size: 13px; }
.tx-status.ok { color: #1d6b2f; }
.tx-status.err { color: #9b1c1c; }

/* ---------- calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; margin-bottom: 18px; }
.chip {
  font-family: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--ink); background: transparent; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 999px; padding: 8px 13px; display: flex; align-items: center; gap: 7px;
}
.chip svg { width: 13px; height: 13px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip.weekly { border-color: var(--purple); color: var(--purple); }
.chip.weekly[aria-pressed="true"] { background: var(--purple); color: #fff; }

/* 21 columns = 3 weeks per row starting Monday → Mondays form 3 purple columns */
.cal-months { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 4px 0; justify-items: center; }
.month-label { grid-column: 1 / -1; justify-self: start; font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }
.day { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; border-radius: 6px; color: #c9c1ae; position: relative; }
.day svg { width: 16px; height: 16px; display: block; }
.day.printed { color: var(--ink); }
.day.skipped { color: #c9c1ae; opacity: .5; }
.day.pre { color: #ddd5c3; }
.day.monday.soon { color: rgba(113,50,245,.45); }
.day.monday { color: rgba(113,50,245,.35); }
.day.monday.printed { color: var(--purple); }
.day.open { color: var(--ink); }
.day.monday.open { color: var(--purple); }
.day.open::after { content: ""; position: absolute; inset: 1px; border-radius: 7px; border: 2px solid var(--purple); animation: pulse 1.8s ease-in-out infinite; }
.day.today::before { content: ""; position: absolute; bottom: 0; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink); }
.day.pad { visibility: hidden; pointer-events: none; }
.day.filtered svg { opacity: .12; }
.day:hover, .day:focus-visible { background: rgba(23,21,15,.08); outline: none; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .day.open::after { animation: none; } html { scroll-behavior: auto; } }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; font-family: var(--label); font-size: 12px; color: var(--ink-2); }
.lg { display: inline-flex; vertical-align: -3px; margin-right: 6px; border-radius: 4px; }
.lg svg { width: 14px; height: 14px; }
.lg.printed { color: var(--ink); }
.lg.monday { color: var(--purple); }
.lg.open { color: var(--ink); outline: 2px solid var(--purple); outline-offset: 1px; }
.lg.coming { color: #c9c1ae; }
.cal-note { display: none; font-family: var(--label); font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.cal-foot { display: flex; justify-content: space-between; margin: 22px 0 18px; font-family: var(--mono); font-size: 14px; }
.cal-foot span:last-child { color: var(--ink-3); }

.tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 300px; padding: 9px 11px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-family: var(--label); font-size: 12.5px; line-height: 1.35;
  opacity: 0; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .1s;
}
.tip.show { opacity: 1; }
.tip .d { font-family: var(--mono); font-size: 11px; opacity: .7; }
.tip .h { font-family: var(--head); font-weight: 700; font-size: 15px; margin-top: 3px; }
.tip .p { margin-top: 3px; opacity: .85; }
.tip .w { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(243,238,226,.2); color: #cbb4ff; font-weight: 700; }

/* ---------- popup ---------- */
dialog#pop { margin: auto; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; }
dialog#pop::backdrop { background: rgba(23,21,15,.55); }
.pop-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; }
.pop-img.soon { position: relative; overflow: hidden; display: grid; place-items: center; cursor: default; }
.pop-img.soon::before { content: ""; position: absolute; inset: -20px; background: inherit; filter: blur(16px); }
.pop-img { display: block; width: 100%; aspect-ratio: 1; border: 0; border-bottom: 1px solid var(--ink); background: var(--paper-2) center/cover no-repeat; cursor: zoom-in; font-family: var(--head); font-style: italic; color: var(--ink-3); }
.pop-body { padding: 16px 18px 18px; }
.pop-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.pop-tabs button { font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--ink); background: none; cursor: pointer; }
.pop-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pop-kind { font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.pop-kind.weekly { color: var(--purple); }
.pop-title { font-family: var(--head); font-weight: 900; font-size: 24px; line-height: 1.12; margin: 6px 0 4px; }
.pop-date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.pop-status { margin-top: 10px; font-family: var(--label); font-size: 13px; color: var(--ink-2); }
.pop-status b { color: var(--ink); }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.pop-actions .wide { grid-column: 1 / -1; }

/* ---------- reader ---------- */
.reader { position: fixed; inset: 0; z-index: 50; background: #1d1b16; display: flex; flex-direction: column; }
.reader[hidden] { display: none; }
.reader-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--ink); color: var(--paper); font-family: var(--label); font-size: 13px; }
.reader-back { border: 1px solid rgba(243,238,226,.5); background: transparent; color: var(--paper); border-radius: 999px; padding: 7px 13px; font-weight: 800; cursor: pointer; }
.reader-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.reader-tools { display: flex; gap: 12px; align-items: center; }
.reader-tools button, .reader-tools a { border: 0; background: none; color: var(--paper); font-weight: 700; cursor: pointer; text-decoration: none; }
.reader-stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 16px; }
.reader-stage img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; box-shadow: 0 6px 30px rgba(0,0,0,.4); cursor: zoom-in; }
.reader-stage.zoomed { place-items: start center; }
.reader-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }

/* ---------- money ---------- */
.split-bar { display: flex; height: 26px; border: 1px solid var(--ink); margin-bottom: 14px; }
.split-bar div { border-right: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--label); font-size: 11px; font-weight: 800; overflow: hidden; white-space: nowrap; }
.split-bar div:last-child { border-right: 0; }
.split-bar .q { background: repeating-linear-gradient(45deg, var(--paper) 0 3px, var(--hair) 3px 4px); }
.split-bar .an { background: var(--ink); color: var(--paper); }
.split-bar .ai { background: var(--hair); }
.table-wrap { overflow-x: auto; }
table.money { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.money th { text-align: left; font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 8px 10px 8px 0; border-bottom: 2px solid var(--ink); }
table.money td { padding: 10px 10px 10px 0; border-bottom: 1px dotted var(--hair); vertical-align: top; }
table.money td.num { font-family: var(--label); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.money .addr { font-family: var(--mono); font-size: 12.5px; }
.money-notes { margin: 16px 0 20px; font-family: var(--label); font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; }
.pending { border-left: 3px solid var(--purple); padding-left: 10px; }

/* ---------- about + footer ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 24px; }
.about h3 { font-family: var(--head); font-size: 24px; margin-bottom: 8px; }
.about p { margin-bottom: 12px; color: var(--ink-2); }
.foot { max-width: 1120px; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: var(--label); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.foot-links { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; }
.foot-links a { text-decoration: none; border-bottom: 1px solid var(--hair); }
.foot-links a[hidden] { display: none; }
.ink-pill { height: 30px; border: 2px solid var(--ink); border-radius: 999px; }

@media (max-width: 860px) {
  .drops, .about-grid { grid-template-columns: 1fr; }
  .mast-nav { gap: 10px 16px; font-size: 12px; }
  .wallet { margin-left: 0; }
  .cal-head { display: block; }
  .mint-row .btn.primary { flex: 1; }
  /* money table → stacked cards */
  table.money thead { display: none; }
  table.money, table.money tbody, table.money tr, table.money td { display: block; width: 100%; }
  table.money tr { border-bottom: 1px solid var(--ink); padding: 8px 0; }
  table.money td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
  table.money td::before { content: attr(data-th); font-family: var(--label); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
  .split-bar div { font-size: 9px; }
  .foot { flex-direction: column; align-items: flex-start; }
  .reader-tools #reader-zoom { display: none; }
  .tip { max-width: 240px; }
  .drop + .drop { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 20px; }
  .cal-months { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px 0; }
  .day.early { display: none; }
  .cal-note { display: block; }
  .day { width: 36px; height: 36px; }
  .day svg { width: 18px; height: 18px; }
  .mast-top { grid-template-columns: 1fr; text-align: center; }
  .mast-meta, .mast-meta.right { text-align: center; }
}

.presets { display: inline-flex; gap: 6px; }
.presets button { font-family: var(--label); font-weight: 800; font-size: 13px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; padding: 0 12px; cursor: pointer; }
.drop.weekly .presets button { border-color: var(--purple); color: var(--purple); }
