/* ============================================================
   1. CSS CUSTOM PROPERTIES — LIGHT (DEFAULT)
   ============================================================ */

:root {
  --bg-primary:    #FAF9F7;
  --bg-secondary:  #F2F1ED;
  --text-primary:  #111111;
  --text-secondary:#444444;
  --text-muted:    #888888;
  --border:        #D1D1C7;
  --accent:        #111111;
}

/* ============================================================
   2. DARK THEME OVERRIDES
   ============================================================ */

[data-theme="dark"] {
  --bg-primary:    #0F0F0E;
  --bg-secondary:  #1A1A18;
  --text-primary:  #E8E6DF;
  --text-secondary:#A8A49C;
  --text-muted:    #5A5854;
  --border:        #2E2E2A;
  --accent:        #E8E6DF;
}

/* ============================================================
   3. CSS RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

/* ============================================================
   4. BASE STYLES
   ============================================================ */

html {
  font-size: 15px;
  line-height: 1.6;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: Georgia, 'Times New Roman', serif;
  padding-top: 64px;
  padding-bottom: 96px;
}

/* ============================================================
   5. LAYOUT
   ============================================================ */

.page-wrapper {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============================================================
   6. NAV
   ============================================================ */

.nav {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 16px;
  margin-bottom: 56px;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color 0.15s ease;
  cursor: default;
}

.nav-logo:hover {
  color: var(--text-muted);
}

#theme-toggle {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

#theme-toggle:hover {
  color: var(--text-primary);
}

/* ============================================================
   7. HERO
   ============================================================ */

.hero {
  margin-bottom: 56px;
}

.hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 36px;
}

/* ============================================================
   8. ARTIFACT INDEX
   ============================================================ */

.artifacts {
  margin-bottom: 0;
}

.artifact-row {
  display: flex;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--border);
  gap: 12px;
}

.artifact-row:first-child {
  border-top: 0.5px solid var(--border);
}

.artifact-tag {
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 36px;
  flex-shrink: 0;
}

.artifact-row a {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
  flex: 1;
}

.artifact-row a:hover {
  text-decoration-color: var(--text-primary);
}

.artifact-meta {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   9. MECHANISM SECTION
   ============================================================ */

.mechanism {
  border-top: 0.5px solid var(--border);
  margin-top: 56px;
  padding-top: 56px;
}

.section-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.mech-block {
  margin-bottom: 44px;
}

.mech-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.mech-block p:not(.mech-title) {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ============================================================
   10. OPEN QUESTIONS SECTION
   ============================================================ */

.questions {
  border-top: 0.5px solid var(--border);
  margin-top: 56px;
  padding-top: 56px;
}

.question-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--border);
}

.q-num {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 24px;
  flex-shrink: 0;
}

.q-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================================
   11. FOOTER
   ============================================================ */

.footer {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  margin-top: 96px;
  border-top: 0.5px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer span {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.footer a {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

.footer a:hover {
  text-decoration-color: var(--text-primary);
}

/* ============================================================
   12. GLOBAL LINK INTERACTIONS
   ============================================================ */

a {
  transition: text-decoration-color 0.15s ease;
}

/* ============================================================
   13. MEDIA QUERIES
   ============================================================ */

/* Tablet: 480px and up */
@media (min-width: 480px) {
  .hero h1 {
    font-size: 48px;
  }
}

/* Desktop: 768px and up */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  .nav {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 80px;
  }

  .page-wrapper {
    padding-left: 0;
    padding-right: 0;
  }

  .footer {
    padding-left: 0;
    padding-right: 0;
  }

  .hero h1 {
    font-size: 58px;
  }

  .hero h2 {
    font-size: 20px;
  }
}

/* Mobile only: artifact row wrapping */
@media (max-width: 479px) {
  .artifact-row {
    flex-wrap: wrap;
  }

  .artifact-meta {
    margin-left: 0;
    padding-left: calc(36px + 12px);
    width: 100%;
    margin-top: 4px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}
