/* ============================================================
   RESERVOIR — CRT / Silent Hill 2 personal blog stylesheet
   Quiet dread. Phosphor glow. Institutional rot.
   ============================================================ */

:root {
  --bg:        #0a0a08;
  --bg-panel:  #0e0f0c;
  --bg-sunk:   #070806;
  --text:      #c8cfc0;   /* desaturated greenish-white phosphor */
  --text-dim:  #6e7568;
  --amber:     #d4a853;
  --rust:      #5a3320;
  --rust-lt:   #7c4a2e;
  --red:       #8b1a1a;
  --red-hot:   #c0392b;
  --line:      #3a3026;
  --shadow:    rgba(0, 0, 0, 0.7);
  --mono-ui:   'Share Tech Mono', 'VT323', monospace;
  --mono-head: 'VT323', 'Share Tech Mono', monospace;
  --mono-body: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono-body);
  font-size: 16px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* subtle uneven base tint, like an old tube */
  background:
    radial-gradient(ellipse at 50% 30%, #101109 0%, var(--bg) 60%, #050604 100%);
}

/* ---------- CRT overlays ---------- */

/* scan lines */
.crt-scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

/* film grain / noise */
.crt-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 0.6s steps(2) infinite;
}

/* darkened edges */
.crt-vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes noiseShift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-4px, 3px); }
}

/* ---------- screen flicker ---------- */
.crt-frame {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 22px 60px;
  animation: flicker 7s infinite steps(60);
}

@keyframes flicker {
  0%, 100%   { opacity: 1; }
  7%         { opacity: 0.98; }
  9%         { opacity: 0.99; }
  18%        { opacity: 0.97; }
  19%        { opacity: 1; }
  37%        { opacity: 0.99; }
  62%        { opacity: 0.98; }
  63%        { opacity: 1; }
  77%        { opacity: 0.985; }
  92%        { opacity: 0.99; }
}

/* ---------- typography ---------- */
h1, h2, h3 {
  font-family: var(--mono-head);
  font-weight: normal;
  letter-spacing: 1px;
  color: var(--text);
  text-shadow: 0 0 6px rgba(200, 207, 192, 0.18);
}

a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px dotted rgba(212, 168, 83, 0.35);
  transition: opacity 0.08s linear, color 0.08s linear;
}
a:hover { animation: hoverFlick 0.25s steps(2) 1; color: var(--red-hot); }

@keyframes hoverFlick {
  0% { opacity: 1; } 25% { opacity: 0.4; } 50% { opacity: 1; } 75% { opacity: 0.6; } 100% { opacity: 1; }
}

.dim { color: var(--text-dim); }

/* blinking cursor */
.blink {
  animation: blink 1.05s steps(1) infinite;
  color: var(--amber);
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---------- chrome: counter, nav, dividers ---------- */
.site-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.visitor-counter {
  font-family: var(--mono-ui);
  border: 1px solid var(--rust);
  background: var(--bg-sunk);
  padding: 4px 10px;
  letter-spacing: 2px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}
.vc-label { color: var(--text-dim); margin-right: 6px; }
.vc-digits {
  color: var(--amber);
  background: #1a1206;
  padding: 1px 5px;
  border: 1px solid #2a1d0c;
  text-shadow: 0 0 5px rgba(212, 168, 83, 0.5);
}

.site-nav {
  font-family: var(--mono-ui);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.site-nav a { border-bottom: none; }
.site-nav a.active { color: var(--red-hot); }
.nav-sep { color: var(--rust); }

.inline-form { display: inline; margin: 0; }
.linklike {
  background: none;
  border: none;
  color: var(--amber);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.08s;
}
.linklike:hover { animation: hoverFlick 0.25s steps(2) 1; color: var(--red-hot); }
.linklike.danger { color: var(--red-hot); }

.divider {
  color: var(--rust);
  font-family: var(--mono-ui);
  overflow: hidden;
  white-space: nowrap;
  margin: 22px 0;
  opacity: 0.7;
  user-select: none;
}
.divider.thin { color: var(--line); margin: 12px 0; }

.site-foot {
  margin-top: 30px;
  font-family: var(--mono-ui);
  color: var(--text-dim);
  text-align: center;
}
.cursor-line { color: var(--text); }
.foot-meta { margin-top: 8px; font-size: 0.8rem; letter-spacing: 2px; }

/* ---------- glitch heading ---------- */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0.6;
}
.glitch::before { color: var(--red); transform: translate(-1px, 0); clip-path: inset(0 0 55% 0); animation: glitchTop 4s infinite steps(2); }
.glitch::after  { color: #2e5a4a; transform: translate(1px, 0);  clip-path: inset(55% 0 0 0); animation: glitchBot 5s infinite steps(2); }
@keyframes glitchTop { 0%,97%,100%{transform:translate(-1px,0);} 98%{transform:translate(-4px,-1px);} }
@keyframes glitchBot { 0%,94%,100%{transform:translate(1px,0);}  96%{transform:translate(4px,1px);} }

.feed-title { font-size: 2rem; margin: 6px 0 18px; }

/* ============================================================
   HOME
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 26px;
}
.home-sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-note {
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-family: var(--mono-ui);
  background: var(--bg-panel);
}
.sidebar-note p { margin: 4px 0; }

/* profile / intake card */
.profile-card {
  border: 1px solid var(--rust);
  background: var(--bg-panel);
  box-shadow: 0 0 0 3px var(--bg), 4px 4px 0 rgba(0,0,0,0.6);
  font-family: var(--mono-ui);
  position: relative;
  transform: rotate(-0.6deg);
}
.pc-header {
  background: var(--rust);
  color: #1a1109;
  padding: 4px 8px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pc-stamp {
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0 4px;
  transform: rotate(-6deg);
  font-size: 0.6rem;
}
.pc-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pc-avatar { align-self: center; }
.pc-avatar img { width: 90px; height: 90px; object-fit: cover; border: 1px solid var(--line); filter: grayscale(0.5) contrast(1.1) brightness(0.85); }
.pc-avatar-placeholder {
  width: 90px; height: 90px;
  border: 1px dashed var(--rust-lt);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--text-dim); font-size: 0.8rem; line-height: 1.1;
  background: var(--bg-sunk);
}
.pc-fields { margin: 0; }
.pc-fields dt { color: var(--amber); font-size: 0.75rem; letter-spacing: 1px; margin-top: 8px; }
.pc-fields dd { margin: 2px 0 0; color: var(--text); font-size: 0.9rem; }
.pc-status { color: var(--red-hot) !important; font-style: italic; }
.pc-notes { line-height: 1.4; }
.pc-footer {
  border-top: 1px solid var(--line);
  padding: 4px 8px; font-size: 0.7rem; color: var(--text-dim); text-align: right;
}

/* post cards — torn / corrupted file cards */
.home-feed { min-width: 0; }
.post-card {
  position: relative;
  border: 1px solid var(--rust);
  background: var(--bg-panel);
  padding: 18px 20px 16px;
  margin: 0 0 26px;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.55);
  /* torn edges */
  clip-path: polygon(0 2%, 3% 0, 60% 1%, 98% 0, 100% 4%, 99% 96%, 100% 100%, 40% 99%, 2% 100%, 0 97%);
}
.post-card.lean-left  { transform: rotate(-0.7deg); }
.post-card.lean-right { transform: rotate(0.7deg); }
.post-card:hover { animation: hoverFlick 0.3s steps(2) 1; }
.post-card-tape {
  position: absolute;
  top: -8px; left: 24px;
  color: var(--rust-lt);
  letter-spacing: -2px;
  opacity: 0.7;
  font-family: var(--mono-ui);
}
.post-card-time {
  color: var(--red-hot);
  font-family: var(--mono-ui);
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.post-card-title { margin: 4px 0 10px; font-size: 1.7rem; line-height: 1; }
.post-card-title a { border-bottom: none; color: var(--text); }
.post-card-title a:hover { color: var(--red-hot); }
.post-card-excerpt { margin: 0 0 12px; color: var(--text); }
.post-card-more { font-family: var(--mono-ui); font-size: 0.85rem; }

.empty { color: var(--text-dim); font-style: italic; }

/* ============================================================
   POST PAGE
   ============================================================ */
.post-full-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono-ui); font-size: 0.85rem;
}
.post-full-time { color: var(--red-hot); letter-spacing: 1px; }
.back-link { font-family: var(--mono-ui); }
.post-full-title { font-size: 2.4rem; margin: 8px 0 4px; line-height: 1; }
.post-full-body { font-size: 1.02rem; }
.post-full-body p { margin: 0 0 16px; }
.post-full-body blockquote {
  border-left: 3px solid var(--red);
  margin: 16px 0; padding: 6px 16px;
  color: var(--amber); background: var(--bg-sunk); font-style: italic;
}
.post-full-body h1, .post-full-body h2, .post-full-body h3 { margin-top: 24px; }
.post-full-body a { color: var(--amber); }
.post-full-body code {
  background: var(--bg-sunk); border: 1px solid var(--line);
  padding: 1px 5px; color: var(--amber);
}
.post-full-body pre {
  background: var(--bg-sunk); border: 1px solid var(--line);
  padding: 12px; overflow-x: auto;
}
.post-full-body img { max-width: 100%; filter: grayscale(0.4) contrast(1.05) brightness(0.9); }

