/* ============================================================
   r10.wtf — main.css
   "brutalist mono terminal with a furry undertone"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --me:    #bda6ff;
  --gold:  #eccb6e;
  --bg:    #0a0a0a;
  --bg-2:  #111110;
  --ink:   #d8d2bc;
  --ink-2: #97907b;
  --muted: #57523f;
  --line:  #25221c;

  --font: 'JetBrains Mono', 'Courier New', monospace;
  --nav-h: 44px;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  font-variant-ligatures: contextual;
  -webkit-font-smoothing: antialiased;
}

/* Prevent hidden attr being overridden */
[hidden] { display: none !important; }

/* ── Animated background layers ── */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-grid {
  background-image: radial-gradient(
    circle,
    color-mix(in oklab, var(--me) 16%, transparent) 1px,
    transparent 1.4px
  );
  background-size: 24px 24px;
  animation: grid-drift 60s linear infinite;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
}
@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 24px 24px; }
}

.bg-scan {
  top: -160px;
  height: 160px;
  background: linear-gradient(
    transparent,
    color-mix(in oklab, var(--me) 10%, transparent),
    transparent
  );
  animation: scan-down 16s linear infinite;
}
@keyframes scan-down {
  from { transform: translateY(0); }
  to   { transform: translateY(2400px); }
}

.bg-crt {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255,255,255,.012) 2px,
    rgba(255,255,255,.012) 3px
  );
  mix-blend-mode: screen;
}

@media (prefers-reduced-motion: reduce) {
  .bg-grid, .bg-scan { animation: none !important; }
}

/* ── Blinking caret ── */
.caret {
  color: var(--me);
  animation: blink 1s steps(2, end) infinite;
  display: inline-block;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Color helpers ── */
.me    { color: var(--me); }
.gold  { color: var(--gold); }
.ink2  { color: var(--ink-2); }
.muted { color: var(--muted); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-prompt {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  list-style: none;
}

.nav-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
  padding: 2px 4px;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--me); }

/* ============================================================
   HERO
   ============================================================ */
.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.hero { margin-bottom: 48px; }

/* Hero banner — CSS border, no emoji alignment issues */
.hero-banner {
  display: inline-block;
  border: 1px solid color-mix(in oklab, var(--me) 35%, transparent);
  padding: 14px 22px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.9;
  box-shadow: 0 0 18px color-mix(in oklab, var(--me) 8%, transparent),
              inset 0 0 40px color-mix(in oklab, var(--me) 3%, transparent);
}

.hero-line1 { font-size: 15px; font-weight: 500; }
.hero-line2 { font-size: 12px; }

.hero-compact {
  display: none;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 20px;
}

/* Stats bar — 3 columns */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-right: 1px solid var(--line);
  gap: 5px;
}
.stat:last-child { border-right: none; }

.stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-value {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

/* UPTIME counter */
#stat-uptime {
  font-size: 11px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   POSTS LIST — simple, no table
   ============================================================ */
.posts-section { margin-bottom: 60px; }

.section-heading {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.section-rule {
  opacity: 0.7;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
}

.posts-loading {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

/* Posts hidden until typewriter finishes */
.posts-list-hidden {
  opacity: 0;
  transform: translateY(6px);
}
.posts-list-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Individual post entry */
.post-entry {
  display: block;
  padding: 14px 16px;
  margin-bottom: 2px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  transition: border-color 0.1s, background 0.1s, color 0.1s;
  cursor: pointer;
}

.post-entry:hover,
.post-entry:focus-visible {
  background: color-mix(in oklab, var(--me) 8%, transparent);
  border-left-color: var(--me);
  border-color: color-mix(in oklab, var(--me) 20%, transparent);
  border-left-color: var(--me);
  outline: none;
  color: var(--ink);
}

.post-entry--about {
  border-left-color: var(--me);
}
.post-entry--about .post-title { color: var(--me); }

.post-title {
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.post-title .cursor {
  animation: blink 1s steps(2,end) infinite;
  color: var(--me);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-date {
  font-size: 11px;
  color: var(--ink-2);
}

.post-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.post-tag {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.post-excerpt {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 5px;
  line-height: 1.5;
}

/* ============================================================
   FOOTER / Colophon — no background
   ============================================================ */
.colophon {
  border-top: 1px solid var(--line);
  padding: 40px 24px 0;
}

.colophon-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-bottom: 32px;
}

.col-heading {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.col-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.col-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
  display: inline-block;
  transition: color 0.15s, border-color 0.15s;
}
.col-links a:hover { color: var(--me); border-color: var(--me); }

.tracks-box {
  color: var(--gold);
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.8;
}

/* Status bar */
.status-bar {
  max-width: 900px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  gap: 16px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--me);
  animation: pulse-dot 2.5s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--me) 50%, transparent); }
  50%       { box-shadow: 0 0 0 4px color-mix(in oklab, var(--me) 0%, transparent); }
}

/* ============================================================
   CONTAINER QUERY — MOBILE (≤640px)
   ============================================================ */
@container brroot (max-width: 640px) {
  .site-main { padding: 20px 14px 40px; }

  .hero-banner { display: none; }
  .hero-compact { display: block; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { grid-column: span 2; }

  .post-title { font-size: 13px; }

  .colophon-grid { grid-template-columns: 1fr; gap: 28px; }

  .status-bar { flex-direction: column; align-items: flex-start; gap: 6px; }

  .nav-prompt { font-size: 11px; }
  .nav-link { font-size: 11px; }
}

@media (max-width: 640px) {
  .colophon { padding: 24px 14px 0; }
}
