:root {
  --paper: #f3e6cd;
  --paper-deep: #e3cfaa;
  --ink: #17130f;
  --ink-soft: #4b3b2b;
  --rail: #0f0d0a;
  --rail-2: #19140f;
  --brass: #a77d35;
  --brass-soft: rgba(167, 125, 53, 0.42);
  --shadow: rgba(0, 0, 0, 0.42);
  --header-h: 74px;
  --header-hide-y: 86px;
  --timeline-h: 104px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--rail);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 230, 205, 0.22), transparent 34rem),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(167, 125, 53, 0.05) 46px 47px),
    linear-gradient(90deg, #130f0b 0, var(--paper-deep) 7%, var(--paper-deep) 93%, #130f0b 100%);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 18rem),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.10), transparent 22rem);
  mix-blend-mode: overlay;
  opacity: 0.9;
  z-index: 5;
}

a {
  color: inherit;
}

.archive-header {
  position: sticky;
  top: calc(0px - var(--header-hide-y));
  z-index: 20;
  margin: 0 auto;
  width: min(1120px, calc(100vw - 24px));
  min-height: var(--header-h);
  padding: 8px clamp(14px, 2.4vw, 30px) 9px;
  transform: translateY(0);
  color: var(--paper);
  background:
    linear-gradient(90deg, transparent 0 1.8%, var(--brass) 1.8% 2%, transparent 2% 98%, var(--brass) 98% 98.2%, transparent 98.2%),
    linear-gradient(180deg, #21180f, #0e0b08);
  border: 1px solid var(--brass);
  border-top: 0;
  box-shadow: 0 9px 24px rgba(0,0,0,0.34), inset 0 0 0 5px #0e0b08, inset 0 0 0 6px rgba(167,125,53,0.45);
  text-align: center;
  transition: transform 180ms ease;
  will-change: transform;
}

.archive-header.is-hidden {
  transform: translateY(0);
}

.archive-header.is-peeking {
  transform: translateY(var(--header-hide-y));
}

.archive-header h1 {
  margin: 1px 0 3px;
  font-family: "Avenir Next Condensed", "Arial Narrow", "Copperplate", "Trebuchet MS", sans-serif;
  font-size: clamp(1.35rem, 3.35vw, 3rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}

.archive-header h1 span {
  color: var(--brass);
  margin: 0 0.18em;
}

.archive-kicker,
.archive-meta {
  font-family: "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(0.52rem, 0.9vw, 0.68rem);
}

.archive-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #dac49a;
}

.archive-meta a {
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}

.header-rule {
  height: 5px;
  margin-bottom: 5px;
  background:
    radial-gradient(circle, var(--brass) 0 1.5px, transparent 2px) center / 24px 5px repeat-x,
    linear-gradient(var(--brass), var(--brass)) center / 100% 1px no-repeat;
}

.issue-stack {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 22px 0 calc(var(--timeline-h) + 34px);
}

.issue-section {
  position: relative;
  margin: 0 auto 54px;
  scroll-margin-top: 12px;
}

.issue-tab {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  margin: 0 auto 10px;
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(167,125,53,0.18), transparent 30%, transparent 70%, rgba(167,125,53,0.18)),
    #14100c;
  border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 3px #14100c, inset 0 0 0 4px rgba(167,125,53,0.36);
  font-family: "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.issue-tab small {
  color: #c8ac72;
  font-size: 0.7rem;
}

.issue-tab strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.85rem, 1.6vw, 1.08rem);
}

.issue-link {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  font-size: 0.72rem;
}

.issue-frame-wrap {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow:
    0 0 0 4px rgba(243,230,205,0.8),
    0 0 0 5px var(--brass-soft),
    0 18px 42px rgba(0,0,0,0.38);
  overflow: hidden;
}

.plate-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 900px;
  color: var(--ink-soft);
  background:
    radial-gradient(circle, rgba(167,125,53,0.13) 0 2px, transparent 2.5px) center / 34px 34px,
    linear-gradient(180deg, rgba(255,255,255,0.20), transparent 48%),
    var(--paper);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  z-index: 1;
}

.plate-loader span {
  padding: 12px 18px;
  border-top: 1px solid var(--brass);
  border-bottom: 1px solid var(--brass);
  background: rgba(243,230,205,0.78);
}

.issue-frame-wrap.is-loaded .plate-loader {
  display: none;
}

.issue-frame {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: 1400px;
  border: 0;
  background: var(--paper);
  pointer-events: none;
  visibility: hidden;
}

