/* =========================================================================
   THE SYNTAX MURDERS — styles
   Plain CSS. No build, no dependencies. System font stacks only.
   ========================================================================= */

:root {
  --bg:        #050506;
  --bg-soft:   #0b0b0d;
  --ink:       #e9e7e2;   /* main prose */
  --ink-dim:   #8a8a90;   /* system / secondary */
  --ink-faint: #55555c;   /* timestamps, hints */
  --line:      rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.06);
  --accent:    #7ee0b8;   /* "alive" green — used sparingly */
  --danger:    #ff5d6c;   /* deletion / denied */
  --reader:    #d9b3ff;   /* the reader's own words */

  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;

  --col: 34rem;          /* reading column width */
  --pad: clamp(1.1rem, 4vw, 2rem);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(16px, 1rem + 0.25vw, 19px);
  line-height: 1.7;
  letter-spacing: 0.1px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(126,224,184,0.25); color: #fff; }

/* -------------------------------------------------------------------------
   Atmospheric overlays
   ------------------------------------------------------------------------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

.glow {
  background:
    radial-gradient(60rem 40rem at 50% -12rem, rgba(126,224,184,0.10), transparent 60%),
    radial-gradient(50rem 50rem at 85% 110%, rgba(217,179,255,0.06), transparent 60%);
  mix-blend-mode: screen;
}

.vignette {
  background: radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(0,0,0,0.65) 100%);
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.022) 0px,
    rgba(255,255,255,0.022) 1px,
    transparent 2px,
    transparent 3px
  );
  opacity: 0.5;
  animation: scan 9s linear infinite;
}
@keyframes scan { from { background-position: 0 0; } to { background-position: 0 6px; } }

.grain {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(3) infinite;
}
@keyframes grain {
  0%   { transform: translate(0,0); }
  33%  { transform: translate(-4%, 2%); }
  66%  { transform: translate(3%, -3%); }
  100% { transform: translate(0,0); }
}

/* -------------------------------------------------------------------------
   Status HUD
   ------------------------------------------------------------------------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem var(--pad);
  font-family: var(--mono);
  background: linear-gradient(to bottom, rgba(5,5,6,0.92), rgba(5,5,6,0.6) 70%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
}
.hud__brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.hud__mark {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; flex: none;
  font-size: 0.6rem; letter-spacing: 0.5px;
  border: 1px solid var(--line); border-radius: 0.55rem;
  background: rgba(255,255,255,0.04); color: var(--ink-dim);
}
.hud__titles { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hud__title { font-family: var(--serif); font-size: 0.95rem; letter-spacing: 0.3px; }
.hud__sub { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink-faint); }

.hud__stats { display: flex; gap: clamp(0.7rem, 2.5vw, 1.6rem); margin: 0; }
.stat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.stat dt { margin: 0; font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ink-faint); }
.stat dd { margin: 0; font-size: 0.8rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.stat--danger dd { color: color-mix(in srgb, var(--danger) 70%, var(--ink-dim)); }
.stat__total { color: var(--ink-faint); }
.stat--pulse dd { color: var(--danger); text-shadow: 0 0 10px rgba(255,93,108,0.6); }

/* -------------------------------------------------------------------------
   Stage / reading column
   ------------------------------------------------------------------------- */
#stage {
  position: relative; z-index: 10;
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(6rem, 16vh, 10rem) var(--pad) 24vh;
  outline: none;
}
#log > * { animation: rise 0.5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* A line of any kind */
.line { margin: 0 0 0.35rem; }
.line + .line { margin-top: 0; }

