/* ==========================================================================
   INTERNET HISTORY PROJECT - MASTER STYLESHEET (styles.css)
   Aesthetic: Scholarly Digital Archive / Academic Research Repository
   ========================================================================== */

:root {
  /* Archival Color Palette */
  --bg-parchment: #fbfaf6;
  --bg-card: #ffffff;
  --bg-subtle: #f4f1ea;
  --bg-alt: #ece8df;
  
  --text-main: #18181b;
  --text-muted: #52525b;
  --text-faint: #71717a;
  
  --border-light: #e4dfd5;
  --border-strong: #d2cbbe;
  --border-dark: #1e3a5f;

  --accent-navy: #1e3a5f;
  --accent-teal: #2d4a43;
  --accent-gold: #8d7024;
  --accent-crimson: #991b1b;
  --accent-crimson-bg: #fef2f2;
  
  /* Status Colors */
  --status-nominal-bg: #ecfdf5;
  --status-nominal-text: #065f46;
  --status-nominal-border: #a7f3d0;

  --status-warn-bg: #fffbeb;
  --status-warn-text: #92400e;
  --status-warn-border: #fde68a;

  --status-corrupt-bg: #fef2f2;
  --status-corrupt-text: #991b1b;
  --status-corrupt-border: #fca5a5;

  /* Typography */
  --font-serif: "Newsreader", "Charter", "Georgia", "Cambria", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;

  /* Layout */
  --sidebar-width: 320px;
  --header-height: 72px;
  --max-content-width: 1440px;

  /* Corruption Factors */
  --corruption-factor: 0.00;
  --glitch-offset-x: 0px;
  --glitch-offset-y: 0px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-parchment);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  background-color: var(--bg-parchment);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Standards */
h1, h2, h3, h4, .serif-heading {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--accent-crimson);
  background-color: rgba(153, 27, 27, 0.05);
}

code, kbd, pre, .mono-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* Accessibility & Focus States */
:focus-visible {
  outline: 2px solid var(--accent-navy);
  outline-offset: 2px;
}

.skip-to-content {
  position: absolute;
  top: -60px;
  left: 1rem;
  background: var(--text-main);
  color: var(--bg-card);
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-to-content:focus {
  top: 1rem;
}

/* ==========================================================================
   TOP BAR & TELEMETRY HEADER
   ========================================================================== */

.archive-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(251, 250, 246, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.topbar-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.15;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Dynamic Integrity Telemetry Pill */
.integrity-telemetry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: all 0.3s ease;
}

.status-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
}

.status-text-group {
  display: flex;
  flex-direction: column;
}

.status-primary {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.status-secondary {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Quick Actions in Topbar */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-archival {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-archival:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-navy);
  color: var(--accent-navy);
}

.btn-archival.btn-primary {
  background: var(--accent-navy);
  color: #ffffff;
  border-color: var(--accent-navy);
}

.btn-archival.btn-primary:hover {
  background: #14273f;
  color: #ffffff;
}

/* ==========================================================================
   HERO / CATALOGUE PROVENANCE BANNER
   ========================================================================== */

.archive-hero {
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #fbfaf6 0%, #f4f1ea 100%);
  padding: 2.5rem 1.5rem 2rem;
}

.hero-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: end;
}

.hero-statement {
  max-width: 820px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--accent-teal);
  padding-left: 0.5rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.hero-metadata-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.meta-item strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Timeline Jump Selector */
.timeline-quick-jump {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  min-width: 240px;
}

.jump-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.jump-select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-parchment);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 3px;
  cursor: pointer;
}

/* ==========================================================================
   APP MAIN TWO-COLUMN LAYOUT
   ========================================================================== */

.archive-app-body {
  flex: 1;
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Left Sidebar Controls (Desktop) */
.archive-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.25rem);
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

.sidebar-block-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-navy);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Search Box */
.search-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg-parchment);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-navy);
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  display: none;
}

.search-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
}

/* Search Anomaly Alert Box */
.search-anomaly-alert {
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  border-left: 3px solid #b45309;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 2px;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.anomaly-alert-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  color: #92400e;
  display: block;
  margin-bottom: 0.2rem;
}

.anomaly-alert-text {
  color: #78350f;
  line-height: 1.4;
}

/* Category Filter Tags */
.category-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.filter-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  padding: 0.4rem 0.65rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-light);
}

.filter-btn.active {
  background: var(--bg-parchment);
  border-color: var(--accent-navy);
  color: var(--accent-navy);
  font-weight: 600;
}

.filter-count {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--bg-subtle);
  border-radius: 10px;
  color: var(--text-muted);
}

