/* CiboloWatch site, 2.0.
   One stylesheet for the three public pages and the generated archive.
   A newspaper front page, not a landing page: one ink, one paper, one accent. */

:root {
  --paper: #f5f0e4;
  --paper-deep: #ece4d2;
  --ink: #16201b;
  --ink-soft: #3b4740;
  --muted: #66716a;
  --rule: rgba(22, 32, 27, 0.16);
  --rule-strong: #16201b;
  --accent: #1d5a42;
  --accent-ink: #f5f0e4;
  --accent-soft: rgba(29, 90, 66, 0.09);
  --danger: #8e3b2c;

  --serif-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif-text: Spectral, Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-sm: 3px;
  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

/* Component display rules must never override the hidden attribute. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  /* Faint newsprint grain. Inline SVG, so no request and nothing for the CSP. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 30;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
  font: 600 14px/1 var(--sans); text-decoration: none; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead ---------- */

.topline {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0 10px; border-bottom: 1px solid var(--rule);
  font: 500 12px/1.4 var(--mono); letter-spacing: 0.02em; color: var(--muted);
}
.topline a { color: var(--accent); text-decoration: none; font-weight: 700; }
.topline a:hover { text-decoration: underline; }

.nameplate { text-align: center; padding: clamp(20px, 4vw, 36px) 0 clamp(14px, 2.5vw, 20px); }
.nameplate a { text-decoration: none; color: var(--ink); }
.nameplate h1, .nameplate .title {
  margin: 0; font-family: var(--serif-display); font-weight: 900;
  font-size: clamp(46px, 10vw, 104px); line-height: 0.92; letter-spacing: -0.025em;
}
.nameplate p {
  margin: 12px auto 0; max-width: 34ch; font-style: italic; color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 19px); line-height: 1.4; text-wrap: balance;
}

.rule-double { border: 0; border-top: 3px double var(--rule-strong); margin: 0; }

.sitenav { display: flex; justify-content: center; gap: clamp(18px, 4vw, 40px); padding: 11px 0; border-bottom: 1px solid var(--rule-strong); }
.sitenav a {
  font: 600 14px/1 var(--sans); text-decoration: none; color: var(--ink-soft);
  padding: 4px 0; border-bottom: 2px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.sitenav a:hover { color: var(--ink); }
.sitenav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Front page grid ---------- */

.front {
  display: grid; gap: clamp(28px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "lead rail" "more rail";
  padding: clamp(28px, 4vw, 44px) 0 56px;
}
.lead { grid-area: lead; }
.more { grid-area: more; }
.rail { grid-area: rail; align-self: start; position: sticky; top: 20px; }

.kicker {
  display: inline-block; margin: 0 0 12px;
  font: 600 12px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}

.lead h1, .lead h2 {
  margin: 0 0 16px; font-family: var(--serif-display); font-weight: 800;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -0.018em; text-wrap: balance;
}
.lead h2 a { text-decoration: none; }
.lead .deck { margin: 0 0 18px; max-width: 62ch; font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font: 500 12.5px/1.5 var(--mono); color: var(--muted); }
.meta .source { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.meta .source:hover { text-decoration: underline; }

.more-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 4px; padding-top: 14px; border-top: 1px solid var(--rule-strong);
}
.more-head h3 { margin: 0; font: 600 13px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.more-head a { font: 600 13.5px/1 var(--sans); color: var(--accent); text-decoration: none; }

.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 40px); }
.story { padding: 20px 0 22px; border-bottom: 1px solid var(--rule); }
.story h4 { margin: 0 0 8px; font-family: var(--serif-display); font-weight: 700; font-size: 23px; line-height: 1.18; letter-spacing: -0.008em; text-wrap: balance; }
.story p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.55; color: var(--ink-soft); }
.story .kicker { margin-bottom: 8px; }

/* ---------- Subscription clipping ---------- */

.clip {
  position: relative; padding: 24px 22px 22px;
  background: var(--paper);
  border: 1.5px dashed rgba(22, 32, 27, 0.45); border-radius: var(--radius-sm);
}
.clip::before {
  content: "\2702"; position: absolute; top: -13px; left: 18px;
  padding: 0 6px; background: var(--paper); font-size: 18px; line-height: 1; color: var(--ink-soft);
}
.clip h2 { margin: 0 0 8px; font-family: var(--serif-display); font-weight: 800; font-size: 28px; line-height: 1.08; letter-spacing: -0.01em; }
.clip > p { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); }

