/* The Publication: shared design system for Infinite by Design.
   Identity lifted from mockup 43 (paper, ink, one blue accent, Newsreader + Geist + JetBrains Mono),
   tempered with the restraint of mockup 18. */

:root {
  --paper: #f6f3ec;
  --paper-2: #ede9df;
  --paper-3: #e3ded1;
  --ink: #15140f;
  --ink-2: #45423b;
  --ink-3: #6b675e;
  --rule: #d6d1c4;
  --rule-strong: #15140f;
  --accent: #2742d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(39, 66, 214, 0.08);
  --warn: #b4341c;
  --card: #fbf9f4;
  --shadow: 0 1px 0 rgba(21,20,15,.06), 0 18px 40px -24px rgba(21,20,15,.35);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --measure: 36rem;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #121210;
  --paper-2: #1a1917;
  --paper-3: #24231f;
  --ink: #ebe7dd;
  --ink-2: #b9b4a8;
  --ink-3: #8f8b82;
  --rule: #2c2b27;
  --rule-strong: #ebe7dd;
  --accent: #8d9bff;
  --accent-ink: #0b0f2a;
  --accent-soft: rgba(141, 155, 255, 0.14);
  --warn: #ff8a6b;
  --card: #181815;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 18px 40px -24px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 18px; line-height: 1.5;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-width: 320px;
}
img, video, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.015em; line-height: 1.1; font-variation-settings: "opsz" 72; overflow-wrap: anywhere; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
em { font-style: italic; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; font-family: var(--sans); font-size: 14px; border-radius: 4px; }
.skip:focus { top: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.kicker { font-family: var(--sans); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.kicker.accent { color: var(--accent); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .01em; color: var(--ink-3); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule.strong { border-top: 2px solid var(--rule-strong); }
.lede { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); line-height: 1.45; max-width: 52ch; }
.u { border-bottom: 1px solid var(--rule); } .u:hover { border-color: var(--accent); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.masthead .bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; letter-spacing: -0.01em; white-space: nowrap; }
.brand .glyph { width: 26px; height: 14px; flex: 0 0 auto; }
.brand .glyph path { fill: none; stroke: currentColor; stroke-width: 1.8; }
.brand em { color: var(--accent); font-style: italic; }
.brand .sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .02em; margin-left: 6px; align-self: end; padding-bottom: 3px; }
.nav { display: flex; gap: 26px; justify-content: center; font-family: var(--sans); font-size: 13.5px; font-weight: 500; letter-spacing: .01em; }
.nav a { color: var(--ink-2); padding: 6px 0; position: relative; white-space: nowrap; }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tools { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 500; font-size: 13.5px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink); background: transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.lg { font-size: 15px; padding: 13px 22px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink-2);
  transition: border-color .25s, color .25s, background .25s; flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: block; } .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.dateline { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; }
.radar-addr { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.radar-addr a { border-bottom: 1px solid var(--rule); }

@media (max-width: 900px) {
  .masthead .bar { grid-template-columns: 1fr auto; height: 56px; }
  .nav { display: none; }
  .brand .sub { display: none; }
}
@media (max-width: 640px) {
  .masthead .dateline, .masthead .radar-addr { display: none; }
  .brand { font-size: 19px; }
}
/* mobile nav strip */
.subnav { display: none; border-bottom: 1px solid var(--rule); background: var(--paper); }
.subnav .wrap { display: flex; gap: 22px; overflow-x: auto; font-family: var(--sans); font-size: 13px; font-weight: 500; height: 40px; align-items: center; scrollbar-width: none; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav a { color: var(--ink-2); white-space: nowrap; padding: 10px 0; }
.subnav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 900px) { .subnav { display: block; } }

/* editorial promise line */
.promise-line { font-size: 16px; color: var(--ink-2); padding: 14px 0 0; }
.promise-line b { font-weight: 500; color: var(--ink); }

/* ---------- footer ---------- */
.footer { border-top: 2px solid var(--rule-strong); margin-top: 96px; padding: 40px 0 72px; }
.footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--sans); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 14px; }
.footer li { margin: 0 0 8px; color: var(--ink-2); }
.footer li a:hover { color: var(--accent); }
.footer .colophon { font-size: 15px; color: var(--ink-2); max-width: 36ch; margin: 14px 0 0; }
.footer .bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
.footer .bottom .mono { max-width: 100%; }
.footer .rss svg { width: 11px; height: 11px; display: inline-block; vertical-align: -1px; margin-right: 5px; }
@media (max-width: 900px) { .footer .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer .grid { grid-template-columns: 1fr; gap: 26px; } .footer { margin-top: 64px; } }

