/* ONES/ZEROES — onesandzeroes.io
   Concept E "Field Notes" · Signal Orange */

:root {
  --paper: #F3F0EA;
  --ink: #1B1B1B;
  --white: #FFFFFF;
  --signal: #D9480F;       /* fills, logo slash, large type */
  --signal-deep: #B23A0A;  /* small orange text on paper (passes contrast) */
  --signal-light: #F26A2E; /* orange on black */
  --stone: #CFC8BB;        /* dividers */
  --sand: #D9D2C5;         /* image placeholders */
  --slate: #6B655B;        /* meta text */
  --body-2: #4E493F;       /* secondary body text */
  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1320px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper);
  padding: 10px 14px; z-index: 10; font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* ---------- Type ---------- */
.display { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.03em; line-height: 0.95; }
.kicker {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal-deep);
}
.on-dark .kicker, .kicker.on-dark { color: var(--signal-light); }
.meta { font-size: 13px; color: var(--slate); }
.section-head {
  display: flex; align-items: baseline; gap: 16px 20px; flex-wrap: wrap;
  border-bottom: 3px solid var(--ink); padding-bottom: 10px; margin: 0 0 24px;
}
.section-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.03em;
}
.section-head .more { margin-left: auto; font-weight: 700; font-size: 14px; }
.section { margin-top: 64px; }

/* ---------- Logo ---------- */
.logo {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -0.035em;
  line-height: 0.9; font-size: 44px; white-space: nowrap;
}
.logo .slash { color: var(--signal); }
.logo:hover { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; font-weight: 700; font-size: 14px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
}
.btn:hover { text-decoration: none; background: #000; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--white); }
.btn-signal:hover { background: var(--signal-deep); border-color: var(--signal-deep); }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); background: transparent; cursor: pointer;
}

/* ---------- Header ---------- */
.site-header { padding-top: 24px; }
.masthead {
  display: flex; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 3px solid var(--ink);
}
.primary-nav ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 6px 22px; flex-wrap: wrap; }
.primary-nav a { font-size: 14px; font-weight: 600; }
.primary-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 3px;
  text-underline-offset: 6px; text-decoration-color: var(--signal);
}
.header-actions { margin-left: auto; display: flex; gap: 10px; }
.menu-toggle { display: none; }

.search-panel { padding: 14px 0; border-bottom: 1px solid var(--stone); }
.search-panel[hidden] { display: none; }
.search-panel form { display: flex; gap: 8px; }
.search-panel input {
  flex: 1; min-height: 44px; border: 2px solid var(--ink); background: var(--white); padding: 0 12px;
}

.news-strip {
  display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: center;
  padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--stone);
}
.news-strip #news-strip-items a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.news-strip { flex-wrap: nowrap; }
.news-strip .label { font-family: var(--font-display); font-weight: 800; color: var(--signal-deep); }
.news-strip .more { margin-left: auto; font-weight: 700; }

