/* Stratum Zero — immersive vault.
   Display: Playfair Display, Didot, Georgia.
   Data and controls: thin system sans.
   The control bar is sticky: the gate is seen first, then the bar locks to the viewport. */

:root {
  --void: #050608;
  --card: #0e1117;
  --gold: #c5a059;
  --crimson: #d9383a;
  --text: #f0f2f5;
  --muted: #8b949e;
  --line: #21262d;
  --serif: "Playfair Display", Didot, "Bodoni MT", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 1180px;
  --tap: 44px;
  --bar-h: 92px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(197, 160, 89, 0.07), transparent 55%),
    var(--void);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(var(--measure), 100%);
  margin-inline: auto;
  padding-inline: 16px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--gold);
  color: var(--void);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.gate {
  display: flex;
  align-items: flex-end;
  min-height: 46vh;
  padding: 14vh 0 7vh;
  animation: gate-in 1.7s ease both;
}

.gate-inner {
  text-align: center;
}

.gate-domain {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.gate h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 6.4vw, 5.6rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 0.95;
  white-space: nowrap;
}

.gate-line {
  width: 1px;
  height: 56px;
  margin: 28px auto 0;
  background: linear-gradient(var(--gold), transparent);
}

.manifesto {
  padding: 0 0 28px;
  animation: gate-in 1.8s ease 0.45s both;
}

.manifesto h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.manifesto p {
  max-width: 68ch;
  margin: 0 0 18px;
  color: var(--text);
}

.method {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.method li {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.method strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.control-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(5, 6, 8, 0.72);
  border-bottom: 1px solid rgba(33, 38, 45, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.control-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 10px;
}

.control-tools,
.control-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.bound-field {
  grid-column: 1 / -1;
}

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input,
select,
button {
  font-family: var(--sans);
  font-weight: 300;
  color: inherit;
}

.search-field input,
.sort-field select,
.dir-field select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  color: var(--text);
  background: rgba(14, 17, 23, 0.85);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 1rem;
}

.search-field input::placeholder {
  color: var(--muted);
}

.bound-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  color: var(--text);
  font-size: 0.92rem;
}

.bound-field input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--gold);
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip,
.expand,
.tab,
.thread-card {
  cursor: pointer;
}

.chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.chip[aria-pressed="true"] {
  color: var(--void);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 500;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head {
  margin: 36px 0 16px;
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

.section-head h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.file-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.file-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 16px 16px;
  background: var(--card);
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 2px;
  scroll-margin-top: calc(var(--bar-h) + 12px);
  box-shadow: 0 0 0 0 rgba(217, 56, 58, 0);
  transition: border-color 1.1s ease, box-shadow 1.3s ease, transform 1.1s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}

.file-card--nuclear {
  border-color: rgba(217, 56, 58, 0.7);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(197, 160, 89, 0.14), transparent 46%),
    linear-gradient(180deg, #14110d 0%, var(--card) 55%);
}

.file-card.is-hidden {
  display: none;
}

.file-card.is-arriving,
.file-card:has(.expand[aria-expanded="true"]) {
  content-visibility: visible;
}

.file-card.is-arriving {
  animation: arrive 1.2s ease;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.file-id {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}

.tier-tag,
.dept-tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tier-tag {
  color: var(--void);
  background: var(--gold);
  font-weight: 500;
}

.dept-tag,
.status-tag {
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-tag--forensic {
  color: var(--crimson);
  border-color: rgba(217, 56, 58, 0.55);
}

.status-tag--bound {
  color: var(--gold);
  border-color: rgba(197, 160, 89, 0.45);
}

.file-card h3 {
  margin: 12px 0 8px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.summary {
  margin: 0;
  color: var(--text);
}

.serial-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.expand {
  width: 100%;
  min-height: var(--tap);
  margin-top: 16px;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(197, 160, 89, 0.35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.expand[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--crimson);
}

.detail {
  margin-top: 14px;
}

.tab-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tab {
  min-height: var(--tap);
  padding: 8px 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--gold);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.tab-panel {
  margin-top: 10px;
  padding: 14px 12px;
  overflow-wrap: anywhere;
  background: rgba(5, 6, 8, 0.55);
  border: 1px solid var(--line);
}

.tab-panel h4,
.witness-label,
.panel-kicker,
.thread-kicker {
  margin: 14px 0 6px;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tab-panel h4:first-child,
.panel-kicker {
  margin-top: 0;
}

.tab-panel p {
  margin: 0 0 10px;
}

.tab-panel p:last-child {
  margin-bottom: 0;
}

.witness-block + .witness-block {
  margin-top: 16px;
}

.witness {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.6;
  unicode-bidi: isolate;
}

.witness[dir="rtl"] {
  text-align: right;
}

.literal,
.fine,
.serials {
  color: var(--muted);
}

.kjv {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.55;
}

.fact-critical {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(217, 56, 58, 0.08);
  border-left: 2px solid var(--crimson);
  font-weight: 400;
}

.fact-critical span {
  color: var(--crimson);
  font-weight: 500;
}

.serials {
  margin: 0 0 12px;
  padding-left: 1.1rem;
}

.thread {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.thread-kicker {
  margin-top: 0;
}

.thread-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.thread-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(197, 160, 89, 0.28);
  transition: border-color 0.8s ease, box-shadow 1s ease;
}

.thread-card strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
}

.thread-card span {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-card .file-id {
  text-transform: none;
}

.empty {
  margin: 0 0 12px;
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
}

.site-footer {
  margin-top: 48px;
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0 0 4px;
}

.noscript {
  padding: 16px;
  color: var(--muted);
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

@media (hover: hover) {
  .file-card:hover,
  .thread-card:hover {
    border-color: var(--crimson);
    box-shadow:
      0 0 0 1px rgba(197, 160, 89, 0.35),
      0 0 28px rgba(217, 56, 58, 0.28);
  }

  .file-card:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 719px) {
  .gate h1 {
    letter-spacing: 0.1em;
    font-size: clamp(1.65rem, 8.2vw, 2.5rem);
  }

  .field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (min-width: 720px) {
  .wrap {
    padding-inline: 28px;
  }

  .method {
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }

  .file-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .tab-list,
  .thread-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .thread-row {
    grid-template-columns: 1fr 1fr;
  }

  .control-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
  }

  .search-field {
    flex: 1 1 240px;
  }

  .control-tools {
    flex: 1 1 360px;
    grid-template-columns: 1fr 1fr auto;
  }

  .bound-field {
    grid-column: auto;
    white-space: nowrap;
  }

  .control-meta {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1100px) {
  .control-inner {
    flex-wrap: nowrap;
    align-items: center;
  }

  .control-meta {
    flex: 1.3 1 auto;
  }

  .file-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .file-grid--nuclear {
    grid-template-columns: 1fr 1fr;
  }

  .file-grid--nuclear .file-card:first-child {
    grid-column: 1 / -1;
  }
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes arrive {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 56, 58, 0);
  }
  40% {
    box-shadow: 0 0 36px rgba(217, 56, 58, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 56, 58, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
