@font-face {
  font-family: 'MiFuente';
  src: url('/font/RS_Xi.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── VARIABLES ── */
:root {
  --bg:        #0a0a09;
  --bg-1:      #111110;
  --bg-2:      rgba(255,255,255,0.04);
  --bg-3:      rgba(255,255,255,0.08);
  --text-0:    rgba(220, 218, 208, 0.92);
  --text-1:    rgba(180, 178, 165, 0.60);
  --text-2:    rgba(140, 138, 126, 0.42);
  --red:       #c0392b;
  --red-dim:   rgba(192, 57, 43, 0.55);
  --red-glow:  rgba(192, 57, 43, 0.18);
  --accent:    #c0392b;
  --border:    rgba(255, 255, 255, 0.07);
  --border-red: rgba(192, 57, 43, 0.30);
  --mono:      'JetBrains Mono', 'Courier New', monospace;
  --sans:      'Space Grotesk', Helvetica, sans-serif;
  --warez:     'MiFuente', 'JetBrains Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text-0);
  width: 100%;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(192,57,43,0.07), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(192,57,43,0.05), transparent 50%);
}

body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── NOISE CANVAS ── */
#noise-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  mix-blend-mode: screen;
  width: 100%; height: 100%;
}

/* ── SCANLINES ── */
.scanlines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 1px,
    transparent 1px, transparent 4px
  );
  opacity: 0.6;
}

/* ── HEADER ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 2.5rem;
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.site-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-0);
  font-family: var(--warez);
  font-size: 14px;
  letter-spacing: 0.1em;
  transition: opacity 0.2s;
}
.site-title:hover { opacity: 0.75; }

.logo-bracket {
  color: var(--red);
  font-size: 16px;
}
.logo-name {
  color: var(--text-0);
  letter-spacing: 0.14em;
  text-transform: lowercase;
}
.logo-sub {
  color: var(--text-2);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-left: 0.4rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-link {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: lowercase;
  color: var(--text-1);
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: var(--text-0);
  border-color: var(--border);
  background: var(--bg-2);
}

/* ── HERO ── */
.hero-group {
  padding: 5rem 0 3.5rem;
  position: relative;
  z-index: 10;
  border-bottom: none;
  margin-bottom: 0;
}
.hero-group::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-dim), transparent);
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red);
  text-transform: lowercase;
  margin-bottom: 1.8rem;
  animation: fadeInUp 0.6s ease both;
}

.hero-line {
  font-family: var(--warez);
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text-0);
  animation: fadeInUp 0.7s ease both;
}
.hero-line-2 {
  animation-delay: 0.1s;
  margin-bottom: 2.5rem;
}

.hero-word {
  display: inline-block;
  position: relative;
}
.hero-word::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity 0.3s, transform 0.4s;
}
.hero-line:hover .hero-word::after {
  opacity: 1;
  transform: scaleX(1);
}

.red { color: var(--red); }

.hero-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-1);
  letter-spacing: 0.1em;
  animation: fadeInUp 0.8s ease 0.2s both;
  margin-bottom: 2rem;
}
.hero-meta-sep { color: var(--red-dim); }

.hero-divi {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.15em;
  animation: fadeInUp 0.9s ease 0.3s both;
}
.hero-divi span {
  display: inline-block;
  animation: danceDot 3s ease-in-out infinite;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ARTICLES SECTION ── */
.articles-section {
  position: relative;
  z-index: 10;
  padding: 3rem 0 2rem;
  flex: 1;
}

.articles-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.articles-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: lowercase;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── ARTICLE ENTRY ── */
.article-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0;
  align-items: stretch;
  padding: 1.8rem 0 1.8rem 1.6rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  text-decoration: none;
  color: var(--text-0);
  transition: background 0.2s;
  border-left: 3px solid transparent;
  margin-left: -28px;
  padding-left: calc(28px + 1.4rem);
  animation: entryFadeIn 0.5s ease both;
}
.article-entry:nth-child(1) { animation-delay: 0.05s; }
.article-entry:nth-child(2) { animation-delay: 0.12s; }
.article-entry:nth-child(3) { animation-delay: 0.19s; }
.article-entry:nth-child(4) { animation-delay: 0.26s; }
.article-entry:nth-child(5) { animation-delay: 0.33s; }

@keyframes entryFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.article-entry::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  opacity: 0;
  transition: opacity 0.25s;
}
.article-entry:hover::before { opacity: 1; }
.article-entry:hover {
  background: linear-gradient(90deg, rgba(192,57,43,0.06), transparent 60%);
}

.entry-inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.entry-date {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-1);
  letter-spacing: 0.08em;
  display: block;
}