/* ---------- shared components ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; padding: 14px 0; border-top: 2px solid var(--rule-strong); margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head .more { font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.section-head .more:hover { color: var(--accent); }

.tag { display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-2); white-space: nowrap; }
.tag.ai { color: #6a2fb8; border-color: color-mix(in srgb, #6a2fb8 40%, transparent); }
.tag.automation { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag.security { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
:root[data-theme="dark"] .tag.ai { color: #c3a0ff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-size: 13px; font-weight: 500; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); transition: all .2s var(--ease); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 5px; }

.sample-note { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px dashed var(--rule); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }

/* evidence labels (amendment A5): words, not dots */
.evidence { display: inline-block; position: relative; padding-left: 15px; font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--ink-2); line-height: 1.4; }
.evidence::before { content: ""; position: absolute; left: 0; top: .42em; width: 8px; height: 8px; border-radius: 2px; background: var(--ink-3); }
.evidence.announcement::before { background: var(--ink-3); }
.evidence.reporting::before { background: var(--accent); }
.evidence.tested::before { background: #2a8a4a; }
.evidence.unverified::before { background: transparent; border: 1.5px solid var(--warn); }
.evidence .attr { font-weight: 400; color: var(--ink-3); }

/* automated summary vs David's take */
.auto-label { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .02em; display: block; margin-bottom: 4px; }
.take { display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin: 14px 0 6px; padding: 12px 14px 12px 12px; background: var(--accent-soft); border-radius: 6px; border-left: 3px solid var(--accent); }
.take .av { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--sans); font-size: 12px; font-weight: 600; }
.take b { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 4px; }
.take p { margin: 0; font-size: 16.5px; line-height: 1.5; color: var(--ink); }

/* newsletter block (home after lead, end of article, end of edition) */
.newsletter { border: 1px solid var(--rule); border-radius: 10px; background: var(--card); padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 40px; align-items: center; }
.newsletter h2 { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 8px; }
.newsletter .lede { font-size: 16.5px; margin: 0; }
.newsletter form { display: grid; gap: 12px; }
.newsletter .row { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input[type="email"] { flex: 1 1 200px; min-width: 0; font: 16px var(--sans); padding: 11px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); }
.newsletter label.check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--sans); font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.newsletter input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.newsletter .demo { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.newsletter .ok { display: none; font-family: var(--sans); font-size: 15px; color: var(--ink); padding: 14px 16px; border: 1px dashed var(--rule); border-radius: 8px; }
.newsletter.sent form { display: none; } .newsletter.sent .ok { display: block; }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; gap: 18px; } }

/* studio band (compact, near the bottom of the home page) */
.studio-band { border-radius: 10px; background: var(--ink); color: var(--paper); padding: clamp(24px, 4vw, 44px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 40px; align-items: center; }
:root[data-theme="dark"] .studio-band { background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); }
.studio-band h2 { font-size: clamp(26px, 3.2vw, 40px); letter-spacing: -0.02em; }
.studio-band p { font-size: 16.5px; opacity: .85; max-width: 50ch; margin: 12px 0 0; }
.studio-band .btn { border-color: currentColor; color: inherit; }
.studio-band .btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.studio-band .mono { color: inherit; opacity: .7; }
@media (max-width: 760px) { .studio-band { grid-template-columns: 1fr; } }

