/* ==========================================================================
   ANARCHY666 — design system
   Concept: a corkboard wall at 2am. Dark room, paper case files pinned up.
   Open a file and it lays flat in front of you — paper panel over dark chrome.
   ========================================================================== */

:root {
  /* ink = the room. paper = the file. */
  --ink: #0b0a0d;
  --ink-2: #17141a;
  --ink-3: #1e1a21;
  --ink-border: #2c2730;

  --paper: #ece4d3;
  --paper-2: #ddd2b8;
  --paper-shadow: #b9ad91;
  --ink-text: #211a15;
  --ink-text-muted: #5c5245;

  --bone: #e6dfd0;
  --muted-bone: #a89f92;

  --redact: #b91f2e;
  --redact-dim: #7d1620;
  --verified: #3b7a54;
  --dusk: #7c68a0;

  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Newsreader', 'Georgia', serif;
  --font-mono: 'Courier Prime', 'Courier New', monospace;

  --max: 1180px;
}

/* ---------- reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.1; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

:focus-visible {
  outline: 2px solid var(--redact);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* faint scanline overlay across the whole site — surveillance-monitor texture */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px,
    transparent 1px, transparent 3px
  );
  opacity: 0.6;
}

/* ---------- eyebrow / stamp / mono labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted-bone);
}
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  border: 2px solid var(--redact);
  color: var(--redact);
  padding: 0.25em 0.6em;
  transform: rotate(-2deg);
  border-radius: 3px;
}
.stamp.verified {
  border-color: var(--verified);
  color: var(--verified);
  transform: rotate(1.5deg);
}

/* redaction-bar signature detail: hides a word behind a solid bar,
   reveals on hover/focus. Text stays in the DOM (opacity, not display:none)
   so screen readers always get the real content. */
.redacted {
  position: relative;
  display: inline-block;
  cursor: default;
}
.redacted-text { opacity: 0; transition: opacity 0.25s ease 0.05s; }
.redacted::before {
  content: "";
  position: absolute;
  inset: 0.02em -0.12em;
  background: var(--bone);
  border-radius: 2px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.redacted:hover::before,
.redacted:focus-within::before {
  opacity: 0;
  transform: scaleY(0.15);
}
.redacted:hover .redacted-text,
.redacted:focus-within .redacted-text { opacity: 1; }
.redacted[tabindex] { outline-offset: 4px; }
/* on paper panels the bar should read as ink, not bone */
.paper-panel .redacted::before { background: var(--ink-text); }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 10, 13, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-border);
}
.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.logo .accent { color: var(--redact); }
.nav-toggle {
  display: none;
  font-size: 1.4rem;
  color: var(--bone);
  line-height: 1;
  padding: 0.3rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-links a { color: var(--muted-bone); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--bone); }
.random-btn {
  border: 1px solid var(--redact-dim);
  color: var(--redact);
  padding: 0.45rem 0.8rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s ease, color 0.15s ease;
}
.random-btn:hover { background: var(--redact); color: var(--ink); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink-2);
    border-bottom: 1px solid var(--ink-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .random-btn { width: 100%; text-align: center; }
}

/* ==========================================================================
   HERO (home)
   ========================================================================== */
.hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
}
.hero .eyebrow { display: block; margin-bottom: 1.1rem; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 7rem);
  letter-spacing: 0.02em;
  color: var(--bone);
}
.hero h1 .accent { color: var(--redact); }
.hero .subhead {
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dusk);
  font-size: 0.95rem;
  margin-top: 0.6rem;
}
.hero p.lede {
  max-width: 560px;
  margin: 1.6rem auto 0;
  color: var(--muted-bone);
  font-size: 1.08rem;
  font-style: italic;
}
.hero .cta {
  display: inline-block;
  margin-top: 2.2rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--redact);
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hero .cta:hover { background: var(--bone); transform: translateY(-2px); }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
  background: var(--ink-2);
  padding: 0.65rem 0;
}
.ticker-track {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--verified);
  animation: ticker-scroll 38s linear infinite;
}
.ticker-track span { padding: 0 1.2rem; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   ARCHIVE GRID (home) — pinned paper case files
   ========================================================================== */
.archive-section { padding: 4.5rem 0 3rem; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head .eyebrow { display: block; margin-bottom: 0.6rem; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: 0.02em;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem 1.8rem;
}
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .archive-grid { grid-template-columns: 1fr; gap: 2.6rem; } }

.case-card {
  position: relative;
  background: var(--paper);
  color: var(--ink-text);
  border-radius: 2px;
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 0 14px 24px -10px rgba(0,0,0,0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.case-card:nth-child(3n+1) { transform: rotate(-1.1deg); }
.case-card:nth-child(3n+2) { transform: rotate(0.8deg); }
.case-card:nth-child(3n+3) { transform: rotate(-0.4deg); }
.case-card:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 22px 32px -12px rgba(0,0,0,0.6);
}
.case-card::before {
  /* pushpin */
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  width: 16px; height: 16px;
  margin-left: -8px;
  background: radial-gradient(circle at 35% 30%, #e85a63, var(--redact-dim));
  border-radius: 50%;
  box-shadow: 0 3px 4px rgba(0,0,0,0.5);
}
.case-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}
.case-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.case-card h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}
.case-card p {
  font-size: 0.92rem;
  color: var(--ink-text-muted);
  margin-bottom: 1rem;
}
.rating-mini { display: flex; gap: 0.15rem; font-size: 0.85rem; }
.rating-mini .off { opacity: 0.25; filter: grayscale(1); }

/* ---------- field guide (home) ---------- */
.field-guide { padding: 2rem 0 5rem; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-top: 2.2rem;
}
@media (max-width: 900px) { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card {
  border: 1px solid var(--ink-border);
  background: var(--ink-2);
  padding: 1.3rem 1.2rem;
  border-radius: 3px;
  border-left: 3px solid var(--dusk);
}
.guide-card .num {
  font-family: var(--font-mono);
  color: var(--dusk);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.guide-card p { margin-top: 0.5rem; font-size: 0.94rem; color: var(--bone); }

/* ==========================================================================
   PAPER PANEL — the "open file" used on theory pages + about
   ========================================================================== */
.file-strip {
  padding: 1.6rem 0 0;
}
.back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-bone);
  display: inline-block;
  margin-bottom: 1.4rem;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--redact); }

