/* Archive & Writing Section — Scoped styles matching ::apa:: terminal aesthetic */

.archive-view {
  display: none;
  position: relative;
  z-index: 100;
  min-height: 100vh;
  background: #0a0a0a;
  color: #e4e8e4;
  padding: clamp(4.25rem, 7vw, 5.5rem) clamp(1rem, 3vw, 1.5rem) 5rem;
  font-family: 'Courier New', Courier, monospace;
}

.archive-view.active {
  display: block;
}

.archive-shell {
  max-width: 1120px;
  margin: 0 auto;
}

/* Header */
.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.22);
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.archive-header .signal-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--terminal, #00ff41);
  font-size: clamp(0.68rem, 1.6vw, 0.85rem);
  letter-spacing: clamp(0.08em, 0.22vw, 0.16em);
  text-transform: uppercase;
}

.archive-header .rewind-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: clamp(0.68rem, 1.6vw, 0.85rem);
}

/* Top bar: section switcher + telemetry stats */
.archive-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.archive-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.archive-heading {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: 0.06em;
  line-height: 1;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
}

.archive-stats {
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  letter-spacing: clamp(0.08em, 0.2vw, 0.14em);
  color: rgba(0, 255, 65, 0.78);
  text-transform: uppercase;
  min-height: 1.25em;
  line-height: 1.35;
}

/* Separate Archive / Writing top-level switch (hidden until writing exists) */
.archive-section-switch {
  display: inline-flex;
  flex-shrink: 0;
  justify-self: end;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid rgba(0, 255, 65, 0.28);
  background: rgba(0, 255, 65, 0.04);
}

.archive-section-switch[hidden] {
  display: none;
}