/* Decade Quick Navigator */
.decade-nav-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  list-style: none;
}

.decade-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.decade-btn:hover, .decade-btn.active {
  background: var(--accent-navy);
  color: #ffffff;
  border-color: var(--accent-navy);
}

/* Sidebar Persistent Telemetry Widget */
.sidebar-telemetry {
  border-top: 1px dashed var(--border-strong);
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ==========================================================================
   MAIN TIMELINE STREAM
   ========================================================================== */

.archive-main-stream {
  min-width: 0; /* Prevents flex/grid blowout */
  position: relative;
}

.stream-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.stream-count-readout {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stream-count-readout strong {
  color: var(--text-main);
}

/* Timeline Vertical Track */
.timeline-entries-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.timeline-entries-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--border-strong),
    var(--border-strong) 4px,
    transparent 4px,
    transparent 8px
  );
  z-index: 0;
}

/* Year Header Group */
.year-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 0.5rem 0;
}

.year-stamp {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-navy);
  background: var(--bg-parchment);
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  box-shadow: 2px 2px 0px rgba(30, 58, 95, 0.08);
}

.year-rule {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Archival Entry Card */
.record-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1.6rem 1.75rem;
  margin-left: 56px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Card Anchor Node on Timeline Line */
.record-card::before {
  content: "";
  position: absolute;
  top: 28px;
  left: -35px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-parchment);
  border: 2px solid var(--accent-navy);
  box-shadow: 0 0 0 3px var(--bg-card);
  transition: all 0.2s ease;
}

.record-card:hover {
  border-color: var(--accent-navy);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.record-card:hover::before {
  background: var(--accent-navy);
  transform: scale(1.15);
}

/* Card Header Meta */
.card-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.record-code {
  color: var(--accent-teal);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.record-date {
  color: var(--text-muted);
  border-left: 1px solid var(--border-light);
  padding-left: 0.65rem;
}

.record-category-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  color: var(--text-muted);
}

/* Status Badges */
.status-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--status-nominal-border);
  background: var(--status-nominal-bg);
  color: var(--status-nominal-text);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-pill.status-disputed {
  border-color: var(--status-warn-border);
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.status-pill.status-anomalous,
.status-pill.status-terminal {
  border-color: var(--status-corrupt-border);
  background: var(--status-corrupt-bg);
  color: var(--status-corrupt-text);
}

/* Card Title & Content */
.record-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-main);
  line-height: 1.3;
}

.record-summary {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Card Footer / Actions */
.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.provenance-tag {
  color: var(--text-faint);
  font-size: 0.72rem;
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   DETAIL READER MODAL / DRAWER
   ========================================================================== */

.record-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.record-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.record-drawer {
  width: 100%;
  max-width: 760px;
  height: 100%;
  background: var(--bg-parchment);
  border-left: 1px solid var(--border-strong);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.record-modal-backdrop.active .record-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-close-btn {
  background: none;
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-muted);
}

.drawer-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 2.25rem 2.5rem;
}

.drawer-meta-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.meta-pair label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}

.meta-pair span {
  color: var(--text-main);
  font-weight: 500;
}

.drawer-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.drawer-text-prose {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 2rem;
}

.drawer-text-prose p {
  margin-bottom: 1.25rem;
}

/* Provenance & Source Citations in Drawer */
.sources-section {
  border-top: 1px solid var(--border-strong);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.sources-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-navy);
  margin-bottom: 1rem;
}

.sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-item {
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  border-radius: 3px;
}

.source-title {
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin-bottom: 0.2rem;
}