/* like button */
.post-actions { margin: 22px 0; }
.like-btn {
  font-family: var(--mono-ui);
  background: var(--bg-panel);
  border: 1px solid var(--rust);
  color: var(--text-dim);
  padding: 8px 16px;
  cursor: pointer;
  letter-spacing: 2px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: opacity 0.1s, color 0.1s, border-color 0.1s;
}
.like-btn:hover { animation: hoverFlick 0.25s steps(2) 1; border-color: var(--red); }
.like-btn .like-glyph { font-size: 1.1rem; }
.like-btn .like-count {
  background: var(--bg-sunk); border: 1px solid var(--line);
  padding: 0 8px; color: var(--amber);
}
.like-btn.liked { color: var(--red-hot); border-color: var(--red-hot); }
.like-btn.liked .like-glyph { text-shadow: 0 0 8px var(--red-hot); }

/* ---------- comments ---------- */
.comments-section { margin-top: 8px; }
.comments-title { font-size: 1.4rem; margin: 0 0 16px; }
.comment {
  border-left: 2px solid var(--line);
  padding: 8px 0 8px 12px;
  margin: 0 0 14px;
}
.comment-reply {
  margin-left: 26px;
  border-left: 2px solid var(--rust);
  background: rgba(255,255,255,0.012);
}
.comment-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono-ui); font-size: 0.82rem;
}
.comment-user { color: var(--amber); }
.comment-time { color: var(--text-dim); }
.comment-body { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.comment-removed { color: var(--text-dim); font-style: italic; }
.comment-actions { font-family: var(--mono-ui); font-size: 0.78rem; display: flex; gap: 10px; }
.comment-replies { margin-top: 12px; }

/* forms (shared terminal style) */
.comment-form-wrap, .gb-sign-wrap { margin-top: 24px; }
.comment-form-title { font-size: 1.2rem; color: var(--amber); }
.field-label {
  display: block;
  font-family: var(--mono-ui);
  color: var(--text-dim);
  letter-spacing: 1px;
  margin: 12px 0 4px;
  font-size: 0.85rem;
}
input[type="text"], input[type="password"], textarea {
  display: block;
  width: 100%;
  background: var(--bg-sunk);
  color: var(--text);
  border: 1px solid var(--rust);
  font-family: var(--mono-body);
  font-size: 1rem;
  padding: 8px 10px;
  margin-top: 4px;
  outline: none;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.7);
}
input:focus, textarea:focus { border-color: var(--amber); box-shadow: inset 0 0 8px rgba(0,0,0,0.7), 0 0 6px rgba(212,168,83,0.25); }
input[readonly] { color: var(--text-dim); cursor: not-allowed; }
textarea { resize: vertical; }

.term-button {
  margin-top: 14px;
  font-family: var(--mono-ui);
  background: var(--bg-panel);
  color: var(--amber);
  border: 1px solid var(--rust);
  padding: 8px 18px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity 0.1s, color 0.1s, border-color 0.1s;
}
.term-button:hover { animation: hoverFlick 0.25s steps(2) 1; color: var(--red-hot); border-color: var(--red); }
.term-button.small { margin-top: 0; padding: 4px 12px; font-size: 0.85rem; }
.term-error { color: var(--red-hot); font-family: var(--mono-ui); min-height: 1.2em; margin: 8px 0 0; }

.reply-indicator {
  font-family: var(--mono-ui); font-size: 0.82rem;
  color: var(--amber); border: 1px dashed var(--rust);
  padding: 4px 8px; margin-bottom: 8px;
}

/* ============================================================
   GUESTBOOK — 1997 BBS wall
   ============================================================ */
.gb-intro { margin-top: -8px; }
.guestbook-entries { display: flex; flex-direction: column; gap: 16px; }
.gb-entry {
  border: 1px solid var(--rust);
  background: var(--bg-panel);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}
