/* ============================================================
   Agent Skills — Showcase Stylesheet
   Brand: #060610 | #00E5FF | #50AAE3 | #7C3AED
   Fonts: Sora | Space Grotesk | JetBrains Mono
   ============================================================ */

@layer reset, base, components, utilities;

/* Font display override for Google Fonts */
@font-face { font-family: 'Sora'; font-display: optional; }
@font-face { font-family: 'Space Grotesk'; font-display: optional; }
@font-face { font-family: 'JetBrains Mono'; font-display: optional; }

/* --- Reset --- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body { min-height: 100dvh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  img, svg { display: block; max-width: 100%; }
  a { text-decoration: none; color: inherit; }
  button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
  ul, ol { list-style: none; }
}

/* --- Base --- */
@layer base {
  :root {
    color-scheme: dark;
    --bg: #060610;
    --bg-raised: #0c0c1d;
    --bg-card: #111128;
    --bg-card-hover: #161640;
    --cyan: #00E5FF;
    --blue: #50AAE3;
    --purple: #7C3AED;
    --purple-light: #a78bfa; /* readable purple for TEXT on dark bg — --purple #7C3AED is only 2.9:1 (WCAG AA fail) */
    --text: #e4e4f0;
    --text-dim: #9e9ebe;
    --text-bright: #ffffff;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(0, 229, 255, 0.15);
    --glow-cyan: rgba(0, 229, 255, 0.12);
    --glow-purple: rgba(124, 58, 237, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --font-heading: 'Sora', system-ui, sans-serif;
    --font-body: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --container: 1200px;
  }

  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
  }

  /* Dot grid background */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle, rgba(158, 158, 190, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
  }

  /* Noise grain texture */
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
  }

  h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-bright); line-height: 1.15; text-wrap: balance; }
  code, pre { font-family: var(--font-mono); }
  ::selection { background: rgba(0, 229, 255, 0.25); color: #fff; }
}

/* --- Utilities --- */
@layer utilities {
  .skip-nav {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1.5rem;
    background: var(--cyan);
    color: var(--bg);
    font-weight: 700;
    border-radius: var(--radius);
    &:focus { top: 1rem; }
  }
  .container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
  .text-cyan { color: var(--cyan); }
  .text-gradient {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 40%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  /* Focus-visible — WCAG 2.2 SC 2.4.11 Focus Appearance */
  :focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
  }
  a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
  }

  .section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
  }
  .section-subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 640px;
    margin: 0 auto 1.5rem;
  }

  /* Quotable answer blocks for AI/GEO citation */
  .quotable {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    max-width: 680px;
    margin: 0 auto 3.5rem;
    line-height: 1.7;
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--cyan);
    background: rgba(0, 229, 255, 0.03);
    border-radius: 0 var(--radius) var(--radius) 0;
    text-align: left;
  }

  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Components --- */