.source-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Related Archival Records Links */
.related-section {
  border-top: 1px dashed var(--border-strong);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.related-link {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 0.3rem 0.65rem;
  border-radius: 2px;
  color: var(--accent-navy);
  text-decoration: none;
  font-size: 0.75rem;
}

.related-link:hover {
  background: var(--accent-navy);
  color: #ffffff;
}

/* Drawer Keyboard Navigation Bar */
.drawer-footer-nav {
  padding: 0.85rem 2rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* ==========================================================================
   CORRUPTION TIERS & PROGRESSIVE INSTABILITY
   ========================================================================== */

/* Tier 0 (1960–2015): Pure Classical Scholarly Stability */
[data-corruption-tier="0"] .status-beacon {
  background: #10b981;
}

/* Tier 1 (2016–2021): Imperceptible Inconsistencies */
[data-corruption-tier="1"] .status-beacon {
  background: #0284c7;
}

/* Tier 2 (2022): Turning Point - Subtle Anomaly Emergence */
[data-corruption-tier="2"] .status-beacon {
  background: #d97706;
}

[data-corruption-tier="2"] .status-primary {
  color: #92400e;
}

/* Tier 3 (2023–2025): Contamination & Information Decay */
[data-corruption-tier="3"] {
  --border-light: #ded8cb;
  --bg-parchment: #f9f7f0;
}

[data-corruption-tier="3"] .status-beacon {
  background: #dc2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

[data-corruption-tier="3"] .status-primary {
  color: #991b1b;
}

[data-corruption-tier="3"] .record-card[data-anomalous="true"] {
  border-left: 3px solid #b45309;
}

/* Tier 4 (November 2026): Terminal Alternate Reality */
[data-corruption-tier="4"] {
  --bg-parchment: #f6f3eb;
  --border-dark: #991b1b;
}

[data-corruption-tier="4"] .archive-topbar {
  border-bottom: 2px solid #991b1b;
}

[data-corruption-tier="4"] .status-beacon {
  background: #991b1b;
  animation: pulseBeacon 2s infinite ease-in-out;
}

[data-corruption-tier="4"] .status-primary {
  color: #991b1b;
  font-weight: 700;
}

/* Stamp Effect for Terminal State */
.terminal-stamp {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border: 2px solid var(--accent-crimson);
  color: var(--accent-crimson);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   HIDDEN CLASSIFIED REVELATION (TERMINAL STATE EASTER EGG)
   ========================================================================== */

.classified-revelation-box {
  margin: 1.25rem 0 0.75rem 0;
  background: var(--bg-subtle);
  border: 1px dashed var(--accent-crimson);
  border-radius: 4px;
  padding: 0.85rem 1.1rem;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
}

.classified-revelation-box:hover,
.classified-revelation-box:focus-visible,
.classified-revelation-box.revealed {
  background: #fefce8;
  border-color: #ca8a04;
  box-shadow: 0 4px 15px rgba(202, 138, 4, 0.15);
}

.classified-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-crimson);
  letter-spacing: 0.06em;
}

.classified-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.classified-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-crimson);
  display: inline-block;
  animation: pulseBeacon 1.4s infinite ease-in-out;
}

.classified-prompt {
  font-size: 0.68rem;
  color: var(--text-faint);
  transition: color 0.2s ease;
}

.classified-revelation-box:hover .classified-prompt,
.classified-revelation-box.revealed .classified-prompt {
  color: #854d0e;
  font-weight: 600;
}

.classified-text-wrap {
  margin-top: 0.35rem;
}

/* Redacted bar by default; highlighted on hover / focus / tap */
.classified-text {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 0.55rem 0.85rem;
  border-radius: 3px;
  background-color: #18181b;
  color: #18181b;
  user-select: all;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.classified-text::selection {
  background-color: #fef08a;
  color: #713f12;
}

/* Active Highlight Reveal */
.classified-revelation-box:hover .classified-text,
.classified-revelation-box:focus-visible .classified-text,
.classified-revelation-box.revealed .classified-text {
  background-color: #fef08a !important;
  color: #713f12 !important;
  font-weight: 700;
  font-style: italic;
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.5), inset 0 -3px 0 #eab308;
  border-left: 3px solid #ca8a04;
}

.classified-revelation-box.in-drawer {
  margin-top: 2rem;
  padding: 1.15rem 1.35rem;
}

.classified-revelation-box.in-drawer .classified-text {
  font-size: 1.05rem;
  line-height: 1.6;
}

@keyframes pulseBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.reduced-motion-active *,
.reduced-motion-active *::before,
.reduced-motion-active *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ==========================================================================
   FOOTER & DISCREET CONTROLS
   ========================================================================== */

.archive-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
}

.footer-discreet-reset {
  background: none;
  border: 1px dashed var(--border-strong);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  border-radius: 2px;
  cursor: pointer;
}

.footer-discreet-reset:hover {
  background: var(--status-corrupt-bg);
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

/* Tablet & Smaller Desktops */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }

  .archive-app-body {
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile & Small Screens (≤ 768px) */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .integrity-telemetry {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .archive-app-body {
    grid-template-columns: 1fr;
    padding: 1rem 0.75rem;
  }

  .archive-sidebar {
    position: static;
    margin-bottom: 1.5rem;
  }

  .timeline-entries-container::before {
    left: 14px;
  }

  .record-card {
    margin-left: 36px;
    padding: 1.25rem;
  }

  .record-card::before {
    left: -29px;
    width: 12px;
    height: 12px;
  }

  .record-modal-backdrop .record-drawer {
    max-width: 100%;
  }

  .drawer-body {
    padding: 1.5rem 1.25rem;
  }
}