.gb-entry-head {
  display: flex; justify-content: space-between; gap: 10px;
  background: linear-gradient(0deg, #14110a, #1c1710);
  border-bottom: 1px solid var(--line);
  padding: 4px 10px;
  font-family: var(--mono-ui); font-size: 0.85rem;
}
.gb-user { color: var(--amber); letter-spacing: 1px; }
.gb-time { color: var(--text-dim); }
.gb-message { padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.gb-signed-ack { font-family: var(--mono-ui); color: var(--amber); margin-top: 18px; border: 1px dashed var(--rust); padding: 10px 12px; }

/* ============================================================
   USERNAME MODAL / LOGIN TERMINAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(2, 3, 1, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-terminal, .login-terminal {
  width: 100%;
  max-width: 440px;
  background: var(--bg-sunk);
  border: 1px solid var(--rust);
  box-shadow: 0 0 0 3px var(--bg), 0 0 24px rgba(0,0,0,0.9), inset 0 0 30px rgba(0,0,0,0.8);
  padding: 0 0 18px;
  font-family: var(--mono-ui);
}
.modal-crt-bar {
  background: var(--rust);
  color: #1a1109;
  padding: 4px 10px;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.modal-art {
  color: var(--rust-lt);
  font-family: var(--mono-ui);
  font-size: 0.78rem;
  margin: 10px 0;
  overflow-x: auto;
}
.modal-terminal form, .login-terminal form { padding: 0 18px; }
.term-prompt { display: block; color: var(--amber); letter-spacing: 1px; margin-bottom: 6px; }
.term-input-row { display: flex; align-items: center; gap: 8px; }
.term-caret { color: var(--amber); }
.term-input-row input { margin-top: 0; }
.term-hint { color: var(--text-dim); font-size: 0.75rem; margin: 8px 0 0; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-frame { max-width: 1080px; }
.admin-badge {
  position: fixed;
  top: 8px; right: 10px;
  z-index: 9600;
  font-family: var(--mono-ui);
  color: var(--red-hot);
  border: 1px solid var(--red);
  background: rgba(10,10,8,0.85);
  padding: 2px 8px;
  letter-spacing: 2px;
  font-size: 0.8rem;
  text-shadow: 0 0 6px rgba(192,57,43,0.5);
}
.login-page { display: flex; justify-content: center; padding-top: 30px; }
.login-error { padding: 0 18px; }
.login-foot { padding: 0 18px; margin: 14px 0 0; }

.admin-page { font-family: var(--mono-ui); }
.admin-page .admin-form input,
.admin-page .admin-form textarea { font-family: var(--mono-body); }
.admin-h1 { font-size: 1.8rem; color: var(--amber); }
.admin-section { margin: 18px 0; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-section h2 { font-size: 1.3rem; color: var(--text); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.admin-table th { color: var(--amber); background: var(--bg-sunk); letter-spacing: 1px; }
.admin-actions { white-space: nowrap; display: flex; gap: 10px; }

.admin-comment { border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 10px; background: var(--bg-panel); }
.admin-comment-head { font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.admin-comment-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

.admin-form { max-width: 640px; }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-page { text-align: center; padding: 40px 0; font-family: var(--mono-ui); }
.error-art { color: var(--red); font-size: 1.6rem; display: inline-block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
  .profile-card { transform: none; }
  .post-card.lean-left, .post-card.lean-right { transform: none; }
  .feed-title { font-size: 1.6rem; }
  .post-full-title { font-size: 1.8rem; }
  .divider { font-size: 0.7rem; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .crt-frame, .crt-noise, .blink, .glitch::before, .glitch::after { animation: none !important; }
}

/* ===== Uploaded media (live viewers inside posts) ===== */
.post-media {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
}
img.post-media { filter: grayscale(0.4) contrast(1.05) brightness(0.9); }
video.post-media { width: 100%; }
audio.post-media { width: 100%; margin: 14px 0; }
.file-download {
  display: inline-block;
  margin: 12px 0;
  padding: 8px 14px;
  border: 1px dashed var(--rust-lt);
  color: var(--amber);
  text-decoration: none;
  font-family: var(--mono-ui);
}
.file-download:hover { color: var(--red-hot); border-color: var(--red); }

/* ===== Post-editor media uploader ===== */
.media-uploader {
  margin: 8px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
}
.media-uploader-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.media-uploader-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.media-uploader input[type="file"] { color: var(--text-dim); font-family: var(--mono-body); max-width: 100%; }
.media-library { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; max-height: 220px; overflow-y: auto; }
.media-lib-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; font-size: 0.88rem; }
.media-lib-name { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Dashboard media library ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.media-card { border: 1px solid var(--line); background: var(--bg-sunk); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.media-card-preview {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.media-card-preview img, .media-card-preview video { max-width: 100%; max-height: 100%; object-fit: cover; filter: grayscale(0.4) contrast(1.05) brightness(0.85); }
.media-card-glyph { font-size: 2.4rem; color: var(--rust-lt); }
.media-card-name { font-size: 0.82rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-actions { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; }

/* ===== Profile card "open file" link ===== */
.pc-open-file {
  display: inline-block;
  margin-top: 4px;
  color: var(--amber);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.pc-open-file:hover { color: var(--red-hot); animation: hoverFlick 0.25s steps(2) 1; }

/* ===== Admin avatar editor ===== */
.avatar-editor { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.avatar-editor-preview { flex: 0 0 auto; }
.avatar-editor-preview img,
.avatar-preview-none {
  width: 96px; height: 96px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
}
.avatar-editor-preview img { filter: grayscale(0.35) contrast(1.05) brightness(0.9); }
.avatar-preview-none {
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--text-dim); font-size: 0.75rem; line-height: 1.1;
  border-style: dashed; border-color: var(--rust-lt);
}
.avatar-editor-controls { flex: 1 1 260px; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.avatar-editor-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.avatar-editor-controls input[type="file"] { color: var(--text-dim); font-family: var(--mono-body); max-width: 100%; }

/* ===== Public dossier / case-file page ===== */
.dossier {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--rust);
  background: var(--bg-panel);
  box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.55);
  padding: 0 0 14px;
}
.dossier-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  filter: grayscale(0.4) contrast(1.1) brightness(0.85);
  z-index: 0;
  pointer-events: none;
}
.dossier-inner { position: relative; z-index: 1; padding: 0 0 0; }
.dossier-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 0; flex-wrap: wrap; gap: 8px; }
.dossier-filetag { color: var(--text-dim); font-size: 0.7rem; letter-spacing: 2px; }
.dossier-head {
  background: var(--rust);
  color: #1a1109;
  margin: 10px 14px 16px;
  padding: 5px 10px;
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 1px; font-size: 0.85rem;
}
.dossier-head-stamp {
  color: var(--red); border: 1px solid var(--red);
  padding: 0 5px; transform: rotate(-5deg); font-size: 0.62rem;
}
.dossier-grid { display: flex; gap: 20px; padding: 0 18px; flex-wrap: wrap; }
.dossier-photo { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dossier-photo-frame { position: relative; padding: 6px; border: 1px solid var(--line); background: var(--bg-sunk); }
.dossier-photo-frame img,
.dossier-photo-none {
  display: block;
  width: 160px; height: 160px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.dossier-photo-frame img { filter: grayscale(0.3) contrast(1.08) brightness(0.9); }
.dossier-photo-none {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--rust-lt); color: var(--text-dim); font-size: 0.85rem; line-height: 1.3;
}
.dossier-photo-tag {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(10,10,8,0.85); color: var(--amber);
  font-size: 0.55rem; letter-spacing: 1px; padding: 1px 4px; border: 1px solid var(--line);
}
.dossier-vital-state {
  color: var(--red-hot); font-family: var(--mono-head); font-size: 1.1rem; letter-spacing: 1px;
  text-align: center; max-width: 172px;
}
.dossier-vitals { flex: 1 1 280px; margin: 0; min-width: 240px; }
.dossier-vitals dt { color: var(--amber); font-size: 0.72rem; letter-spacing: 2px; margin-top: 12px; }
.dossier-vitals dt:first-child { margin-top: 0; }
.dossier-vitals dd { margin: 3px 0 0; color: var(--text); }
.dossier-name { font-family: var(--mono-head); font-size: 1.8rem; line-height: 1; color: var(--text); }
.dossier-tagline { color: var(--red-hot) !important; font-style: italic; }
.dossier-nowplaying { color: var(--amber); }
.dossier-section { padding: 0 18px; margin-top: 18px; }
.dossier-h2 { font-family: var(--mono-head); color: var(--amber); font-size: 1.2rem; letter-spacing: 1px; margin: 0 0 8px; }
.dossier-about { line-height: 1.55; color: var(--text); margin: 0; }
.dossier-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}
.stat-cell {
  border: 1px solid var(--line); background: var(--bg-sunk);
  padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-family: var(--mono-head); font-size: 1.9rem; line-height: 1; color: var(--text); }
.stat-key { font-size: 0.62rem; letter-spacing: 1.5px; color: var(--text-dim); }
.dossier-loglines { margin: 12px 0 0; font-size: 0.85rem; letter-spacing: 1px; color: var(--amber); }
.dossier-links { list-style: none; margin: 0; padding: 0; }
.dossier-links li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.dossier-links .freq-dot { color: var(--rust-lt); }
.dossier-links a { color: var(--amber); text-decoration: none; }
.dossier-links a:hover { color: var(--red-hot); animation: hoverFlick 0.25s steps(2) 1; }
.dossier-epitaph {
  margin: 22px 18px 6px;
  padding: 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center; font-style: italic; color: var(--text-dim);
  font-size: 1.15rem; line-height: 1.5;
}
.dossier-quote-mark { color: var(--rust-lt); font-family: var(--mono-head); font-size: 1.6rem; vertical-align: -0.2em; }
.dossier-foot {
  margin-top: 14px; padding: 6px 14px 0;
  border-top: 1px solid var(--line);
  text-align: right; color: var(--text-dim); font-size: 0.7rem; letter-spacing: 1px;
}
@media (max-width: 600px) {
  .dossier-grid { justify-content: center; text-align: center; }
  .dossier-vitals dt { margin-top: 14px; }
}
.dossier-comments { margin-top: 22px; }
.dossier-comments .comment-form-wrap { margin-top: 16px; }
.pc-list { margin: 8px 0 0; }
.pc-list .comment { margin-top: 10px; }

/* ===== Admin banner editor ===== */
.banner-editor { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.banner-editor-preview {
  height: 90px;
  border: 1px solid var(--line);
  background-color: var(--bg-sunk);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.banner-preview-hint { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 1px; }

/* ===== Radio page ===== */
.radio-intro { text-align: center; }
.radio-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 92px 0 28px; /* top room for the antenna */
}
/* Full-page fog — fixed to the viewport (only rendered on /radio), so it never
   looks cropped. Sits at z-index -1 inside the transparent .crt-frame, i.e.
   above the page background but behind all radio content. Drifts + glitches. */
.radio-fog-page {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  animation: fogGlitch 7s steps(1) infinite;
}
.radio-fog-page span {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 207, 192, 0.16), transparent 70%);
  filter: blur(40px);
  will-change: transform, opacity;
}
.radio-fog-page span:nth-child(1) { width: 60vw; height: 60vh; left: -12vw; top: -6vh;   animation: fogDrift 26s ease-in-out infinite alternate; }
.radio-fog-page span:nth-child(2) { width: 55vw; height: 55vh; right: -10vw; top: 10vh;   animation: fogDrift2 32s ease-in-out infinite alternate; }
.radio-fog-page span:nth-child(3) { width: 70vw; height: 55vh; left: 18vw; bottom: -14vh; animation: fogDrift 38s ease-in-out infinite alternate-reverse; }
.radio-fog-page span:nth-child(4) { width: 48vw; height: 48vh; left: 30vw; top: 28vh;     animation: fogDrift2 22s ease-in-out infinite alternate-reverse; }
.radio-fog-page span:nth-child(5) { width: 52vw; height: 50vh; right: 12vw; bottom: 4vh;  animation: fogDrift 30s ease-in-out infinite alternate; }
@keyframes fogDrift  { from { transform: translate(-6%, -3%) scale(1); } to { transform: translate(10%, 4%) scale(1.18); } }
@keyframes fogDrift2 { from { transform: translate(8%, 3%) scale(1.1); } to { transform: translate(-10%, -4%) scale(0.95); } }
/* glitch: sudden opacity drops + position snaps, on a steps() timeline */
@keyframes fogGlitch {
  0%, 38%, 61%, 100% { opacity: 1; transform: translateX(0); }
  39% { opacity: 0.45; transform: translateX(4px); }
  40% { opacity: 1; transform: translateX(-3px); }
  62% { opacity: 0.7; transform: translateX(-5px); }
  63% { opacity: 1; transform: translateX(2px); }
  85% { opacity: 0.85; }
  86% { opacity: 1; }
}

.radio { position: relative; z-index: 1; }

/* Antenna (the toggle) — hinged at the top-left of the body, telescoping up */
.radio-antenna {
  position: absolute;
  left: 26%;
  bottom: 100%;
  margin-bottom: -16px;          /* drop the hinge slightly into the body top */
  width: 24px; height: 150px;
  transform-origin: bottom center;
  transform: rotate(-22deg);     /* up / extended */
  transition: transform 0.55s cubic-bezier(0.34, 1.2, 0.64, 1);
  background: none; border: none; padding: 0; cursor: pointer;
  z-index: 4;
}
.radio-antenna.down { transform: rotate(70deg); }   /* folded down */
.radio-antenna:disabled { cursor: default; }
/* mounting base fixed to the body */
.antenna-hinge {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 12px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(#3a3026, #14110d); border: 1px solid #0c0a07;
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.antenna-hinge::after {           /* the pivot screw */
  content: ""; position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b8b8b8, #555);
}
/* tapered telescoping rod: thicker at the base, thin at the tip */
.antenna-rod {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 138px;
  clip-path: polygon(20% 0, 80% 0, 62% 100%, 38% 100%);
  background: linear-gradient(to top, #6f6f6f 0%, #cfcfcf 45%, #f2f2f2 100%);
}
.antenna-tip {
  position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #7a7a7a);
  box-shadow: 0 0 4px rgba(255,255,255,0.4);
}
.radio-antenna:hover:not(:disabled) .antenna-rod { background: linear-gradient(to top, var(--amber), #fff); }
.radio-antenna:hover:not(:disabled) .antenna-tip { background: radial-gradient(circle at 35% 30%, #fff, var(--amber)); }

/* Body */
.radio-body {
  position: relative;
  display: flex; align-items: center; gap: 22px;
  padding: 26px 28px 28px;
  border-radius: 10px;
  max-width: 540px;
  background:
    radial-gradient(circle at 18% 120%, rgba(124, 74, 46, 0.55), transparent 50%),
    radial-gradient(circle at 92% -20%, rgba(90, 51, 32, 0.5), transparent 45%),
    linear-gradient(160deg, #2a221c, #15110d);
  border: 1px solid #3a3026;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.55), inset 0 0 42px rgba(0, 0, 0, 0.65);
}

/* Speaker */
.radio-speaker {
  flex: 0 0 auto;
  width: 150px; height: 150px; border-radius: 50%;
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 60%), #15140f;
  border: 3px solid #2a2620;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85);
}
.radio-speaker::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background-image: radial-gradient(circle, #000 1.4px, transparent 1.9px);
  background-size: 13px 13px; opacity: 0.55;
}
.radio-speaker::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 70% 80%, rgba(124, 74, 46, 0.35), transparent 55%);
  mix-blend-mode: screen;
}

/* Dial */
.radio-dial { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.radio-bands { font-family: var(--mono-ui); font-size: 0.62rem; letter-spacing: 1px; color: var(--text-dim); display: flex; flex-direction: column; gap: 3px; }
.band-tag { color: var(--amber); }
.band-unit { color: var(--text-dim); }
.radio-needle {
  position: absolute; top: -2px; left: 8%; width: 2px; height: 40px;
  background: var(--red-hot); box-shadow: 0 0 6px var(--red-hot), 0 0 14px rgba(192,57,43,0.5);
  animation: tunerScrub 9s steps(1, end) infinite, tunerJitter 0.14s steps(2) infinite;
}
.radio-needle::before { /* little pointer cap at the top of the needle */
  content: ""; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--red-hot);
}
/* glitchy scrub: sweeps across, snaps back and stutters like a bad tuner */
@keyframes tunerScrub {
  0%   { left: 8%; }
  12%  { left: 24%; }
  14%  { left: 19%; }   /* stutter back */
  30%  { left: 47%; }
  44%  { left: 41%; }   /* glitch */
  58%  { left: 73%; }
  60%  { left: 66%; }
  78%  { left: 92%; }
  80%  { left: 58%; }   /* hard snap */
  92%  { left: 80%; }
  100% { left: 8%; }
}
@keyframes tunerJitter { 0% { transform: translateX(0); } 50% { transform: translateX(1px); } 100% { transform: translateX(-1px); } }

/* Marquee screen */
.radio-screen {
  position: relative; overflow: hidden;
  height: 32px; border-radius: 3px;
  display: flex; align-items: center;
  background: linear-gradient(#0b1c10, #05140a);
  border: 1px solid #06371d;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9);
}
.radio-screen.dead { background: linear-gradient(#1a1410, #0c0a07); border-color: #2a2620; }
.radio-marquee { display: inline-flex; white-space: nowrap; will-change: transform; animation: marquee 14s linear infinite; }
.radio-screen.dead .radio-marquee { animation-duration: 26s; }
.marquee-text {
  padding: 0 4ch; font-family: var(--mono-head); font-size: 1.15rem; letter-spacing: 2px;
  color: #6dff9e; text-shadow: 0 0 6px rgba(80, 255, 140, 0.7);
}
.radio-screen.dead .marquee-text { color: var(--text-dim); text-shadow: none; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.radio-static {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0.6;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 2px);
  animation: radioStatic 0.18s steps(2) infinite;
}
@keyframes radioStatic {
  0% { transform: translate(0, 0); opacity: 0.45; }
  50% { transform: translate(-1px, 1px); opacity: 0.7; }
  100% { transform: translate(1px, -1px); opacity: 0.5; }
}
.radio-scan { position: absolute; left: 0; right: 0; height: 6px; pointer-events: none; background: linear-gradient(rgba(255, 255, 255, 0.15), transparent); animation: radioScan 3.5s linear infinite; }
@keyframes radioScan { from { top: -6px; } to { top: 100%; } }

/* Knobs + brand */
.radio-knobs { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; }
.radio-knobs span {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #565656, #111); border: 1px solid #000;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
}
.radio-brand { position: absolute; bottom: 6px; right: 12px; font-size: 0.6rem; letter-spacing: 2px; color: var(--text-dim); }

.radio-status { text-align: center; color: var(--amber); letter-spacing: 2px; font-size: 0.8rem; margin-top: 8px; }
.radio-note { text-align: center; color: var(--text-dim); font-style: italic; margin-top: 2px; }

/* Lost frequencies */
.lost-frequencies { margin-top: 6px; }
.lf-list { list-style: none; margin: 12px 0 0; padding: 0; }
.lf-item { padding: 10px 0; border-bottom: 1px dotted var(--line); }
.lf-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.lf-title { color: var(--text); font-family: var(--mono-head); font-size: 1.15rem; letter-spacing: 1px; }
.lf-artist { color: var(--amber); }
.lf-date { margin-left: auto; color: var(--text-dim); font-size: 0.72rem; }
.lf-note { color: var(--text-dim); font-style: italic; margin-top: 3px; font-size: 0.9rem; }

/* Admin radio rows */
.song-live { color: var(--red-hot); font-size: 0.7rem; letter-spacing: 1px; }
.song-note-form { display: flex; gap: 6px; align-items: center; }
.song-note-form input { flex: 1 1 auto; min-width: 120px; }

@media (max-width: 560px) {
  .radio-body { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .radio-dial { flex-basis: 100%; order: 3; }
  .radio-knobs { flex-direction: row; }
  .radio-antenna { left: 24%; }
}

@media (prefers-reduced-motion: reduce) {
  .radio-fog-page, .radio-fog-page span, .radio-marquee, .radio-static, .radio-scan, .radio-needle { animation: none !important; }
}

/* ===== Guestbook arrival ritual ===== */
.gb-welcome {
  border: 1px solid var(--amber);
  background: linear-gradient(var(--bg-panel), var(--bg-sunk));
  padding: 16px 18px; margin: 0 0 20px;
  box-shadow: 0 0 16px rgba(212, 168, 83, 0.12), inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: welcomePulse 3.6s ease-in-out infinite;
}
.gb-welcome-title { font-family: var(--mono-head); color: var(--red-hot); font-size: 1.6rem; letter-spacing: 2px; margin: 0 0 8px; }
.gb-welcome-body { margin: 0; line-height: 1.6; color: var(--text); }
.gb-welcome-tail { display: block; margin-top: 8px; color: var(--amber); letter-spacing: 1px; }
@keyframes welcomePulse {
  0%, 100% { box-shadow: 0 0 14px rgba(212, 168, 83, 0.10), inset 0 0 30px rgba(0, 0, 0, 0.5); }
  50%      { box-shadow: 0 0 26px rgba(192, 57, 43, 0.22), inset 0 0 30px rgba(0, 0, 0, 0.5); }
}

/* the just-signed entry flashes onto the wall */
.gb-entry-fresh { animation: freshMark 1.8s ease; }
@keyframes freshMark { 0% { background: rgba(192, 57, 43, 0.28); } 100% { background: transparent; } }

/* the doorway that manifests after signing */
.gb-proceed {
  text-align: center; margin: 26px 0 8px; padding: 24px 14px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  animation: eerieIn 2.6s ease forwards;
}
.gb-proceed-msg { color: var(--text-dim); font-style: italic; letter-spacing: 1px; margin: 0 0 16px; }
.gb-proceed-sub { color: var(--text-dim); font-size: 0.8rem; margin: 14px 0 0; opacity: 0.7; }
.gb-proceed-btn {
  display: inline-block; font-family: var(--mono-head); font-size: 1.5rem; letter-spacing: 5px;
  color: var(--red-hot); border: 1px solid var(--red); padding: 10px 28px; text-decoration: none;
  background: rgba(139, 26, 26, 0.08);
  box-shadow: 0 0 14px rgba(192, 57, 43, 0.25);
  animation: doorwayFlicker 3s steps(1) infinite 2.6s;
}
.gb-proceed-btn:hover { color: #fff; background: rgba(139, 26, 26, 0.28); box-shadow: 0 0 24px rgba(192, 57, 43, 0.55); }
@keyframes eerieIn {
  0%   { opacity: 0; filter: blur(5px); transform: translateY(10px); }
  18%  { opacity: 0.25; }
  20%  { opacity: 0; }
  40%  { opacity: 0.7; filter: blur(1px); }
  43%  { opacity: 0.15; }
  62%  { opacity: 0.95; transform: translateY(0); filter: blur(0); }
  66%  { opacity: 0.4; }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes doorwayFlicker {
  0%, 90%, 100% { opacity: 1; }
  92% { opacity: 0.5; } 93% { opacity: 1; } 96% { opacity: 0.7; } 97% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gb-welcome, .gb-proceed, .gb-proceed-btn, .gb-entry-fresh { animation: none !important; }
}

/* ===== Audit log (black box) ===== */
.audit-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.audit-chip {
  font-size: 0.75rem; letter-spacing: 1px; padding: 3px 10px;
  border: 1px solid var(--line); color: var(--text-dim); text-decoration: none;
}
.audit-chip:hover { color: var(--amber); border-color: var(--rust-lt); }
.audit-chip.on { color: var(--bg); background: var(--amber); border-color: var(--amber); }
.audit-scroll { overflow-x: auto; border: 1px solid var(--line); }
.audit-table { margin: 0; font-size: 0.82rem; min-width: 760px; }
.audit-table th, .audit-table td { padding: 6px 8px; vertical-align: top; }
.audit-time { white-space: nowrap; color: var(--text-dim); font-size: 0.78rem; }
.audit-event { font-family: var(--mono-ui); color: var(--text); white-space: nowrap; }
.audit-detail { min-width: 220px; }
.audit-ip { white-space: nowrap; color: var(--text-dim); font-size: 0.78rem; }
.audit-badge {
  display: inline-block; font-size: 0.66rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 1px 6px; border: 1px solid currentColor; border-radius: 2px;
}
.audit-auth, .audit-badge.audit-auth { color: var(--amber); }
.audit-admin, .audit-badge.audit-admin { color: #6dab8f; }
.audit-visitor, .audit-badge.audit-visitor { color: var(--text-dim); }
.audit-security, .audit-badge.audit-security { color: var(--red-hot); }
.audit-system, .audit-badge.audit-system { color: var(--rust-lt); }
/* security rows draw the eye */
.audit-table tr:has(.audit-badge.audit-security) { background: rgba(139, 26, 26, 0.10); }
.audit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.audit-foot form { margin: 0; }

/* ===== Power-on boot sequence (Persona-style TV portal) =====
   static -> a glowing seam splits into two bars (one up, one down) ->
   the page zooms up through the opening, fish-eyed, then settles. */
#crt-boot { display: none; }
html.booting { overflow: hidden; }            /* contain the zoom overshoot */
html.booting #crt-boot {
  display: block;
  position: fixed; inset: 0; z-index: 9996; pointer-events: none;
  background: transparent;                    /* the shutters provide the black; the gap reveals the page */
}
/* opening tuning static — sits ABOVE the shutters so it's actually seen first */
.boot-static {
  position: absolute; inset: 0; z-index: 3; background-color: #000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: bootStaticFade 1.9s ease-out forwards, staticBoil 0.14s steps(2, end) infinite;
}
/* two black halves meeting at center; their glowing inner edges = the bar */
.boot-shutter { position: absolute; left: 0; right: 0; height: 50%; background: #000; z-index: 1; }
.boot-shutter-top {
  top: 0; border-bottom: 2px solid rgba(232,236,226,0.95);
  box-shadow: 0 7px 22px 1px rgba(200,207,192,0.7);
  animation: shutterTop 1.9s cubic-bezier(0.7, 0, 0.22, 1) forwards;
}
.boot-shutter-bottom {
  bottom: 0; border-top: 2px solid rgba(232,236,226,0.95);
  box-shadow: 0 -7px 22px 1px rgba(200,207,192,0.7);
  animation: shutterBottom 1.9s cubic-bezier(0.7, 0, 0.22, 1) forwards;
}
/* the page falls up through the opening, fish-eyed, then settles (full intensity only).
   origin is anchored to the VIEWPORT centre (50vh), not the tall page's centre, and the
   perspective is held CONSTANT so the zoom interpolates smoothly; `forwards` holds the
   final (identical-to-normal) frame so there's no end snap. */
html.booting[data-fx="full"] .crt-frame {
  transform-origin: 50% 50vh;
  animation: flicker 7s infinite steps(60), crtEnter 1.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes bootStaticFade {
  0%, 16% { opacity: 1; }
  30%     { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes shutterTop {
  0%, 26%   { transform: translateY(0); }
  72%, 100% { transform: translateY(-100%); }
}
@keyframes shutterBottom {
  0%, 26%   { transform: translateY(0); }
  72%, 100% { transform: translateY(100%); }
}
@keyframes crtEnter {
  0%, 24% { opacity: 0; transform: perspective(420px) translateZ(-340px); filter: blur(14px) brightness(1.7) contrast(1.2); }
  36%     { opacity: 1; transform: perspective(420px) translateZ(-150px); filter: blur(9px) brightness(1.4) contrast(1.1); }
  74%     { opacity: 1; transform: perspective(420px) translateZ(75px);   filter: blur(2.5px) brightness(1.12); }  /* close & bulged — the fish-eye */
  100%    { opacity: 1; transform: perspective(420px) translateZ(0);      filter: blur(0) brightness(1); }          /* settles flush — no snap */
}
/* during the boot, skip the redundant page tune-in */
html.booting #tube-switch { animation: none !important; }
/* defense: never boot when motion is reduced */
@media (prefers-reduced-motion: reduce) { #crt-boot { display: none !important; } html.booting { overflow: auto; } }

/* ===== Channel-change transition ===== */
#tube-switch {
  position: fixed; inset: 0; z-index: 9990; pointer-events: none;
  opacity: 0; visibility: hidden;
  background-color: #050505;
  /* layer 1 (top): dark veil that dims everything below — no flashbang.
     layer 2: a faint phosphor roll band.  layer 3: fine static. */
  background-image:
    linear-gradient(rgba(5,5,5,0.5), rgba(5,5,5,0.5)),
    linear-gradient(rgba(255,255,255,0) 46%, rgba(200,207,192,0.10) 50%, rgba(255,255,255,0) 54%);
  background-size: cover, 100% 240px;
  background-repeat: no-repeat, no-repeat;
  /* plays once on every page load: a smooth "tune in" */
  animation: tubeIn 0.42s ease-out 1;
}
/* boiling static, painted ABOVE the veil so it actually crackles */
#tube-switch::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: staticBoil 0.14s steps(2, end) infinite;
}
#tube-switch.switching {
  /* plays on link click before navigating: a smooth "tune out" */
  animation: tubeOut 0.26s ease-in forwards;
}
@keyframes tubeIn {
  0%   { opacity: 0.82; visibility: visible; background-position: 0 0, 0 -10%; }
  100% { opacity: 0; visibility: hidden; background-position: 0 0, 0 110%; }
}
@keyframes tubeOut {
  0%   { opacity: 0; visibility: visible; background-position: 0 0, 0 110%; }
  100% { opacity: 0.82; visibility: visible; background-position: 0 0, 0 -10%; }
}
/* rapid noise jitter = TV static boiling */
@keyframes staticBoil {
  0%   { background-position: 0 0; }
  25%  { background-position: -47px 33px; }
  50%  { background-position: 31px -41px; }
  75%  { background-position: -22px 18px; }
  100% { background-position: 40px 27px; }
}
/* gated by the reception control + OS reduced-motion */
html[data-fx="min"] #tube-switch { display: none !important; }
@media (prefers-reduced-motion: reduce) { #tube-switch { display: none !important; } }

/* ===== Reception control (visual-intensity toggle) ===== */
.fx-toggle {
  position: fixed; left: 14px; bottom: 14px; z-index: 9400;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 9px;
  background: rgba(10, 10, 8, 0.7);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--mono-ui); font-size: 0.62rem; letter-spacing: 1px;
  cursor: pointer;
}
.fx-toggle:hover { color: var(--amber); border-color: var(--rust-lt); }
.fx-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.fx-bars i { width: 3px; background: currentColor; display: block; }
.fx-bars i:nth-child(1) { height: 5px; }
.fx-bars i:nth-child(2) { height: 8px; }
.fx-bars i:nth-child(3) { height: 12px; }
.fx-toggle[data-level="faint"] .fx-bars i:nth-child(3) { opacity: 0.2; }
.fx-toggle[data-level="min"] .fx-bars i:nth-child(2),
.fx-toggle[data-level="min"] .fx-bars i:nth-child(3) { opacity: 0.2; }
.fx-label { white-space: nowrap; }
@media (max-width: 560px) { .fx-toggle .fx-label { display: none; } }

/* --- FAINT: calmer. Dim the overlays, kill the heaviest motion. --- */
html[data-fx="faint"] .crt-noise { opacity: 0.02; animation: none; }
html[data-fx="faint"] .crt-scanlines { opacity: 0.4; }
html[data-fx="faint"] .crt-vignette { background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.4) 100%); }
html[data-fx="faint"] .crt-frame { animation: none; }
html[data-fx="faint"] .radio-fog-page { opacity: 0.5; animation: none; }
html[data-fx="faint"] .radio-fog-page span,
html[data-fx="faint"] .radio-static,
html[data-fx="faint"] .radio-scan { animation: none; }
html[data-fx="faint"] .glitch::before,
html[data-fx="faint"] .glitch::after { display: none; }

/* --- CLEAR (min): readability first. Hide overlays, stop decorative motion. --- */
html[data-fx="min"] .crt-scanlines,
html[data-fx="min"] .crt-noise,
html[data-fx="min"] .crt-vignette,
html[data-fx="min"] .radio-fog-page { display: none; }
html[data-fx="min"] .glitch::before,
html[data-fx="min"] .glitch::after { display: none; }
html[data-fx="min"] .crt-frame,
html[data-fx="min"] .radio-static,
html[data-fx="min"] .radio-scan,
html[data-fx="min"] .radio-needle,
html[data-fx="min"] .gb-welcome,
html[data-fx="min"] .gb-proceed,
html[data-fx="min"] .gb-proceed-btn,
html[data-fx="min"] .gb-entry-fresh,
html[data-fx="min"] .blink { animation: none !important; }

/* ===== "The building remembers you" ===== */
#whisper {
  position: fixed; bottom: 60px; left: 50%; z-index: 9300;
  max-width: 92%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(10, 10, 8, 0.88);
  border: 1px solid var(--rust);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
  color: var(--text-dim);
  font-family: var(--mono-ui); font-size: 0.82rem; letter-spacing: 1px; font-style: italic;
  text-align: center; padding: 8px 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
#whisper.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; cursor: pointer; }
#whisper .whisper-name { color: var(--red-hot); font-style: normal; }

/* the visitor's own guestbook signature, quietly marked */
.gb-entry.gb-mine { border-left: 2px solid var(--red); padding-left: 10px; }
.gb-mine-tag { color: var(--red-hot); font-size: 0.68rem; letter-spacing: 1px; margin-left: 8px; }

/* ===== Sound control (ambiance + persistent signal) ===== */
.signal-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 9400;
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px;
  background: rgba(10, 10, 8, 0.7);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--mono-ui); font-size: 0.62rem; letter-spacing: 1px; cursor: pointer;
}
.signal-toggle:hover { color: var(--amber); border-color: var(--rust-lt); }
.signal-toggle.on { color: var(--red-hot); border-color: var(--red); }
.signal-ico { font-size: 0.85rem; line-height: 1; }
@media (max-width: 560px) { .signal-toggle .signal-label { display: none; } }

/* ===== Room 312 (hidden room) ===== */
.room312 { position: relative; min-height: 62vh; padding: 24px 0; }
.room312-fog { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.room312-fog span {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 150, 140, 0.12), transparent 70%);
  filter: blur(44px);
}
.room312-fog span:nth-child(1) { width: 64vw; height: 60vh; left: -12vw; top: 4vh;  animation: fogDrift 32s ease-in-out infinite alternate; }
.room312-fog span:nth-child(2) { width: 58vw; height: 56vh; right: -10vw; top: 18vh; animation: fogDrift2 26s ease-in-out infinite alternate; }
.room312-fog span:nth-child(3) { width: 70vw; height: 54vh; left: 16vw; bottom: -12vh; animation: fogDrift 38s ease-in-out infinite alternate-reverse; }
.room312-inner { max-width: 620px; margin: 0 auto; position: relative; z-index: 1; text-align: center; }
.room312-eyebrow { color: var(--text-dim); letter-spacing: 2px; font-size: 0.8rem; }
.room312-title { font-size: 3rem; color: var(--red-hot); margin: 6px 0 26px; }
.room312-note {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(7, 8, 6, 0.72);
  padding: 18px 20px; line-height: 1.7;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.7);
}
.room312-note p { margin: 0 0 14px; }
.room312-sign { color: var(--amber); font-style: italic; margin-top: 18px; margin-bottom: 0; }
.room312-leave { margin-top: 26px; }
.room312-leave a { color: var(--amber); letter-spacing: 1px; border-bottom: 1px dotted rgba(212,168,83,0.35); }
.room312-foot { color: var(--text-dim); font-size: 0.75rem; letter-spacing: 2px; margin-top: 30px; }

/* the hidden door — a faint, flickering pixel in the footer */
.secret-door {
  display: inline-block; width: 10px; height: 10px; line-height: 10px;
  margin-left: 8px; vertical-align: middle;
  color: var(--red-hot); font-size: 12px; text-decoration: none; border: none;
  animation: secretFlicker 4.5s steps(1) infinite;
}
.secret-door:hover { color: #fff; text-shadow: 0 0 9px var(--red-hot); }
@keyframes secretFlicker {
  0%, 100% { opacity: 0.4; }
  48% { opacity: 0.4; }
  50% { opacity: 0.9; }
  53% { opacity: 0.35; }
  87% { opacity: 0.45; }
  90% { opacity: 0.9; }
  93% { opacity: 0.4; }
}

/* ===== Room 312: door-opening animation + counter ===== */
.door-open {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: #000; overflow: hidden; opacity: 1;
}
.door-open.go { animation: doorScene 2.4s ease-in forwards; }       /* fades to reveal the room */
.door-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 1100px; transform-origin: 50% 50%; transform: scale(0.9);
}
.door-open.go .door-stage { animation: doorZoom 2.4s cubic-bezier(0.45, 0, 0.55, 1) forwards; }  /* pushes through */
.door-frame {                                        /* the dark room beyond the door */
  position: absolute; width: 31vmin; height: 58vmin;
  background: #06070b;
  box-shadow: 0 0 0 7vmin #040504, inset 0 0 40px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(40, 36, 30, 0.8);
}
.door {                                              /* a single pale paneled door */
  position: relative; width: 30vmin; height: 56vmin;
  transform-origin: left center; transform: rotateY(0deg);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.35), rgba(255,255,255,0.06) 12%, transparent 30%),
    linear-gradient(160deg, #cfc8ba, #a89f8e 60%, #8c8474);
  border: 1px solid #5a5346; box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  backface-visibility: hidden;
}
.door-open.go .door { animation: doorSwing 2.4s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.door::before, .door::after {                        /* recessed panels */
  content: ""; position: absolute; left: 14%; right: 14%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(0,0,0,0.12));
}
.door::before { top: 22%; height: 32%; }
.door::after  { top: 58%; height: 32%; }
.door-number {
  position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
  font-family: var(--mono-head); font-size: 4.6vmin; letter-spacing: 0.6vmin; line-height: 1;
  color: #6e6354;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45), 0 -1px 0 rgba(0, 0, 0, 0.45);
}
.door-knob {
  position: absolute; right: 9%; top: 50%; width: 1.6vmin; height: 1.6vmin;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8e0cf, #6b6457);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); transform: translateY(-50%);
}
@keyframes doorSwing {
  0%   { transform: rotateY(0deg); }
  14%  { transform: rotateY(-2.5deg); }    /* sticks */
  18%  { transform: rotateY(-1deg); }      /* shudders */
  100% { transform: rotateY(-86deg); }     /* swings open */
}
@keyframes doorZoom {
  0%   { transform: scale(0.9); }
  16%  { transform: scale(1); }            /* approach, then it gives */
  100% { transform: scale(4.6); }          /* through the doorway */
}
@keyframes doorScene {
  0%, 76% { opacity: 1; }
  100%    { opacity: 0; visibility: hidden; }
}
.room312-inner { animation: room312In 2.6s ease both; }
@keyframes room312In { 0%, 62% { opacity: 0; } 100% { opacity: 1; } }
.room312-count { color: var(--amber); font-size: 0.8rem; letter-spacing: 1px; margin-top: 18px; }
html[data-fx="min"] .door-open { display: none; }
html[data-fx="min"] .room312-inner { animation: none; }
@media (prefers-reduced-motion: reduce) { .door-open { display: none; } .room312-inner { animation: none; } }

/* ===== Room 312: background image (dimmed, dark, foggy) ===== */
.room312-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-size: cover; background-position: center;
  opacity: 0.22;                                   /* low opacity */
  filter: grayscale(0.4) brightness(0.5) contrast(1.05) blur(1px);
}
.room312-bg::after {                               /* darken edges + sink it back */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(5, 6, 4, 0.9) 100%);
}
html[data-fx="min"] .room312-bg { opacity: 0.12; filter: grayscale(0.6) brightness(0.45); }

/* ===== Per-post atmosphere (mood wash on the post page) ===== */
.term-select {
  background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line);
  font-family: var(--mono-body); padding: 6px 8px; margin-top: 4px;
}
.atmos-layer {
  position: fixed; inset: 0; z-index: 8997; pointer-events: none;
  opacity: 0; transition: opacity 1.4s ease;
}
.atmos-layer[data-atmos="fog"],
.atmos-layer[data-atmos="rust"],
.atmos-layer[data-atmos="dread"],
.atmos-layer[data-atmos="cold"],
.atmos-layer[data-atmos="void"] { opacity: 1; }

/* FOG — pale wash + visible drifting fog (lightens the page) */
.atmos-layer[data-atmos="fog"] { background: rgba(198, 205, 190, 0.20); mix-blend-mode: screen; }
.atmos-fog { display: none; }
.atmos-layer[data-atmos="fog"] .atmos-fog {
  display: block; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 219, 208, 0.42), transparent 70%);
  filter: blur(46px); mix-blend-mode: screen;
}
.atmos-layer[data-atmos="fog"] .atmos-fog:nth-child(1) { width: 62vw; height: 60vh; left: -10vw; top: 6vh;  animation: fogDrift 34s ease-in-out infinite alternate; }
.atmos-layer[data-atmos="fog"] .atmos-fog:nth-child(2) { width: 56vw; height: 55vh; right: -8vw; top: 20vh; animation: fogDrift2 28s ease-in-out infinite alternate; }
.atmos-layer[data-atmos="fog"] .atmos-fog:nth-child(3) { width: 72vw; height: 52vh; left: 14vw; bottom: -12vh; animation: fogDrift 40s ease-in-out infinite alternate-reverse; }

/* RUST — warm amber decay (clear tint, center kept readable) */
.atmos-layer[data-atmos="rust"] { background: radial-gradient(ellipse at center, rgba(150, 92, 48, 0.30) 28%, rgba(64, 34, 16, 0.68) 100%); }

/* DREAD — red wash tightening into a heavy dark vignette */
.atmos-layer[data-atmos="dread"] { background: radial-gradient(ellipse at center, rgba(128, 14, 14, 0.30) 26%, rgba(26, 0, 0, 0.80) 100%); }

/* COLD — clinical blue chill */
.atmos-layer[data-atmos="cold"] { background: radial-gradient(ellipse at center, rgba(66, 120, 150, 0.28) 28%, rgba(14, 32, 52, 0.72) 100%); }

/* VOID — light swallowed from the edges */
.atmos-layer[data-atmos="void"] { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.30) 6%, rgba(0, 0, 0, 0.93) 100%); }

/* INTERFERENCE — heavier grain + scanlines, flickering (opacity driven by its own animation) */
.atmos-layer[data-atmos="interference"] {
  background-color: rgba(10, 14, 10, 0.22);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.28) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: auto, 130px 130px;
  opacity: 0.5;
  animation: atmosFlicker 3.6s steps(1) infinite;
}
/* mostly steady with occasional brief dips — an unstable signal, not a strobe */
@keyframes atmosFlicker {
  0%, 100% { opacity: 0.5; background-position: 0 0, 0 0; }
  9%  { opacity: 0.6; }
  10% { opacity: 0.4; }
  11% { opacity: 0.54; }
  50% { opacity: 0.5; background-position: 0 0, 5px -4px; }
  66% { opacity: 0.42; }
  67% { opacity: 0.56; }
}

