/* OpenHands Explained — static stylesheet, no external dependencies */

:root {
  --bg:        #0a0b12;
  --bg-alt:    #0d0f18;
  --surface:   rgba(255,255,255,.035);
  --surface-2: rgba(255,255,255,.055);
  --border:    rgba(255,255,255,.09);
  --border-2:  rgba(255,255,255,.16);
  --text:      #e8eaf2;
  --text-dim:  #a2a8bd;
  --text-mute: #767d94;
  --violet:    #7c5cff;
  --blue:      #3ba9ff;
  --cyan:      #38e0c8;
  --amber:     #ffb547;
  --radius:    16px;
  --radius-sm: 11px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 18px 50px -22px rgba(0,0,0,.85);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: .87em;
  background: rgba(124,92,255,.14);
  border: 1px solid rgba(124,92,255,.22);
  color: #cfc4ff;
  padding: .12em .42em;
  border-radius: 6px;
  white-space: nowrap;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .6em; font-weight: 680; }

h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: .5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--violet); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

.wrap { width: min(1160px, 92vw); margin-inline: auto; }

.dim { color: var(--text-dim); }
.small { font-size: .86rem; }
.sub { margin-top: 2.2rem; }

/* ── Nav ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,11,18,.72);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(10,11,18,.92); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 680; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand em { color: var(--text-mute); font-style: normal; font-weight: 500; }

.brand-mark {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 0 18px -2px rgba(124,92,255,.7);
}

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  color: var(--text-dim); font-size: .9rem; font-weight: 520;
  padding: .45rem .7rem; border-radius: 8px; transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-cta { color: var(--text) !important; border: 1px solid var(--border-2); }
.nav-cta:hover { border-color: var(--violet); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 42px; height: 38px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.nav-toggle span:not(.sr-only) { display: block; height: 2px; background: var(--text-dim); border-radius: 2px; }

/* ── Hero ──────────────────────────────────────────── */
.hero { position: relative; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); overflow: hidden; }
.hero-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 620px; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(124,92,255,.32), transparent 70%) 18% 30%/620px 620px no-repeat,
    radial-gradient(closest-side, rgba(59,169,255,.24), transparent 70%) 78% 10%/560px 560px no-repeat,
    radial-gradient(closest-side, rgba(56,224,200,.14), transparent 70%) 50% 70%/520px 520px no-repeat;
  filter: blur(10px);
}
.hero-inner { position: relative; }

.badge {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .82rem; font-weight: 560; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: .38rem .85rem; border-radius: 999px; margin-bottom: 1.6rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px 2px rgba(56,224,200,.8); }

h1 { font-size: clamp(2.4rem, 6.6vw, 4.35rem); margin-bottom: 1.2rem; letter-spacing: -.035em; }
.gradient {
  background: linear-gradient(100deg, var(--violet) 0%, var(--blue) 48%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede { font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--text-dim); max-width: 64ch; }
.lede strong { color: var(--text); font-weight: 620; }

.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.9rem 0 2.4rem; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .68rem 1.25rem; border-radius: 11px; font-size: .94rem; font-weight: 600;
  border: 1px solid var(--border-2); color: var(--text); background: var(--surface);
  transition: transform .16s, border-color .18s, background .18s, box-shadow .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--border-2); background: var(--surface-2); }