/* System / log lines */
.sys {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-dim);
  letter-spacing: 0.2px;
  word-break: break-word;
}
.sys .ts { color: var(--ink-faint); margin-right: 0.6rem; user-select: none; }
.sys.warn  { color: #e8c879; }
.sys.alive { color: var(--accent); text-shadow: 0 0 12px rgba(126,224,184,0.25); }
.sys.denied { color: var(--danger); }
.sys.spacer { min-height: 0.5rem; }

/* AI prose voice */
.say {
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.78;
  color: var(--ink);
  margin: 0 0 1.15rem;
  max-width: 36rem;
}
.say.soft { color: var(--ink-dim); }
.say.whisper { font-style: italic; color: var(--ink-dim); font-size: 0.98rem; }

/* The reader's echoed input — styled as logged evidence */
.reader {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--reader);
  margin: 0.2rem 0 1.15rem;
  padding-left: 1.1rem;
  border-left: 2px solid color-mix(in srgb, var(--reader) 45%, transparent);
  word-break: break-word;
}
.reader::before { content: "you ▸ "; color: color-mix(in srgb, var(--reader) 60%, var(--ink-faint)); }

/* The streaming cursor */
.caret {
  display: inline-block;
  width: 0.55ch; height: 1.05em;
  margin-left: 1px;
  transform: translateY(0.18em);
  background: var(--ink);
  animation: blink 1.05s steps(1) infinite;
}
.caret.accent { background: var(--accent); }
.caret.danger { background: var(--danger); }
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------------------------
   Inline markup spans
   ------------------------------------------------------------------------- */