/* respect the reception control / reduced motion: keep the tint, drop the motion */
html[data-fx="min"] .atmos-fog,
html[data-fx="min"] .atmos-layer[data-atmos="interference"] { animation: none !important; }
html[data-fx="min"] .atmos-layer { opacity: 0.55; }
@media (prefers-reduced-motion: reduce) {
  .atmos-fog, .atmos-layer[data-atmos="interference"] { animation: none !important; }
}

/* ===== Real-clock darkness (dims/cools toward night) ===== */
.nightfall {
  position: fixed; inset: 0; z-index: 8996; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(8, 12, 20, 0) 32%, rgba(5, 9, 16, 0.92) 120%);
  opacity: var(--nightfall, 0);
  transition: opacity 60s linear;   /* eases as the hour changes */
}
html[data-fx="min"] .nightfall { opacity: calc(var(--nightfall, 0) * 0.45); }   /* gentler when effects are dialed down */

/* ===== Live presence ("souls wandering") ===== */
.presence {
  margin-top: 6px;
  font-family: var(--mono-ui); font-size: 0.76rem; letter-spacing: 2px;
  color: var(--rust-lt);
}

/* ===== Post decay — older transmissions rot like abandoned documents ===== */
/* aging cast (sepia/foxed, not just faded) */
.post-card[data-decay="1"] { filter: sepia(0.12) brightness(0.98); }
.post-card[data-decay="2"] { filter: sepia(0.3) brightness(0.95) saturate(0.95); opacity: 0.97; }
.post-card[data-decay="3"] { filter: sepia(0.52) brightness(0.9) contrast(1.05); opacity: 0.93; }
.post-card[data-decay="4"] { filter: sepia(0.72) brightness(0.82) contrast(1.08); opacity: 0.88; }