@layer components {

  /* ---- Navigation ---- */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(6, 6, 16, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
  }

  .nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-bright);
  }

  .nav__logo-icon { font-size: 1.5rem; }

  .nav__links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-dim);
  }

  .nav__links a:hover { color: var(--cyan); }

  .nav__cta {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
    color: var(--bg) !important;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  }

  .nav__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--glow-cyan);
  }

  .nav__mobile {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    min-height: 44px;
    padding: 4px 0;
  }

  .nav__mobile span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  }

  /* ---- Hero ---- */
  .hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
    overflow: hidden;
  }

  .hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
  }

  .hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: orb-drift 12s ease-in-out infinite alternate;
  }

  .hero__orb--cyan {
    width: 500px;
    height: 500px;
    background: var(--cyan);
    top: 10%;
    left: 20%;
    animation-delay: 0s;
  }

  .hero__orb--purple {
    width: 600px;
    height: 600px;
    background: var(--purple);
    bottom: 10%;
    right: 15%;
    animation-delay: -4s;
  }

  .hero__orb--blue {
    width: 400px;
    height: 400px;
    background: var(--blue);
    top: 50%;
    left: 55%;
    animation-delay: -8s;
  }

  @keyframes orb-drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
  }

  .hero__grid {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
  }

  .hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
  }

  .hero__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--cyan);
    border: 1px solid rgba(0, 229, 255, 0.25);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    margin-bottom: 2rem;
    background: rgba(0, 229, 255, 0.05);
    animation: badge-glow 3s ease-in-out infinite alternate;
  }

  @keyframes badge-glow {
    0% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
    100% { box-shadow: 0 0 24px rgba(0, 229, 255, 0.1); }
  }

  .hero__title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
  }

  .hero__subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 2.5rem;
  }

  .hero__subtitle strong { color: var(--text-bright); }

  /* ---- Terminal Demo ---- */
  .hero__terminal {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(6, 6, 16, 0.9);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px var(--glow-cyan);
    text-align: left;
  }

  .terminal__header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
  }

  .terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }

  .terminal__dot--red { background: #ff5f57; }
  .terminal__dot--yellow { background: #febc2e; }
  .terminal__dot--green { background: #28c840; }

  .terminal__title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
  }

  .terminal__body {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    min-height: 160px;
  }

  .terminal__line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .terminal__prompt { color: var(--cyan); font-weight: 600; }
  .terminal__typed { color: var(--text-bright); }

  .terminal__cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--cyan);
    animation: cursor-blink 1s step-end infinite;
    vertical-align: text-bottom;
  }

  @keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
  }

  .terminal__output {
    margin-top: 0.75rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.6;
  }

  .terminal__output .out-success, .terminal__output-line.terminal__success { color: #28c840; }
  .terminal__output .out-cyan, .terminal__output-line.terminal__info { color: var(--cyan); }
  .terminal__output .out-dim { color: var(--text-dim); }

  .terminal__output-line {
    opacity: 0;
    animation: termFadeIn 0.3s ease forwards;
    padding: 0.1rem 0;
  }

  @keyframes termFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .stat { text-align: center; }

  .stat__number {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .stat__label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
    display: block;
  }

  .hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* 404 / error page — styles moved out of inline style= so CSP can drop style-src 'unsafe-inline' */
  .error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
  }
  .error-page__code { font-size: clamp(3rem, 8vw, 6rem); margin-bottom: 1rem; }
  .error-page__msg { font-size: 1.25rem; color: var(--text-dim); margin-bottom: 2rem; }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.25s var(--ease);
  }

  .btn--primary {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: var(--bg);
    box-shadow: 0 4px 24px var(--glow-cyan);
  }

  .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.25);
  }

  .btn--ghost {
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255,255,255,0.03);
  }

  .btn--ghost:hover {
    border-color: var(--border-hover);
    background: rgba(0, 229, 255, 0.05);
    color: var(--cyan);
  }

  /* Hero install command */
  .hero__install-cmd {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.25rem 0.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    max-width: 540px;
    margin: 0 auto 1rem;

    & code { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  }

  .hero__copy-btn {
    padding: 0.6rem 1.25rem;
    background: var(--cyan);
    color: var(--bg);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.2s;
    &:hover { background: var(--blue); }
  }

  .hero__btns { display: flex; gap: 1rem; justify-content: center; }

  /* Compatible tools bar */
  .hero__compat {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }

  .hero__compat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
  }

  .hero__compat-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

  .compat-tool {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    transition: all 0.2s;
    &:hover { border-color: var(--border-hover); color: var(--cyan); }
  }

  .hero__scroll {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    animation: scroll-bounce 2s ease-in-out infinite;
  }

  @keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
  }

  /* ---- How It Works ---- */
  .how {
    padding: 8rem 0;
    position: relative;
  }

  .how__steps {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 900px;
    margin: 0 auto;
  }

  .how__step {
    flex: 1;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  }

  .how__step:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 40px var(--glow-cyan);
  }

  .how__step-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
  }

  .how__step h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
  }

  .how__step code {
    display: block;
    font-size: 0.8rem;
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 229, 255, 0.1);
    overflow-x: auto;
  }

  .how__step p { font-size: 0.9rem; color: var(--text-dim); }

  .how__connector {
    width: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .how__connector::after {
    content: '→';
    font-size: 1.5rem;
    color: var(--text-dim);
  }

  /* ---- Deck Filter (search + chips) ---- */
  .filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 2.5rem;
  }
  .filter__search {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 240px;
    min-width: 0;
    padding: 0.6rem 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  }
  .filter__search:focus-within {
    border-color: var(--cyan);
    background: rgba(0, 229, 255, 0.05);
  }
  .filter__icon { flex: none; color: var(--text-dim); transition: color 0.2s var(--ease); }
  .filter__search:focus-within .filter__icon { color: var(--cyan); }
  .filter__input {
    flex: 1 1 auto;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
  }
  .filter__input::placeholder { color: var(--text-dim); }
  .filter__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .filter__chip {
    padding: 0.45rem 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .filter__chip:hover { color: var(--text); border-color: var(--border-hover); transform: translateY(-1px); }
  .filter__chip--active {
    color: var(--cyan);
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.08);
  }
  .filter__chip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
  .filter__count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
  }
  .filter__count strong { color: var(--cyan); font-weight: 600; }
  .filter__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
  }
  .filter__clear {
    background: none;
    border: none;
    padding: 0;
    color: var(--cyan);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .filter__clear:hover { color: var(--text-bright); }
  .skill-card[hidden], .agent-card[hidden] { display: none; }

  @media (prefers-reduced-motion: reduce) {
    .filter__chip { transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
    .filter__chip:hover { transform: none; }
  }

  /* ---- Skill Router demo ---- */
  .router { padding: 8rem 0; }
  .router__demo {
    max-width: 920px;
    margin: 2.5rem auto 0;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .router__search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  }
  .router__search:focus-within { border-color: var(--cyan); background: rgba(0, 229, 255, 0.05); }
  .router__search:focus-within .filter__icon { color: var(--cyan); }
  .router__input {
    flex: 1 1 auto;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
  }
  .router__input::placeholder { color: var(--text-dim); }
  .router__examples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 1.5rem; }
  .router__ex {
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .router__ex:hover { color: var(--cyan); border-color: rgba(0, 229, 255, 0.4); transform: translateY(-1px); }
  .router__ex:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
  .router__readout {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1.4rem;
  }
  .router__readout strong { color: var(--cyan); font-weight: 600; }
  .router__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.5rem;
  }
  .router__node {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-dim);
    /* No opacity-dimming of inactive nodes: 0.4 dropped text contrast to 2.1:1
       (WCAG AA fail — and made skipped categories unreadable). --text-dim at full
       opacity is 7:1; active nodes stand out via .router__node--on (brighter text
       + cyan border/glow), not by making inactive text unreadable. */
    transition: border-color 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s var(--ease);
  }
  .router__node b { font-family: var(--font-mono); font-size: 0.82rem; color: inherit; }
  .router__node--on {
    opacity: 1;
    color: var(--text);
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(0, 229, 255, 0.08);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.15);
  }
  .router__node--on b { color: var(--cyan); }

  @media (prefers-reduced-motion: reduce) {
    .router__node { transition: opacity 0.35s var(--ease); }
    .router__ex:hover { transform: none; }
  }

  /* ---- Skills Grid ---- */
  .skills {
    padding: 8rem 0;
    background: var(--bg-raised);
    position: relative;
  }

  .skills::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }

  .skills__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
  }

  .skill-card {
    padding: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
  }

  .skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
  }

  .skill-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  .skill-card:hover::before { opacity: 1; }

  .skill-card__number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    opacity: 0.6;
  }

  .skill-card__title {
    font-size: 1.15rem;
    margin: 0.5rem 0;
    font-weight: 700;
  }

  .skill-card__desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  .skill-card__docs {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--purple-light);
  }

  /* ---- Capabilities ---- */
  .caps {
    padding: 8rem 0;
    position: relative;
  }
  .caps::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }

  .caps__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
  }

  .cap-card {
    padding: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
    position: relative;
    overflow: hidden;
  }
  .cap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
  }
  .cap-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  .cap-card:hover::before { opacity: 1; }

  .cap-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.35rem;
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.18);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
  }

  .cap-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
  }

  .cap-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .cap-card__list li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-dim);
  }
  .cap-card__list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--cyan);
    font-size: 0.85rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .cap-card { transition: none; }
    .cap-card:hover { transform: none; }
  }

  /* ---- Agents Grid ---- */
  .agents {
    padding: 8rem 0;
    position: relative;
  }

  .agents__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
  }

  .agent-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
  }

  .agent-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
  }

  .agent-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.3rem;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.16);
    border-radius: var(--radius);
    margin-bottom: 0.85rem;
  }

  .agent-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .agent-card__model {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* lighter purple: brand --purple (#7c3aed) is only 2.9:1 on the dark badge bg (WCAG AA fail) */
  .agent-card__model { background: rgba(124, 58, 237, 0.15); color: var(--purple-light); }

  .agent-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
  }

  /* ---- Stack ---- */
  .stack {
    padding: 8rem 0;
    background: var(--bg-raised);
    position: relative;
  }

  .stack::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }

  .stack__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    max-width: 960px;
    margin: 0 auto;
  }

  .stack__item {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .stack__category {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
  }

  .stack__techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tech-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    transition: all 0.2s var(--ease);
  }

  .tech-badge:hover {
    border-color: var(--border-hover);
    background: rgba(0, 229, 255, 0.05);
    color: var(--cyan);
  }

  /* ---- Platforms ---- */
  .platforms {
    padding: 8rem 0;
    position: relative;
  }

  .platforms__categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
  }
  @media (min-width: 620px) {
    .platforms__categories { grid-template-columns: repeat(2, 1fr); }
  }
  @media (min-width: 968px) {
    /* 3 columns for 4 groups left a big empty quadrant (Directory Formats alone
       bottom-left). Force 3 cols at desktop and let the largest group span the
       full bottom row so the section reads balanced, not half-empty. Tablet
       (620–967px) stays a clean 2×2; mobile is one column. */
    .platforms__categories { grid-template-columns: repeat(3, 1fr); }
    .platform-group:last-child { grid-column: 1 / -1; }
  }

  .platform-group {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .platform-group__title {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    color: var(--text-bright);
  }

  .platform-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .platform-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all 0.2s var(--ease);
  }

  .platform-tag:hover { border-color: var(--border-hover); color: var(--text); }
  .platform-tag--modern { border-color: rgba(0, 229, 255, 0.15); color: var(--cyan); }
  .platform-tag--named { border-color: rgba(80, 170, 227, 0.15); color: var(--blue); }
  .platform-tag--dir { border-color: rgba(124, 58, 237, 0.15); color: var(--purple-light); }

  /* ---- Install ---- */
  .install {
    padding: 8rem 0;
    background: var(--bg-raised);
    position: relative;
  }

  .install::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }

  .install__methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    max-width: 960px;
    margin: 0 auto;
  }

  .install__method {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .install__method h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-bright);
  }

  .code-block {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }

  .code-block pre {
    padding: 1rem;
    /* Reserve the top-right Copy-button column + wrap long commands so the
       full text is always readable and never runs under the button. */
    padding-right: 4.25rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--cyan);
  }

  .code-block__copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    transition: all 0.2s var(--ease);
  }

  .code-block__copy:hover { background: rgba(0, 229, 255, 0.1); color: var(--cyan); }

  .code-comment { color: var(--text-dim); }

  /* ---- Author ---- */
  .author {
    padding: 8rem 0;
    position: relative;
  }

  .author__content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
  }

  .author__content p {
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
  }

  .author__links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
  }

  .author__links a {
    color: var(--cyan);
    font-size: 0.95rem;
    transition: opacity 0.2s;
  }

  .author__links a:hover { opacity: 0.7; }

  /* ---- Footer ---- */
  .footer {
    padding: 5rem 0 2rem;
    background: var(--bg-raised);
    border-top: 1px solid var(--border);
  }

  .footer__grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
  }

  .footer__brand p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.6;
  }

  .footer__col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer__col h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
  }

  .footer__col a {
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: color 0.2s;
  }

  .footer__col a:hover { color: var(--cyan); }

  .footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
  }

  .footer__bottom a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
  .footer__contact a { text-decoration: underline; }
}