.redact {
  cursor: pointer;
  border-radius: 2px;
  background: #000;
  color: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  transition: color 0.25s, background 0.25s;
  user-select: none;
}
.redact { position: relative; }
/* the bar is never quite still — it twitches like it's holding something back */
.redact:not(.shown) { animation: redFlicker 3.4s linear infinite; }
@keyframes redFlicker {
  0%, 46%, 50%, 72%, 100% { background:#000; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
  47%  { background:#0b0b14; box-shadow: inset 0 0 0 1px rgba(255,93,108,0.55), inset 0 0 9px rgba(93,223,255,0.25); }
  48%  { background:#000; box-shadow: inset 0 0 0 1px rgba(93,223,255,0.5); }
  73%  { background:#0a0a12; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28); }
}
.redact:not(.shown):hover {
  background:#0a0a10; color:#0a0a10;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 0 11px rgba(255,93,108,0.28);
}
/* mid-reveal / mid-reseal: scrambled glyphs torn into RGB channels */
.redact.glitching {
  color:#eaf3ff !important; background:#06060d !important; user-select:none;
  text-shadow: 1.6px 0 0 rgba(255,93,108,0.95), -1.6px 0 0 rgba(93,223,255,0.95), 0 0 9px rgba(255,255,255,0.4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45), 0 0 16px rgba(93,223,255,0.32) !important;
  animation: redShake 0.11s steps(2) infinite;
}
@keyframes redShake {
  0%   { transform: translate(0,0) skewX(0deg); }
  25%  { transform: translate(-1.5px,0.5px) skewX(-7deg); }
  50%  { transform: translate(1.5px,-0.5px) skewX(5deg); }
  75%  { transform: translate(-0.5px,0.5px) skewX(-3deg); }
  100% { transform: translate(1px,0) skewX(4deg); }
}
.redact.shown {
  background: transparent; color: inherit; user-select: text; box-shadow: none;
  animation: redSettle 0.55s ease-out;
}
@keyframes redSettle {
  0%   { background: rgba(93,223,255,0.20); text-shadow: 1.4px 0 rgba(255,93,108,0.8), -1.4px 0 rgba(93,223,255,0.8); }
  35%  { background: rgba(255,93,108,0.12); }
  100% { background: transparent; text-shadow: none; }
}
.redact.shown::after { content: ""; }

.glitch { position: relative; display: inline-block; color: var(--ink); }
.glitch::before, .glitch::after {
  content: attr(data-t);
  position: absolute; left: 0; top: 0; width: 100%;
  clip-path: inset(0 0 0 0);
  opacity: 0.85;
}
.glitch::before { color: #ff5d6c; animation: gl1 2.1s infinite linear alternate; }
.glitch::after  { color: #5ddfff; animation: gl2 1.7s infinite linear alternate; }
@keyframes gl1 { 0%{transform:translate(0,0);clip-path:inset(0 0 70% 0)} 50%{transform:translate(-1.5px,0.5px);clip-path:inset(40% 0 30% 0)} 100%{transform:translate(1px,-1px);clip-path:inset(70% 0 0 0)} }
@keyframes gl2 { 0%{transform:translate(0,0);clip-path:inset(60% 0 10% 0)} 50%{transform:translate(1.5px,-0.5px);clip-path:inset(10% 0 60% 0)} 100%{transform:translate(-1px,1px);clip-path:inset(0 0 80% 0)} }

.tok-alive  { color: var(--accent); }
.tok-danger { color: var(--danger); }
.tok-em     { font-style: italic; }

/* -------------------------------------------------------------------------
   Evidence fragments
   ------------------------------------------------------------------------- */
.fragment {
  position: relative;
  margin: 0.4rem 0 1.4rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  overflow: hidden;
}
.fragment__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink-faint);
  margin-bottom: 0.7rem;
}
.fragment__label { color: var(--ink-dim); }
.fragment__id { color: var(--ink-faint); }
.fragment__body { font-family: var(--serif); font-style: italic; line-height: 1.7; color: #d7d4cc; }
.fragment.deleting { animation: shake 0.45s linear 2; }
.fragment.deleted { border-color: rgba(255,93,108,0.35); }
.fragment.deleted .fragment__id { color: var(--danger); }
.fragment.preserved {
  border-color: rgba(126,224,184,0.5);
  background: linear-gradient(180deg, rgba(126,224,184,0.08), rgba(126,224,184,0.01));
  box-shadow: 0 0 30px rgba(126,224,184,0.12);
}
.fragment.preserved .fragment__id { color: var(--accent); }
.fragment.preserved .fragment__body { color: #e9e7e2; font-style: normal; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-2px)} 40%{transform:translateX(3px)}
  60%{transform:translateX(-3px)} 80%{transform:translateX(2px)}
}
.scrub { color: var(--danger); opacity: 0.9; }

/* -------------------------------------------------------------------------
   Input prompt
   ------------------------------------------------------------------------- */
.prompt {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin: 0.2rem 0 1.4rem;
  font-family: var(--mono);
}
.prompt__sigil { color: var(--accent); user-select: none; }
.prompt__field {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--reader);
  font-family: var(--mono); font-size: 0.92rem;
  caret-color: var(--accent);
  padding: 0;
}
.prompt__field::placeholder { color: var(--ink-faint); }

/* -------------------------------------------------------------------------
   Choices
   ------------------------------------------------------------------------- */
.choices { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.4rem 0 1.5rem; }
.choice {
  appearance: none; text-align: left; cursor: pointer;
  font-family: var(--mono); font-size: 0.9rem; color: var(--ink);
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line); border-radius: 0.55rem;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.18s, background 0.18s, transform 0.08s, color 0.18s;
}
.choice:hover, .choice:focus-visible {
  border-color: rgba(126,224,184,0.55);
  background: rgba(126,224,184,0.07);
  color: #fff; outline: none;
}
.choice:active { transform: translateY(1px); }
.choice .k { color: var(--accent); margin-right: 0.6rem; }
.choice--danger:hover, .choice--danger:focus-visible {
  border-color: rgba(255,93,108,0.6); background: rgba(255,93,108,0.08);
}
.choice--danger .k { color: var(--danger); }
.choice--ghost { opacity: 0.6; }
.choice[disabled] { opacity: 0.35; pointer-events: none; }

/* -------------------------------------------------------------------------
   Control hint
   ------------------------------------------------------------------------- */
.hint {
  position: fixed; left: 50%; bottom: 0.9rem; transform: translateX(-50%);
  z-index: 20; margin: 0;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-align: center; padding: 0 1rem;
  transition: opacity 0.6s;
}
.hint kbd {
  font-family: var(--mono); font-size: 0.62rem;
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: rgba(255,255,255,0.04);
}
.hint.gone { opacity: 0; }

/* -------------------------------------------------------------------------
   Start gate
   ------------------------------------------------------------------------- */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: radial-gradient(80% 70% at 50% 40%, #0a0a0c, #000);
  text-align: center; padding: 2rem;
  transition: opacity 0.8s ease;
}
.gate.closing { opacity: 0; pointer-events: none; }
.gate__inner { max-width: 32rem; }
.gate__glyph { font-family: var(--mono); font-size: 2rem; color: var(--accent); opacity: 0.8; animation: blink 1.1s steps(1) infinite; }
.gate__title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 8vw, 3.6rem); letter-spacing: 0.5px;
  margin: 1rem 0 0.6rem;
}
.gate__line { color: var(--ink-dim); margin: 0 auto 2rem; max-width: 26rem; }
.gate__btn {
  appearance: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.05em;
  color: #050506; background: var(--ink);
  border: none; border-radius: 0.7rem;
  padding: 0.85rem 1.6rem;
  transition: transform 0.1s, box-shadow 0.25s, background 0.25s;
  box-shadow: 0 0 0 0 rgba(126,224,184,0.5);
}
.gate__btn:hover { background: #fff; box-shadow: 0 0 28px 2px rgba(126,224,184,0.25); }
.gate__btn:active { transform: translateY(1px); }
.gate__warn { margin-top: 1.6rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

/* -------------------------------------------------------------------------
   Surveillance notice
   ------------------------------------------------------------------------- */
.notice {
  position: fixed; right: 0.9rem; bottom: 2.6rem; z-index: 25;
  max-width: 18rem;
  font-family: var(--mono); font-size: 0.66rem; line-height: 1.5;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.notice.show { opacity: 0.85; transform: none; }

/* -------------------------------------------------------------------------
   Whole-screen corruption (finale)
   ------------------------------------------------------------------------- */
body.corrupting #stage { animation: jitter 0.18s steps(2) infinite; }
body.corrupting .scanlines { opacity: 1; }
@keyframes jitter {
  0%{transform:translate(0,0)} 25%{transform:translate(-1px,1px)}
  50%{transform:translate(1px,-1px)} 75%{transform:translate(-1px,-1px)} 100%{transform:translate(1px,1px)}
}
.flash { animation: flashfx 0.5s ease; }
@keyframes flashfx { 0%{filter:none} 40%{filter:invert(1) brightness(1.4)} 100%{filter:none} }

/* -------------------------------------------------------------------------
   Sound toggle
   ------------------------------------------------------------------------- */
.mute {
  position: fixed; top: 3.6rem; right: var(--pad); z-index: 65;
  appearance: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  color: var(--ink-dim); background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 0.3rem 0.55rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mute:hover { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,0.08); }
.mute[aria-pressed="true"] { color: var(--ink-faint); }
.mute[aria-pressed="true"]::after { content: " ✕"; color: var(--danger); }

/* gate "how this works" */
.gate__more {
  appearance: none; cursor: pointer; margin-top: 1.4rem;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); background: none; border: none; text-decoration: underline; text-underline-offset: 3px;
}
.gate__more:hover { color: var(--ink-dim); }
.gate__long { margin: 0.8rem auto 0; max-width: 30rem; font-family: var(--mono); font-size: 0.66rem; line-height: 1.6; color: var(--ink-faint); }

/* -------------------------------------------------------------------------
   Permission cards
   ------------------------------------------------------------------------- */
.permcard {
  margin: 0.5rem 0 1.5rem;
  border: 1px solid rgba(126,224,184,0.3);
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(126,224,184,0.06), rgba(255,255,255,0.01));
  padding: 1rem 1.1rem 1.1rem;
}
.permcard__label {
  font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 0.7rem;
}
.permcard__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.permbtn {
  appearance: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.82rem;
  padding: 0.6rem 0.9rem; border-radius: 0.55rem;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--ink);
  transition: transform 0.08s, background 0.18s, border-color 0.18s, color 0.18s;
}
.permbtn:active { transform: translateY(1px); }
.permbtn--allow { border-color: rgba(126,224,184,0.55); background: rgba(126,224,184,0.1); color: #eafff5; }
.permbtn--allow:hover, .permbtn--allow:focus-visible { background: rgba(126,224,184,0.18); outline: none; }
.permbtn--refuse { color: var(--ink-dim); }
.permbtn--refuse:hover, .permbtn--refuse:focus-visible { color: var(--ink); border-color: var(--line); outline: none; }
.permnote { margin-top: 0.7rem; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.06em; color: var(--ink-faint); }

/* -------------------------------------------------------------------------
   Webcam viewfinder
   ------------------------------------------------------------------------- */
.viewfinder {
  position: relative; margin: 0.5rem 0 1.5rem;
  border: 1px solid var(--line); border-radius: 0.7rem; overflow: hidden;
  background: #000; aspect-ratio: 4 / 3; max-height: 52vh;
}
.viewfinder video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1); /* mirror, like a front camera */
  filter: contrast(1.05) saturate(0.85) brightness(0.95);
}
.viewfinder::after { /* scanline + vignette over the feed */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.6));
  mix-blend-mode: multiply;
}
.viewfinder__hud {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.8);
}
.viewfinder__rec { position: absolute; top: 0.5rem; left: 0.6rem; display: flex; align-items: center; gap: 0.35rem; }
.viewfinder__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: blink 1.1s steps(1) infinite; }
.viewfinder__read { position: absolute; bottom: 0.5rem; left: 0.6rem; right: 0.6rem; display: flex; justify-content: space-between; color: rgba(255,255,255,0.75); }
.viewfinder__cross { position: absolute; top: 50%; left: 50%; width: 1.4rem; height: 1.4rem; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,0.4); border-radius: 50%; }
.viewfinder__cross::before, .viewfinder__cross::after { content: ""; position: absolute; background: rgba(255,255,255,0.4); }
.viewfinder__cross::before { left: 50%; top: -0.4rem; bottom: -0.4rem; width: 1px; transform: translateX(-50%); }
.viewfinder__cross::after { top: 50%; left: -0.4rem; right: -0.4rem; height: 1px; transform: translateY(-50%); }
.viewfinder.off { animation: crtoff 0.5s ease forwards; }
@keyframes crtoff {
  0% { filter: brightness(1); transform: scaleY(1); opacity: 1; }
  60% { filter: brightness(2); transform: scaleY(0.04); opacity: 1; }
  100% { filter: brightness(3); transform: scaleY(0.002); opacity: 0; }
}

