/* Asylum's pages on devpipe.com.
 *
 * The lander keeps its styles inline because it is one page with one job. These
 * are three long documents that must not drift from each other, so they share a
 * sheet — served from `site/` with an explicit content type (see serve.ts), the
 * same way the lander's script is a file rather than a <style> block.
 *
 * Same amber-CRT palette as the lander. Asylum is part of Devpipe, not a
 * neighbouring product, and a second visual identity would say otherwise. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --void:  #0B0E14;
  --panel: #11151D;
  --line:  #1D2431;
  --text:  #C9D1DE;
  --dim:   #6B7688;
  --amber: #FFB454;
  --ember: #FF7A45;
  --good:  #7BD88F;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Rail ───────────────────────────────────────────────────────────────── */

header.rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.mark {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.mark svg { width: 26px; height: 26px; }
.mark a { color: var(--text); text-decoration: none; }
.mark .sep { color: var(--dim); font-weight: 400; }
.mark .here { color: var(--amber); }

.rail-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.rail-nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: .95rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.rail-nav a:hover { color: var(--text); }
.rail-nav a[aria-current="page"] { color: var(--amber); border-bottom-color: var(--amber); }

/* ── Type ───────────────────────────────────────────────────────────────── */

main { padding: 3.5rem 0 1rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 1.25rem;
  font-weight: 700;
}
h1 .quiet { color: var(--dim); display: block; }

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
h2:first-of-type { border-top: none; padding-top: 0; }

h3 {
  font-size: 1.15rem;
  margin: 2rem 0 .5rem;
  letter-spacing: -.01em;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text);
  max-width: 46rem;
  margin: 0 0 2rem;
}
.lede strong { color: var(--amber); font-weight: 600; }

p { max-width: 46rem; }
p, li { color: var(--text); }
.dim { color: var(--dim); }

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember); }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .1em .35em;
}

pre {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.6;
  max-width: 52rem;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* ── Cards ──────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; font-size: .95rem; }
.card p + p { margin-top: .6rem; }

a.card { display: block; text-decoration: none; color: var(--text); }
a.card:hover { border-color: var(--amber); }
a.card h3 { color: var(--amber); }

/* ── Lessons ────────────────────────────────────────────────────────────── */

.lesson {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.lesson:last-child { border-bottom: none; }

.lesson .num {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--amber);
  padding-top: .1rem;
}
.lesson h3 { margin: 0 0 .35rem; }
.lesson p { margin: 0 0 .5rem; font-size: .97rem; }

.meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
}
.meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .15rem .6rem;
  color: var(--dim);
}
.meta .level-beginner { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.meta .level-intermediate { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.meta .level-advanced { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 35%, transparent); }

/* ── Callout ────────────────────────────────────────────────────────────── */

.note {
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 7%, transparent);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  max-width: 52rem;
}
.note p { margin: 0; }
.note p + p { margin-top: .6rem; }
.note strong { color: var(--amber); }

/* ── Steps ──────────────────────────────────────────────────────────────── */

ol.steps { counter-reset: step; list-style: none; padding: 0; max-width: 52rem; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1.35rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.05rem;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--amber);
}

/* ── Table ──────────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .9rem;
}
.foot-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.foot-nav a { color: var(--dim); text-decoration: none; }
.foot-nav a:hover { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
