/* ==========================================================================
   CubanPress.org — "Paper for the record, terminal for the live feed."
   Aged newsprint ground · ink type · proofreader's red as the only accent.
   Technical modules appear as dark inset panels embedded in the paper.
   ========================================================================== */

:root {
  /* ink & paper */
  --paper:      #f4f1e9;
  --paper-2:    #eee9dd;
  --card:       #fbf9f4;
  --ink:        #17140f;
  --ink-soft:   #3d372e;
  --muted:      #6d6455;
  --faint:      #9a9082;
  --rule:       #ddd6c6;
  --rule-soft:  #e8e2d5;

  /* the one accent: correction red */
  --red:        #b32c17;
  --red-soft:   rgba(179, 44, 23, .10);

  /* terminal panels */
  --term:       #14120f;
  --term-2:     #1d1a15;
  --term-ink:   #e9e3d6;
  --term-muted: #8d8474;
  --term-rule:  #2e2a22;
  --term-red:   #ef6b4e;
  --term-green: #8fbf7a;

  --display: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans:  "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 62ch;
  --gutter: clamp(20px, 5vw, 64px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  /* faint paper tooth */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0,0,0,.014) 0 1px, transparent 1px),
    radial-gradient(circle at 68% 74%, rgba(0,0,0,.012) 0 1px, transparent 1px);
  background-size: 43px 43px, 67px 67px;
}

/* ---------- structure ---------- */

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 680px; }
.prose { max-width: var(--measure); }

section { padding-block: clamp(38px, 6vw, 76px); }
section + section { border-top: 1px solid var(--rule-soft); }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(31px, 5.1vw, 55px); line-height: 1.08; }
h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin-bottom: 14px; }
h3 { font-size: clamp(19px, 2.4vw, 23px); line-height: 1.2; margin-bottom: 6px; }

p { margin: 0 0 16px; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); color: var(--red); }
strong { font-weight: 600; }
em { font-style: italic; }

.lede {
  font-size: clamp(19px, 2.3vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 58ch;
}

.eyebrow {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.kicker { font: 500 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }

.mono { font-family: var(--mono); }
.small { font-size: 14.5px; }
.muted { color: var(--muted); }

/* ---------- header / footer ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head .bar {
  display: flex; align-items: center; gap: 18px;
  min-height: 58px;
}
.brand {
  font-family: var(--display); font-size: 22px; letter-spacing: -.015em;
  text-decoration: none; white-space: nowrap;
}
.brand .dot { color: var(--red); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font: 500 13px/1 var(--mono); letter-spacing: .03em;
  padding: 12px 11px; border-radius: 4px; text-decoration: none; color: var(--ink-soft);
  white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--red); }
.lang {
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0 12px;
  min-height: 34px; display: inline-flex; align-items: center; text-decoration: none; color: var(--muted);
}
.lang:hover { border-color: var(--red); color: var(--red); }

.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 40px 56px;
  font-size: 14.5px; color: var(--muted);
}
.site-foot .cols { display: flex; flex-wrap: wrap; gap: 28px 56px; align-items: flex-start; }
.site-foot a { text-decoration: none; }
.site-foot .fnav { display: grid; gap: 7px; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(44px, 8vw, 92px) clamp(30px, 5vw, 56px); }
.hero h1 { margin-bottom: 20px; }
.hero h1 .red { color: var(--red); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 60px); align-items: start; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  font: 500 14px/1 var(--mono); letter-spacing: .02em;
  border-radius: 3px; text-decoration: none; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  transition: transform .12s ease, background .18s ease;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); background: var(--paper-2); color: var(--ink); }

/* ---------- the signature element: diff panel (terminal in paper) ---------- */

.term {
  background: var(--term);
  color: var(--term-ink);
  border-radius: 6px;
  border: 1px solid var(--term-rule);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(23,20,15,.08), 0 18px 40px -28px rgba(23,20,15,.5);
}
.term-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--term-2);
  border-bottom: 1px solid var(--term-rule);
  font: 500 11.5px/1.4 var(--mono); letter-spacing: .04em; color: var(--term-muted);
}
.term-head .src { color: var(--term-ink); }
.term-head .spacer { flex: 1; }
.term-body { padding: 16px 18px; font: 400 14px/1.62 var(--mono); }
.term-body p { margin: 0 0 10px; }
.term-body p:last-child { margin-bottom: 0; }

.del { color: var(--term-red); text-decoration: line-through; text-decoration-thickness: 1px; }
.ins { color: var(--term-green); }
.tag {
  display: inline-block; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 3px; border: 1px solid currentColor;
}
.tag.red { color: var(--term-red); }
.tag.green { color: var(--term-green); }

/* live dot */
.live { display: inline-flex; align-items: center; gap: 7px; }
.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--term-green); box-shadow: 0 0 0 0 rgba(143,191,122,.55);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143,191,122,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(143,191,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(143,191,122,0); }
}
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }

/* ---------- cards / grids ---------- */

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 22px 22px 24px;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card .num {
  font: 400 clamp(30px, 4vw, 40px)/1 var(--display);
  color: var(--red); display: block; margin-bottom: 6px;
}

/* numbered feature rows */
.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 62px 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.row .idx { font: 400 26px/1 var(--display); color: var(--red); padding-top: 2px; }
.row p:last-child { margin-bottom: 0; }

/* quote / pull */
.pull {
  border-left: 2px solid var(--red);
  padding: 4px 0 4px 20px;
  margin: 26px 0;
  font-family: var(--display);
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.28;
  max-width: 48ch;
}

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
.stat { background: var(--card); padding: 18px 20px; }
.stat b { display: block; font: 400 clamp(26px, 3.4vw, 34px)/1.05 var(--display); color: var(--ink); margin-bottom: 5px; }
.stat span { font: 500 11.5px/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* roadmap */
.road { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.road-item {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 18px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.road-item .when { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.road-item .what strong { font-weight: 600; }
.road-item .state {
  font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 3px; white-space: nowrap;
}
.state.done { color: var(--red); background: var(--red-soft); }
.state.next { color: var(--muted); border: 1px solid var(--rule); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 6px 0 18px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { font: 500 11.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* misc */
ul.tight { margin: 0 0 16px; padding-left: 1.1em; display: grid; gap: 8px; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 30px 0; }

.note {
  border: 1px solid var(--rule); border-left: 2px solid var(--red);
  background: var(--card); border-radius: 0 5px 5px 0;
  padding: 18px 20px; font-size: 15.5px;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- page-load reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(10px); animation: rise .62s cubic-bezier(.2,.7,.3,1) forwards; }
  .reveal:nth-child(2) { animation-delay: .07s; }
  .reveal:nth-child(3) { animation-delay: .14s; }
  .reveal:nth-child(4) { animation-delay: .21s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body { font-size: 16.5px; }
  .road-item { grid-template-columns: 1fr auto; }
  .road-item .when { grid-column: 1 / -1; }
  .row { grid-template-columns: 40px 1fr; gap: 14px; }
  .cta-row .btn { width: 100%; justify-content: center; }
  .site-foot .cols { gap: 22px; }
}