.issue-frame-wrap.is-loaded .issue-frame {
  visibility: visible;
}

.loading-card {
  margin: 12vh auto;
  width: min(620px, 90%);
  padding: 26px;
  text-align: center;
  color: var(--paper);
  background: #15100c;
  border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 5px #15100c, inset 0 0 0 6px rgba(167,125,53,0.42);
}

.loading-title {
  font-family: "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.loading-rule {
  height: 8px;
  margin-top: 18px;
  background:
    radial-gradient(circle, var(--brass) 0 2px, transparent 2.5px) center / 22px 8px repeat-x,
    linear-gradient(var(--brass), var(--brass)) center / 100% 1px no-repeat;
}

.timeline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  min-height: var(--timeline-h);
  height: auto;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 8px;
  padding: 8px clamp(10px, 2vw, 24px) calc(10px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, rgba(167,125,53,0.22), transparent 24%),
    linear-gradient(90deg, #090705, #18120d 14%, #21180f 50%, #18120d 86%, #090705);
  color: var(--paper);
  border-top: 1px solid var(--brass);
  box-shadow: 0 -8px 28px rgba(0,0,0,0.48), inset 0 0 0 4px #0c0906, inset 0 0 0 5px rgba(167,125,53,0.45);
}

.timeline-arrow {
  align-self: stretch;
  min-height: 0;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: #100c08;
  border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 3px #100c08, inset 0 0 0 4px rgba(167,125,53,0.35);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.timeline-arrow:focus-visible,
.timeline-button:focus-visible {
  outline: 2px solid #f3e6cd;
  outline-offset: 3px;
}

.timeline-window {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--brass);
  padding: 5px 10px 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(167,125,53,0.13) 38px 39px),
    #11100d;
  box-shadow: inset 0 0 0 3px #11100d, inset 0 0 0 4px rgba(167,125,53,0.35);
}

.timeline-status {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 3px;
  line-height: 1;
  font-family: "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  color: #d6bd88;
}

.timeline-status strong {
  color: var(--paper);
  font-size: 0.82rem;
}

.timeline-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 52px;
  overflow: hidden;
  overscroll-behavior: none;
  padding: 0 4px;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 21px;
  z-index: 0;
  height: 2px;
  background:
    linear-gradient(var(--brass), var(--brass)) center / 100% 1px no-repeat,
    linear-gradient(#0a0805, #0a0805);
}

.timeline-button {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 52px;
  padding: 32px 3px 8px;
  color: #cbb07a;
  background: transparent;
  border: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.58rem;
  line-height: 1;
  cursor: pointer;
}

.timeline-button::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  background: #20170f;
  border: 1px solid var(--brass);
  box-shadow: 0 0 0 2px #11100d;
}

.timeline-button strong {
  display: block;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 1;
}

.timeline-button.is-active {
  color: var(--paper);
}

.timeline-button.is-active::before {
  background: var(--paper);
  box-shadow: 0 0 0 2px #11100d, 0 0 14px rgba(243,230,205,0.45);
}

.timeline-indicator {
  position: absolute;
  top: 4px;
  z-index: 1;
  height: calc(100% - 8px);
  width: 110px;
  left: 0;
  transform: translateX(-50%);
  border: 1px solid var(--brass);
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(243,230,205,0.12), rgba(15,11,7,0.98) 42%),
    #0f0b07;
  box-shadow:
    0 0 0 3px #0e0b08,
    0 0 0 4px rgba(167,125,53,0.45),
    0 0 22px rgba(0,0,0,0.56);
  transition: left 220ms ease, width 220ms ease;
}

@media (max-width: 900px) {
  :root {
    --header-h: 64px;
    --timeline-h: 0px;
  }

  body {
    background:
      linear-gradient(90deg, #120e0a 0 3%, var(--paper-deep) 3% 97%, #120e0a 97% 100%);
  }

  .archive-header {
    width: calc(100vw - 12px);
    padding: 7px 10px 8px;
  }

  .archive-header h1 {
    letter-spacing: 0.01em;
    font-size: clamp(0.76rem, 3.9vw, 0.96rem);
  }

  .archive-meta {
    gap: 9px;
  }

  .archive-meta span:nth-child(2) {
    display: none;
  }

  .issue-stack {
    width: calc(100vw - 10px);
    padding: 12px 0 24px;
  }

  .issue-section {
    margin-bottom: 22px;
  }

  .issue-tab {
    display: none;
  }

  .timeline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .timeline-indicator { transition: none; }
}