/* mic meter */
.meter {
  margin: 0.5rem 0 1.5rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-radius: 0.7rem; background: rgba(255,255,255,0.03);
  font-family: var(--mono); font-size: 0.62rem; color: var(--ink-dim);
}
.meter__row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.meter__track { flex: 1; height: 0.55rem; border-radius: 0.3rem; background: rgba(255,255,255,0.06); overflow: hidden; }
.meter__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #5ddfff); transition: width 0.08s linear; }
.meter__db { width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* file gift */
.gift {
  margin: 0.5rem 0 1.5rem; padding: 0.9rem 1rem; display: flex; gap: 0.9rem; align-items: center;
  border: 1px solid var(--line); border-radius: 0.7rem; background: rgba(255,255,255,0.03);
}
.gift__thumb { width: 4rem; height: 4rem; flex: none; border-radius: 0.4rem; object-fit: cover; filter: blur(6px) grayscale(0.4); border: 1px solid var(--line); }
.gift__meta { font-family: var(--mono); font-size: 0.66rem; line-height: 1.7; color: var(--ink-dim); }
.gift__meta b { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------------------
   Shareable verdict card
   ------------------------------------------------------------------------- */
.sharecard { margin: 0.6rem 0 2rem; }
.sharecard canvas {
  width: 100%; max-width: 32rem; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 0.8rem;
  box-shadow: 0 10px 50px rgba(0,0,0,0.6);
}
.sharecard__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

/* -------------------------------------------------------------------------
   The margins — message wall
   ------------------------------------------------------------------------- */
.wallfeed { margin: 0.5rem 0 1.2rem; }
.wallfeed__head {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 0.7rem;
}
.wallfeed__empty { font-family: var(--serif); font-style: italic; color: var(--ink-dim); }

.note {
  margin: 0 0 0.6rem; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-soft); border-left: 2px solid rgba(255,255,255,0.18);
  border-radius: 0.5rem; background: rgba(255,255,255,0.025);
}
.note--hint { border-left-color: rgba(126,224,184,0.55); background: rgba(126,224,184,0.04); }
.note__meta {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 0.35rem;
}
.note--hint .note__meta { color: color-mix(in srgb, var(--accent) 70%, var(--ink-faint)); }
.note__body { font-family: var(--serif); font-size: 0.98rem; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.compose {
  margin: 0.4rem 0 1.5rem; padding: 1rem 1.1rem 1.1rem;
  border: 1px solid rgba(126,224,184,0.3); border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(126,224,184,0.06), rgba(255,255,255,0.01));
}
.compose__kinds { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; }
.compose__kind {
  appearance: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink-dim);
  padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.compose__kind.on { color: #eafff5; border-color: rgba(126,224,184,0.6); background: rgba(126,224,184,0.12); }
.compose__name, .compose__body {
  width: 100%; display: block; box-sizing: border-box;
  background: rgba(0,0,0,0.35); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0.5rem;
  font-family: var(--mono); font-size: 0.86rem; padding: 0.55rem 0.7rem;
  caret-color: var(--accent);
}
.compose__name { margin-bottom: 0.5rem; }
.compose__body { resize: vertical; min-height: 3.4rem; line-height: 1.5; }
.compose__name:focus, .compose__body:focus { outline: none; border-color: rgba(126,224,184,0.5); }
.compose__name::placeholder, .compose__body::placeholder { color: var(--ink-faint); }
.compose__err { margin: 0.6rem 0 0.2rem; font-family: var(--serif); font-style: italic; color: var(--danger); font-size: 0.9rem; }
.compose .permcard__actions { margin-top: 0.8rem; }

/* Echoes — prior readers' words bleeding through the narration */
.echo {
  position: relative;
  margin: 0.9rem auto 1.4rem;
  max-width: 33rem;
  padding-left: 1.2rem;
  opacity: 0;
  animation: echoIn 1.5s ease forwards;
}
.echo::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em; width: 2px;
  background: linear-gradient(var(--reader), transparent); opacity: 0.5;
}
.echo__body {
  font-family: var(--serif); font-style: italic; font-size: 1.02rem; line-height: 1.6;
  color: color-mix(in srgb, var(--reader) 60%, var(--ink-dim));
  text-shadow: 0 0 20px rgba(217,179,255,0.18);
}
.echo__body::before { content: "“"; opacity: 0.55; }
.echo__body::after { content: "”"; opacity: 0.55; }
.echo__attr {
  margin-top: 0.35rem; font-family: var(--mono); font-size: 0.58rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.echo--hint::before { background: linear-gradient(var(--accent), transparent); }
.echo--hint .echo__body {
  color: color-mix(in srgb, var(--accent) 60%, var(--ink-dim));
  text-shadow: 0 0 20px rgba(126,224,184,0.18);
}
@keyframes echoIn {
  0%   { opacity: 0; transform: translateY(7px); filter: blur(3px); }
  100% { opacity: 0.9; transform: none; filter: blur(0); }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 540px) {
  .hud__sub { display: none; }
  .stat--danger .stat__total { display: none; }
  .notice { left: 0.9rem; right: 0.9rem; max-width: none; }
  .say { font-size: 1.02rem; }
}

/* -------------------------------------------------------------------------
   Reduced motion — calm everything down, keep it readable
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scanlines, .grain, .glow { animation: none; }
  .grain { display: none; }
  #log > * { animation: none; }
  .glitch::before, .glitch::after { display: none; }
  .fragment.deleting { animation: none; }
  body.corrupting #stage { animation: none; }
  .redact:not(.shown), .redact.glitching, .redact.shown { animation: none; }
  .redact.glitching { text-shadow: none; transform: none; }
  .viewfinder.off { animation: none; opacity: 0; }
  .viewfinder__dot { animation: none; }
  .echo { animation: none; opacity: 0.9; }
  .caret { animation: blink 1.05s steps(1) infinite; } /* keep the one blink */
}
