/* ============================================================
   style.css — Permutation 04AV9ZR
   Archive noir aesthetic. Mobile-first.
   ============================================================ */

/* ------------------------------------------------------------
   Design tokens
   Change these variables to retheme the whole site at once.
   ------------------------------------------------------------ */
:root {
  --bg:          #1c1c1a;      /* near-black background */
  --bg-record:   #1f1f1d;      /* very slightly lighter for record cards */
  --text:        #dfd8c8;      /* warm off-white */
  --text-dim:    #7a7570;      /* dimmed text for labels and metadata */
  --accent:      #c8a05a;      /* muted amber — primary accent */
  --accent-red:  #7a3030;      /* deep red — used very sparingly (WITHHELD status) */
  --border:      #333330;      /* subtle rule color */

  --font-mono:  'Courier Prime', 'Courier New', Courier, monospace;
  --font-prose: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;

  --col-width:   680px;
  --gap:         2rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   Focus states — always visible for keyboard users
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   Utility: hidden state
   Used on both #landing and #archive to toggle visibility.
   JavaScript adds or removes this class; CSS controls display.
   ------------------------------------------------------------ */
.is-hidden {
  display: none !important;
}


/* ============================================================
   LANDING SCREEN
   ============================================================ */

#landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--gap);
  /* Shift content ~10% above true center */
  padding-bottom: 18vh;
  text-align: center;
}

.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Quiet document designation above the metadata block */
.landing-designation {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  opacity: 0.55;
  margin-bottom: 1.75rem;
  text-transform: uppercase;
}

/* Metadata block — RUN IDENTIFIER and STATUS read as one unit */
.landing-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.landing-content .meta-field {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.landing-content .value {
  color: var(--text);
}

/* Run identifier value — slightly more prominent than standard .value */
.run-id-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--text);
}

/* OPEN FILE button — terminal / archive command aesthetic */
#open-file-btn {
  margin-top: 2.5rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  padding: 0.8rem 2rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  /* Large tap target on mobile */
  min-height: 48px;
  min-width: 180px;
}

#open-file-btn:hover {
  background-color: var(--accent);
  color: var(--bg);
}

#open-file-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  background-color: transparent;
  color: var(--accent);
}


/* ============================================================
   ARCHIVE CONTENT — outer wrapper
   ============================================================ */

#archive {
  padding: var(--gap);
  padding-top: 4rem;
  padding-bottom: 6rem;
}

/* Narrow centered content column */
.column {
  max-width: var(--col-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}


/* ============================================================
   RECORD SECTIONS
   Each section feels like a filed document.
   ============================================================ */

.record {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.record-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
}

/* Section label in amber — small caps feel */
.record-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.record-section {
  margin-bottom: 1.75rem;
}

/* Footnote-style note at bottom of a record */
.record-note {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8125rem;
  line-height: 1.6;
}


/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

/* Labels: dim mono uppercase */
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Values: brighter mono */
.value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
}

/* Standard metadata line (label + value together) */
.meta-field {
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* Label used as a section heading above prose */
.section-label {
  display: block;
  margin-bottom: 0.6rem;
}

/* Prose paragraphs — switch to the readable prose font */
.prose-text {
  font-family: var(--font-prose);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 60ch;
  margin-bottom: 0.85rem;
}

.prose-text:last-child {
  margin-bottom: 0;
}


/* ============================================================
   INDEX TABLE  (CCR list, pending records)
   ============================================================ */

.index-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.index-table td {
  padding: 0.5rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

/* First row has a top border too */
.index-table tr:first-child td {
  border-top: 1px solid var(--border);
}

/* Reference ID column */
.ref-id {
  color: var(--text-dim);
  width: 5.5rem;
  padding-right: 1.25rem;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* Title column (three-col tables only) */
.ref-title {
  color: var(--text);
  padding-right: 1.25rem;
}

/* Status column — right-aligned in two-col, right-aligned in three-col */
.ref-status {
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

/* CCR-04 highlight */
.ref-highlight {
  color: var(--accent);
}

/* Status variants — status is also communicated by text, not color alone */
.status-sealed {
  color: var(--text-dim);
  font-style: italic;
}

.status-unavailable {
  color: var(--text-dim);
}

.status-withheld {
  color: var(--accent-red);
}


/* ============================================================
   PRODUCTION DATA TABLE
   ============================================================ */

.production-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.875rem;
}

.production-table td {
  padding: 0.45rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.production-table tr:first-child td {
  border-top: 1px solid var(--border);
}

/* Label column */
.prod-label {
  font-family: var(--font-mono);
  color: var(--text-dim);
  width: 9.5rem;
  padding-right: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Value column — prose font for readability */
.production-table td:last-child {
  font-family: var(--font-prose);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.6;
}


/* ============================================================
   NAVIGATION — cross-references
   ============================================================ */

.cross-ref-list {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cross-ref {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.cross-ref:hover,
.cross-ref:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.email-link {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.email-link:hover,
.email-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   AUTHOR STATEMENT
   The archive voice drops. Prose font takes over.
   ============================================================ */

.record-author {
  border-top: 2px solid var(--border);
  padding-top: 3.5rem;
}

/* Title in prose font — quieter, not monospace command */
.author-title {
  font-family: var(--font-prose);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

.author-prose {
  font-family: var(--font-prose);
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 58ch;
}

/* The two rhetorical questions — set apart with amber left rule */
.author-question {
  font-style: italic;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.author-sig {
  margin-top: 1.25rem;
  font-style: italic;
  color: var(--text-dim);
}


/* ============================================================
   RESPONSIVE — tablet and above
   Mobile-first: all rules above are for small screens.
   Wider screens get slightly more breathing room.
   ============================================================ */

@media (min-width: 600px) {
  :root {
    --gap: 3rem;
  }

  .landing-content .meta-field {
    font-size: 0.875rem;
  }

  .record-title {
    font-size: 0.75rem;
  }

  .author-prose {
    font-size: 1.125rem;
  }
}