.btn.primary {
  background: linear-gradient(135deg, var(--violet), var(--blue));
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 32px -14px rgba(124,92,255,.95);
}
.btn.primary:hover { box-shadow: 0 16px 38px -12px rgba(124,92,255,1); }
.btn.ghost { background: transparent; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.chips li {
  font-size: .8rem; color: var(--text-mute); font-weight: 540;
  border: 1px solid var(--border); border-radius: 999px; padding: .3rem .75rem;
}

/* ── Sections ──────────────────────────────────────── */
.section { padding: clamp(3.4rem, 7vw, 5.6rem) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.eyebrow {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--violet); margin-bottom: .7rem; font-weight: 600;
}
.section-lede { font-size: 1.05rem; color: var(--text-dim); max-width: 74ch; margin-bottom: 2.4rem; }
.section-lede em { color: var(--text); font-style: italic; }

/* ── Grids ─────────────────────────────────────────── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.tight { gap: .8rem; }
.grid-3 + .callout, .grid + .sub { margin-top: 2.4rem; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.45rem; transition: border-color .2s, background .2s, transform .2s;
}
.card:hover { border-color: var(--border-2); background: var(--surface-2); }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--text-dim); font-size: .94rem; margin-bottom: 0; }
.card-icon { font-size: 1.5rem; margin-bottom: .7rem; line-height: 1; }

.card.feature header { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .7rem; }
.card.feature h3 { margin: 0; }
.card.feature .meta { margin-top: .9rem; font-size: .84rem; color: var(--text-mute); font-style: italic; }
.card.muted { opacity: .82; }

.pill {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .22rem .55rem; border-radius: 6px; color: #d9d2ff; flex: none;
  background: rgba(124,92,255,.18); border: 1px solid rgba(124,92,255,.32);
}
.pill.ghost { background: transparent; color: var(--text-mute); border-color: var(--border); }

.tagline { margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tagline code { font-size: .74rem; }

.callout {
  margin: 2.4rem 0 0; padding: 1.5rem 1.7rem; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124,92,255,.14), rgba(59,169,255,.09));
  border: 1px solid rgba(124,92,255,.28);
}
.callout h3 { color: #cfc4ff; font-size: .88rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.callout p { margin: 0; font-size: 1.08rem; color: var(--text); max-width: 72ch; }

.mini {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem;
}
.mini strong { font-size: .92rem; }
.mini span { font-size: .85rem; color: var(--text-dim); line-height: 1.5; }

/* ── Diagram ───────────────────────────────────────── */
.diagram-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1.4rem; overflow-x: auto;
}
.diagram { display: block; width: 100%; min-width: 660px; height: auto; }
.dbox { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.14); stroke-width: 1.4; }
.dbox.accent { fill: rgba(124,92,255,.10); stroke: rgba(124,92,255,.42); }
.dinner { fill: rgba(255,255,255,.05); stroke: rgba(255,255,255,.10); }
.dtitle { fill: #e8eaf2; font-family: var(--sans); font-size: 16px; font-weight: 650; }
.dsub { fill: #9aa1b8; font-family: var(--sans); font-size: 12.5px; }
.dlabel { fill: #767d94; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; }
.dlink { stroke: #6b7a99; stroke-width: 1.6; fill: none; }
.dlink.dashed { stroke-dasharray: 4 4; }

/* ── Tools ─────────────────────────────────────────── */
.tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.1rem 1.15rem;
}
.tool-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; font-size: .9rem; margin-bottom: .6rem;
  background: rgba(59,169,255,.14); color: var(--blue); border: 1px solid rgba(59,169,255,.26);
}
.tool h4 { margin-bottom: .3rem; font-size: .95rem; }
.tool p { margin: 0; font-size: .86rem; color: var(--text-dim); line-height: 1.55; }

/* ── Split / lists ─────────────────────────────────── */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.4rem; margin-top: 2.6rem; }
.stack > :last-child { margin-bottom: 0; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: s; position: relative; padding-left: 2.6rem; margin-bottom: 1rem;
  font-size: .93rem; color: var(--text-dim);
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: .05rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .78rem; font-weight: 700; color: #cfc4ff;
  background: rgba(124,92,255,.16); border: 1px solid rgba(124,92,255,.34);
}
.steps strong, .ticks strong { color: var(--text); font-weight: 620; }

.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li {
  position: relative; padding-left: 1.6rem; margin-bottom: .8rem;
  font-size: .93rem; color: var(--text-dim);
}
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .55rem;
  width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}

/* ── Code ──────────────────────────────────────────── */
.code-block {
  background: #070810; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem .75rem .45rem 1rem; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: .74rem; color: var(--text-mute);
  background: rgba(255,255,255,.025);
}
.code-block pre { margin: 0; padding: 1rem 1.15rem; overflow-x: auto; }
.code-block code {
  background: none; border: 0; padding: 0; color: #cdd3e6;
  font-size: .82rem; line-height: 1.7; white-space: pre; display: block;
}
.copy {
  font: inherit; font-family: var(--sans); font-size: .74rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
  padding: .2rem .6rem; border-radius: 6px; cursor: pointer; transition: color .18s, border-color .18s;
}
.copy:hover { color: var(--text); border-color: var(--border-2); }
.copy.ok { color: var(--cyan); border-color: rgba(56,224,200,.5); }

.note {
  margin-top: 2.2rem; padding: 1rem 1.2rem; font-size: .92rem; color: var(--text-dim);
  border-left: 3px solid var(--violet); background: rgba(124,92,255,.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note code { white-space: normal; }

/* ── Use cases ─────────────────────────────────────── */
.use {
  border-left: 2px solid rgba(124,92,255,.4); padding: .2rem 0 .2rem 1.1rem;
}
.use h4 { margin-bottom: .25rem; }
.use p { margin: 0; font-size: .88rem; color: var(--text-dim); }

/* ── Link cards ────────────────────────────────────── */
.link-card {
  display: flex; flex-direction: column; gap: .25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; color: var(--text);
  transition: border-color .18s, transform .18s, background .18s;
}
.link-card:hover { text-decoration: none; border-color: rgba(124,92,255,.55); transform: translateY(-2px); background: var(--surface-2); }
.link-card strong { font-size: .95rem; }
.link-card span { font-size: .83rem; color: var(--text-mute); }

/* ── Footer ────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 2.6rem 0 2rem; }
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.footer-brand { font-weight: 680; font-size: 1.05rem; margin-bottom: .5rem; }
.footer-brand span { color: var(--text-mute); font-weight: 500; }
.footer-head { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--violet); font-weight: 650; margin-bottom: .5rem; }
.footer a { color: var(--text-dim); text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); }
.footer a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
}
.totop {
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--text-dim); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .45rem .9rem;
  transition: color .18s, border-color .18s;
}
.totop:hover { color: var(--text); border-color: var(--border-2); }

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .2rem;
    background: rgba(10,11,18,.98); border-bottom: 1px solid var(--border);
    padding: .8rem 4vw 1.1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .7rem .8rem; font-size: .95rem; }
  .split { gap: 2rem; }
  .diagram { min-width: 600px; }
}

/* ── 404 page ──────────────────────────────────────── */
.error-page { min-height: 72vh; display: grid; place-items: center; text-align: center; }
.error-title { font-size: clamp(1.8rem, 4.4vw, 2.6rem); }
.error-lede { margin-inline: auto; max-width: 52ch; }
.error-cta { justify-content: center; margin-bottom: 0; }

/* ── Reveal on scroll (only when JS is active) ─────── */
body.js .reveal { opacity: 0; transform: translateY(14px); }
body.js .reveal.visible { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