.entry-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.2s;
}
.article-entry:hover .entry-title { color: #fff; }

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.entry-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  text-transform: lowercase;
  transition: border-color 0.2s, color 0.2s;
}
.article-entry:hover .entry-tag {
  border-color: var(--border-red);
  color: var(--text-1);
}

.entry-arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text-2);
  align-self: center;
  padding-left: 1.5rem;
  transition: color 0.2s, transform 0.2s;
}
.article-entry:hover .entry-arrow {
  color: var(--red);
  transform: translate(3px,-3px);
}

/* ── LOADING STATE ── */
.loading-state {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 2rem 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.1em;
}
.loading-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: loadPulse 1.4s ease-in-out infinite;
}
@keyframes loadPulse {
  0%,100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ── EMPTY STATE ── */
.empty-state {
  padding: 3rem 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.1em;
}

/* ── FOOTER ── */
footer {
  position: relative; z-index: 10;
  border-top: 1px solid var(--border);
  padding: 1.8rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-sig {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  letter-spacing: 0.08em;
}
.footer-bracket { color: var(--red); }
.footer-link {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text-1); }

/* ══════════════════════════════════════════
   ARTICLE PAGE
══════════════════════════════════════════ */
body.article-page {
  max-width: 780px;
}

.article-main {
  position: relative; z-index: 10;
  padding: 0 0 4rem;
  flex: 1;
}

.article-header-block {
  padding: 4rem 0 2.5rem;
  border-bottom: none;
  margin-bottom: 3rem;
  position: relative;
}
.article-header-block::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent 80%);
  opacity: 0.5;
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-1);
  letter-spacing: 0.1em;
}
.article-date-badge { color: var(--red); }
.article-sep { color: var(--text-2); }

.article-big-title {
  font-family: var(--sans);
  font-size: clamp(26px, 4.5vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1.4rem;
}

.article-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}
.atag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-1);
  border: 1px solid var(--border-red);
  padding: 3px 9px;
  text-transform: lowercase;
}

.article-title-divi {
  height: 1px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 80%);
  opacity: 0.4;
}

/* ── ARTICLE BODY TYPOGRAPHY ── */
.article-body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text-0);
}

.article-body h1 {
  font-family: var(--sans);
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 2.8rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.article-body h1:first-child { display: none; } /* hide the # title, we show it in header */

.article-body h2 {
  font-family: var(--sans);
  font-size: clamp(18px, 2.8vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 2.2rem 0 0.9rem;
}
.article-body h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-0);
  margin: 1.8rem 0 0.7rem;
}
.article-body h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
  margin: 1.5rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1.1rem;
  color: var(--text-0);
}

.article-body a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--red-dim);
  transition: text-decoration-color 0.2s, color 0.2s;
}
.article-body a:hover {
  color: #e84040;
  text-decoration-color: #e84040;
}

.article-body strong { color: #fff; font-weight: 600; }
.article-body em { color: var(--text-1); font-style: italic; }

.article-body code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
  background: rgba(192,57,43,0.09);
  border: 1px solid rgba(192,57,43,0.18);
  padding: 1px 6px;
  border-radius: 2px;
}

.article-body pre {
  background: #0e0e0d;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-1);
  position: relative;
}
.article-body pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0.3;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.8rem 0 0.8rem 1.4rem;
  border-left: 3px solid var(--red-dim);
  background: rgba(192,57,43,0.04);
  color: var(--text-1);
  font-style: italic;
}

.article-body ul, .article-body ol {
  padding-left: 1.6rem;
  margin-bottom: 1.2rem;
}
.article-body li {
  margin-bottom: 0.4rem;
  color: var(--text-0);
}
.article-body li::marker { color: var(--red); }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
  position: relative;
}
.article-body hr::after {
  content: '//';
  position: absolute;
  left: 0; top: -9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg);
  padding-right: 0.6rem;
}

.loading-placeholder {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.1em;
  padding: 2rem 0;
}

.article-back-row {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.back-link {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--text-1);
  text-transform: lowercase;
  transition: color 0.2s;
}
.back-link:hover { color: var(--red); }

/* ── PRISM OVERRIDES ── */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: rgba(140,138,126,0.5); }

.token.punctuation { color: var(--text-1); }

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol { color: #e06c75; }

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin { color: #98c379; }

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string { color: #56b6c2; }

.token.atrule,
.token.attr-value,
.token.keyword { color: #c678dd; }

.token.function { color: #61afef; }

.token.regex,
.token.important,
.token.variable { color: #e5c07b; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  body { padding: 0 18px; }
  header { padding: 1.5rem 0 2rem; flex-wrap: wrap; gap: 1rem; }
  .logo-sub { display: none; }
  .hero-group { padding: 3rem 0 2.5rem; }
  .article-big-title { font-size: 24px; }
  .entry-arrow { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