/* ---------- Homepage: cover + latest ---------- */
main { display: block; padding: 28px 0 72px; }
.cover-row { display: flex; flex-wrap: wrap; gap: 28px; }
.cover {
  flex: 999 1 640px; min-width: 0; min-height: 520px; padding: 36px;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center; position: relative;
}
.cover.has-image::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(27,27,27,.92) 15%, rgba(27,27,27,.2) 75%);
}
.cover > * { position: relative; }
.cover h1 {
  margin: 10px 0 14px; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 4.2vw, 54px); line-height: 1; letter-spacing: -0.03em; max-width: 780px;
}
.cover p { margin: 0 0 16px; font-size: 18px; line-height: 1.55; color: var(--stone); max-width: 620px; }
.cover .meta { color: #A39C8F; }

.latest { flex: 1 1 340px; min-width: 0; }
.latest h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.story-list { list-style: none; margin: 0; padding: 0; }
.story-list li { border-bottom: 1px solid var(--stone); }
.story-list a { display: block; padding: 13px 0; }
.story-list .title { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; }
.story-list .meta { display: block; margin-top: 4px; }
.feed-status { font-size: 12px; color: var(--slate); margin-top: 8px; }

/* ---------- Learn tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab-desc { margin-left: auto; font-size: 14px; color: var(--slate); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; }
.card { display: block; background: var(--white); padding: 22px; border-top: 6px solid var(--signal); }
.card:hover { text-decoration: none; }
.card:hover .card-title { text-decoration: underline; }
.card-num { font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; color: #E4DED3; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.2; margin-top: 10px; }
.card-desc { font-size: 14px; line-height: 1.5; color: var(--body-2); margin-top: 8px; }
.card-meta { font-size: 13px; font-weight: 600; margin-top: 12px; }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Series ---------- */
.series-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.series { padding: 32px; min-height: 300px; display: flex; flex-direction: column; }
.series .eyebrow { font-family: var(--font-display); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; opacity: .85; }
.series h3 { margin: 8px 0 6px; font-family: var(--font-display); font-weight: 900; font-size: 32px; line-height: 1; letter-spacing: -0.025em; }
.series p { margin: 0 0 18px; font-size: 15px; line-height: 1.5; opacity: .9; }
.series .latest-label { font-size: 12px; font-weight: 700; opacity: .85; margin-top: auto; }
.series .latest-title { font-size: 18px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.series .all { margin-top: 16px; font-weight: 700; font-size: 14px; text-decoration: underline; }
.series-signal { background: var(--signal); color: var(--white); }
.series-ink { background: var(--ink); color: var(--paper); }
.series-white { background: var(--white); color: var(--ink); }

/* ---------- Experts ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.quote { display: block; }
.quote blockquote {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px;
  line-height: 1.2; letter-spacing: -0.01em;
}
.byline { display: flex; gap: 12px; align-items: center; margin-top: 16px; font-size: 13px; line-height: 1.4; }
.avatar { width: 44px; height: 44px; background: var(--sand); flex: none; object-fit: cover; }
.badge {
  display: inline-block; padding: 2px 8px; background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; vertical-align: middle;
}

/* ---------- Topics ---------- */
.topic-row { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 20px 0; border-bottom: 1px solid var(--stone); }
.topic-name { flex: 0 0 200px; font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.topic-links { flex: 1 1 600px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; }
.topic-links a { font-size: 16px; font-weight: 600; line-height: 1.4; }

/* ---------- Events + newsletter ---------- */
.split { display: flex; flex-wrap: wrap; gap: 28px; }
.split > .grow { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 340px; min-width: 0; }
.event { display: flex; gap: 12px 20px; align-items: center; padding: 16px 0; border-top: 1px solid var(--stone); flex-wrap: wrap; }
.event .kind { width: 80px; flex: none; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--signal-deep); }
.event .info { flex: 1 1 300px; min-width: 0; }
.event .title { font-size: 17px; font-weight: 700; }

.newsletter { background: var(--signal); color: var(--white); padding: 28px; }
.newsletter h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; }
.newsletter p { margin: 10px 0 16px; font-size: 15px; line-height: 1.5; }
.newsletter label { display: block; font-size: 13px; font-weight: 600; }
.newsletter input {
  display: block; width: 100%; min-height: 46px; margin-top: 4px; border: 0; padding: 0 12px;
  font-size: 16px; color: var(--ink); background: var(--white);
}
.newsletter .btn { width: 100%; margin-top: 10px; }
.form-note { font-size: 13px; margin-top: 8px; min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--stone); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; padding: 40px 0; }
.footer-grid .logo { font-size: 28px; color: var(--paper); }
.footer-grid .logo .slash { color: var(--signal-light); }
.footer-grid h2 { margin: 0 0 8px; font-size: 14px; color: var(--paper); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid #333; padding: 16px 0 28px; font-size: 13px; color: #A39C8F; }

/* ---------- Section page ---------- */
.page-hero { display: flex; flex-wrap: wrap; gap: 24px 56px; align-items: flex-end; padding-top: 20px; }
.page-hero h1 { margin: 0; font-size: clamp(56px, 8vw, 104px); }
.page-hero p { margin: 0; flex: 1 1 360px; font-size: 19px; line-height: 1.55; color: var(--body-2); }
.three-q { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 40px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--stone); }
.three-q > div { padding: 20px 24px 20px 0; }
.three-q > div + div { border-left: 1px solid var(--stone); padding-left: 24px; }
.three-q .n { font-family: var(--font-display); font-weight: 900; font-size: 36px; line-height: 1; color: var(--signal-deep); }
.three-q h2 { margin: 8px 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.three-q p { margin: 0; font-size: 14px; color: var(--body-2); }

.featured { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 48px; }
.featured .lead {
  flex: 999 1 600px; min-width: 0; min-height: 440px; padding: 32px; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.featured .lead .title { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.02; letter-spacing: -0.03em; margin-top: 10px; }
.featured .stack { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.featured .stack a { display: block; background: var(--white); padding: 24px; flex: 1; }
.featured .stack .title { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; margin-top: 8px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.story-row { display: flex; gap: 8px 24px; padding: 22px 0; border-bottom: 1px solid var(--stone); flex-wrap: wrap; }
.story-row[hidden] { display: none; }
.story-row .topic { width: 140px; flex: none; padding-top: 6px; }
.story-row .body { flex: 1 1 480px; min-width: 0; }
.story-row .title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.story-row .sum { display: block; font-size: 15px; line-height: 1.5; color: var(--body-2); margin-top: 6px; }
.story-row .by { width: 200px; flex: none; padding-top: 6px; font-size: 13px; color: var(--slate); }

.cta-band { margin-top: 64px; background: var(--signal); color: var(--white); padding: 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 36px; line-height: 1; }
.cta-band p { margin: 10px 0 0; font-size: 17px; max-width: 620px; }

/* ---------- Article ---------- */
.crumbs { font-size: 13px; font-weight: 600; }
.crumbs a { color: var(--signal-deep); }
.article-head { max-width: 920px; }
.article-head h1 { margin: 14px 0 16px; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 5vw, 58px); line-height: 1; letter-spacing: -0.03em; }
.article-head .dek { margin: 0; font-size: 21px; line-height: 1.5; color: var(--body-2); }
.article-byline { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; font-size: 14px; }
.article-byline .avatar { width: 48px; height: 48px; }
.share { margin-left: auto; display: flex; gap: 8px; }
.hero-figure { margin: 32px 0 0; }
.hero-figure .ph { aspect-ratio: 21 / 9; background: var(--ink); }
.hero-figure figcaption { font-size: 13px; color: var(--slate); margin-top: 8px; }
.article-layout { display: flex; flex-wrap: wrap; gap: 56px; margin-top: 40px; }
.prose { flex: 999 1 640px; min-width: 0; max-width: 720px; font-size: 19px; line-height: 1.7; }
.prose h2 { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 44px 0 10px; }
.prose p { margin: 0 0 18px; }
.short-version { background: var(--white); border-top: 6px solid var(--signal); padding: 24px 28px; font-size: 16px; line-height: 1.55; }
.short-version h2 { margin: 0 0 14px; font-size: 20px; font-weight: 900; }
.short-version dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 20px; margin: 0; }
.short-version dt { font-weight: 700; color: var(--signal-deep); }
.short-version dd { margin: 0; }
.timeline { list-style: none; margin: 0 0 18px; padding: 0; border-left: 3px solid var(--ink); font-size: 16px; line-height: 1.5; }
.timeline li { padding: 0 0 14px 20px; }
.pull { margin: 32px 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
.decisions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 16px; line-height: 1.5; counter-reset: d; }
.decisions li { display: flex; gap: 18px; background: var(--white); padding: 18px 20px; counter-increment: d; }
.decisions li::before { content: counter(d, decimal-leading-zero); font-family: var(--font-display); font-weight: 900; font-size: 28px; color: var(--signal-deep); line-height: 1; width: 36px; flex: none; }
.sources { margin-top: 40px; border-top: 1px solid var(--stone); padding-top: 20px; font-size: 14px; line-height: 1.6; color: var(--body-2); }
.sources h2 { margin: 0; font-size: 16px; color: var(--ink); }
.author-box { margin-top: 32px; background: var(--ink); color: var(--paper); padding: 24px; display: flex; gap: 18px; font-size: 15px; line-height: 1.55; }
.author-box .avatar { width: 64px; height: 64px; background: #4E493F; }
.author-box a { color: var(--signal-light); font-weight: 700; }
.rail { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 32px; font-size: 15px; }
.rail h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 18px; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li a { display: block; padding: 11px 0; border-bottom: 1px solid var(--stone); font-weight: 600; line-height: 1.4; }
.rail .newsletter h2 { border: 0; padding: 0; font-size: 22px; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.related .ph { aspect-ratio: 16 / 9; background: var(--sand); }
.related .title { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.2; margin-top: 12px; }

/* ---------- Forms (write for us) ---------- */
.form-card { background: var(--white); padding: 28px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field textarea, .field select {
  min-height: 44px; border: 2px solid var(--ink); background: var(--white); padding: 10px 12px; font-weight: 400; font-size: 16px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field .hint { font-weight: 400; color: var(--slate); font-size: 13px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid var(--ink); font-size: 14px; font-weight: 700; }
.chips input:checked + span { background: var(--ink); color: var(--paper); }
.chips input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps > div { background: var(--white); padding: 22px; }
.steps .n { font-family: var(--font-display); font-weight: 900; font-size: 28px; color: var(--signal-deep); }
.steps h3 { margin: 6px 0; font-size: 18px; }
.steps p { margin: 0; font-size: 14px; color: var(--body-2); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .site-header { padding-top: 14px; }
  .masthead { align-items: center; padding-bottom: 12px; }
  .logo { font-size: 28px; }
  .menu-toggle { display: inline-flex; }
  .primary-nav { order: 3; width: 100%; }
  .primary-nav[data-open="false"] { display: none; }
  .primary-nav ul { flex-direction: column; gap: 0; padding: 0; }
  .primary-nav a { display: block; padding: 12px 0; border-top: 1px solid var(--stone); font-size: 16px; }
  .header-actions .btn { display: none; }
  .news-strip a:not(:first-of-type):not(.more) { display: none; }
  .cover { min-height: 460px; padding: 22px; }
  .tab-desc { margin-left: 0; width: 100%; }
  .series { min-height: 0; padding: 24px; }
  .topic-name { flex-basis: 100%; }
  .story-row .topic, .story-row .by { width: auto; padding-top: 0; }
  .three-q > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--stone); }
  .short-version dl { grid-template-columns: 1fr; gap: 4px; }
  .short-version dd { margin-bottom: 10px; }
  .share { margin-left: 0; }
  .cta-band { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
.rail li > span { display: block; padding: 11px 0; border-bottom: 1px solid var(--stone); font-weight: 600; line-height: 1.4; }
