/* Byteperform — site-wide styles */
:root {
  --ink: #17161a;
  --bone: #f4f1ea;
  --paper: #ffffff;
  --blue: #2547ff;
  --red: #c8102e;
  --rule: rgba(23,22,26,0.14);
  --rule-strong: rgba(23,22,26,0.22);
  --muted: rgba(23,22,26,0.58);
  --muted-2: rgba(23,22,26,0.42);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
}
::selection { background: var(--blue); color: var(--bone); }
::-moz-selection { background: var(--blue); color: var(--bone); }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Keyboard focus — visible, branded, skipped for mouse */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 1px;
}
a:focus-visible, button:focus-visible { outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 2px rgba(37,71,255,0.2);
}
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Paper grain — a subtle multiply-blended noise overlay on everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }

/* ── Layout ───────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.shell { max-width: 1180px; margin: 0 auto; padding: 0 48px; width: 100%; }
.row { display: flex; align-items: center; }

/* ── Nav ──────────────────────────── */
.nav {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--bone); z-index: 10;
}
.nav .shell { justify-content: space-between; display: flex; align-items: center; }
.nav .links { display: flex; gap: 28px; font-size: 13px; color: var(--muted); }
.nav .links a { padding: 4px 0; position: relative; }
.nav .links a.active { color: var(--ink); font-weight: 500; }
.nav .links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav .links a:hover { color: var(--blue); }
.nav .links a:hover::after { transform: scaleX(1); }
.nav .links a.active::after { transform: scaleX(1); background: var(--ink); }
.nav .cta { font-weight: 500; color: var(--ink); }

/* ── Wordmark ─────────────────────── */
.wm {
  display: inline-flex; align-items: baseline;
  font-family: var(--mono); font-weight: 500;
  font-size: 17px; letter-spacing: -0.01em; color: var(--ink);
  line-height: 1;
}
.wm .br { color: var(--blue); font-weight: 400; }
.wm .b { margin: 0 0.04em; }
.wm .rest { margin-left: 0.08em; }
.wm .slash { opacity: 0.35; margin: 0 0.08em; }

/* ── Hero + eyebrow + headlines ─── */
.eyebrow {
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3 { font-family: var(--mono); font-weight: 500; letter-spacing: -0.03em; margin: 0; overflow-wrap: break-word; }
h1 { font-size: 56px; line-height: 1.05; }
h2 { font-size: 36px; line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }

/* Hero headline — scales up on wide screens, never breaks words mid-hyphen */
.hero-h1 {
  font-size: clamp(44px, 5.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  hyphens: none;
  overflow-wrap: normal;
}
.hero-h1 .bw { display: inline-block; }
.nowrap { white-space: nowrap; }
.em-blue { color: var(--blue); font-style: italic; font-weight: 400; }
.em-red { color: var(--red); font-weight: 500; }
.stamp {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--red); border: 1px solid var(--red); background: transparent;
  font-weight: 500; font-family: var(--mono);
}
.stamp::before {
  content: ""; width: 6px; height: 6px; background: var(--red); border-radius: 50%;
  animation: bp-pulse 2s ease-in-out infinite;
}
@keyframes bp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) { .stamp::before { animation: none; } }
.lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 640px; }

/* ── Sections ─────────────────────── */
section { padding: 96px 0; border-bottom: 2px solid rgba(23,22,26,0.18); position: relative; }
section::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  border-bottom: 1px solid var(--rule);
  pointer-events: none;
}
section.tight { border-bottom: 0; padding: 64px 0; }
section.tight::after { display: none; }
section.hero { padding: 120px 0 140px; }
.section-head {
  display: grid; grid-template-columns: 200px 1fr; gap: 40px;
  margin-bottom: 56px;
}
.section-head .idx {
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); padding-top: 6px;
}

/* ── Cards / grids ────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.card {
  padding: 28px; background: var(--paper);
  border: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 14px;
}
.card .tag {
  font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
}
.card h3 { margin-top: 4px; }
.card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }

/* ── Footer ───────────────────────── */
footer {
  margin-top: auto; padding: 60px 0 36px;
  background: var(--ink); color: var(--bone);
  border-bottom: none;
}
footer .shell { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
footer .wm { color: var(--bone); }
footer a { color: rgba(244,241,234,0.65); font-size: 13px; }
footer a:hover { color: var(--bone); }
footer .col { display: flex; flex-direction: column; gap: 10px; }
footer .col .h {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(244,241,234,0.45); margin-bottom: 6px;
}
footer .base {
  grid-column: 1 / -1; margin-top: 40px; padding-top: 24px;
  border-top: 1px solid rgba(244,241,234,0.14);
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.08em; color: rgba(244,241,234,0.5);
}

/* ── Misc ─────────────────────────── */
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.divider-label {
  display: flex; align-items: center; gap: 16px;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; border-top: 1px solid var(--rule);
}
.pill {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--rule-strong);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink); background: var(--paper);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}
a.pill:hover {
  border-color: var(--blue); color: var(--blue);
  transform: translateY(-1px);
}

