/* bootload one-pager — styles.css
   Token source of truth. Mirrors DESIGN.md. */

:root {
  /* color — dark scheme, matched to bootload.io/docs */
  --paper: #0a0e1a;     /* page background (--bg) */
  --surface: #111a2e;   /* cards / raised panels (--raised) */
  --panel: #0c1322;     /* terminal / code body (--inset) */
  --panel-2: #131d33;   /* terminal chrome bar */
  --ink: #e9eef8;       /* primary text */
  --ink-2: #ffffff;     /* brightest headings */
  --muted: #93a1bf;     /* secondary text (--muted) */
  --line: #283355;      /* borders / dividers (--border) */
  --accent: #4deeea;    /* primary CTA — brand cyan (--brand) */
  --accent-ink: #06222b;/* text on accent (--on-brand) */
  --sea: #7eaaff;       /* links / secondary accent (--wave-ink) */
  --sea-soft: #13233f;  /* tinted dark fills */
  --good: #2dd4bf;      /* success teal (--ok-ink) */

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* space (4px base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 40px; --s7: 64px; --s8: 96px;

  /* shape */
  --r-sm: 8px; --r: 14px; --r-lg: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);

  --maxw: 72rem;
  color-scheme: dark;
}

/* ---------- day mode (opt-in; night is the default) ---------- */
html[data-theme="light"] {
  --paper: #eef3fb;     /* light page (bootload light --bg family) */
  --surface: #ffffff;   /* cards */
  --ink: #14203c;       /* dark text */
  --ink-2: #0a1228;     /* darkest headings */
  --muted: #4d5b7c;     /* secondary text */
  --line: #d3deef;      /* borders */
  --sea-soft: #e6f0fb;  /* tinted fills */
  --sea: #1d4ed8;       /* links — deeper blue for contrast on light */
  --good: #0c7d5f;      /* success — deeper teal on light */
  --shadow: 0 1px 2px rgba(20, 32, 60, .06), 0 16px 40px rgba(20, 32, 60, .12);
  color-scheme: light;
  /* terminals (--panel/--panel-2) and brand cyan (--accent) stay as-is in both modes */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 var(--s4); }
.eyebrow { font: 600 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sea); margin: 0 0 var(--s3); }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: var(--s4); height: 64px; }
.brand { display: flex; align-items: center; gap: var(--s3); font-weight: 700; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.head-spacer { flex: 1; }
.head-links { display: flex; align-items: center; gap: var(--s5); }
.head-links a { color: var(--muted); font-size: .95rem; }
.head-links a:hover { color: var(--accent); }
@media (max-width: 720px) { .head-links .hide-sm { display: none; } }
.theme-toggle { appearance: none; -webkit-appearance: none; background: transparent; border: 1px solid var(--line); color: var(--ink); width: 36px; height: 36px; flex: none; border-radius: 999px; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }


/* ---------- tabs ---------- */
.tabs { display: flex; justify-content: center; padding-top: var(--s7); }
.tablist { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: 600 .98rem/1 var(--sans); color: var(--muted);
  padding: 10px 20px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s, background .15s;
}
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tab:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.tab .ico { font-size: 1.05em; }

.panel { display: none; }
.panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel.is-active { animation: none; } }

/* ---------- hero ---------- */
.hero { padding: var(--s7) 0 var(--s6); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: 16ch; }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 46ch; margin: 0 0 var(--s6); }
.hero .lede strong { color: var(--ink); font-weight: 600; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s7); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--s6); } }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 1rem/1 var(--sans); padding: 14px 22px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn:active { transform: translateY(0); }

