/* AEL — ael.openeng.ai
   One hand-written stylesheet. No framework, no build step, no external font,
   no network request of any kind. Palette taken from the AEL logo artwork:
   emerald #10B981, cyan #0891B2, indigo #4338CA, ink #152634. */

/* ---------- tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: #FBFCFC;
  --surface: #F1F5F6;
  --surface-2: #E7EDEF;
  --border: #D7E0E4;
  --border-strong: #B9C7CE;
  --text: #152634;
  --muted: #4B5F6D;
  --link: #0A6C80;
  --accent: #0891B2;
  /* --accent is decoration (3:1 suffices). Eyebrow is normal-size TEXT and needs AA 4.5:1;
     #0E7490 on --bg measures 5.21:1. */
  --accent-text: #0E7490;
  --emerald: #10B981;
  --indigo: #4338CA;
  --yes: #0A6640;
  --no: #8C2F1F;
  --code-comment: #4B5F6D;

  --measure: 68ch;
  --shell: 70rem;
  --gutter: 1rem;
  --radius: 10px;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "DejaVu Sans Mono", "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1620;
    --surface: #13202C;
    --surface-2: #1A2A38;
    --border: #263846;
    --border-strong: #3A4F60;
    --text: #E3ECF1;
    --muted: #9BB0BD;
    --link: #5FD0E8;
    --accent: #22D3EE;
    --accent-text: #22D3EE;
    --emerald: #34D399;
    --indigo: #A5B4FC;
    --yes: #6EE7B7;
    --no: #FCA5A5;
    --code-comment: #9BB0BD;
  }
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

/* ---------- skip link and focus ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--link);
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

main { display: block; }

section { margin-block: 3.5rem; }

section:first-of-type { margin-top: 2.5rem; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand img { width: 30px; height: 29px; }

.brand span { line-height: 1; }

.brand:hover { color: var(--link); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.975rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--text); border-bottom-color: var(--border-strong); }

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- headings ---------- */

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.7vw, 3.25rem); font-weight: 750; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.9rem); font-weight: 700; margin-top: 0; }
h3 { font-size: 1.15rem; font-weight: 680; margin-top: 2rem; }
h4 { font-size: 1rem; font-weight: 650; margin-top: 1.5rem; }

p { margin: 0 0 1.05rem; }

a { color: var(--link); text-underline-offset: 0.18em; }

a:hover { text-decoration-thickness: 2px; }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.85rem;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 1rem + 6vw, 4.5rem) 1rem;
  border-bottom: 1px solid var(--border);
}

.hero-logo {
  width: min(330px, 78vw);
  height: auto;
  margin-bottom: 1.75rem;
  display: block;
}

.hero h1 { max-width: 18ch; }

.hero .lede { max-width: 58ch; margin-top: 1.1rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.975rem;
}

.btn:hover { border-color: var(--accent); color: var(--link); }

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn-primary:hover { background: var(--link); border-color: var(--link); color: #FFFFFF; }

@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--link); border-color: var(--link); color: #06121A; }
  .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #06121A; }
}

/* ---------- the standing status strip ---------- */

.strip {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-block: 1.75rem;
}

.strip p:last-child { margin-bottom: 0; }

.strip strong { font-weight: 700; }

/* ---------- code ---------- */

pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 4;
}

pre:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

code { font-family: var(--mono); font-size: 0.925em; }

p code, li code, td code, th code, dd code, dt code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

pre code { background: none; padding: 0; font-size: inherit; }

.c { color: var(--code-comment); font-style: italic; }

figure { margin: 0 0 2rem; }

figure figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.code-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.io {
  border-left: 3px solid var(--emerald);
}

/* ---------- panels and grids ---------- */

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.3rem;
}

.card h3 { margin-top: 0; }

.card p:last-child, .card ul:last-child { margin-bottom: 0; }

/* ---------- lists ---------- */

ul, ol { padding-left: 1.3rem; margin: 0 0 1.05rem; }

li { margin-bottom: 0.45rem; }

.plain { list-style: none; padding-left: 0; }

.ticks { list-style: none; padding-left: 0; }

.ticks li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.7rem;
}

.ticks li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-weight: 700;
}

.ticks.yes li::before { content: "+"; color: var(--yes); }
.ticks.no li::before { content: "\2212"; color: var(--no); }

dl { margin: 0 0 1.25rem; }

dt {
  font-family: var(--mono);
  font-size: 0.925rem;
  font-weight: 600;
  margin-top: 1.25rem;
  overflow-wrap: anywhere;
}

dd { margin: 0.3rem 0 0; color: var(--muted); }

dd code { color: var(--text); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin-bottom: 1.5rem; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  min-width: 34rem;
}

caption {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  border-bottom: 2px solid var(--border-strong);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody th { font-weight: 600; }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18em 0.55em;
  border-radius: 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.badge-yes { color: var(--yes); }
.badge-no { color: var(--no); }
.badge-plan { color: var(--muted); }

/* ---------- callouts ---------- */

.note {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-block: 1.5rem;
}

.note > :last-child { margin-bottom: 0; }

.note-warn { border-left-color: var(--no); }
.note-ok { border-left-color: var(--emerald); }

.note h3 { margin-top: 0; font-size: 1rem; }

/* ---------- stamp ---------- */

.stamp {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
}

/* A whole sentence must be allowed to wrap; only atomic tokens stay intact,
   otherwise the strip overflows a 360px viewport. */
.stamp span { white-space: normal; }
.stamp code { white-space: nowrap; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2.25rem 2.75rem;
}

.site-footer h2 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
  font-weight: 650;
}

.footer-cols {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: 2rem;
}

.footer-cols ul { list-style: none; padding-left: 0; margin: 0; }

.footer-cols li { margin-bottom: 0.4rem; font-size: 0.95rem; }

.footer-note { font-size: 0.9rem; color: var(--muted); max-width: var(--measure); }

.footer-note a { color: var(--link); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 2.5rem;
}

/* ---------- misc ---------- */

.anchor-list { columns: 2; column-gap: 2rem; }

@media (max-width: 40rem) {
  .anchor-list { columns: 1; }
  table { font-size: 0.9rem; }
}

.muted { color: var(--muted); }

.nowrap { white-space: nowrap; }

abbr[title] { text-decoration: underline dotted; cursor: help; }