@layer components {
  /* --- Compare --- */
  .proof {
    padding: 8rem 0;
    position: relative;
    text-align: center;
  }
  .proof::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }
  .proof::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(55% 55% at 50% 0%, rgba(0, 229, 255, 0.08), transparent 70%);
  }
  .proof__score {
    margin: 2.75rem 0 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }
  .proof__score-num {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
  }
  .proof__score-den {
    font-size: 0.38em;
    font-weight: 600;
    -webkit-text-fill-color: var(--text-dim);
    color: var(--text-dim);
  }
  .proof__score-label {
    color: var(--text-dim);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
  }
  .proof .quotable {
    margin: 2.25rem auto 0;
    max-width: 68ch;
    text-align: left;
  }
  .proof__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem auto 0;
    max-width: 50rem;
  }
  .proof__btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2.5rem 0 0;
  }

  .compare { padding: 6rem 0; }

  .compare__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
  }

  .compare__col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
  }

  .compare__col--before { border-color: rgba(255, 80, 80, 0.15); }
  .compare__col--after { border-color: rgba(0, 229, 255, 0.15); box-shadow: 0 0 40px var(--glow-cyan); }

  .compare__label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
  }

  .compare__col--before .compare__label { color: #ff5050; }
  .compare__col--after .compare__label { color: var(--cyan); }

  .compare__terminal {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
  }

  .compare__line--dim { color: var(--text-dim); } /* no opacity:0.6 — it dropped --text-dim to 2.x:1 (WCAG fail); full is 7:1, still muted vs the cyan/green lines */
  .compare__line--red { color: #ff5050; }
  .compare__line--cyan { color: var(--cyan); }
  .compare__line--green { color: #28c840; font-weight: 600; }

  /* --- Flow Diagram --- */
  .flow { padding: 6rem 0; }

  .flow__diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
  }
  .flow__diagram::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.05), transparent 70%);
    pointer-events: none;
  }
  .flow__diagram > * { position: relative; z-index: 1; }

  .flow__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    transition: all 0.25s var(--ease);
    &:hover { border-color: var(--border-hover); transform: translateY(-2px); }
  }

  .flow__node--start { border-color: var(--border-hover); }
  .flow__node--router {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--cyan);
    color: var(--cyan);
    animation: flowBreathe 3s ease-in-out infinite;
  }
  .flow__node--end {
    background: rgba(40, 200, 64, 0.08);
    border-color: #28c840;
    color: #28c840;
    box-shadow: 0 0 20px rgba(40, 200, 64, 0.14);
  }
  .flow__node--agents {
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--purple);
    color: var(--purple-light);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.14);
  }

  .flow__icon { font-size: 1.5rem; }

  /* Arrows carry a signal pulse that travels left→right along the chain. */
  .flow__arrow {
    color: var(--cyan);
    font-size: 1.25rem;
    font-weight: 400;
    animation: flowPulse 2.4s var(--ease) infinite;
  }
  .flow__diagram > .flow__arrow:nth-child(4) { animation-delay: 0.3s; }
  .flow__diagram > .flow__arrow:nth-child(6) { animation-delay: 0.6s; }
  .flow__diagram > .flow__arrow:nth-child(8) { animation-delay: 0.9s; }

  @keyframes flowPulse {
    0%, 100% { opacity: 0.35; text-shadow: none; }
    50% { opacity: 1; text-shadow: 0 0 12px rgba(0, 229, 255, 0.7); }
  }
  @keyframes flowBreathe {
    0%, 100% { box-shadow: 0 0 16px rgba(0, 229, 255, 0.12); }
    50% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.3); }
  }
  @media (prefers-reduced-motion: reduce) {
    .flow__arrow { animation: none; opacity: 0.8; }
    .flow__node--router { animation: none; }
  }

  .flow__branch {
    display: flex;
    gap: 0.4rem;

    & .flow__node { padding: 0.6rem 0.8rem; font-size: 0.75rem; }
  }

  .flow__node--skill {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
  }

  /* --- FAQ --- */
  .faq { padding: 6rem 0; }

  .faq__list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .faq__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
    &:hover, &[open] { border-color: var(--border-hover); }

    & summary {
      padding: 1.25rem 1.5rem;
      font-weight: 600;
      font-family: var(--font-heading);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      list-style: none;
      color: var(--text-bright);

      &::after {
        content: '+';
        font-size: 1.25rem;
        color: var(--cyan);
        transition: transform 0.2s;
      }

      &::-webkit-details-marker { display: none; }
    }

    &[open] summary::after { content: '−'; }

    & p {
      padding: 0 1.5rem 1.25rem;
      color: var(--text-dim);
      line-height: 1.7;
    }
  }

  /* --- Sticky CTA --- */
  .sticky-cta {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    z-index: 900;
    transition: bottom 0.35s var(--ease);
    pointer-events: none;
  }

  .sticky-cta--visible { bottom: 0; pointer-events: auto; }

  .sticky-cta__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(6, 6, 16, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }

  .sticky-cta__cmd {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
  }

  .sticky-cta__copy {
    padding: 0.5rem 1rem;
    background: var(--cyan);
    color: var(--bg);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.2s;
    &:hover { background: var(--blue); }
  }
} /* close @layer components (continued) */

