/* ============================================================
   ARCGENT — RETRO-FUTURISTIC
   1970s/80s computer manual meets analog sci-fi.
   Instrument Serif display · IBM Plex Serif body · IBM Plex Mono.
   Warm amber + parchment + terracotta + graphite.
   ============================================================ */

:root {
  /* Palette — aged paper and analog warmth */
  --parchment:    #F4E9D1;
  --parchment-2:  #EADDBA;
  --parchment-3:  #DCC99B;
  --cream:        #FAF3DF;

  --ink:          #2A2420;   /* warm graphite, like typewriter ink */
  --ink-2:        #433A32;
  --ink-3:        #6B5D4F;
  --ink-4:        #9A8C7A;

  --amber:        #E8A33D;   /* primary analog accent */
  --amber-2:      #D48A1E;
  --amber-3:      #F6BC5C;
  --amber-bg:     rgba(232, 163, 61, 0.12);

  --terracotta:   #BC4A2A;
  --terracotta-2: #9A3A1E;
  --terracotta-bg: rgba(188, 74, 42, 0.08);

  --rule:         rgba(42, 36, 32, 0.18);
  --rule-strong:  rgba(42, 36, 32, 0.38);
  --rule-amber:   rgba(232, 163, 61, 0.5);

  /* Type */
  --display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --body:    "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
  /* Analog paper warmth + subtle scanline vibe */
  background:
    /* Horizontal CRT-ish scan lines — very subtle */
    repeating-linear-gradient(
      0deg,
      rgba(42, 36, 32, 0.02) 0,
      rgba(42, 36, 32, 0.02) 1px,
      transparent 1px,
      transparent 3px
    ),
    /* Warm paper glow */
    radial-gradient(ellipse 1400px 800px at 50% -200px, rgba(232, 163, 61, 0.08), transparent 55%),
    radial-gradient(ellipse 800px 500px at 85% 70%, rgba(188, 74, 42, 0.05), transparent 55%),
    var(--parchment);
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--ink); }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--parchment-2); }
::-webkit-scrollbar-thumb { background: var(--ink-3); border: 2px solid var(--parchment-2); }
::-webkit-scrollbar-thumb:hover { background: var(--terracotta); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  98% { opacity: 1; }
  99% { opacity: 0.92; }
}
.rise { animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.35s; }
.d4 { animation-delay: 0.5s; }
.d5 { animation-delay: 0.65s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1.75rem, 4vw, 3rem);
  position: relative;
}

/* ============ TOP STRIP — like a technical manual masthead ============ */
.masthead {
  padding: 1.5rem 0 1.25rem;
  border-bottom: 3px double var(--ink);
  background: var(--parchment);
  position: relative;
}
.masthead::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--ink);
}
.masthead__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}
.masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}
.masthead__brand img {
  height: 36px;
  width: auto;
}
.masthead__brand .tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
  line-height: 1.35;
}
.masthead__brand .tag strong { color: var(--ink); font-weight: 700; display: block; font-size: 0.74rem; }

.masthead__meta {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.4;
}
.masthead__meta strong { color: var(--ink); font-weight: 700; }
.masthead__meta .vol {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--terracotta);
  font-style: italic;
  display: block;
  line-height: 1;
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.masthead__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--ink);
  transition: all 260ms var(--ease);
}
.masthead__cta:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
}
.masthead__cta::after { content: "▶"; font-size: 0.7rem; color: var(--amber); }

/* Secondary nav strip */
.masthead__nav {
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  overflow-x: auto;
}
.masthead__nav a {
  padding: 0.3rem 1.1rem;
  border-right: 1px solid var(--rule);
  transition: color 220ms var(--ease);
  white-space: nowrap;
}
.masthead__nav a:first-child { padding-left: 0; }
.masthead__nav a:last-child { border-right: none; }
.masthead__nav a:hover { color: var(--terracotta); }
.masthead__nav .marker { color: var(--terracotta); font-weight: 700; }