.archive-section-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  letter-spacing: 0.12em;
  padding: 0.45rem clamp(0.6rem, 1.6vw, 0.85rem);
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.archive-section-btn:hover {
  color: var(--terminal, #00ff41);
}

.archive-section-btn.active {
  color: #0a0a0a;
  background: var(--terminal, #00ff41);
  border-color: var(--terminal, #00ff41);
  font-weight: 700;
}

/* Dynamic class/category tabs */
.archive-tabs-wrap {
  margin-bottom: 1.25rem;
}

.archive-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 65, 0.35) transparent;
}

.archive-tab {
  flex: 0 0 auto;
  background: rgba(0, 255, 65, 0.03);
  border: 1px solid rgba(0, 255, 65, 0.24);
  color: rgba(255, 255, 255, 0.74);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.archive-tab:hover {
  border-color: rgba(0, 255, 65, 0.65);
  color: #ffffff;
}

.archive-tab.active {
  border-color: var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.14);
  color: var(--terminal, #00ff41);
}

.archive-tab-count {
  opacity: 0.72;
  margin-left: 0.35rem;
  font-size: 0.72rem;
}

.archive-category-desc {
  margin-top: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-left: 2px solid var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  line-height: 1.55;
}

/* Search & sort controls */
.archive-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.archive-search-box {
  flex: 1 1 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.archive-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 65, 0.28);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.62rem 2.4rem 0.62rem 0.9rem;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.archive-search-input::placeholder {
  color: rgba(255, 255, 255, 0.36);
  letter-spacing: 0.06em;
}

.archive-search-input:focus {
  border-color: var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.04);
}

.archive-search-clear {
  position: absolute;
  right: 0.45rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.archive-search-clear:hover {
  color: var(--terminal, #00ff41);
}

.archive-sort-select {
  background: #0f1310;
  border: 1px solid rgba(0, 255, 65, 0.28);
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.62rem 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
}

.archive-sort-select:focus {
  outline: 1px solid var(--terminal, #00ff41);
}

/* Scanned PDF Card Grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.archive-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 255, 65, 0.18);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  text-align: left;
}

.archive-card:hover,
.archive-card:focus-visible {
  border-color: var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.04);
  transform: translateY(-2px);
  outline: none;
}

.archive-card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #111512;
  border-bottom: 1px solid rgba(0, 255, 65, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Typographic archival cover fallback when a PDF has no thumbnail yet */
.archive-cover-fallback {
  width: 100%;
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #101712 0%, #0b0e0c 100%);
  border: 6px solid #0c100d;
  box-sizing: border-box;
}

.archive-cover-fallback-top {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(0, 255, 65, 0.72);
  text-transform: uppercase;
}

.archive-cover-fallback-title {
  font-family: 'Anton', Impact, sans-serif;
  font-size: 1.4rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: #f0f4f0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.archive-cover-fallback-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
  border-top: 1px solid rgba(0, 255, 65, 0.18);
  padding-top: 0.5rem;
}

.archive-card-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(10, 10, 10, 0.88);
  border: 1px solid rgba(0, 255, 65, 0.4);
  color: var(--terminal, #00ff41);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.45rem;
  text-transform: uppercase;
}

.archive-card-badge.index-only {
  border-color: rgba(255, 210, 60, 0.55);
  color: #ffd23c;
}

.archive-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.archive-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(0, 255, 65, 0.8);
  text-transform: uppercase;
  flex-wrap: wrap;
}

.archive-card-title {
  font-family: 'Anton', Impact, sans-serif;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: #ffffff;
  margin: 0;
}

.archive-card-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.62);
}

.archive-card-summary {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  margin: 0.15rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-card-snippet {
  margin-top: 0.35rem;
  padding: 0.45rem 0.6rem;
  background: rgba(0, 255, 65, 0.06);
  border-left: 2px solid var(--terminal, #00ff41);
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.archive-card-snippet mark {
  background: rgba(0, 255, 65, 0.25);
  color: #ffffff;
  padding: 0 0.15rem;
}

.archive-card-foot {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.48);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Writing List Layout (visually distinct from scanned PDFs) */
.archive-writing-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 920px;
}

.archive-writing-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 255, 65, 0.18);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.archive-writing-row:hover,
.archive-writing-row:focus-visible {
  border-color: var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.04);
  outline: none;
}

/* Empty & Status States */
.archive-state {
  padding: 3rem 1.5rem;
  border: 1px dashed rgba(0, 255, 65, 0.26);
  background: rgba(0, 255, 65, 0.02);
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.archive-state-label {
  color: var(--terminal, #00ff41);
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.archive-state p {
  max-width: 540px;
  margin: 0 auto;
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.6);
}

/* Detail Reader View (PDF.js Streaming Viewer & Writing Essay View) */
.archive-reader {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.archive-reader-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  padding: clamp(0.55rem, 1.4vw, 0.75rem) clamp(0.7rem, 2vw, 1rem);
  background: rgba(14, 18, 15, 0.96);
  border: 1px solid rgba(0, 255, 65, 0.26);
  position: sticky;
  top: 0.75rem;
  z-index: 20;
}

.archive-reader-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.archive-reader-group:empty {
  display: none;
}

.archive-btn {
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.32);
  color: var(--terminal, #00ff41);
  font-family: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.archive-btn:hover:not(:disabled) {
  background: var(--terminal, #00ff41);
  color: #0a0a0a;
}

.archive-btn-primary {
  background: rgba(0, 255, 65, 0.14);
  border-color: var(--terminal, #00ff41);
  color: var(--terminal, #00ff41);
  font-weight: 700;
}

.archive-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.archive-page-input {
  width: 3.4rem;
  background: #0a0a0a;
  border: 1px solid rgba(0, 255, 65, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.35rem 0.25rem;
}

.archive-page-total,
.archive-zoom-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 3rem;
  text-align: center;
}

.archive-reader-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.18);
}

.archive-reader-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-reader-title {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: #ffffff;
  margin: 0;
}

.archive-reader-summary {
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  max-width: 72ch;
  margin: 0.25rem 0 0;
}

.archive-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.archive-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(0, 255, 255, 0.85);
  border: 1px solid rgba(0, 255, 255, 0.25);
  padding: 0.15rem 0.45rem;
  text-transform: uppercase;
}

/* PDF Canvas Stage */
.archive-pdf-stage {
  background: #141715;
  border: 1px solid rgba(0, 255, 65, 0.2);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 60vh;
  overflow: auto;
}

.archive-pdf-stage canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  background: #ffffff;
  display: block;
}

.archive-pdf-status {
  padding: 3rem 1rem;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  color: rgba(0, 255, 65, 0.85);
  text-transform: uppercase;
  text-align: center;
}

/* Writing Prose Body */
.archive-prose {
  max-width: 68ch;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.08rem;
  line-height: 1.82;
  color: rgba(242, 246, 242, 0.92);
  padding: 0.5rem 0 2rem;
}

.archive-prose h1,
.archive-prose h2,
.archive-prose h3,
.archive-prose h4 {
  font-family: 'Anton', Impact, sans-serif;
  letter-spacing: 0.04em;
  color: #ffffff;
  margin: 2rem 0 0.75rem;
  line-height: 1.2;
}

.archive-prose h2 { font-size: 1.65rem; }
.archive-prose h3 { font-size: 1.3rem; }

.archive-prose p {
  margin: 0 0 1.2rem;
}

.archive-prose blockquote {
  margin: 1.4rem 0;
  padding: 0.65rem 1.1rem;
  border-left: 2px solid var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-style: italic;
}

.archive-prose code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88em;
  background: rgba(0, 255, 65, 0.09);
  color: var(--terminal, #00ff41);
  padding: 0.1rem 0.35rem;
}

.archive-prose pre {
  background: #0d120e;
  border: 1px solid rgba(0, 255, 65, 0.22);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.archive-prose pre code {
  background: transparent;
  padding: 0;
  color: #d8f8df;
}

.archive-prose ul,
.archive-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.archive-prose li {
  margin-bottom: 0.45rem;
}

.archive-prose a {
  color: #00ffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.archive-prose hr {
  border: none;
  border-top: 1px solid rgba(0, 255, 65, 0.22);
  margin: 2rem 0;
}

/* Writing Reader — Editorial Layout & Sticky Chapter Rail */
.archive-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 255, 65, 0.12);
  z-index: 900;
  pointer-events: none;
}

.archive-read-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--terminal, #00ff41);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.65);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.archive-essay-layout {
  display: grid;
  grid-template-columns: minmax(0, 74ch) 220px;
  gap: 3rem;
  align-items: start;
  justify-content: space-between;
}

.archive-essay-layout .archive-prose {
  max-width: 74ch;
  min-width: 0;
}

.archive-essay-layout .archive-prose h2 {
  scroll-margin-top: 5.5rem;
}

.archive-toc-rail {
  position: sticky;
  top: 5.5rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(0, 255, 65, 0.18);
  font-family: 'Courier New', Courier, monospace;
}

.archive-toc-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(0, 255, 65, 0.72);
  margin-bottom: 0.75rem;
}