/* ============================================================
   Scroll-driven animations (progressive enhancement)
   ============================================================ */
@supports (animation-timeline: view()) {
  /* Opacity stays 1 (text always readable / contrast-safe); only transform
     animates so the reveal never trips color-contrast mid-fade. */
  .reveal {
    opacity: 1;
    animation: scroll-reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

  @keyframes scroll-reveal {
    from { transform: translateY(24px); }
    to { transform: translateY(0); }
  }

  /* Stagger skill cards */
  .skill-card:nth-child(2) { animation-range: entry 2% entry 32%; }
  .skill-card:nth-child(3) { animation-range: entry 4% entry 34%; }
  .skill-card:nth-child(4) { animation-range: entry 6% entry 36%; }

  /* Stagger agent cards */
  .agent-card:nth-child(2) { animation-range: entry 2% entry 32%; }
  .agent-card:nth-child(3) { animation-range: entry 4% entry 34%; }
  .agent-card:nth-child(4) { animation-range: entry 6% entry 36%; }
}

/* ============================================================
   Micro-interaction hover states
   ============================================================ */
@layer components {
  .skill-card:hover .skill-card__number { opacity: 1; color: var(--cyan); }
  .skill-card:hover .skill-card__docs { opacity: 1; color: var(--cyan); }

  .agent-card:hover .agent-card__icon { transform: scale(1.15); transition: transform 0.25s var(--ease); }

  .how__step:hover .how__step-number { transform: scale(1.05); transition: transform 0.25s var(--ease); }

  .flow__node--router:hover { box-shadow: 0 0 24px var(--glow-cyan); }
  .flow__node--agents:hover { box-shadow: 0 0 24px var(--glow-purple); }
  .flow__node--end:hover { box-shadow: 0 0 24px rgba(40, 200, 64, 0.15); }

  .tech-badge { transition: all 0.2s var(--ease), transform 0.2s var(--ease); }
  .tech-badge:hover { transform: translateY(-2px); }

  .platform-tag { transition: all 0.2s var(--ease), transform 0.2s var(--ease); }
  .platform-tag:hover { transform: translateY(-1px); }

  .faq__item summary { transition: color 0.2s var(--ease); }
  .faq__item summary:hover { color: var(--cyan); }
}

/* ============================================================
   @starting-style entry animations
   ============================================================ */

/* FAQ accordion content — fade+slide in on open */
.faq__item > p {
  opacity: 0;
  transform: translateY(-8px);
}

.faq__item[open] > p {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@starting-style {
  .faq__item[open] > p {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* FAQ answer code wraps on narrow screens — long install commands
   (e.g. git clone … ~/.codex/skills/agent-skills) overflowed ~11px at 390px. */
.faq__item > p code {
  overflow-wrap: anywhere;
}

/* Mobile nav menu — fade+slide in on open */
.nav__links--open {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

@starting-style {
  .nav__links--open {
    opacity: 0;
    transform: translateY(-12px);
  }
}

/* ============================================================
   Responsive
   ============================================================ */

/* 375px — small phones */
@media (max-width: 480px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .hero__install-cmd { flex-direction: column; border-radius: var(--radius); padding: 0.75rem; }
  .hero__copy-btn { width: 100%; border-radius: var(--radius); }
  .hero__btns { flex-direction: column; }
  .how__steps { flex-direction: column; }
  .how__connector { width: auto; min-width: auto; height: 24px; }
  .how__connector::after { transform: rotate(90deg); }
  .compare__grid { grid-template-columns: 1fr; }
  .flow__diagram { flex-direction: column; }
  .flow__arrow { transform: rotate(90deg); }
  .flow__branch { flex-wrap: wrap; justify-content: center; }
  .sticky-cta__cmd { display: none; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .nav__links { display: none; }
  .nav__mobile { display: flex; }
  .nav__links--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(6, 6, 16, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }
}

/* 768px — tablets */
@media (max-width: 768px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .how__steps { flex-direction: column; }
  .how__connector { width: auto; min-width: auto; height: 24px; }
  .how__connector::after { transform: rotate(90deg); }
  .compare__grid { grid-template-columns: 1fr; }
  .flow__diagram { flex-direction: column; }
  .flow__arrow { transform: rotate(90deg); }
  .flow__branch { flex-wrap: wrap; justify-content: center; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .install__methods { grid-template-columns: 1fr; }
}

/* 1024px — small desktops */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  /* The full 7-link nav crowds below ~1024px (logo jams the first link, "Try It"
     wraps) → tablets get the hamburger; the full nav shows only on real desktop. */
  .nav__links { display: none; }
  .nav__mobile { display: flex; }
  .nav__links--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(6, 6, 16, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .nav, .hero__bg, .hero__scroll, .code-block__copy { display: none; }
  body { background: #fff; color: #000; }
  .text-gradient { -webkit-text-fill-color: #000; }
}

/* ── Cinematic layer (fire: cross-agent arc) ───────────────────────────── */
.hero__nebula {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.85;
}

.scroll-progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 200;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #00E5FF, #7C3AED);
    animation: scroll-progress-grow linear both;
    animation-timeline: scroll();
  }

  @keyframes scroll-progress-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { animation: none; transform: scaleX(0); }
}

/* ── Cinematic pass 2 ──────────────────────────────────────────────────── */

/* Scroll-driven card reveals — platform-native where supported; the JS
   IntersectionObserver fallback (see inline script) covers the rest. */
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
    animation: reveal-rise both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

@keyframes reveal-rise {
  from { opacity: 0; translate: 0 26px; }
  to { opacity: 1; translate: 0 0; }
}

/* Resilience fallback — browsers WITHOUT scroll-driven animations (Firefox)
   reveal .reveal elements via the inline JS IntersectionObserver. If JS is
   disabled OR the inline script errors before wiring the observer, content
   would stay at opacity:0 → a blank body. Force opacity:1 so body content is
   ALWAYS visible there; the observer still animates transform (opacity holds
   at 1 — contrast-safe). No effect on Chromium/Safari (they match the
   @supports (animation-timeline: view()) branch, not this one). */
@supports not (animation-timeline: view()) {
  .reveal { opacity: 1; }
}

/* Bento asymmetry — anchor cards span wide at desktop */
@media (min-width: 1024px) {
  .skill-card[data-category="01"],
  .skill-card[data-category="28"] {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(124, 58, 237, 0.08));
    border-color: rgba(0, 229, 255, 0.25);
  }
}

/* Kinetic hero gradient — slow pan, type stays perfectly legible */
.hero__title .text-gradient {
  background-size: 220% 220%;
  animation: gradient-pan 9s ease-in-out infinite alternate;
}

@keyframes gradient-pan {
  from { background-position: 0% 40%; }
  to { background-position: 100% 60%; }
}

/* First-paint hero entrance — @starting-style, zero JS */
.hero__badge, .hero__title, .hero__subtitle {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  @starting-style {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title .text-gradient { animation: none; }
  .hero__badge, .hero__title, .hero__subtitle { transition: none; }
  @supports (animation-timeline: view()) {
    .reveal { animation: none; opacity: 1; translate: none; }
  }
}

/* ── Cinematic pass 3 ──────────────────────────────────────────────────── */

/* Cross-document view transitions (free for 404→home and future pages) */
@view-transition {
  navigation: auto;
}

/* FAQ accordion — smooth height interpolation where supported */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq__item::details-content {
    block-size: 0;
    overflow-y: clip;
    transition: block-size 0.35s var(--ease), content-visibility 0.35s allow-discrete;
  }
  .faq__item[open]::details-content {
    block-size: auto;
  }
}

/* Terminal window — ambient breathing glow, the daunting centerpiece */
.hero__terminal {
  animation: terminal-glow 6s ease-in-out infinite alternate;
}

@keyframes terminal-glow {
  from { box-shadow: 0 0 24px rgba(0, 229, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.5); }
  to { box-shadow: 0 0 44px rgba(0, 229, 255, 0.16), 0 24px 64px rgba(0, 0, 0, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__terminal { animation: none; }
  @supports (interpolate-size: allow-keywords) {
    .faq__item::details-content { transition: none; }
  }
}

/* ── Mobile 375 hardening (fire-16): kill horizontal overflow ──────────── */
.hero {
  overflow-x: clip;
}

@media (max-width: 640px) {
  .terminal__line,
  .hero__install-cmd {
    flex-wrap: wrap;
  }
  #typed-cmd,
  .terminal__output-line,
  .hero__install-cmd code,
  .sticky-cta__cmd {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  .install__methods {
    grid-template-columns: 1fr;
  }
  .install__method {
    min-width: 0;
  }
  .code-block pre,
  .code-block code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

body {
  overflow-x: clip;
}

@media (max-width: 640px) {
  .footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
  .sticky-cta__inner {
    flex-wrap: wrap;
    min-width: 0;
  }
}
