/* APEX Runner — Guides
   Palette: deep aubergine-ink, warm bone, gold (settlement), teal (live/links)
   Type: Fraunces (display) · IBM Plex Sans (body) · IBM Plex Mono (code/data) */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink:    #131017;
  --ink-2:  #1A1622;
  --panel:  #1F1A29;
  --bone:   #ECE6DA;
  --muted:  #9A93A6;
  --faint:  #6E6878;
  --gold:   #E8B24C;
  --gold-d: #C8902F;
  --teal:   #5FD0C5;
  --line:   rgba(236, 230, 218, 0.10);
  --line-2: rgba(236, 230, 218, 0.06);
  --measure: 46rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint vertical glow behind content, kept very quiet */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(58rem 40rem at 50% -8rem, rgba(232,178,76,0.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: var(--measure); margin: 0 auto; padding: 0 1.4rem; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(19,16,23,0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 64rem; margin: 0 auto; padding: 0.85rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em; color: var(--bone); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 400; }
.nav-links { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.nav-links a {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; letter-spacing: 0.02em;
  color: var(--muted); text-transform: uppercase;
}
.nav-links a:hover { color: var(--gold); text-decoration: none; }
.nav-links a.active { color: var(--bone); }

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 2.5rem; animation: rise 0.6s cubic-bezier(0.2,0.7,0.2,1) both; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--gold-d); }
h1 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 1.1rem;
}
.lede { font-size: 1.18rem; color: var(--muted); max-width: 38rem; margin: 0; }

/* ---------- typography blocks ---------- */
.body { padding-bottom: 5rem; }
.body h2 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.7rem; line-height: 1.2;
  margin: 3.2rem 0 0.4rem; padding-top: 2rem; border-top: 1px solid var(--line-2);
}
.body h2:first-child { border-top: none; padding-top: 0; margin-top: 1.5rem; }
.body h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.22rem; margin: 2rem 0 0.5rem; }
.body p { margin: 0.9rem 0; }
.body ul, .body ol { margin: 0.9rem 0; padding-left: 1.3rem; }
.body li { margin: 0.4rem 0; }
.body li::marker { color: var(--gold-d); }
strong { color: var(--bone); font-weight: 600; }

/* inline + block code */
code {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.88em;
  background: var(--ink-2); color: var(--teal);
  padding: 0.12em 0.4em; border-radius: 4px; border: 1px solid var(--line-2);
}
pre {
  position: relative; margin: 1.4rem 0; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 1.1rem 1.2rem; overflow-x: auto;
}
pre code { background: none; border: none; color: var(--bone); padding: 0; font-size: 0.84rem; line-height: 1.7; }
pre[data-lang]::after {
  content: attr(data-lang); position: absolute; top: 0.6rem; right: 0.8rem;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint);
}
.tok-c { color: var(--faint); font-style: italic; } /* comment */
.tok-s { color: var(--gold); }                       /* string */
.tok-k { color: var(--teal); }                       /* keyword */

/* ---------- handshake signature ---------- */
.handshake {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin: 2rem 0; counter-reset: step;
}
.step {
  position: relative; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 1rem 0.85rem;
}
.step.pay { border-color: var(--gold-d); background: linear-gradient(180deg, rgba(232,178,76,0.10), transparent); }
.step .n {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--faint);
  letter-spacing: 0.1em;
}
.step.pay .n { color: var(--gold); }
.step .t { font-family: 'Fraunces', serif; font-weight: 600; font-size: 0.98rem; margin-top: 0.3rem; }
.step .d { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.45; }
.step:not(:last-child)::after {
  content: "→"; position: absolute; right: -0.55rem; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 0.9rem; z-index: 2;
}

/* ---------- callouts ---------- */
.note {
  margin: 1.6rem 0; padding: 1rem 1.2rem; background: var(--ink-2);
  border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 6px;
  font-size: 0.95rem;
}
.note.gold { border-left-color: var(--gold); }
.note .label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal); display: block; margin-bottom: 0.35rem;
}
.note.gold .label { color: var(--gold); }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: 0.92rem; }
.tbl th, .tbl td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.tbl td code { font-size: 0.82rem; }

/* ---------- guide cards (landing) ---------- */
.cards { display: grid; gap: 1rem; margin: 2.5rem 0; }
.card {
  display: block; padding: 1.5rem 1.6rem; background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 10px; transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--gold-d); transform: translateY(-2px); text-decoration: none; }
.card .k { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem; margin: 0.5rem 0 0.4rem; color: var(--bone); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- cta ---------- */
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 2rem 0; }
.btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; letter-spacing: 0.03em;
  padding: 0.7rem 1.2rem; border-radius: 7px; border: 1px solid var(--gold);
  background: var(--gold); color: #1a1206; font-weight: 600;
}
.btn:hover { background: var(--gold-d); border-color: var(--gold-d); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--bone); background: transparent; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line); padding: 2.5rem 0 3.5rem; margin-top: 2rem;
  color: var(--faint); font-size: 0.85rem;
}
.foot .links { display: flex; gap: 1.3rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.foot .links a { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; }
.foot .disc { max-width: 40rem; line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .handshake { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .step:nth-child(2)::after, .step:not(:last-child)::after { content: none; }
  .nav-links { gap: 0.9rem; }
  .nav-links a { font-size: 0.7rem; }
}

/* ---------- a11y ---------- */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