/* consistent keyboard focus across every interactive element */
.btn:focus-visible,
.term-bar .copy:focus-visible,
a:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- terminal ---------- */
.term { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px var(--s4); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #2f4a57; }
.term-bar .dot.r { background: #ff6b6b; } .term-bar .dot.y { background: #ffc857; } .term-bar .dot.g { background: #2dd4bf; }
.term-bar .title { margin-left: 8px; color: #8aa0aa; font: 500 .8rem/1 var(--mono); }
.term-bar .copy { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.16); color: #cfdde2; font: 500 .76rem/1 var(--sans); padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.term-bar .copy:hover { border-color: var(--sea); color: #fff; }
.term-body { margin: 0; padding: var(--s4) var(--s5); font: .9rem/1.7 var(--mono); color: #d7e3e8; overflow-x: auto; }
.term-body .p { color: var(--sea); user-select: none; }   /* prompt $ */
.term-body .c { color: #eef4f4; }                          /* command */
.term-body .o { color: #8aa0aa; }                          /* output */
.term-body .ok { color: var(--good); }
.term-body .u { color: var(--accent); }                    /* url / highlight */

/* ---------- sections ---------- */
section.block { padding: var(--s7) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 52ch; margin-bottom: var(--s6); }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.section-head p { color: var(--muted); margin: 0; }

/* manifest list */
.manifest { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.manifest .row { display: grid; grid-template-columns: 200px 1fr; gap: var(--s4); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.manifest .row:last-child { border-bottom: 0; }
.manifest .k { font: 600 .9rem/1.5 var(--mono); color: var(--sea); }
.manifest .v { color: var(--ink); margin: 0; }
.manifest .v small { color: var(--muted); }
@media (max-width: 620px) { .manifest .row { grid-template-columns: 1fr; gap: 4px; } }

/* feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); }
.card h3 { font-size: 1.1rem; margin-bottom: var(--s2); }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }
.card .ic { font-size: 1.5rem; display: block; margin-bottom: var(--s3); }

/* steps */
.steps { display: grid; gap: var(--s4); counter-reset: step; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: var(--s4); align-items: start; }
.step .n { counter-increment: step; width: 32px; height: 32px; border-radius: 50%; background: var(--sea-soft); color: var(--sea); display: grid; place-items: center; font: 700 .95rem/1 var(--mono); }
.step .n::before { content: counter(step); }
.step h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); }

/* agent-specific code block (file) */
.filebox { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.filebox .name { padding: 10px var(--s4); border-bottom: 1px solid var(--line); font: 600 .82rem/1 var(--mono); color: var(--muted); background: var(--paper); display: flex; align-items: center; gap: 8px; }
.filebox pre { margin: 0; padding: var(--s4) var(--s5); font: .82rem/1.65 var(--mono); color: var(--ink); overflow-x: auto; }
.filebox pre .cm { color: var(--muted); }
.filebox pre .kw { color: var(--accent); }
.filebox pre .st { color: var(--sea); }

.callout { border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; padding: var(--s4) var(--s5); margin: var(--s5) 0; }
.callout strong { color: var(--ink); }

/* compatible-agents chip list */
.agents-list { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.agents-list li { background: var(--sea-soft); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 500; }
.agents-list li:last-child { background: transparent; color: var(--muted); border-style: dashed; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- big CTA band → bootload.io ---------- */
.cta-band { border-top: 1px solid var(--line); text-align: center; margin-top: var(--s7);
  padding: clamp(64px, 10vw, 120px) 0;
  background: radial-gradient(900px 360px at 50% 118%, rgba(77, 238, 234, .10), transparent 70%); }
.cta-band .eyebrow { color: var(--accent); }
.cta-band h2 { font-size: clamp(2rem, 5.5vw, 3.4rem); margin: 0 auto var(--s4); max-width: 18ch; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto var(--s6); font-size: 1.05rem; }
.btn-xl { font-size: 1.2rem; padding: 18px 38px; box-shadow: 0 0 0 1px rgba(77, 238, 234, .35), 0 16px 50px rgba(77, 238, 234, .28); }
.btn-xl:hover { transform: translateY(-2px); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: var(--s7) 0 var(--s6); margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6) var(--s5); align-items: start; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
footer h4 { font: 600 .78rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a { color: var(--ink); font-size: .95rem; }
footer a:hover { color: var(--accent); }
.foot-note { color: var(--muted); font-size: .9rem; margin-top: var(--s5); }
.lang-bar { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.lang-bar a { color: var(--muted); font-size: .9rem; }
.lang-bar a:hover { color: var(--accent); }
.lang-bar a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.foot-meta { margin-top: var(--s5); display: grid; gap: var(--s3); max-width: 78ch; }
.foot-meta p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.foot-meta strong { color: var(--ink); font-weight: 600; }
.foot-meta .pill { display: inline-block; background: var(--sea-soft); color: var(--good); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .8rem; margin-right: 6px; white-space: nowrap; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font: 600 .9rem/1 var(--sans); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* touch ergonomics: comfortable tap targets on coarse pointers */
@media (pointer: coarse) {
  .tab { padding-top: 13px; padding-bottom: 13px; }
  .term-bar .copy { padding: 11px 14px; }
  .head-links a { padding: 6px 2px; }
}

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] .term-body,
[dir="rtl"] .filebox pre { direction: ltr; text-align: left; }   /* code stays left-to-right */
[dir="rtl"] code { direction: ltr; unicode-bidi: embed; }
[dir="rtl"] .callout { border-left: 0; border-right: 3px solid var(--accent); border-radius: var(--r) 0 0 var(--r); }
[dir="rtl"] .foot-meta .pill { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .term-bar .title { direction: rtl; }