@media (max-width: 860px) {
  .masthead__meta { display: none; }
}

/* ============ HERO / COVER PAGE ============ */
.hero {
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3.5rem, 7vw, 6rem);
  position: relative;
}

.hero__topmeta {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--rule);
  flex-wrap: wrap;
}
.hero__topmeta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero__topmeta strong { color: var(--ink); font-weight: 700; }
.hero__topmeta .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(188, 74, 42, 0.2);
}

.hero__headline {
  font-family: var(--display);
  font-size: clamp(3.2rem, 9.5vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 clamp(1.75rem, 3vw, 2.5rem);
  max-width: 14ch;
}
.hero__headline em {
  font-style: italic;
  color: var(--terracotta);
  font-weight: 400;
}
.hero__headline .amber {
  color: var(--amber-2);
  font-style: italic;
}
.hero__headline .cursor::after {
  content: "▮";
  color: var(--terracotta);
  font-family: var(--mono);
  font-size: 0.75em;
  margin-left: 0.1em;
  animation: blink 1.1s step-end infinite;
}

.hero__lede {
  font-family: var(--body);
  font-size: clamp(1.08rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 2.5rem;
  font-weight: 400;
}
.hero__lede strong {
  color: var(--ink);
  font-weight: 600;
  background: var(--amber-bg);
  padding: 0 0.15em;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn-terminal {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1rem 1.75rem;
  background: var(--ink);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--ink);
  position: relative;
  transition: all 260ms var(--ease);
}
.btn-terminal::before {
  content: "▶";
  color: var(--terracotta);
  font-size: 0.7rem;
}
.btn-terminal:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--parchment);
}
.btn-terminal:hover::before { color: var(--amber); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--ink);
  transition: all 260ms var(--ease);
}
.btn-outline:hover {
  background: var(--amber);
  border-color: var(--amber);
}
.btn-outline::after { content: "→"; }

/* ============ TERMINAL READOUT — faux analog diagram on cover ============ */
.readout {
  margin-top: clamp(3rem, 5vw, 4.5rem);
  padding: 1.75rem clamp(1.5rem, 2.5vw, 2rem);
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
  animation: crt-flicker 6s ease-in-out infinite;
}
.readout::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(232, 163, 61, 0.02) 0,
    rgba(232, 163, 61, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}
.readout__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(232, 163, 61, 0.25);
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
}
.readout__bar .port { color: var(--parchment); }
.readout__body {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  white-space: pre;
  overflow-x: auto;
  color: var(--parchment-3);
}
.readout__body .prompt { color: var(--terracotta); font-weight: 700; }
.readout__body .cmd { color: var(--parchment); }
.readout__body .ok { color: var(--amber); }
.readout__body .dim { color: var(--ink-4); }
.readout__body .hl { color: var(--terracotta); font-weight: 700; }
.readout__body .num { color: var(--amber-3); }

/* ============ SECTION HEADERS — like figure captions ============ */
.section {
  padding: clamp(4.5rem, 8vw, 7rem) 0;
  position: relative;
}
.section + .section { border-top: 1px solid var(--rule); }

.fig {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 820px) {
  .fig { grid-template-columns: 1fr; gap: 0.5rem; }
}
.fig__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--terracotta);
  padding-top: 0.5rem;
  border-top: 2px solid var(--terracotta);
  line-height: 1.5;
}
.fig__num strong {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--ink);
  margin-top: 0.2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.fig__title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 1.25rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--ink);
  text-wrap: balance;
}
.fig__title em { font-style: italic; color: var(--terracotta); }
.fig__title .amber { color: var(--amber-2); font-style: italic; }
.fig__lede {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0;
}
.fig__lede strong { color: var(--ink); font-weight: 600; }

