/* AI-Open-Network — site.v2.css
   Versioned filename: bump to site.v2.css on change (served with a 1-year immutable cache). */

/* ---------- Tokens ---------- */
:root {
  --bg: #06080f;
  --bg-2: #0a0e1a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edf5;
  --muted: #9aa4b8;
  --faint: #7d879c;
  --accent: #8b7bff;
  --accent-2: #2dd4ff;
  --accent-3: #34d399;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --ring: 0 0 0 3px rgba(139, 123, 255, 0.45);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Ambient background: soft glows + faint grid, no images */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(139, 123, 255, 0.22), transparent 60%),
    radial-gradient(800px 520px at 95% 8%, rgba(45, 212, 255, 0.14), transparent 60%),
    radial-gradient(700px 600px at 50% 110%, rgba(52, 211, 153, 0.08), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
ul { margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); border-radius: 8px; } /* transparent outline stays visible in forced-colors (Windows high contrast) */
::selection { background: rgba(139, 123, 255, 0.35); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.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-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 15, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.brand small { color: var(--faint); font-weight: 500; font-size: 0.75rem; border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.5rem; }
.nav-menu { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; list-style: none; }
.nav-menu a:not(.btn) {
  display: block; padding: 0.5rem 0.85rem; border-radius: 999px;
  color: var(--muted); font-size: 0.94rem; font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav-menu a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.nav-menu a:not(.btn)[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.7rem 1.25rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #0b0b14; background: var(--grad);
  box-shadow: 0 8px 30px -8px rgba(139, 123, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 12px 38px -8px rgba(45, 212, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 38px; padding: 0.45rem 1rem; font-size: 0.9rem; }

/* ---------- Generic sections ---------- */
section { padding: 5.5rem 0; }
.section-tight { padding: 3.5rem 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-2);
}
.section-head { max-width: 680px; margin-bottom: 2.75rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin: 0.6rem 0 0.9rem; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 0.85rem; color: var(--muted);
}
.pill b { padding: 0.1rem 0.55rem; border-radius: 999px; background: rgba(52, 211, 153, 0.14); color: var(--accent-3); font-weight: 600; font-size: 0.75rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 4rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); font-weight: 800; letter-spacing: -0.035em; margin: 1.25rem 0 1.25rem; }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-points { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 2.25rem; list-style: none; color: var(--muted); font-size: 0.92rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-points .icon { color: var(--accent-3); width: 1.1em; height: 1.1em; }

/* ---------- Agent (chat) ---------- */
.agent {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 24, 40, 0.9), rgba(10, 13, 24, 0.92));
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 120px -40px rgba(139, 123, 255, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  display: flex; flex-direction: column;
  height: 560px; max-height: 78vh; min-height: 440px;
  overflow: hidden;
}
.agent::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(139, 123, 255, 0.7), transparent 35%, transparent 65%, rgba(45, 212, 255, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.agent-head { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.agent-avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #0b0b14;
}
.agent-avatar .icon { width: 20px; height: 20px; stroke-width: 2; }
.agent-title { font-weight: 650; font-size: 0.98rem; line-height: 1.2; }
.agent-status { font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.4rem; }
.agent-status .dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }
.agent[data-state="offline"] .agent-status .dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16); }
.agent-reset {
  margin-left: auto; border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 10px; padding: 0.35rem 0.6rem; font-size: 0.8rem; cursor: pointer;
}
.agent-reset:hover { color: var(--text); background: var(--surface-2); }

.agent-log { flex: 1; overflow-y: auto; padding: 1.15rem; display: flex; flex-direction: column; gap: 0.85rem; scrollbar-width: thin; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 0.7rem 0.95rem; border-radius: 16px; font-size: 0.95rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 6px; }
.msg-user { align-self: flex-end; background: linear-gradient(120deg, rgba(139, 123, 255, 0.95), rgba(99, 102, 241, 0.95)); color: #fff; border-top-right-radius: 6px; }
.msg-note { align-self: center; max-width: 100%; font-size: 0.82rem; color: var(--muted); background: transparent; padding: 0.2rem 0.5rem; text-align: center; }
.msg-error { align-self: flex-start; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.typing { display: inline-flex; gap: 4px; padding: 0.2rem 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.agent-suggest { display: flex; gap: 0.5rem; padding: 0 1.15rem 0.85rem; overflow-x: auto; scrollbar-width: none; }
.agent-suggest::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 0.42rem 0.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: 0.84rem;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.chip:hover { color: var(--text); background: var(--surface-2); border-color: rgba(139, 123, 255, 0.5); }

.agent-form { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.85rem; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.2); }
.agent-input {
  flex: 1; resize: none; min-height: 46px; max-height: 140px;
  padding: 0.7rem 0.9rem; border-radius: 14px;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04);
  font-size: 16px; /* >=16px prevents iOS zoom on focus */ line-height: 1.4;
}
.agent-input::placeholder { color: var(--faint); }
.agent-input:focus { outline: 2px solid transparent; border-color: rgba(139, 123, 255, 0.7); box-shadow: var(--ring); }
.agent-send {
  width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer; flex: none;
  display: grid; place-items: center; background: var(--grad); color: #0b0b14;
}
.agent-send:disabled { opacity: 0.45; cursor: not-allowed; }
.agent-send .icon { width: 20px; height: 20px; stroke-width: 2.2; }
/* Voice (mic button + listening states) */
.agent-mic {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; position: relative;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.agent-mic[hidden] { display: none; }
.agent-mic .icon { width: 20px; height: 20px; stroke-width: 2; }
.agent-mic:hover { color: var(--text); }
.agent-mic:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.agent-mic[aria-pressed="true"] { color: #fff; background: rgba(139, 123, 255, 0.35); border-color: rgba(139, 123, 255, 0.8); }
.agent[data-voice="hearing"] .agent-mic { background: rgba(52, 211, 153, 0.3); border-color: rgba(52, 211, 153, 0.85); }
.agent[data-voice="thinking"] .agent-mic { opacity: 0.7; }
.agent[data-voice="listening"] .agent-mic::after,
.agent[data-voice="hearing"] .agent-mic::after {
  content: ""; position: absolute; inset: -4px; border-radius: 17px; border: 2px solid currentColor; opacity: 0;
  animation: mic-pulse 1.6s ease-out infinite; pointer-events: none;
}
.agent[data-voice="hearing"] .agent-mic::after { border-color: rgba(52, 211, 153, 0.9); animation-duration: 0.9s; }
@keyframes mic-pulse { 0% { transform: scale(0.92); opacity: 0.55; } 100% { transform: scale(1.18); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .agent[data-voice="listening"] .agent-mic::after, .agent[data-voice="hearing"] .agent-mic::after { animation: none; opacity: 0.6; transform: none; }
}
.agent-foot { padding: 0 1rem 0.75rem; font-size: 0.74rem; color: var(--faint); text-align: center; background: rgba(0, 0, 0, 0.2); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card {
  position: relative; padding: 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
a.card:hover, .card.hoverable:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.card h3, .grid .card > h2 { font-size: 1.12rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1.1rem;
  color: var(--accent-2); background: rgba(45, 212, 255, 0.08); border: 1px solid rgba(45, 212, 255, 0.2);
}
.card-icon.violet { color: var(--accent); background: rgba(139, 123, 255, 0.1); border-color: rgba(139, 123, 255, 0.25); }
.card-icon.green { color: var(--accent-3); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.22); }
.card-icon .icon { width: 22px; height: 22px; }
.cat-card { text-align: left; }
.cat-card .arrow { position: absolute; top: 1.5rem; right: 1.4rem; color: var(--faint); transition: transform 0.25s var(--ease), color 0.25s; }
.cat-card:hover .arrow { transform: translateX(3px); color: var(--text); }

.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted);
}
.tag-planned { color: #fcd34d; border-color: rgba(252, 211, 77, 0.3); background: rgba(252, 211, 77, 0.06); }
.tag-live { color: var(--accent-3); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.06); }

/* Steps */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; }
.steps .card::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 0.85rem; color: var(--accent); margin-bottom: 0.9rem;
}

/* CTA band */
.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(600px 260px at 20% 0%, rgba(139, 123, 255, 0.35), transparent 70%),
    radial-gradient(600px 260px at 80% 100%, rgba(45, 212, 255, 0.25), transparent 70%),
    var(--bg-2);
}
.cta h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 0.9rem; }
.cta p { color: var(--muted); max-width: 560px; margin: 0 auto 1.75rem; }
.cta .hero-actions { justify-content: center; margin-top: 0; }

