/* ─────────── identity: ROSSO ───────────
   Near-black ground, one uncompromising red (#e3001b), off-white type.
   Display: Bricolage Grotesque (condensed, heavy) · Text: Hanken Grotesk
   Catalogue marks: Martian Mono. Outlined type as a recurring motif.      */

:root {
  --bg: #0d0a0a;
  --bg-2: #171212;
  --fg: #f3ecea;
  --fg-2: #b8aaa7;
  --mute: #7a6c69;
  --rule: #2b2222;
  --red: #e3001b;
  --red-hot: #ff2a3d;
  --on-red: #0d0a0a;
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --w: 1240px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--red); color: var(--on-red); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; font-stretch: 87.5%; }
/* outline drawn with shadows (text-stroke shows variable-font overlap seams) */
.outline {
  --o: var(--fg); --f: var(--bg); --t: 2px;
  color: var(--f);
  text-shadow:
    var(--t) 0 0 var(--o), calc(var(--t) * -1) 0 0 var(--o), 0 var(--t) 0 var(--o), 0 calc(var(--t) * -1) 0 var(--o),
    calc(var(--t) * .7) calc(var(--t) * .7) 0 var(--o), calc(var(--t) * -.7) calc(var(--t) * .7) 0 var(--o),
    calc(var(--t) * .7) calc(var(--t) * -.7) 0 var(--o), calc(var(--t) * -.7) calc(var(--t) * -.7) 0 var(--o);
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ─────────── top bar ─────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.mark {
  text-decoration: none; display: flex; align-items: center; gap: 10px;
  font: 800 22px/1 var(--display); font-stretch: 75%; letter-spacing: -.01em;
}
.mark-sq { width: 14px; height: 14px; background: var(--red); display: inline-block; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.mark:hover .mark-sq { transform: rotate(45deg); }
.mark span:last-child { font: 400 11px var(--mono); color: var(--mute); }
.topbar nav { display: flex; gap: 28px; font: 500 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.topbar nav a { text-decoration: none; position: relative; }
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--red); transition: right .25s ease;
}
.topbar nav a:hover::after { right: 0; }
.topbar nav { align-items: center; }
.lang-switch { display: inline-flex; border: 1px solid var(--rule); margin-left: 4px; }
.lang-switch b, .lang-switch a { padding: 4px 8px; font-weight: 500; letter-spacing: .04em; }
.lang-switch b { background: var(--red); color: var(--on-red); }
.lang-switch a { color: var(--fg-2); }
.lang-switch a::after { display: none; }
.lang-switch a:hover { color: var(--fg); background: var(--bg-2); }

main, .footer { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }

/* ─────────── hero: full-bleed red ─────────── */
.hero {
  position: relative; color: var(--on-red); background: var(--red);
  box-shadow: 0 0 0 100vmax var(--red); clip-path: inset(0 -100vmax);
  padding: clamp(60px, 12vw, 150px) 0 clamp(50px, 8vw, 100px);
}
.neural { /* living neural network, see static/neural.js */
  position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; height: 100%;
  pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.8) 0%, #000 45%);
          mask-image: linear-gradient(to right, rgba(0,0,0,.8) 0%, #000 45%);
}
.eyebrow { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.dot { width: 8px; height: 8px; background: var(--on-red); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.hero-name {
  font: 800 clamp(72px, 15vw, 210px)/.86 var(--display); font-stretch: 75%;
  letter-spacing: -.015em; text-transform: uppercase; margin: 28px 0 36px; position: relative; z-index: 1;
}
.hero-name .outline { --o: var(--on-red); --f: var(--red); --t: 2.5px; letter-spacing: .02em; }
.section-title .outline, .hero-name .outline { display: inline-block; }
.hero-line {
  font: 500 clamp(22px, 2.6vw, 34px)/1.2 var(--display); max-width: 22em; letter-spacing: -.01em;
  position: relative; z-index: 1;
}
.hero-stats { display: flex; gap: 40px; margin-top: 48px; text-transform: uppercase; position: relative; z-index: 1; }
.hero-stats b {
  display: block; font: 800 44px/1 var(--display); font-stretch: 75%;
  letter-spacing: -.02em; margin-bottom: 6px;
}

/* ─────────── ticker ─────────── */
.ticker {
  overflow: hidden; border-bottom: 1px solid var(--rule); white-space: nowrap;
  margin: 0 calc(50% - 50vw); padding: 14px 0; background: var(--bg);
}
.ticker-track { display: inline-flex; animation: scroll 40s linear infinite; }
.ticker span {
  font: 800 22px/1 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: .02em; padding-right: .4em;
}
.ticker i { font-style: normal; color: var(--red); padding: 0 .5em; font-size: .55em; vertical-align: .25em; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ─────────── about ─────────── */
.about {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(24px, 4vw, 64px);
  padding: 72px 0; border-bottom: 1px solid var(--rule);
}
.label { color: var(--red); text-transform: uppercase; font-weight: 500; margin-bottom: 18px; }
.lead { font: 500 24px/1.3 var(--display); letter-spacing: -.01em; }
.about p { color: var(--fg-2); }
.about .lead { color: var(--fg); }
.now { list-style: none; }
.now li { padding: 10px 0; border-top: 1px solid var(--rule); color: var(--fg-2); }
.now li:last-child { border-bottom: 1px solid var(--rule); }
.now li::before { content: "■ "; color: var(--red); font-size: 10px; vertical-align: 2px; }

/* ─────────── featured ─────────── */
.featured { padding: 72px 0 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); border: 1px solid var(--fg); }
.feature {
  --x: 100%; --y: 100%;
  display: flex; flex-direction: column; gap: 14px; min-height: 300px; padding: 28px;
  text-decoration: none; border-right: 1px solid var(--fg); position: relative; overflow: hidden;
  isolation: isolate; transition: color .35s;
}
/* red ink spreading from where the cursor entered */
.feature::before {
  content: ""; position: absolute; inset: 0; background: var(--red); z-index: -2;
  clip-path: circle(0% at var(--x) var(--y)); transition: clip-path .6s cubic-bezier(.7,0,.2,1);
}
.feature:hover::before { clip-path: circle(160% at var(--x) var(--y)); }
/* giant outlined entry number rising from the bottom */
.feature::after {
  content: var(--big); position: absolute; right: -.04em; bottom: -.36em; z-index: -1;
  font: 800 200px/1 var(--display); font-stretch: 75%; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 2px var(--on-red);
  transform: translateY(40%); opacity: 0;
  transition: transform .7s cubic-bezier(.2,.7,.2,1) .08s, opacity .4s .08s;
}
.feature:hover::after { transform: translateY(0); opacity: 1; }
.feature:last-child { border-right: 0; }
.feature h3 {
  font: 800 34px/1 var(--display); font-stretch: 75%; letter-spacing: -.015em; text-transform: uppercase;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.feature:hover h3 { transform: translateX(10px); }
.feature h3::before {
  content: "→"; display: inline-block; width: 0; overflow: hidden; vertical-align: top; white-space: nowrap;
  transition: width .4s cubic-bezier(.2,.7,.2,1);
}
.feature:hover h3::before { width: 1.15em; }
.feature p { color: var(--fg-2); font-size: 15px; flex: 1; transition: color .35s; max-width: 32ch; }
.feature .num { color: var(--red); transition: color .35s; }
.feature-foot { display: flex; justify-content: space-between; color: var(--mute); transition: color .35s; }
.feature:hover, .feature:hover p, .feature:hover .num, .feature:hover .feature-foot { color: var(--on-red); }
.feature:hover .star.on { color: var(--on-red); }
.feature:hover .star { color: rgba(13,10,10,.3); }

/* ─────────── index ─────────── */
.index { padding: 96px 0 120px; }
.index-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.section-title {
  font: 800 clamp(56px, 8vw, 110px)/.9 var(--display); font-stretch: 75%;
  letter-spacing: -.01em; text-transform: uppercase;
}
.section-title .outline { --o: var(--red); --f: var(--bg); --t: 2px; letter-spacing: .02em; }
.legend { display: flex; gap: 20px; color: var(--mute); }
.legend span { white-space: nowrap; }

.filters {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  padding: 14px 0; border-top: 2px solid var(--red); border-bottom: 1px solid var(--rule);
  position: sticky; top: 59px; z-index: 5; background: var(--bg);
}
.seg button, .tag, #sort, #q {
  font: 500 11px var(--mono); font-stretch: 87.5%; color: var(--fg); background: transparent; border: 0; cursor: pointer;
}
.seg { display: inline-flex; border: 1px solid var(--fg); }
.seg button { padding: 7px 14px; }
.seg button + button { border-left: 1px solid var(--fg); }
.seg button.on { background: var(--red); color: var(--on-red); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 6px 10px; border: 1px solid var(--rule); color: var(--fg-2); transition: all .2s; }
.tag:hover { border-color: var(--red); color: var(--fg); }
.tag.on { background: var(--red); border-color: var(--red); color: var(--on-red); }
.filters .right { margin-left: auto; display: flex; gap: 10px; }
#q { border-bottom: 1px solid var(--fg); padding: 6px 2px; width: 160px; outline: none; cursor: text; }
#q::placeholder { color: var(--mute); }
#q:focus { border-color: var(--red); }
#sort { border: 1px solid var(--rule); padding: 6px 8px; }
#sort option { background: var(--bg); }

.entries { list-style: none; }
.entry { border-bottom: 1px solid var(--rule); animation: rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.entry-link {
  display: grid; grid-template-columns: 70px 80px 1fr auto 30px; gap: 24px; align-items: baseline;
  padding: 26px 0; text-decoration: none; position: relative; isolation: isolate;
}
.entry-link::before {
  content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.7,0,.2,1); z-index: -1;
}
.entry-link:hover::before { transform: scaleX(1); }
.entry-link > * { transition: color .25s; }
.entry .num { color: var(--red); }
.entry .date { color: var(--mute); text-transform: uppercase; }
.entry .body { display: flex; flex-direction: column; gap: 6px; }
.entry .title {
  font: 800 clamp(26px, 3vw, 36px)/1 var(--display); font-stretch: 75%;
  letter-spacing: -.015em; text-transform: uppercase;
}
.entry .summary { color: var(--fg-2); max-width: 62ch; font-size: 15px; transition: color .25s; }
.entry-tags { color: var(--mute); transition: color .25s; }
.arrow { font-size: 22px; transition: transform .25s, color .25s; color: var(--mute); }
.entry-link:hover, .entry-link:hover .num, .entry-link:hover .date, .entry-link:hover .summary,
.entry-link:hover .entry-tags, .entry-link:hover .arrow { color: var(--on-red); }
.entry-link:hover .arrow { transform: translateX(6px); }
.entry-link:hover .star.on { color: var(--on-red); }
.entry-link:hover .star { color: rgba(13,10,10,.3); }
.entry-link:hover .badge { border-color: var(--on-red); color: var(--on-red); }
.badge { font-size: 9px; text-transform: uppercase; border: 1px solid var(--red); color: var(--red); padding: 3px 6px; vertical-align: middle; letter-spacing: .06em; }
.empty { padding: 60px 0; color: var(--mute); text-align: center; }

.stars { white-space: nowrap; font-size: 15px; letter-spacing: 2px; }
.star { color: var(--rule); }
.star.on { color: var(--red); }

/* ─────────── article ─────────── */
.article { max-width: 760px; margin: 0 auto; padding: 64px 0 100px; }
.back { text-decoration: none; color: var(--mute); }
.back:hover { color: var(--red); }
.article-head { padding: 48px 0 40px; border-bottom: 2px solid var(--red); margin-bottom: 48px; }
.article-head .num { color: var(--red); }
.article h1 {
  font: 800 clamp(48px, 7vw, 88px)/.92 var(--display); font-stretch: 75%;
  letter-spacing: -.01em; text-transform: uppercase; margin: 18px 0 24px;
}
.article-summary { font: 500 24px/1.3 var(--display); color: var(--fg-2); letter-spacing: -.01em; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-top: 36px; }
.meta dt { color: var(--mute); text-transform: uppercase; margin-bottom: 4px; }
.meta dd a { text-decoration-color: var(--red); text-underline-offset: 3px; }

.prose { font-size: 17px; line-height: 1.75; color: #ddd3d0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font: 800 36px/1 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: -.02em;
  margin-top: 2em; color: var(--fg);
}
.prose h2::before { content: ""; display: inline-block; width: .38em; height: .38em; background: var(--red); margin-right: .3em; vertical-align: .12em; }
.prose h3 { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--red); margin-top: 1.8em; }
.prose strong { color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--red); }
.prose a { text-decoration-color: var(--red); text-underline-offset: 3px; }
.prose code { font: 13px var(--mono); background: var(--bg-2); border: 1px solid var(--rule); padding: 1px 5px; }
.prose pre { background: var(--bg-2); border-left: 3px solid var(--red); padding: 20px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { border-left: 3px solid var(--red); padding-left: 18px; font: 500 22px/1.35 var(--display); color: var(--fg); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; }
.prose img { max-width: 100%; }

.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; color: var(--fg-2); }
.pager a:hover { color: var(--red); }

/* ─────────── footer ─────────── */
.footer { padding-top: 80px; padding-bottom: 40px; border-top: 2px solid var(--red); }
.footer-big {
  font: 800 clamp(64px, 12vw, 180px)/.88 var(--display); font-stretch: 75%;
  letter-spacing: -.015em; text-transform: uppercase;
}
.footer-big em { font-style: normal; color: var(--red); }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 32px; margin: 40px 0 60px; font-size: 18px; }
.footer-links a { text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.footer-links a:hover { color: var(--red); }
.colophon { color: var(--mute); }

/* ─────────── responsive ─────────── */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .feature { border-right: 0; border-bottom: 1px solid var(--fg); }
  .feature:last-child { border-bottom: 0; }
  .entry-link { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .entry .num, .entry .date { grid-row: 1; }
  .entry .date { justify-self: end; }
  .entry .body { grid-column: 1 / -1; }
  .arrow { display: none; }
  .filters { position: static; }
  .filters .right { margin-left: 0; width: 100%; }
  #q { flex: 1; }
  .topbar nav { gap: 16px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* keep small hero text crisp over the neural network */
.eyebrow, .hero-line, .hero-stats { text-shadow: 0 0 2px var(--red), 0 0 6px var(--red), 0 0 12px var(--red); }

/* GitHub call-to-action on project pages */
.meta dd { overflow-wrap: anywhere; }
.repo-btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 32px; padding: 12px 18px;
  background: var(--red); color: var(--on-red); text-decoration: none; font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--red);
  transition: background .25s, color .25s;
}
.repo-btn span { transition: transform .25s; }
.repo-btn:hover { background: transparent; color: var(--red); }
.repo-btn:hover span { transform: translate(3px, -3px); }