.field { display: block; margin: 0 0 12px; }
.field span { display: block; margin: 0 0 6px; font: 600 13px/1.3 var(--sans); color: var(--ink); }
.field span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 12px;
  font: 400 16px/1.3 var(--sans); color: var(--ink);
  background: #fffdf8; border: 1px solid rgba(22, 32, 27, 0.3); border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:user-invalid { border-color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 12px 18px;
  font: 600 15.5px/1 var(--sans); color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  transition: background-color .2s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: #164a36; color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn.inline { width: auto; }

.fine { margin: 12px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--muted); }
.fine a { color: var(--muted); }

.status { display: none; margin: 12px 0 0; padding: 10px 12px; font: 500 14px/1.45 var(--sans); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.status.show { display: block; }
.status.error { background: rgba(142, 59, 44, 0.09); color: var(--danger); }

.share-next { display: block; margin-top: 10px; font: 600 14px/1.4 var(--sans); color: var(--accent); }

.rail-note { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.rail-note b { display: block; margin-bottom: 4px; font: 600 13px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }

/* ---------- Loading, empty, error ---------- */

.skeleton { display: block; background: linear-gradient(90deg, var(--paper-deep), #e4dbc7, var(--paper-deep)); background-size: 200% 100%; border-radius: var(--radius-sm); animation: shimmer 1.4s ease-in-out infinite; }
.skeleton.h { height: 52px; margin: 6px 0 14px; width: 92%; }
.skeleton.h2 { height: 52px; margin: 0 0 22px; width: 64%; }
.skeleton.l { height: 16px; margin: 0 0 10px; }
.skeleton.l.short { width: 70%; }
.skeleton.l.tiny { width: 30%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.notice { padding: 22px 0; max-width: 60ch; }
.notice h2 { margin: 0 0 10px; font-family: var(--serif-display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.notice p { margin: 0 0 12px; color: var(--ink-soft); }

/* ---------- Inner pages (About, Archive, issues) ---------- */

.page-head { padding: clamp(30px, 5vw, 56px) 0 clamp(18px, 3vw, 28px); border-bottom: 1px solid var(--rule); }
.page-head h1 { margin: 0 0 12px; max-width: 18ch; font-family: var(--serif-display); font-weight: 800; font-size: clamp(38px, 6vw, 66px); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.page-head p { margin: 0; max-width: 60ch; font-size: clamp(18px, 2vw, 21px); color: var(--ink-soft); }

.prose { max-width: 66ch; }
.prose h2 { margin: 44px 0 12px; font-family: var(--serif-display); font-weight: 800; font-size: 30px; line-height: 1.12; letter-spacing: -0.01em; }
.prose h3 { margin: 26px 0 6px; font: 600 15px/1.35 var(--sans); }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.1em; }
.prose li { margin: 0 0 6px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(28px, 5vw, 64px); padding: 8px 0 64px; }
.aside-card { align-self: start; position: sticky; top: 20px; padding: 24px 22px; background: var(--paper-deep); border-radius: var(--radius); }
.aside-card h2 { margin: 0 0 8px; font-family: var(--serif-display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.aside-card > p { margin: 0 0 16px; font-size: 16px; color: var(--ink-soft); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 24px 0 8px; border-top: 1px solid var(--rule-strong); }
.facts div { padding: 14px 16px 14px 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts b { display: block; font-family: var(--serif-display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.facts span { font: 500 13px/1.4 var(--sans); color: var(--muted); }

.qa { margin: 0; }
.qa dt { margin: 22px 0 4px; font: 600 16px/1.4 var(--sans); color: var(--ink); }
.qa dd { margin: 0; color: var(--ink-soft); }

/* Archive rows */
.issue-list { list-style: none; margin: 0; padding: 0 0 64px; }
.issue-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 20px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit;
  transition: background-color .2s var(--ease);
}
.issue-row:hover { background: var(--accent-soft); color: inherit; }
.issue-row .date { font: 500 13px/1.4 var(--mono); color: var(--muted); }
.issue-row h3 { margin: 0 0 6px; font-family: var(--serif-display); font-weight: 700; font-size: 24px; line-height: 1.18; }
.issue-row p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.issue-row .go { font: 600 14px/1 var(--sans); color: var(--accent); white-space: nowrap; }

/* ---------- Utility pages: legal, unsubscribe, referral ---------- */

.legal { padding: 8px 0 64px; }
.legal h2 { font-size: 26px; margin-top: 36px; }
.page-head .meta { margin-top: 10px; }

.narrow { max-width: 620px; }
.unsub-form { padding: 24px 0 8px; max-width: 460px; }
.unsub-form .btn { width: auto; }

.share-page { max-width: 820px; padding: clamp(28px, 4vw, 44px) var(--gutter) 64px; }
.share-page h1 { margin: 0 0 12px; font-family: var(--serif-display); font-weight: 800; font-size: clamp(36px, 5.5vw, 58px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
.share-page .subtitle { margin: 0 0 28px; max-width: 60ch; font-size: clamp(18px, 2vw, 21px); color: var(--ink-soft); }
.share-page .eyebrow { margin: 0 0 8px; font: 600 12px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

.hub {
  position: relative; margin: 0 0 40px; padding: 26px 24px 22px;
  border: 1.5px dashed rgba(22, 32, 27, 0.45); border-radius: var(--radius-sm); background: var(--paper);
}
.hub::before { content: "\2702"; position: absolute; top: -13px; left: 18px; padding: 0 6px; background: var(--paper); font-size: 18px; line-height: 1; color: var(--ink-soft); }
.hub h2 { margin: 0 0 6px; font-family: var(--serif-display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.hub > p { margin: 0 0 14px; color: var(--ink-soft); }
.hub-link {
  margin: 0 0 12px; padding: 12px 14px; overflow-wrap: anywhere;
  font: 500 14px/1.45 var(--mono); color: var(--ink); background: #fffdf8;
  border: 1px solid rgba(22, 32, 27, 0.3); border-radius: var(--radius-sm);
}
.hub-note { margin: 14px 0 0; font: 400 13.5px/1.5 var(--sans); color: var(--muted); }

.tiers { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.tiers li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--ink-soft); }
.tiers .n {
  display: grid; place-items: center; width: 36px; height: 36px;
  font: 700 15px/1 var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm);
}
.tiers li.done { color: var(--ink); }
.tiers li.done .n { color: var(--accent-ink); background: var(--accent); }

.share-block { padding: 26px 0 28px; border-top: 1px solid var(--rule-strong); }
.share-block h2 { margin: 0 0 6px; font-family: var(--serif-display); font-weight: 700; font-size: 25px; line-height: 1.15; }
.share-block .hint { margin: 0 0 14px; font: 400 15px/1.5 var(--sans); color: var(--muted); }
.copy-box {
  margin: 0 0 14px; padding: 16px 18px; white-space: pre-wrap;
  font: 400 16.5px/1.6 var(--serif-text); color: var(--ink);
  background: var(--paper-deep); border-radius: var(--radius-sm);
}

.copy-btn, .action-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; margin: 0 8px 8px 0;
  font: 600 14.5px/1 var(--sans); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.copy-btn { color: var(--accent); background: transparent; border: 1.5px solid var(--accent); }
.copy-btn:hover { background: var(--accent-soft); }
.copy-btn.copied { color: var(--accent-ink); background: var(--accent); }
.action-btn { color: var(--accent-ink); background: var(--accent); border: 1.5px solid var(--accent); }
.action-btn:hover { color: var(--accent-ink); background: #164a36; }
.copy-btn:active, .action-btn:active { transform: translateY(1px); }

.why-box { margin-top: 12px; padding: 22px 24px; background: var(--paper-deep); border-radius: var(--radius); }
.why-box h3 { margin: 0 0 8px; font: 600 13px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.why-box ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.why-box li { margin: 0 0 6px; }

/* Continue-to-source confirmation (api/go.js) */
.nameplate.compact { padding: 22px 0 14px; }
.nameplate.compact .title { font-size: clamp(34px, 7vw, 54px); }
.go-card { max-width: 580px; margin: clamp(32px, 7vw, 72px) auto 88px; }
.go-card h1 { margin: 0 0 14px; font-family: var(--serif-display); font-weight: 800; font-size: clamp(34px, 6vw, 50px); line-height: 1.05; letter-spacing: -0.02em; }
.go-card > p { color: var(--ink-soft); }
.go-card .go-story { margin: 0 0 14px; padding: 12px 14px; font-size: 16.5px; background: var(--paper-deep); border-radius: var(--radius-sm); }
.go-card .go-story b { color: var(--ink); font-weight: 600; }
.go-card form { margin: 22px 0 6px; }
.go-card .btn { overflow-wrap: anywhere; line-height: 1.25; }

/* ---------- Footer ---------- */

.sitefoot { margin-top: 24px; padding: 28px 0 40px; border-top: 3px double var(--rule-strong); font: 400 13.5px/1.6 var(--sans); color: var(--muted); }
.sitefoot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.sitefoot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sitefoot a { color: var(--ink-soft); text-decoration: none; }
.sitefoot a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Motion ---------- */

.reveal { animation: rise .5s var(--ease) both; }
.reveal.d1 { animation-delay: .06s; } .reveal.d2 { animation-delay: .12s; } .reveal.d3 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

/* ---------- Narrow screens ---------- */

@media (max-width: 960px) {
  .front { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "rail" "more"; }
  .rail, .aside-card { position: static; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .topline .tl-tag { display: none; }
  .stories { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .issue-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sitenav { gap: 22px; }
}
