/* HALFHOOK shared site styles ("night ledger"). Requires tokens.css first.
   Components: .sheet, .topbar (brand/nav/ca/countdown/actions), .masthead, .kicker, .rule*, .cols,
   .btn, .field, .ledger (tables), .badge, .addr, .copy, .note, .colophon (footer + disclaimer). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-synthesis: none;            /* Sora has no italic: never fake one */
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: var(--lh-snug); text-wrap: balance; }
p { margin: 0 0 var(--s3); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
code, kbd, samp, .mono { font-family: var(--mono); font-size: 0.86em; font-variant-ligatures: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; 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: var(--s3); top: -60px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s3); font-family: var(--mono); font-size: var(--fs-sm);
}
.skip:focus { top: var(--s3); }

/* ---------- sheet ---------- */
.sheet {
  max-width: var(--sheet-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--s3) var(--s5); flex-wrap: wrap;
  padding: var(--s3) 0;
  border-bottom: var(--rule);
  font-family: var(--mono); font-size: var(--fs-sm);
}
.brand {
  font-family: var(--serif); font-size: 1.125rem; font-weight: 700; letter-spacing: 0.16em;
  text-decoration: none; line-height: 1; white-space: nowrap;
  font-variation-settings: "opsz" 72;
}
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: var(--s4); }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

/* CA slip: address + copy, and a caption line */
.ca {
  display: inline-flex; align-items: stretch; border: var(--rule); background: var(--paper-hi);
  font-family: var(--mono); font-size: var(--fs-sm); border-radius: var(--radius); overflow: hidden;
}
.ca__label { padding: 5px 8px; border-right: var(--rule); color: var(--ink-3); letter-spacing: var(--track-caps); font-size: var(--fs-xs); display: flex; align-items: center; }
.ca__addr { padding: 5px 8px; white-space: nowrap; display: flex; align-items: center; }
.ca .copy { border: 0; border-left: var(--rule); }
.ca-note { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }

.countdown { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.countdown b { color: var(--ink); font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 36px; padding: 6px 14px;
  border: var(--rule); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: 500 var(--fs-sm)/1.2 var(--mono); letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn--lg { min-height: 48px; padding: 10px 20px; font-size: 0.9375rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed; color: var(--ink-3); border-color: var(--ink-ghost); background: transparent;
}
.btn--solid[disabled], .btn--solid[aria-disabled="true"] { background: var(--paper-deep); }
.copy {
  appearance: none; border: var(--rule); background: transparent; color: var(--ink);
  font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: var(--track-caps); text-transform: uppercase;
  padding: 0 10px; min-height: 30px; min-width: 56px; cursor: pointer; border-radius: var(--radius);
}
.ca .copy { border-radius: 0; }
.copy:hover { background: var(--ink); color: var(--paper); }
.copy[data-done] { background: var(--accent); color: var(--paper); }

/* ---------- type helpers ---------- */
.kicker {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-2);
}
.kicker--accent { color: var(--accent); }
.headline { font-size: var(--fs-xl); line-height: var(--lh-tight); font-weight: 500; font-variation-settings: "opsz" 144; letter-spacing: -0.01em; }
.dek { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.4; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  border-top: var(--rule); padding-top: var(--s2); margin-bottom: var(--s4);
}
.section-head h2 { font-size: var(--fs-lg); font-weight: 600; font-variation-settings: "opsz" 72; }
.section-head .kicker { white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: var(--accent); }
.small { font-size: 0.9375rem; }

/* ---------- rules ---------- */
.rule { border: 0; border-top: var(--rule); margin: 0; }
.rule--double { border: 0; border-top: var(--rule-double); margin: 0; }
.rule--soft { border: 0; border-top: var(--rule-soft); margin: 0; }

/* ---------- newspaper columns ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6) var(--col-gap); }
@media (min-width: 900px) {
  .cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols--3 > *, .cols--2 > * { position: relative; }
  .cols--3 > * + *::before, .cols--2 > * + *::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--col-gap) / -2);
    border-left: var(--rule-soft);
  }
}

/* ---------- form fields ---------- */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
.field label, .field__label { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-2); }
.field__well { display: flex; align-items: stretch; border: var(--rule); background: var(--paper-deep); border-radius: var(--radius); overflow: hidden; }
.field__well:hover { border-color: rgba(200, 214, 245, 0.4); }
.field__well:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.field input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink);
  font: 500 1.5rem/1.2 var(--mono); padding: 10px 12px; font-variant-numeric: tabular-nums;
}
.field input:focus { outline: none; }
.field__unit { display: flex; align-items: center; padding: 0 12px; border-left: var(--rule); font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- ledger tables ---------- */
.ledger { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ledger caption { text-align: left; }
.ledger th {
  text-align: left; font-weight: 500; font-size: var(--fs-xs); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--ink-2); padding: 6px 8px 6px 0; border-bottom: var(--rule);
}
.ledger td { padding: 7px 8px 7px 0; border-bottom: var(--rule-soft); vertical-align: baseline; }
.ledger tr:last-child td { border-bottom: var(--rule); }
.ledger .r { text-align: right; padding-right: 0; }
.ledger a { text-decoration: none; border-bottom: 1px solid var(--ink-ghost); }
.ledger a:hover { border-color: var(--accent); color: var(--accent-hi); }

/* rows of label ......... value */
.rows { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: var(--fs-sm); }
.rows li, .rows > div { display: flex; justify-content: space-between; gap: var(--s3); padding: 7px 0; border-bottom: var(--rule-soft); }
.rows li:last-child, .rows > div:last-child { border-bottom: 0; }
.rows dt, .rows .k { color: var(--ink-2); }
.rows dd, .rows .v { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- badges / notes ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: var(--rule); border-radius: 999px;
  font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.badge--soft { border-color: var(--ink-ghost); color: var(--ink-2); }
.badge--accent { border-color: var(--accent); color: var(--accent); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.note { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.5; }
.note--warn { color: var(--accent); }
.addr { font-family: var(--mono); font-size: var(--fs-sm); word-break: break-all; }
.pre {
  font-family: var(--mono); font-size: var(--fs-sm); background: var(--paper-deep); border: var(--rule-soft);
  padding: 10px 12px; overflow-x: auto; white-space: pre; margin: 0; border-radius: var(--radius);
}

/* ---------- footer / colophon ---------- */
.colophon { margin-top: var(--s8); border-top: var(--rule-double); padding: var(--s5) 0 var(--s7); }
.colophon__row { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: baseline; justify-content: space-between; font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); }
.colophon__row a { color: var(--ink-2); }
.disclaimer { max-width: 72ch; margin-top: var(--s4); font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); }

@media (max-width: 599px) {
  .topbar { gap: var(--s2) var(--s3); }
  .topbar__right { margin-left: 0; width: 100%; }
  .ca { max-width: 100%; }
  .ca__addr { overflow: hidden; text-overflow: ellipsis; }
}