/* ---------- Page header (sub-pages) ---------- */
.page-hero { padding: 4.5rem 0 2.5rem; }
.page-hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.5rem); font-weight: 800; letter-spacing: -0.03em; margin: 0.9rem 0 1rem; }
.page-hero p { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 0; }

/* ---------- Marketplace ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  font-size: 0.9rem; font-weight: 500; transition: all 0.2s;
}
.filter:hover { color: var(--text); background: var(--surface-2); }
.filter[aria-pressed="true"] { color: #0b0b14; background: var(--text); border-color: var(--text); }
.filter .icon { width: 1.05em; height: 1.05em; }
.listing { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.listing[hidden] { display: none; }
.listing-top {
  height: 128px; display: grid; place-items: center; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(220px 120px at 30% 20%, rgba(139, 123, 255, 0.25), transparent 70%),
    radial-gradient(220px 120px at 80% 90%, rgba(45, 212, 255, 0.18), transparent 70%),
    rgba(255, 255, 255, 0.02);
}
.listing-top .icon { width: 42px; height: 42px; stroke-width: 1.4; color: var(--text); opacity: 0.9; }
.listing-body { padding: 1.35rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.listing h2, .listing h3 { font-size: 1.15rem; margin-bottom: 0.45rem; }
.listing p { flex: 1; }
.listing-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: #0b0b14; background: var(--grad); }
.empty { color: var(--muted); padding: 2rem 0; }
.notice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 1rem 1.15rem; border-radius: var(--radius-sm); margin-bottom: 2rem;
  border: 1px solid rgba(252, 211, 77, 0.25); background: rgba(252, 211, 77, 0.05); color: #f5e3a3; font-size: 0.93rem;
}
.notice .icon { color: #fcd34d; margin-top: 0.15rem; }
.notice p { margin: 0; }

/* ---------- Docs / prose ---------- */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3rem; align-items: start; }
.toc { position: sticky; top: 96px; list-style: none; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 0.35rem 0 0.35rem 1rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); font-size: 0.92rem; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.prose { max-width: 760px; }
.prose section { padding: 0 0 3rem; }
.prose h2 { font-size: 1.65rem; margin-bottom: 1rem; }
.prose h3 { font-size: 1.12rem; margin: 1.6rem 0 0.6rem; }
.prose p, .prose li { color: #c7cedb; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a:not(.btn) { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(45, 212, 255, 0.35); text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-color: var(--accent-2); }
.prose code { font-family: var(--mono); font-size: 0.88em; padding: 0.12rem 0.4rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
details.faq { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 0.75rem; }
details.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.15rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.25rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding: 0 1.15rem 1rem; }
details.faq > div p:last-child { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 3.5rem 0 2rem; background: rgba(0, 0, 0, 0.25); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-grid p { color: var(--muted); font-size: 0.93rem; max-width: 320px; margin-top: 1rem; }
.footer-grid h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 0.9rem; font-weight: 600; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-grid li a { color: var(--muted); font-size: 0.93rem; }
.footer-grid li a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.85rem; }

/* ---------- 404 ---------- */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-family: var(--mono); font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; line-height: 1; }