.archive-toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.archive-toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.52);
  text-decoration: none;
  padding: 0.2rem 0;
  transition: color 0.16s ease, transform 0.16s ease;
}

.archive-toc-link:hover {
  color: #ffffff;
  transform: translateX(2px);
}

.archive-toc-link.active {
  color: var(--terminal, #00ff41);
}

.archive-toc-num {
  font-size: 0.66rem;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Cinema Figures, Film Stills & Scroll Reveal */
[data-reveal="true"] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-reveal="true"].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.archive-figure {
  margin: 2.1rem 0;
}

.archive-figure-hero {
  margin: 0.75rem 0 2.25rem;
}

.archive-frame {
  position: relative;
  overflow: hidden;
  background: #040604;
  border: 1px solid rgba(0, 255, 65, 0.24);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65);
  cursor: zoom-in;
}

.archive-frame::before,
.archive-frame::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.65;
}

.archive-frame::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--terminal, #00ff41);
  border-left: 1px solid var(--terminal, #00ff41);
}

.archive-frame::after {
  bottom: 7px;
  right: 7px;
  border-bottom: 1px solid var(--terminal, #00ff41);
  border-right: 1px solid var(--terminal, #00ff41);
}

.archive-frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.45s ease, filter 0.35s ease;
}

.archive-frame:hover img,
.archive-frame:focus-visible img {
  transform: scale(1.018);
  filter: contrast(1.04);
}

.archive-frame:focus-visible {
  outline: 2px solid var(--terminal, #00ff41);
  outline-offset: 2px;
}

.archive-frame-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--terminal, #00ff41);
  background: rgba(5, 8, 5, 0.84);
  border: 1px solid rgba(0, 255, 65, 0.4);
  padding: 0.22rem 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.archive-frame:hover .archive-frame-expand,
.archive-frame:focus-visible .archive-frame-expand {
  opacity: 1;
}

.archive-figure figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.7rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(0, 255, 65, 0.35);
}

.archive-figure-tag {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-figure-caption {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.88rem;
  line-height: 1.5;
  font-style: italic;
  color: rgba(235, 242, 236, 0.74);
}

/* Side-by-Side Diptych */
.archive-diptych {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.1rem 0;
}

.archive-diptych .archive-figure {
  margin: 0;
}

/* Interactive Lighting / Frame Compare Block */
.archive-compare,
.archive-diagram {
  margin: 2.3rem 0;
  padding: 1rem;
  background: #0a0f0b;
  border: 1px solid rgba(0, 255, 65, 0.26);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.archive-compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.16);
}

.archive-compare-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-compare-modes {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.archive-compare-modes .archive-btn {
  font-size: 0.68rem;
  padding: 0.3rem 0.6rem;
}

.archive-compare-modes .archive-btn.active {
  background: var(--terminal, #00ff41);
  color: #070a07;
  border-color: var(--terminal, #00ff41);
}

.archive-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.archive-compare-grid[hidden],
.archive-wipe-wrap[hidden],
.archive-wipe-stage[hidden] {
  display: none;
}

.archive-compare-grid .archive-figure {
  margin: 0;
}

.archive-wipe-stage {
  position: relative;
  overflow: hidden;
  background: #040604;
  border: 1px solid rgba(0, 255, 65, 0.25);
  user-select: none;
}

.archive-wipe-base,
.archive-wipe-overlay img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.archive-wipe-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.archive-wipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--terminal, #00ff41);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.75);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

.archive-wipe-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #070b08;
  color: var(--terminal, #00ff41);
  border: 1px solid var(--terminal, #00ff41);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  padding: 0.28rem 0.45rem;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.archive-wipe-badge {
  position: absolute;
  bottom: 10px;
  z-index: 2;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  padding: 0.22rem 0.5rem;
  background: rgba(5, 8, 5, 0.84);
  border: 1px solid rgba(0, 255, 65, 0.35);
  color: #e8f8ec;
  pointer-events: none;
}

.archive-wipe-badge.left { left: 10px; }
.archive-wipe-badge.right { right: 10px; }

.archive-wipe-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 4;
}

.archive-wipe-captions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  line-height: 1.45;
  font-style: italic;
  color: rgba(235, 242, 236, 0.72);
}

/* Interactive Camera-Blocking SVG Diagram */
.archive-diagram-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: 'Courier New', Courier, monospace;
}

@keyframes archiveOrbitCam {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.archive-diagram.is-tracking .archive-diagram-cam2 {
  transform-origin: 332px 158px;
  animation: archiveOrbitCam 16s linear infinite;
}

.archive-diagram-note {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 255, 65, 0.14);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(238, 246, 239, 0.82);
}

/* Screenplay Excerpt Block */
.archive-script-block {
  margin: 1.6rem 0;
  border: 1px solid rgba(0, 255, 65, 0.24);
  background: #0b100c;
}

.archive-script-header {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(0, 255, 65, 0.82);
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.16);
  background: rgba(0, 255, 65, 0.04);
}

.archive-script-block pre {
  margin: 0;
  border: none;
  background: transparent;
}

/* Fullscreen Cinema Lightbox */
.archive-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(3, 6, 4, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.archive-lightbox-inner {
  position: relative;
  max-width: min(1180px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.archive-lightbox-close {
  align-self: flex-end;
  font-size: 0.72rem;
}

.archive-lightbox-inner img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border: 1px solid rgba(0, 255, 65, 0.35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}

.archive-lightbox-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  max-width: 72ch;
}

.archive-lightbox-caption {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(240, 246, 241, 0.86);
}

/* Rich Social Share Card Panel & Modal */
.archive-share-panel {
  margin: 3rem 0 1rem;
  padding: 1.25rem;
  background: #0a0f0b;
  border: 1px solid rgba(0, 255, 65, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  font-family: 'Courier New', Courier, monospace;
}

.archive-share-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.16);
}

.archive-share-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-share-sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.52);
  text-transform: uppercase;
}