/* Cards gain a subtle lift on hover */
.card { transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 220ms ease, box-shadow 220ms ease; }
a.card:hover, a > .card:hover, .card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: 0 8px 30px -18px rgba(23,22,26,0.25);
}
.kicker-blue { display: inline-block; width: 8px; height: 8px; background: var(--blue); margin-right: 10px; transform: translateY(-2px); }

/* ── Forms ────────────────────────── */
label.field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
label.field input,
label.field select,
label.field textarea {
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-strong);
  padding: 12px 14px; border-radius: 0;
  outline: none; letter-spacing: normal; text-transform: none;
}
label.field input:focus,
label.field select:focus,
label.field textarea:focus { border-color: var(--blue); }
label.field textarea { min-height: 140px; resize: vertical; }
button.btn {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--bone); border: 0;
  padding: 14px 22px; cursor: pointer; letter-spacing: 0.06em;
}
button.btn:hover { background: var(--blue); }

/* ── Serif for long-form pages (Legal) ── */
.prose { font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--ink); max-width: 720px; }
.prose h2 { font-family: var(--mono); font-size: 22px; margin: 48px 0 16px; }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 18px; }
.prose li { margin-bottom: 8px; }

/* ── Page signatures ──────────────── */
.dateline {
  display: flex; align-items: center; gap: 14px;
  font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted); padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.dateline .no { color: var(--ink); font-weight: 500; }
.dateline .dot { width: 4px; height: 4px; background: var(--blue); }

.ascii {
  font-family: var(--mono); font-size: 11px; line-height: 1.5;
  color: var(--muted-2); white-space: pre; letter-spacing: 0;
}

.bar { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.bar i {
  display: inline-block; width: 4px; background: var(--ink);
}

.issue-stamp {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 6px 12px;
}
.issue-stamp .sq { width: 6px; height: 6px; background: var(--blue); }

.marginalia {
  font-family: var(--serif); font-style: italic;
  font-size: 15px; color: var(--muted); line-height: 1.6;
  padding-left: 16px; border-left: 2px solid var(--blue);
}

.tick-row {
  display: flex; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.tick-row::-webkit-scrollbar { display: none; }
.tick-row span { padding: 0 28px; border-right: 1px solid var(--rule); }
.tick-row span:last-child { border-right: 0; }
.tick-row b { color: var(--ink); font-weight: 500; margin-right: 8px; }

/* ── Timeline (About) ────────────── */
.timeline { display: block; position: relative; }
.timeline .year { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.timeline .item { padding: 28px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 120px 1fr; gap: 40px; }
.timeline .item:last-child { border-bottom: 1px solid var(--rule); }
.timeline .item .tag-sm { font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }

/* ── Reusable column splits with mobile collapse ── */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.case-row { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 48px 0; border-bottom: 1px solid var(--rule); }
.case-row:last-child { border-bottom: 0; }
.role-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: center; transition: background 120ms ease; }
.role-row:hover { background: rgba(37,71,255,0.04); }
.contact-shell { display: grid; grid-template-columns: 220px 1fr; gap: 64px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Column rules — newspaper-style vertical divider in 2-col sections ── */
.col-ruled { gap: 0 !important; }
.col-ruled > div { padding: 0 32px; }
.col-ruled > div:nth-child(2n+1) { padding-left: 0; }
.col-ruled > div:nth-child(2n) { border-left: 1px solid var(--rule); }

/* ── Standfirst — serif italic pull paragraph, newspaper-standfirst style ── */
.standfirst {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 22px; line-height: 1.5; color: var(--ink);
  max-width: 720px; letter-spacing: -0.005em;
  padding: 40px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.standfirst::first-letter {
  font-weight: 500; font-style: normal; font-family: var(--serif);
  color: var(--blue); font-size: 2.2em; float: left; line-height: 0.9;
  padding: 0.15em 0.1em 0 0;
}

/* ── Colophon row in footer ── */
.colophon {
  grid-column: 1 / -1;
  padding: 18px 0 0;
  font-family: var(--serif); font-style: italic;
  font-size: 13px; color: rgba(244,241,234,0.42);
  letter-spacing: 0.01em;
}
.colophon .sep { margin: 0 10px; color: rgba(244,241,234,0.25); }

/* ── Marquee ticker ── */
.tick-row { overflow: hidden; padding: 0; position: relative; }
.tick-track {
  display: inline-flex; min-width: 200%;
  padding: 12px 0;
  animation: bp-tick 60s linear infinite;
  white-space: nowrap;
}
.tick-row:hover .tick-track { animation-play-state: paused; }
.tick-track span { padding: 0 28px; border-right: 1px solid var(--rule); flex-shrink: 0; }
.tick-track b { color: var(--ink); font-weight: 500; margin-right: 8px; }
@keyframes bp-tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .tick-track { animation: none; }
}

/* ── Running numbers sidebar ────── */
.running-nos {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  color: var(--muted-2); text-transform: uppercase; writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ── Drop caps — editorial opening paragraph ── */
.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 500; font-style: normal;
  color: var(--blue);
  font-size: 3.4em; line-height: 0.85;
  float: left;
  padding: 0.08em 0.12em 0 0;
  margin-top: 0.05em;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(12px);
  transition: opacity 800ms cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 800ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; filter: none; transform: none; transition: none; }
}

/* ── Front-page modular grid ── */
.frontpage {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  padding: 72px 0 56px;
  border-bottom: 2px solid rgba(23,22,26,0.18);
  position: relative;
}
.frontpage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px;
  border-bottom: 1px solid var(--rule);
}
.frontpage .lead { padding-right: 20px; border-right: 1px solid var(--rule); }
.frontpage .rail { display: flex; flex-direction: column; gap: 28px; }
.frontpage .rail-item { padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.frontpage .rail-item:last-child { border-bottom: 0; padding-bottom: 0; }
.frontpage .rail-item .kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--red); font-weight: 500; margin-bottom: 8px;
}
.frontpage .rail-item h4 {
  font-family: var(--mono); font-size: 17px; font-weight: 500; letter-spacing: -0.015em;
  margin: 0 0 8px; line-height: 1.25;
}
.frontpage .rail-item p {
  margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55;
}