.paper-panel {
  background: var(--paper);
  color: var(--ink-text);
  border-radius: 3px;
  padding: clamp(1.8rem, 5vw, 3.4rem);
  margin: 0 auto 4rem;
  max-width: 880px;
  transform: rotate(-0.35deg);
  box-shadow: 0 26px 50px -20px rgba(0,0,0,0.65);
  position: relative;
}
.paper-panel::before {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  width: 18px; height: 18px;
  margin-left: -9px;
  background: radial-gradient(circle at 35% 30%, #e85a63, var(--redact-dim));
  border-radius: 50%;
  box-shadow: 0 3px 5px rgba(0,0,0,0.5);
}

.file-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.case-title-block h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: 0.01em;
  margin-top: 0.4rem;
}
.case-title-block .tagline {
  font-style: italic;
  color: var(--ink-text-muted);
  font-size: 1.15rem;
  margin-top: 0.5rem;
  max-width: 46ch;
}

.tinfoil-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-text-muted);
  background: var(--paper-2);
  padding: 0.5rem 0.7rem;
  border-radius: 3px;
  white-space: nowrap;
}
.tinfoil-rating .icons { font-size: 1rem; margin-right: 0.35rem; }
.tinfoil-rating .off { opacity: 0.25; filter: grayscale(1); }

.content-block { margin-top: 2.4rem; }
.content-block h2 { margin-bottom: 0.9rem; }
.content-block p { margin-bottom: 0.9rem; max-width: 68ch; }
.content-block p:last-child { margin-bottom: 0; }
.content-block ul {
  margin: 0.8rem 0 0.4rem;
  padding-left: 0;
}
.content-block ul li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.65rem;
  max-width: 66ch;
}
.content-block ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--redact);
}

.content-block.official {
  background: var(--paper-2);
  padding: 1.6rem 1.7rem;
  border-radius: 3px;
  border-left: 4px solid var(--verified);
}
.content-block.official h2 { margin-bottom: 0.9rem; }

.file-divider {
  border: none;
  border-top: 1px dashed var(--paper-shadow);
  margin: 2.4rem 0 0;
}

/* ---------- related files ---------- */
.related-section { padding: 0 0 5rem; }
.related-section h3 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--muted-bone);
  text-align: center;
  margin-bottom: 1.6rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: 880px;
  margin: 0 auto;
}
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  border: 1px solid var(--ink-border);
  background: var(--ink-2);
  padding: 1.1rem 1.2rem;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.related-card:hover { border-color: var(--redact-dim); transform: translateY(-3px); }
.related-card .icon { font-size: 1.5rem; }
.related-card .rc-no {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-bone);
  letter-spacing: 0.06em;
}
.related-card .rc-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  margin-top: 0.1rem;
}

/* ==========================================================================
   ABOUT PAGE extras
   ========================================================================== */
.about-block { margin-bottom: 2.2rem; }
.about-block h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin-bottom: 0.7rem;
  letter-spacing: 0.01em;
}
.about-block p { margin-bottom: 0.8rem; max-width: 68ch; }
.signoff {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-text-muted);
  margin-top: 2rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ink-2);
  border-top: 1px solid var(--ink-border);
  padding: 3rem 0 2.2rem;
}
.footer-wrap { text-align: center; }
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.9rem;
}
.footer-logo .accent { color: var(--redact); }
.footer-text {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted-bone);
  font-size: 0.92rem;
  font-style: italic;
}
.footer-links {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-bone);
}
.footer-links a { color: var(--muted-bone); }
.footer-links a:hover { color: var(--redact); }
.footer-copyright {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #5a544e;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   404 PAGE — the "surveillance" readout embedded in the paper file
   ========================================================================== */
.surveillance-box {
  background: var(--ink);
  border-radius: 3px;
  padding: 1.3rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 1rem;
}
.log-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(230, 223, 208, 0.15);
}
.log-row:last-child { border-bottom: none; }
.log-key {
  color: var(--muted-bone);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.log-val {
  color: var(--redact);
  text-align: right;
  word-break: break-all;
  max-width: 62%;
}
.log-footnote {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-text-muted);
  margin-top: 1rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
  justify-content: center;
}
.btn-outline {
  display: inline-block;
  border: 1.5px solid var(--redact-dim);
  color: var(--redact);
  padding: 0.8rem 1.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-outline:hover { background: var(--redact); color: var(--paper); }

@media (max-width: 560px) {
  .log-row { flex-direction: column; gap: 0.15rem; }
  .log-val { max-width: 100%; text-align: left; }
  .error-actions { flex-direction: column; }
  .error-actions a, .error-actions button { text-align: center; }
}

/* hidden footer link into the terminal easter egg — deliberately unstyled
   until hover/focus, so it blends into the copyright line */
.footer-secret {
  transition: color 0.2s ease;
}
.footer-secret:hover,
.footer-secret:focus-visible {
  color: var(--redact);
}