.archive-share-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: center;
}

.archive-share-preview {
  border: 1px solid rgba(0, 255, 65, 0.32);
  background: #040705;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.archive-share-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: start;
}

.archive-share-actions .archive-btn {
  font-size: 0.72rem;
  padding: 0.45rem 0.72rem;
}

.archive-share-modal-inner {
  width: min(860px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.archive-share-modal-inner .archive-share-panel {
  margin: 0;
}

/* Writing Thumbnail Cards, Weekly Prompt Callouts & Series Nav */
.archive-writing-row.has-thumb {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}

.archive-writing-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 65, 0.24);
  background: #050806;
}

.archive-week-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  padding: 0.18rem 0.45rem;
  background: rgba(5, 8, 6, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.55);
  color: var(--terminal, #00ff41);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
}

.archive-week-badge.is-final {
  border-color: rgba(255, 224, 130, 0.7);
  color: #ffe082;
}

.archive-writing-group {
  max-width: 920px;
  margin-bottom: 2.35rem;
}

.archive-writing-group:last-child {
  margin-bottom: 0;
}

.archive-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0 0 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.28);
  flex-wrap: wrap;
}

.archive-group-head-left {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.archive-group-title {
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-group-sub {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.52);
  text-transform: uppercase;
}

.archive-group-count {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(0, 255, 65, 0.78);
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-course-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 0.95rem 1.15rem;
  margin-bottom: 1.65rem;
  background: rgba(0, 255, 65, 0.045);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-left: 3px solid var(--terminal, #00ff41);
  flex-wrap: wrap;
}

.archive-course-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 320px;
}

.archive-course-banner-kicker {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-course-banner-text {
  font-size: 0.82rem;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.78);
}

.archive-writing-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.archive-writing-row:hover .archive-writing-thumb img {
  transform: scale(1.04);
}

.archive-writing-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.archive-prompt-box {
  margin: 1.6rem 0 2rem;
  padding: 1rem 1.2rem;
  background: rgba(0, 255, 65, 0.045);
  border: 1px solid rgba(0, 255, 65, 0.28);
  border-left: 3px solid var(--terminal, #00ff41);
}

.archive-prompt-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.archive-prompt-text {
  margin: 0 !important;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.96rem;
  line-height: 1.62;
  font-style: italic;
  color: rgba(235, 244, 237, 0.86);
}

.archive-series-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 2.75rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 255, 65, 0.2);
  font-family: 'Courier New', Courier, monospace;
}