/* frayed edges get rougher with age (torn sheet, not shredded — reveals the dark behind) */
.post-card[data-decay="3"] {
  clip-path: polygon(0 2%, 3% 0, 50% 1.5%, 97% 0, 100% 3%, 99% 50%, 100% 97%, 60% 99%, 4% 100%, 1% 60%, 2% 20%);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(34, 22, 10, 0.5);
}
.post-card[data-decay="4"] {
  clip-path: polygon(2% 3%, 6% 0, 30% 2%, 55% 0, 80% 2%, 96% 0, 100% 5%, 98% 40%, 100% 72%, 97% 98%, 55% 99%, 6% 100%, 1% 80%, 3% 45%, 0 15%);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.55), inset 0 0 30px rgba(26, 15, 7, 0.7);   /* scorched inner edge */
}

/* chromatic glitch creeps into aged titles */
.post-card[data-decay="3"] .post-card-title a,
.post-card[data-decay="4"] .post-card-title a {
  text-shadow: 1px 0 rgba(192, 57, 43, 0.5), -1px 0 rgba(46, 90, 74, 0.5);
}

/* ::before = mottled soaked-in staining + darkened edges (behind the text) */
.post-card[data-decay="2"]::before,
.post-card[data-decay="3"]::before,
.post-card[data-decay="4"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.post-card[data-decay="2"]::before {
  background:
    radial-gradient(ellipse at 30% 42%, rgba(112, 72, 36, 0.16), transparent 55%),
    radial-gradient(circle at 72% 68%, rgba(96, 60, 28, 0.18) 0 18%, transparent 34%),
    radial-gradient(ellipse at center, transparent 55%, rgba(24, 15, 7, 0.30) 100%);
}
.post-card[data-decay="3"]::before {
  background:
    radial-gradient(circle at 24% 30%, rgba(112, 72, 34, 0.26) 0 16%, transparent 32%),
    radial-gradient(circle at 70% 62%, rgba(92, 58, 26, 0.30) 0 20%, transparent 38%),
    radial-gradient(circle at 52% 84%, rgba(72, 46, 22, 0.26) 0 15%, transparent 32%),
    radial-gradient(circle at 84% 22%, rgba(102, 66, 30, 0.22) 0 13%, transparent 28%),
    radial-gradient(ellipse at center, transparent 42%, rgba(20, 12, 6, 0.52) 100%);
}
.post-card[data-decay="4"]::before {
  background:
    radial-gradient(circle at 20% 28%, rgba(98, 60, 28, 0.42) 0 18%, transparent 36%),
    radial-gradient(circle at 68% 58%, rgba(82, 50, 24, 0.44) 0 22%, transparent 42%),
    radial-gradient(circle at 48% 82%, rgba(60, 38, 18, 0.42) 0 17%, transparent 36%),
    radial-gradient(circle at 82% 20%, rgba(92, 58, 26, 0.36) 0 15%, transparent 32%),
    radial-gradient(circle at 40% 52%, rgba(50, 32, 16, 0.34) 0 26%, transparent 48%),
    radial-gradient(ellipse at center, transparent 30%, rgba(14, 8, 4, 0.68) 100%);
}

/* ::after = fine grime speckle mottling the surface (no holes; over the text, faint) */
.post-card[data-decay="3"]::after,
.post-card[data-decay="4"]::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04 0.05' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.34  0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 -1.2 0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  opacity: 0.4;
}
.post-card[data-decay="4"]::after { opacity: 0.6; }