.bulletin-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 28px 0;
  border-bottom: 2px solid rgba(23,22,26,0.18);
  position: relative;
}
.bulletin-row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px;
  border-bottom: 1px solid var(--rule);
}
.bulletin-row > div {
  padding: 0 28px;
  border-right: 1px solid var(--rule);
}
.bulletin-row > div:first-child { padding-left: 0; }
.bulletin-row > div:last-child { border-right: 0; padding-right: 0; }
.bulletin-row .bnum {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.bulletin-row .btitle {
  font-family: var(--mono); font-weight: 500; font-size: 15px; margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.bulletin-row .btext {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--muted); line-height: 1.55;
}

/* ── Masthead stat bar with odometer counters ── */
.statbar {
  display: flex; gap: 48px; flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
}
.statbar .stat { display: inline-flex; gap: 10px; align-items: baseline; }
.statbar .stat .val {
  color: var(--ink); font-weight: 500; font-size: 16px; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.statbar .stat .suffix { color: var(--muted-2); }
.odometer { font-variant-numeric: tabular-nums; }

/* ── Typewriter (CSS-only, mono-width) ── */
.typewrite {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid currentColor;
  vertical-align: bottom;
  width: 0;
  animation: bp-type 1.9s steps(22, end) 0.3s forwards,
             bp-caret 0.7s step-end 2.3s infinite;
}
@keyframes bp-type { from { width: 0; } to { width: 22ch; } }
@keyframes bp-caret { 50% { border-right-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .typewrite { animation: none; width: auto; border-right: 0; }
}

/* ── Ink stamp — rotated, outlined, red ── */
.case-row { position: relative; }
.ink-stamp {
  position: absolute; top: 40px; right: 8px;
  color: var(--red); border: 2px solid var(--red);
  padding: 10px 16px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.3em; text-transform: uppercase;
  transform: rotate(-7deg);
  opacity: 0.78;
  pointer-events: none;
  background: rgba(244,241,234,0.6);
  line-height: 1;
  display: inline-flex; align-items: center; gap: 8px;
}
.ink-stamp::after {
  content: ""; width: 6px; height: 6px; background: var(--red);
}

/* ── Hero blur-in (one moment, on load) ── */
.blur-in .bw {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.3em);
  animation: bp-blurin 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--bw-d, 0ms);
}
.blur-in .bw + .bw { margin-left: 0.28em; }
.blur-in-line {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(8px);
  animation: bp-blurin 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--bw-d, 0ms);
}
@keyframes bp-blurin {
  0%   { opacity: 0; filter: blur(10px); transform: translateY(0.3em); }
  60%  { opacity: 0.6; filter: blur(3px); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .blur-in .bw, .blur-in-line {
    opacity: 1; filter: none; transform: none; animation: none;
  }
}

/* ── Mobile-ish collapse ──────────── */
@media (max-width: 820px) {
  .shell { padding: 0 24px; }
  h1 { font-size: 38px; }
  h2 { font-size: 26px; }
  section { padding: 64px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  footer .shell { grid-template-columns: 1fr 1fr; }
  .nav .links { display: none; }
  .split-2, .case-row, .contact-shell, .form-row { grid-template-columns: 1fr; gap: 24px; }
  .role-row { grid-template-columns: 1fr; gap: 8px; }
  .timeline .item { grid-template-columns: 1fr; gap: 12px; }
  .marginalia-fixed { display: none; }
  .frontpage { grid-template-columns: 1fr; gap: 32px; }
  .frontpage .lead { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 32px; }
  .bulletin-row { grid-template-columns: 1fr; gap: 20px; }
  .bulletin-row > div { padding: 0; border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 20px; }
  .bulletin-row > div:last-child { border-bottom: 0; padding-bottom: 0; }
  .col-ruled > div:nth-child(2n) { border-left: 0; padding-left: 0; }
  .col-ruled > div { padding: 0; }
}