.archive-series-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 255, 65, 0.24);
  background: rgba(0, 255, 65, 0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.archive-series-link.next {
  text-align: right;
}

.archive-series-link:hover {
  border-color: var(--terminal, #00ff41);
  background: rgba(0, 255, 65, 0.08);
  transform: translateY(-1px);
}

.archive-series-dir {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--terminal, #00ff41);
  text-transform: uppercase;
}

.archive-series-title {
  font-family: 'Anton', Impact, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: #ffffff;
  line-height: 1.2;
}

/* Responsive */
@media (max-width: 1120px) {
  .archive-essay-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .archive-toc-rail {
    display: none;
  }
}

@media (max-width: 960px) {
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .archive-grid,
  .archive-diptych,
  .archive-compare-grid,
  .archive-wipe-captions,
  .archive-share-body,
  .archive-writing-row.has-thumb,
  .archive-series-nav {
    grid-template-columns: 1fr;
  }

  .archive-pdf-stage {
    padding: 0.5rem;
  }

  .archive-lightbox {
    padding: 1rem;
  }
}

@media (max-width: 460px) {
  .archive-top-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .archive-section-switch {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-card,
  .archive-btn,
  .archive-tab,
  .archive-section-btn,
  .archive-frame img,
  [data-reveal="true"] {
    transition: none;
  }

  [data-reveal="true"] {
    opacity: 1;
    transform: none;
  }

  .archive-diagram.is-tracking .archive-diagram-cam2 {
    animation: none;
  }

  .archive-card:hover,
  .archive-frame:hover img {
    transform: none;
  }
}