/* writing list, borrowed from 18-quiet-studio: pale year in the margin */
.year { display: grid; grid-template-columns: 7rem 1fr; gap: 2rem; padding: 2rem 0 .5rem; }
.year .y { font-size: clamp(2rem, 1.5rem + 2vw, 3.2rem); font-weight: 300; color: var(--paper-3); line-height: 1; position: sticky; top: 76px; align-self: start; font-variation-settings: "opsz" 72; }
:root[data-theme="dark"] .year .y { color: var(--paper-3); }
.year ul { list-style: none; margin: 0; padding: 0; }
.entry { border-top: 1px solid var(--rule); }
.year ul .entry:last-child { border-bottom: 1px solid var(--rule); }
.entry a { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 10rem; gap: 1.4rem; padding: 1.4rem 0; align-items: baseline; transition: padding-left .4s var(--ease); }
.entry a:hover { padding-left: .5rem; color: inherit; }
.entry a:hover .t { color: var(--accent); }
.entry .m { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 6px; }
.entry .t { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.8rem); line-height: 1.2; letter-spacing: -0.01em; transition: color .3s var(--ease); display: block; }
.entry .d { display: block; margin-top: .45rem; color: var(--ink-2); font-size: 1rem; max-width: 42rem; line-height: 1.45; }
.entry .k { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); }
.entry.hide, .year.hide { display: none; }
@media (max-width: 760px) {
  .year { grid-template-columns: 1fr; gap: .4rem; padding-top: 1.4rem; }
  .year .y { position: static; }
  .entry a { grid-template-columns: 1fr; gap: .3rem; padding: 1.1rem 0; }
  .entry .k { flex-direction: row; align-items: center; text-align: left; }
}

/* Radar item (shared by the edition page, the item page and the home column) */
.ritem { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--rule); }
.ritem .rmeta { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ritem h3 { font-size: clamp(22px, 2.1vw, 27px); line-height: 1.2; margin-bottom: 8px; letter-spacing: -0.015em; }
.ritem h3 a:hover { color: var(--accent); }
.ritem .evline { margin: 0 0 12px; }
.ritem .summary { font-size: 17px; color: var(--ink-2); margin-bottom: 10px; max-width: 66ch; }
.ritem .why { margin: 0 0 6px; max-width: 66ch; }
.ritem .why summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 500; padding: 4px 0; }
.ritem .why summary::-webkit-details-marker { display: none; }
.ritem .why summary::before { content: "+"; font-family: var(--mono); width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; font-size: 12px; line-height: 1; }
.ritem .why[open] summary::before { content: "\2212"; }
.ritem .why p { margin: 8px 0 4px; padding-left: 14px; border-left: 2px solid var(--accent); font-size: 17px; color: var(--ink); }
.ritem .correction { font-size: 14.5px; color: var(--ink-2); border-left: 2px solid var(--warn); padding-left: 12px; margin: 12px 0 6px; max-width: 66ch; }
.ritem .correction b { font-weight: 500; color: var(--warn); font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
.ritem .rfoot { display: flex; flex-direction: column; gap: 8px; font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }
.ritem .rfoot .lbl { display: inline-block; margin-right: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.ritem .rfoot a { color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.ritem .rfoot a:hover { color: var(--accent); border-color: var(--accent); }
.ritem .rfoot sup { color: var(--accent); margin-right: 3px; }
.ritem .sep { margin: 0 8px; }
.ritem .perma { color: var(--accent) !important; border-bottom: 0 !important; font-weight: 500; }
.ritem .src, .ritem .rel { line-height: 1.8; }
@media (max-width: 640px) {
  .ritem { grid-template-columns: 1fr; gap: 10px; padding: 22px 0; }
  .ritem .rmeta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .ritem .summary, .ritem .why p { font-size: 16.5px; }
}

.fade { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.fade.in { opacity: 1; transform: none; }

/* bracketed notes for David (amendment A2) */
.todo { font-family: var(--mono); font-size: .78em; color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); padding: 1px 5px; border-radius: 3px; font-style: normal; }

.footer .finalists-link { margin: 22px 0 0; font-family: var(--sans); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.footer .finalists-link a { color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.footer .finalists-link a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .fade { opacity: 1; transform: none; }
}

.evidence.linked::before { background: var(--accent); }

/* the sign-up and feed links stay in the pages but are hidden while PUB.show turns them off (pub.js) */
.no-feeds .rss, .no-feeds a[href$=".xml"], .no-feeds .feeds-only,
.no-newsletter a[href^="#nl-"], .no-newsletter .newsletter-only { display: none !important; }