/* on the post page keep it legible — age the title/meta, leave the body mostly clear */
.post-full[data-decay="3"] .post-full-title,
.post-full[data-decay="4"] .post-full-title {
  color: var(--text-dim);
  text-shadow: 1px 0 rgba(192, 57, 43, 0.35), -1px 0 rgba(46, 90, 74, 0.35);
}
.post-full[data-decay="3"] { filter: sepia(0.28) brightness(0.96); }
.post-full[data-decay="4"] { filter: sepia(0.45) brightness(0.9); }
.post-full[data-decay="4"] .post-full-body { opacity: 0.92; }

/* CLEAR intensity: strip decay so posts read clean */
html[data-fx="min"] .post-card {
  opacity: 1 !important; filter: none !important;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.55) !important;
  clip-path: polygon(0 2%, 3% 0, 60% 1%, 98% 0, 100% 4%, 99% 96%, 100% 100%, 40% 99%, 2% 100%, 0 97%);
}
html[data-fx="min"] .post-card::before,
html[data-fx="min"] .post-card::after { display: none !important; }
html[data-fx="min"] .post-full[data-decay] { filter: none; }
html[data-fx="min"] .post-full[data-decay] .post-full-title { color: var(--text); text-shadow: none; }
html[data-fx="min"] .post-full[data-decay] .post-full-body { opacity: 1; }