/* ============ INDEX TABLE (numbered list of items) ============ */
.index {
  border-top: 2px solid var(--ink);
}
.index__row {
  display: grid;
  grid-template-columns: 90px 1fr 2.2fr 160px;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: clamp(1.5rem, 2.5vw, 2.25rem) 1rem;
  margin: 0 -1rem;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: background 260ms var(--ease);
  position: relative;
}
.index__row::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 1rem;
  right: 1rem;
  height: 1px;
  border-top: 1px dotted var(--rule-strong);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}
.index__row:hover {
  background: var(--parchment-2);
}
.index__num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--terracotta);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.index__title {
  font-family: var(--display);
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.018em;
}
.index__title em { font-style: italic; color: var(--terracotta); }
.index__desc {
  font-size: 0.98rem;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 52ch;
}
.index__page {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-align: right;
  padding-top: 0.5rem;
  border-top: 1px dotted var(--rule-strong);
}
.index__page strong { color: var(--ink); font-weight: 700; display: block; font-size: 0.75rem; margin-top: 0.15rem; }

@media (max-width: 900px) {
  .index__row { grid-template-columns: 60px 1fr; }
  .index__desc, .index__page { grid-column: 2; }
  .index__page { text-align: left; }
}

/* ============ PHILOSOPHY / EPIGRAPH ============ */
.epigraph {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  text-align: center;
  background: var(--ink);
  color: var(--parchment);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.epigraph::before,
.epigraph::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 1px;
  background: var(--amber);
}
.epigraph::before { top: 3rem; }
.epigraph::after { bottom: 3rem; }
.epigraph__wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}
.epigraph__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--amber);
  margin-bottom: 2rem;
}
.epigraph__text {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--parchment);
  margin: 0 auto 1.75rem;
  max-width: 28ch;
  text-wrap: balance;
  font-style: italic;
}
.epigraph__text .amber-text { color: var(--amber); }
.epigraph__byline {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

/* ============ CTA ============ */
.cta {
  padding: clamp(5rem, 9vw, 8rem) 0;
  text-align: center;
}
.cta__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  margin-bottom: 1.5rem;
}
.cta__headline {
  font-family: var(--display);
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 auto 1.5rem;
  max-width: 22ch;
  text-wrap: balance;
}
.cta__headline em { font-style: italic; color: var(--terracotta); }
.cta__lede {
  font-size: 1.15rem;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 54ch;
  margin: 0 auto 2.25rem;
}

/* ============ COLOPHON / FOOTER ============ */
.colophon {
  padding: clamp(3.5rem, 6vw, 5rem) 0 2rem;
  border-top: 3px double var(--ink);
  background: var(--parchment-2);
  position: relative;
}
.colophon::before {
  content: "";
  position: absolute;
  top: 7px; left: 0; right: 0;
  height: 1px;
  background: var(--ink);
}
.colophon__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
@media (max-width: 720px) { .colophon__head { grid-template-columns: 1fr; } }
.colophon__head h3 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  font-style: italic;
  color: var(--terracotta);
  margin: 0;
  letter-spacing: -0.018em;
}
.colophon__head h3 .plain { color: var(--ink); font-style: normal; }
.colophon__head .addr {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-align: right;
}
@media (max-width: 720px) { .colophon__head .addr { text-align: left; } }
.colophon__head .addr strong { color: var(--ink); font-weight: 700; display: block; font-size: 0.88rem; font-family: var(--display); font-style: italic; margin-bottom: 0.2rem; }

.colophon__cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 820px) { .colophon__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .colophon__cols { grid-template-columns: 1fr; } }

.colophon__brand img { height: 34px; margin-bottom: 0.75rem; }
.colophon__brand p {
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.5;
  margin: 0;
  max-width: 32ch;
}
.colophon__col h4 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--terracotta);
  margin: 0 0 1rem;
}
.colophon__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.colophon__col a {
  font-size: 0.95rem;
  color: var(--ink-2);
  transition: color 220ms var(--ease);
}
.colophon__col a:hover { color: var(--terracotta); }

.colophon__bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.colophon__bottom .amber { color: var(--terracotta); }