/* ---------- Reveal on scroll (JS adds .js to <html>) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .agent { height: 520px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  /* Without JS the menu simply wraps; with JS it becomes a disclosure panel. */
  .nav { flex-wrap: wrap; height: auto; min-height: 68px; }
  .js .nav { flex-wrap: nowrap; height: 68px; }
  .js .nav-toggle { display: inline-flex; }
  .js .nav-menu {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    padding: 0.75rem 1.25rem 1.25rem; margin: 0;
    background: rgba(6, 8, 15, 0.97); border-bottom: 1px solid var(--border);
    display: none;
  }
  .js .nav-open .nav-menu { display: flex; }
  .js .nav-menu a:not(.btn) { padding: 0.85rem 1rem; font-size: 1.02rem; border-radius: 12px; }
  .js .nav-menu .btn { margin-top: 0.5rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 0.25rem; border-left: 0; }
  .toc a { padding: 0.35rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; margin: 0; }
}
@media (max-width: 600px) {
  section { padding: 4rem 0; }
  .hero { padding: 2.5rem 0 3rem; }
  .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .agent { height: min(72vh, 72dvh, 600px); min-height: 440px; border-radius: 20px; }
  .msg { max-width: 92%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  body::before, body::after, .site-header, .agent, .site-footer { display: none; }
  body { background: #fff; color: #000; }
}

/* 404 extras */
.notfound .hero-actions { justify-content: center; }
.notfound .lead { color: var(--muted); font-size: 1.1rem; margin: 1rem auto 2rem; }
.notfound h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }

/* AION brand lockup (mark + two-line name) */
.brand { gap: 0.7rem; }
.brand-mark { width: 36px; height: 36px; filter: drop-shadow(0 4px 14px rgba(139, 123, 255, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 1.12rem; font-weight: 800; letter-spacing: 0.2em; }
.brand-text span { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }
.footer-grid .brand-mark { width: 40px; height: 40px; }

/* BEGIN generated: aion logo animation (tools/gen_logo_anim.py) */
/* Animated AION logo (header). One timeline, each step after the previous one:
   trace A -> trace I -> I's dot lights up -> trace O -> N lights up ->
   A, I, O, N glow one by one -> constellation stays (small dim white dots, larger bright white dot on the I).
   Plays on page load and again on hover. Reduced motion: no movement, constellation shown.
   Generated: edit the timeline in tools/gen_logo_anim.py rather than by hand. */
.aion-anim .aion-idot, .aion-anim .aion-flash { transform-box: fill-box; transform-origin: center; }
.aion-anim .aion-trace-a { animation: aion-trace-a 8.8s 0.4s linear both; }
.brand:hover .aion-trace-a { animation-name: aion-trace-a-r; animation-delay: 0s; }
.aion-anim .aion-trace-i { animation: aion-trace-i 8.8s 0.4s linear both; }
.brand:hover .aion-trace-i { animation-name: aion-trace-i-r; animation-delay: 0s; }
.aion-anim .aion-idot { animation: aion-idot 8.8s 0.4s linear both; }
.brand:hover .aion-idot { animation-name: aion-idot-r; animation-delay: 0s; }
.aion-anim .aion-flash { animation: aion-flash 8.8s 0.4s linear both; }
.brand:hover .aion-flash { animation-name: aion-flash-r; animation-delay: 0s; }
.aion-anim .aion-trace-o { animation: aion-trace-o 8.8s 0.4s linear both; }
.brand:hover .aion-trace-o { animation-name: aion-trace-o-r; animation-delay: 0s; }
.aion-anim .aion-glow-n { animation: aion-glow-n 8.8s 0.4s linear both; }
.brand:hover .aion-glow-n { animation-name: aion-glow-n-r; animation-delay: 0s; }
.aion-anim .aion-glow-a { animation: aion-glow-a 8.8s 0.4s linear both; }
.brand:hover .aion-glow-a { animation-name: aion-glow-a-r; animation-delay: 0s; }
.aion-anim .aion-glow-i { animation: aion-glow-i 8.8s 0.4s linear both; }
.brand:hover .aion-glow-i { animation-name: aion-glow-i-r; animation-delay: 0s; }
.aion-anim .aion-glow-o { animation: aion-glow-o 8.8s 0.4s linear both; }
.brand:hover .aion-glow-o { animation-name: aion-glow-o-r; animation-delay: 0s; }
.aion-anim .aion-stars { animation: aion-stars 8.8s 0.4s linear both; }
.brand:hover .aion-stars { animation-name: aion-stars-r; animation-delay: 0s; }
/* Each keyframe set exists twice: switching animation-name on hover restarts the timeline. */
@keyframes aion-trace-a { 0.00% { stroke-dashoffset: 30; } 13.64% { stroke-dashoffset: -150.43; } 100% { stroke-dashoffset: -150.43; } }
@keyframes aion-trace-a-r { 0.00% { stroke-dashoffset: 30; } 13.64% { stroke-dashoffset: -150.43; } 100% { stroke-dashoffset: -150.43; } }
@keyframes aion-trace-i { 0.00% { stroke-dashoffset: 30; } 13.64% { stroke-dashoffset: 30; } 22.73% { stroke-dashoffset: -70.44; } 100% { stroke-dashoffset: -70.44; } }
@keyframes aion-trace-i-r { 0.00% { stroke-dashoffset: 30; } 13.64% { stroke-dashoffset: 30; } 22.73% { stroke-dashoffset: -70.44; } 100% { stroke-dashoffset: -70.44; } }
@keyframes aion-idot { 0.00% { transform: scale(1); } 22.73% { transform: scale(1); } 25.57% { transform: scale(1.5); } 29.55% { transform: scale(1); } 100% { transform: scale(1); } }
@keyframes aion-idot-r { 0.00% { transform: scale(1); } 22.73% { transform: scale(1); } 25.57% { transform: scale(1.5); } 29.55% { transform: scale(1); } 100% { transform: scale(1); } }
@keyframes aion-flash { 0.00% { opacity: 0; } 22.73% { opacity: 0; } 25.57% { opacity: 1; } 30.68% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-flash-r { 0.00% { opacity: 0; } 22.73% { opacity: 0; } 25.57% { opacity: 1; } 30.68% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-trace-o { 0.00% { stroke-dashoffset: 30; } 29.55% { stroke-dashoffset: 30; } 43.18% { stroke-dashoffset: -259.33000000000004; } 100% { stroke-dashoffset: -259.33000000000004; } }
@keyframes aion-trace-o-r { 0.00% { stroke-dashoffset: 30; } 29.55% { stroke-dashoffset: 30; } 43.18% { stroke-dashoffset: -259.33000000000004; } 100% { stroke-dashoffset: -259.33000000000004; } }
@keyframes aion-glow-n { 0.00% { opacity: 0; } 44.32% { opacity: 0; } 47.16% { opacity: 1; } 50.57% { opacity: 1; } 55.11% { opacity: 0; } 79.55% { opacity: 0; } 82.39% { opacity: 1; } 85.80% { opacity: 1; } 90.34% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-n-r { 0.00% { opacity: 0; } 44.32% { opacity: 0; } 47.16% { opacity: 1; } 50.57% { opacity: 1; } 55.11% { opacity: 0; } 79.55% { opacity: 0; } 82.39% { opacity: 1; } 85.80% { opacity: 1; } 90.34% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-a { 0.00% { opacity: 0; } 55.68% { opacity: 0; } 58.52% { opacity: 1; } 61.93% { opacity: 1; } 66.48% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-a-r { 0.00% { opacity: 0; } 55.68% { opacity: 0; } 58.52% { opacity: 1; } 61.93% { opacity: 1; } 66.48% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-i { 0.00% { opacity: 0; } 63.64% { opacity: 0; } 66.48% { opacity: 1; } 69.89% { opacity: 1; } 74.43% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-i-r { 0.00% { opacity: 0; } 63.64% { opacity: 0; } 66.48% { opacity: 1; } 69.89% { opacity: 1; } 74.43% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-o { 0.00% { opacity: 0; } 71.59% { opacity: 0; } 74.43% { opacity: 1; } 77.84% { opacity: 1; } 82.39% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-glow-o-r { 0.00% { opacity: 0; } 71.59% { opacity: 0; } 74.43% { opacity: 1; } 77.84% { opacity: 1; } 82.39% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aion-stars { 0.00% { opacity: 0; } 90.34% { opacity: 0; } 98.86% { opacity: 1; } 100% { opacity: 1; } }
@keyframes aion-stars-r { 0.00% { opacity: 0; } 90.34% { opacity: 0; } 98.86% { opacity: 1; } 100% { opacity: 1; } }
/* Pulsar: after the constellation appears, the I's star beats (quick flash, slow decay)
   and sends out a faint expanding ring every 3.2s. Small dots stay still. */
.aion-anim .aion-beat, .aion-anim .aion-wave { transform-box: fill-box; transform-origin: center; }
.aion-anim .aion-beat { animation: aion-beat 3.2s 9.4s ease-out infinite; }
.aion-anim .aion-wave { opacity: 0; animation: aion-wave 3.2s 9.4s ease-out infinite; }
@keyframes aion-beat { 0% { opacity: 0.85; transform: scale(1); } 6% { opacity: 1; transform: scale(1.3); } 40%, 100% { opacity: 0.85; transform: scale(1); } }
@keyframes aion-wave { 0% { opacity: 0; transform: scale(1); } 6% { opacity: 0.6; transform: scale(1.1); } 65%, 100% { opacity: 0; transform: scale(2.5); } }
@media (prefers-reduced-motion: reduce) {
  .aion-anim .aion-fx { display: none; }
  .aion-anim .aion-idot { animation: none; }
  .aion-anim .aion-stars { animation: none; opacity: 1; }
  .aion-anim .aion-beat, .aion-anim .aion-wave { animation: none; }
}
/* END generated: aion logo animation */

/* Language switcher (EN / FR …) in the main menu */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin: 0 0.25rem; border: 1px solid var(--border); border-radius: 999px; }
.nav-menu .lang-switch a:not(.btn) { padding: 0.25rem 0.6rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; border-radius: 999px; }
.nav-menu .lang-switch a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
@media (max-width: 860px) {
  .js .nav-menu .lang-item { align-self: flex-start; }
  .js .nav-menu .lang-switch { margin: 0.5rem 0 0 0.6rem; }
  .js .nav-menu .lang-switch a:not(.btn) { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
}

/* Chat sign-in panel (Cloudflare Access) */
.agent-gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.6rem; padding: 1.5rem; }
.agent-gate[hidden], .agent-log[hidden], .agent-form[hidden], .agent-account[hidden] { display: none; }
.agent-gate-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: rgba(139, 123, 255, 0.1); border: 1px solid rgba(139, 123, 255, 0.25); }
.agent-gate-icon .icon { width: 24px; height: 24px; }
.agent-gate h2, .agent-gate h3 { font-size: 1.1rem; }
.agent-gate p { color: var(--muted); font-size: 0.92rem; max-width: 34ch; margin: 0; }
.agent-gate .btn { margin-top: 0.4rem; }
.agent-gate-msg:empty { display: none; }
.agent-gate-msg { color: #fcd34d !important; }
.agent-gate-note { font-size: 0.78rem !important; color: var(--faint) !important; }
.agent[data-state="locked"] .agent-status .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.18); }
.agent-account { padding: 0.35rem 1rem 0; margin: 0; font-size: 0.78rem; color: var(--faint); text-align: center; background: rgba(0, 0, 0, 0.2); }
.agent-account a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.agent-account span { color: var(--muted); }
