/* ametios.dev — Developer Hub styles. Dependency-free, mobile-first. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ink: #16181d;
  --muted: #5b6270;
  --line: #e2e5ea;
  --accent: #1f4fd8;
  --accent-ink: #173ea8;
  --code-bg: #0f1420;
  --code-ink: #dbe2f0;
  --stable: #147a3c;
  --stable-bg: #e6f4ea;
  --draft: #9a6200;
  --draft-bg: #fdf1dc;
  --roadmap: #1f4fd8;
  --roadmap-bg: #e8eefe;
  --radius: 10px;
  --maxw: 76rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1rem;
}

/* ---------- header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); font-weight: 400; }
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.1rem;
  margin-left: auto;
}
.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
}
.main-nav a:hover { color: var(--ink); background: var(--bg-soft); }
.main-nav a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 52rem; }
main { padding: 2.5rem 0 4rem; }

.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
}
.hero h1 { font-size: 2rem; margin: 0 0 0.75rem; line-height: 1.25; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 46rem; margin: 0 0 1.25rem; }
.hero p.lede a { color: var(--accent); }

h1 { font-size: 1.9rem; line-height: 1.3; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 2.25rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.75rem; }
h3 { font-size: 1.08rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
ul, ol { margin: 0 0 1rem 1.25rem; padding: 0; }
li { margin-bottom: 0.4rem; }

/* ---------- status pills ---------- */
.status-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1.5rem; }
.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-stable { color: var(--stable); background: var(--stable-bg); border-color: #bfe3cb; }
.pill-draft { color: var(--draft); background: var(--draft-bg); border-color: #f0d9a8; }
.pill-roadmap { color: var(--roadmap); background: var(--roadmap-bg); border-color: #c3d0f7; }
.status-note { font-size: 0.9rem; color: var(--muted); }

/* ---------- legend ---------- */
.legend {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
}
@media (min-width: 46rem) { .legend { grid-template-columns: repeat(3, 1fr); } }
.legend-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--bg);
}
.legend-item p { margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- doc index cards ---------- */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 46rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card h3 { margin: 0; font-size: 1.05rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; font-size: 0.92rem; color: var(--muted); flex: 1; }
.card .card-foot { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- steps ---------- */
.steps { counter-reset: step; list-style: none; margin-left: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.75rem 0 0.75rem 3.25rem;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.75rem;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps li p:last-child { margin-bottom: 0; }

/* ---------- chain diagram ---------- */
.chain { display: flex; flex-direction: column; gap: 0; margin: 1.5rem 0; }
.stage-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1rem 1.15rem;
}
.stage-box h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.stage-box h3 .n {
  display: inline-block; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 0.85rem;
  text-align: center; line-height: 1.6rem; margin-right: 0.5rem;
}
.stage-box p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.chain-arrow { text-align: center; color: var(--muted); font-size: 1.25rem; line-height: 1; padding: 0.35rem 0; }

/* ---------- code ---------- */
.codeblock { margin: 1.25rem 0; }
.codeblock .caption {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.5rem 0.9rem;
  background: var(--bg-soft);
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  border: 1px solid var(--line);
}
pre code { font-family: inherit; background: none; padding: 0; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}
/* highlighter token colors */
.tok-kw { color: #7dd3fc; font-weight: 600; }
.tok-str { color: #a5d6a7; }
.tok-num { color: #f0abfc; }
.tok-com { color: #7d8db0; font-style: italic; }
.tok-key { color: #93c5fd; }
.tok-bool { color: #f0abfc; font-weight: 600; }
.tok-fn { color: #fde68a; }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* ---------- callouts ---------- */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-soft);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.94rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--draft); }
.callout.info { border-left-color: var(--roadmap); }

/* ---------- breadcrumb ---------- */
.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }
.crumb a { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 3rem; }
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .site-footer .inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { margin: 0 0 0.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; font-size: 0.92rem; }
.site-footer p { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.5rem; }
.powered { font-size: 0.88rem; color: var(--muted); margin-top: 0.75rem; }
.powered strong { color: var(--ink); }

/* ---------- changelog ---------- */
.log-entry { border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.log-entry time { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.log-entry h2 { border: 0; padding: 0; margin: 0.25rem 0 0.5rem; }

/* ---------- misc ---------- */
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.toc p { font-weight: 700; margin: 0 0 0.5rem; font-size: 0.92rem; }
.toc ul { margin-bottom: 0; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0.35rem 1rem; margin: 1rem 0; }
@media (min-width: 46rem) { .kv { grid-template-columns: 12rem 1fr; } }
.kv dt { font-weight: 700; font-size: 0.93rem; }
.kv dd { margin: 0; font-size: 0.93rem; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { position: static; padding: 0.5rem; background: #fff; }

/* --- Site 14 components (Visual Elevation, "The Chain, Specified") --- */
.pill-ref{background:#eceff4;color:var(--ink)}
.chain-diagram{list-style:none;margin:1.25rem 0;padding:0}
.chain-diagram>li{margin:0}
.chain-stage{border:1px solid var(--line);border-radius:10px;padding:.95rem 1.05rem;background:#fff}
.chain-stage h3{margin:0;font-size:1.05rem}
.stage-num{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--accent-ink);margin-right:.35rem}
.stage-def{margin:.35rem 0 0}
.stage-docs{margin:.55rem 0 0;font-size:.93rem;display:flex;flex-wrap:wrap;gap:.35rem .6rem;align-items:center}
.chain-arrow{display:block;text-align:center;color:var(--accent-ink);font-size:1.05rem;line-height:1.5}
.layer-strip{margin:1.5rem 0;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}
.layer{padding:.9rem 1.05rem}
.layer+.layer{border-top:2px dashed var(--line)}
.layer h3{margin:0 0 .5rem;font-size:.78rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.layer ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem 1.5rem}
.layer li{display:flex;gap:.5rem;align-items:center;margin:0}
.spec-strip{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88rem;border-bottom:2px solid var(--ink);padding:.4rem 0;margin:0 0 1.1rem}
.spec-strip .here{text-decoration:underline;text-underline-offset:3px}
.get-told{border:1px solid var(--line);border-radius:10px;padding:1.05rem 1.15rem;margin:1.75rem 0;background:#fbfcfe}
.get-told h2{margin-top:0}
.announce-form .field{margin:.75rem 0}
.announce-form label{font-weight:600}
.announce-form .check label{font-weight:400}
.announce-form input[type="email"]{display:block;width:100%;max-width:26rem;margin-top:.35rem;padding:.55rem .65rem;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff;color:var(--ink)}
.announce-form input[type="checkbox"]{width:1.05rem;height:1.05rem;vertical-align:-.15rem;margin-right:.4rem}
.field-error{color:#b3261e;font-size:.92rem;margin:.35rem 0 0}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.button{display:inline-block;background:var(--accent);color:#fff;border:0;border-radius:8px;padding:.55rem 1.15rem;font:inherit;font-weight:600;cursor:pointer}
.button[disabled]{background:var(--muted);cursor:default}
.preview-badge{display:inline-block;background:var(--draft-bg);color:var(--draft);border-radius:6px;padding:.2rem .55rem;font-size:.88rem;font-weight:600}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media print{.announce-form{display:none}}
