/* EduBase Features — styles
   Brand: EduBase purple #7700b5, Source Sans 3. Light + dark themes. */

/* ------------------------------------------------------------------ tokens */
:root {
  --brand: #7700b5;
  --brand-strong: #5e008f;
  --brand-soft: #f3e8fb;
  --brand-2: #c026d3;
  --brand-3: #4f46e5;
  --cyan: #22d3ee;
  --amber: #f59e0b;

  --bg: #fbf8fe;
  --bg-2: #f6f0fb;
  --surface: #ffffff;
  --surface-2: #f7f2fb;
  --surface-3: #efe6f7;
  --border: #ebe1f4;
  --border-strong: #d9c8ea;
  --text: #1b1226;
  --text-2: #3d3150;
  --muted: #6e6282;
  --ring: rgba(119, 0, 181, .28);
  --shadow-sm: 0 1px 2px rgba(40, 10, 70, .05);
  --shadow: 0 1px 3px rgba(60, 10, 110, .08);
  --shadow-lg: 0 4px 12px rgba(70, 10, 120, .1);

  --m-y: #16a34a; --m-y-bg: #dcfce7;

  --code-bg: #140a20;
  --radius: 4px;
  --topbar-h: 64px;
  --ctl-h: 44px;    /* toolbar controls */
  --ctl-h-sm: 40px; /* header controls */
  --chip-h: 24px;   /* IDs, plans, counts */
  --tint: rgba(119, 0, 181, .07);        /* hover / active backgrounds */
  --tint-strong: rgba(119, 0, 181, .11);
  --font: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #b26af0;
    --brand-strong: #c98bff;
    --brand-soft: #2a1740;
    --bg: #0c0713;
    --bg-2: #120a1c;
    --surface: #150d21;
    --surface-2: #1c122b;
    --surface-3: #241837;
    --border: #2a1f3b;
    --border-strong: #3b2c52;
    --text: #f4edfc;
    --text-2: #d8cbe9;
    --muted: #a597b9;
    --ring: rgba(178, 106, 240, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    --m-y: #4ade80; --m-y-bg: rgba(34, 197, 94, .14);
    --tint: rgba(178, 106, 240, .1);
    --tint-strong: rgba(178, 106, 240, .16);
    --code-bg: #0a0510;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #b26af0;
  --brand-strong: #c98bff;
  --brand-soft: #2a1740;
  --bg: #0c0713;
  --bg-2: #120a1c;
  --surface: #150d21;
  --surface-2: #1c122b;
  --surface-3: #241837;
  --border: #2a1f3b;
  --border-strong: #3b2c52;
  --text: #f4edfc;
  --text-2: #d8cbe9;
  --muted: #a597b9;
  --ring: rgba(178, 106, 240, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  --m-y: #4ade80; --m-y-bg: rgba(34, 197, 94, .14);
  --tint: rgba(178, 106, 240, .1);
  --tint-strong: rgba(178, 106, 240, .16);
  --code-bg: #0a0510;
  color-scheme: dark;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
mark { background: rgba(245, 158, 11, .32); color: inherit; border-radius: 4px; padding: 0 1px; }
::selection { background: rgba(192, 38, 211, .25); }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 4px; }
.skip:focus { left: 8px; }

.grad-text {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 45%, var(--brand-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em; justify-content: center;
  border-radius: 4px; border: 1px solid transparent; padding: .7em 1.15em;
  font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8a10d0 0%, #7700b5 45%, #5b10a8 100%);
  box-shadow: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { height: var(--ctl-h-sm); padding: 0 .9em; font-size: .88rem; border-radius: 4px; }
.btn-lg { padding: .85em 1.4em; font-size: 1.05rem; border-radius: 4px; }
.icon-btn {
  width: var(--ctl-h-sm); height: var(--ctl-h-sm); border-radius: 4px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.i-light { display: none; }
:root[data-theme="dark"] .i-dark { display: none; }
:root[data-theme="dark"] .i-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-dark { display: none; }
  :root:not([data-theme="light"]) .i-light { display: inline; }
}
.text-btn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ----------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { display: block; height: 30px; width: auto; }
.logo-white { display: none; }
:root[data-theme="dark"] .topbar .logo-color { display: none; }
:root[data-theme="dark"] .topbar .logo-white { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar .logo-color { display: none; }
  :root:not([data-theme="light"]) .topbar .logo-white { display: block; }
}
.brand-sub {
  font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  height: 26px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 4px; }
.topnav a:hover { background: var(--tint); color: var(--brand); text-decoration: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-actions .icon-btn, .topbar-actions .btn-ghost { border-color: transparent; background: transparent; }
.topbar-actions .icon-btn:hover, .topbar-actions .btn-ghost:hover { border-color: transparent; background: var(--tint); color: var(--brand); }
.lang-switch { display: inline-flex; height: var(--ctl-h-sm); padding: 2px; gap: 2px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.lang-switch button {
  border: 0; background: transparent; padding: 0 8px; border-radius: 3px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .78rem; letter-spacing: .04em; color: var(--muted);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
@media (max-width: 860px) { .topnav { display: none; } }
@media (max-width: 560px) { .brand-sub { display: none; } }
@media (max-width: 420px) {
  .topbar-actions .btn-primary { display: none; }
  .logo { height: 26px; }
  .eyebrow { font-size: .78rem; padding: 5px 12px; }
}

/* ------------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: 84px 0 64px; isolation: isolate; }
.aurora { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -2; filter: blur(70px); opacity: .55; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 520px; height: 520px; left: 2%; top: 0; background: #d8b4fe; }
.aurora span:nth-child(2) { width: 460px; height: 460px; right: 4%; top: 6%; background: #f0abfc; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 380px; height: 380px; left: 40%; top: 30%; background: #a5b4fc; animation-delay: -12s; }
:root[data-theme="dark"] .aurora { opacity: .32; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora { opacity: .32; } }
.grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  opacity: .7;
}
.hero-inner { text-align: center; }
.eyebrow {
  display: inline-flex; flex-wrap: wrap; justify-content: center; text-align: center; max-width: 100%; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; letter-spacing: .04em;
  color: var(--brand); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border-strong);
  padding: 6px 14px; border-radius: 4px; box-shadow: var(--shadow-sm);
}
.hero h1 { margin: 22px auto 0; font-size: clamp(2.2rem, 6.2vw, 5rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.02; max-width: 15ch; }
.lede { margin: 22px auto 0; max-width: 680px; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); }
.hero-cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) { .hero { padding: 56px 0 44px; } }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 30px) scale(.95); }
}

/* ------------------------------------------------------------- highlights */
.highlights {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; padding: 96px 0 104px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(192, 38, 211, .35), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(79, 70, 229, .35), transparent 60%),
    linear-gradient(180deg, #16052b 0%, #210844 50%, #12041f 100%);
}
.highlights::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}
.hl-aurora { position: absolute; inset: 0; z-index: -1; filter: blur(80px); pointer-events: none; }
.hl-aurora span { position: absolute; border-radius: 50%; opacity: .55; animation: drift 16s ease-in-out infinite alternate; }
.hl-aurora span:nth-child(1) { width: 480px; height: 480px; left: -6%; top: 10%; background: #9d1ee0; }
.hl-aurora span:nth-child(2) { width: 420px; height: 420px; right: -4%; top: 30%; background: #db2777; opacity: .35; animation-delay: -5s; }
.hl-aurora span:nth-child(3) { width: 380px; height: 380px; left: 35%; bottom: -10%; background: #0891b2; opacity: .3; animation-delay: -10s; }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section-head h2 { margin-top: 0; font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 900; letter-spacing: -.03em; }
.section-head p:not(.eyebrow) { margin-top: 14px; color: var(--muted); font-size: 1.12rem; }
.section-head.on-dark h2 {
  background: linear-gradient(100deg, #fff 0%, #f5d0fe 40%, #c4b5fd 70%, #a5f3fc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head.on-dark p:not(.eyebrow) { color: rgba(240, 225, 255, .78); }
.eyebrow-glow { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); box-shadow: none; }
.eyebrow-glow i { color: #fbbf24; }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(210px, auto); gap: 18px; }
.hl {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px;
  border-radius: 4px; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, border-color .35s ease;
}
.reveal .hl:not(.in) { opacity: 0; transform: translateY(24px) scale(.98); }
.reveal .hl.in { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, border-color .35s ease; transition-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms), 0s, 0s; }
.reveal .hl.in:hover { transition-delay: 0s; }
.hl::before { /* mouse spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(232, 121, 249, .22), transparent 45%);
}
.hl:hover { text-decoration: none; transform: translateY(-4px); border-color: rgba(255, 255, 255, .28); }
.hl:hover::before { opacity: 1; }

@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.hl-border {
  position: absolute; inset: 0; border-radius: 4px; padding: 1.5px; pointer-events: none; z-index: 1;
  background: conic-gradient(from var(--angle), transparent 0deg, transparent 220deg, #f0abfc 270deg, #a78bfa 300deg, #67e8f9 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 7s linear infinite paused; animation-delay: calc(var(--i) * -0.9s);
  opacity: 0; transition: opacity .3s ease;
}
.hl:hover .hl-border, .hl:focus-visible .hl-border { opacity: .85; animation-play-state: running; }
@keyframes spin { to { --angle: 360deg; } }

.hl-icon {
  margin-bottom: 6px; width: 52px; height: 52px; border-radius: 4px; display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, #d946ef, #7c3aed 55%, #4f46e5);
}
.hl-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.hl-text { color: rgba(240, 228, 255, .82); font-size: 1rem; }
.hl-bullets { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hl-bullets span { display: flex; gap: 10px; align-items: baseline; color: rgba(255, 255, 255, .92); font-weight: 600; }
.hl-bullets i { color: #86efac; font-size: .85em; }
.hl-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.hl-go { font-weight: 700; font-size: .9rem; color: #f5d0fe; display: inline-flex; gap: 6px; align-items: center; }
.hl-go i { transition: transform .25s ease; }
.hl:hover .hl-go i { transform: translateX(4px); }

.hl-xl { grid-column: span 2; grid-row: span 2; padding: 34px;
  background: linear-gradient(150deg, rgba(168, 85, 247, .32), rgba(79, 70, 229, .18) 50%, rgba(255, 255, 255, .03)); }
.hl-xl .hl-icon { width: 64px; height: 64px; font-size: 28px; border-radius: 4px; }
.hl-xl .hl-title { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; max-width: 18ch; }
.hl-xl .hl-text { font-size: 1.12rem; max-width: 52ch; }
.hl-tall { grid-row: span 2; background: linear-gradient(170deg, rgba(219, 39, 119, .22), rgba(255, 255, 255, .03) 60%); }
.hl-wide { grid-column: span 2; }

/* decorative visuals inside highlight cards */
.hl-viz { display: block; margin: 8px 0 4px; }
.heat { display: grid; grid-template-columns: 92px repeat(6, 1fr); gap: 5px; max-width: 560px; align-items: center; }
.heat .hd { font-size: .68rem; color: rgba(255, 255, 255, .55); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .c {
  height: 24px; border-radius: 4px; display: grid; place-items: center;
  font-size: .66rem; font-weight: 800; letter-spacing: .02em; color: rgba(20, 8, 32, .78); font-variant-numeric: tabular-nums;
  transition: background-color .6s ease, box-shadow .6s ease, transform .3s ease;
}
.heat .c.na { background: transparent; border: 1px dashed rgba(255, 255, 255, .22); }
.heat .l0, .heat-foot .l0 { background-color: rgba(52, 211, 153, .9); }
.heat .l1, .heat-foot .l1 { background-color: rgba(163, 230, 53, .9); }
.heat .l2, .heat-foot .l2 { background-color: #facc15; }
.heat .l3, .heat-foot .l3 { background-color: #fb923c; }
.heat .l4, .heat-foot .l4 { background-color: #f43f5e; color: #fff; }
.heat .c.bump { transform: scale(1.12); box-shadow: 0 0 0 2px #fff, 0 0 16px 2px rgba(110, 231, 183, .7); }
.hl.in .heat .c { animation: cell-in .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--d) * 35ms + .3s); }
@keyframes cell-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
.heat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; max-width: 560px; font-size: .74rem; font-weight: 600; color: rgba(255, 255, 255, .6); }
.heat-foot .lg { display: inline-flex; align-items: center; gap: 6px; }
.heat-foot i { width: 10px; height: 10px; border-radius: 2px; }
.heat-foot i.na { border: 1px dashed rgba(255, 255, 255, .4); }
.heat-total { margin-left: auto; }
.heat-total b { color: #fff; font-size: .9rem; font-variant-numeric: tabular-nums; }
.graph { width: 100%; height: auto; max-height: 290px; }
.graph .edge { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 2; }
.graph .flow { fill: none; stroke: url(#gflow); stroke-width: 2.5; stroke-dasharray: 6 10; animation: dash 1.6s linear infinite; }
.graph .node { fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.graph .node.ok { fill: rgba(134, 239, 172, .25); stroke: #86efac; }
.graph .node.warn { fill: rgba(251, 191, 36, .2); stroke: #fbbf24; }
.graph .node.start { fill: rgba(232, 121, 249, .3); stroke: #f0abfc; }
.graph text { fill: #fff; font: 700 10px var(--font); letter-spacing: .02em; }
.graph text.lbl { fill: rgba(255, 255, 255, .6); font: 600 8px var(--font); letter-spacing: .04em; }
@keyframes dash { to { stroke-dashoffset: -32; } }

@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .hl-xl { grid-column: span 2; grid-row: span 1; }
  .hl-tall { grid-row: span 1; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .hl-xl, .hl-wide { grid-column: span 1; }
  .highlights { padding: 64px 0 72px; }
  .heat { grid-template-columns: 70px repeat(6, 1fr); }
}

/* ----------------------------------------------------------------- toolbar */
.anchor { position: relative; top: calc(-1 * var(--topbar-h)); }
.toolbar {
  position: sticky; top: var(--topbar-h); z-index: 40; padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease;
}
.toolbar.stuck { border-bottom-color: var(--border); }
.toolbar-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  flex: 1 1 300px; display: flex; align-items: center; gap: 10px; height: var(--ctl-h); padding: 0 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.search i { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--text); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 26px; padding: 0 7px; cursor: pointer;
  font-size: .78rem; color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.search-clear[hidden] { display: none; }
.search .search-clear i { color: inherit; }
.search-clear:hover { color: var(--brand); border-color: var(--brand); background: var(--tint); }
.seg { display: inline-flex; align-items: stretch; height: var(--ctl-h); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 0 12px; border-radius: 4px; font-weight: 700; font-size: .88rem;
  color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.tag-llm {
  font-size: .62rem; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); vertical-align: middle;
}
.result-count:empty { display: none; }
.result-count { margin-left: auto; font-size: .88rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) {
  .result-count { width: 100%; margin-left: 0; }
  .toolbar { position: relative; top: 0; }
}
@media (max-width: 560px) {
  .plan-filter { width: 100%; }
  .plan-filter button { flex: 1; justify-content: center; padding: 0 6px; }
}

/* ---------------------------------------------------------------- layout */
.layout > * { min-width: 0; }
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 36px; padding-top: 28px; padding-bottom: 80px; }
.sidebar { position: sticky; top: calc(var(--topbar-h) + 92px); align-self: start; max-height: calc(100vh - var(--topbar-h) - 110px); overflow-y: auto; overflow-x: hidden; padding: 2px 2px 12px; }
#catnav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.navlink {
  white-space: nowrap; min-width: 0;
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 4px;
  color: var(--text-2); font-weight: 600; font-size: .95rem; transition: background .15s ease, color .15s ease;
}
.navlink span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.navlink i { width: 18px; text-align: center; color: var(--muted); }
.navlink b { flex: none; margin-left: auto; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 8px; }
.navlink:hover { background: var(--tint); text-decoration: none; color: var(--text); }
.navlink.active { background: var(--tint-strong); color: var(--brand); }
.navlink.active i { color: var(--brand); }
.navlink.dim { opacity: .45; }
.navgroup { min-width: 0; }
.subnav { display: none; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid var(--border-strong); }
.navgroup.open .subnav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.sublink { display: block; min-width: 0; padding: 5px 10px; border-radius: 4px; font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sublink:hover { background: var(--tint); color: var(--text); text-decoration: none; }
.sublink.active { background: var(--tint); color: var(--brand); }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; max-height: none; overflow: visible; margin: 0 -16px; }
  .subnav, .navgroup.open .subnav { display: none; }
  #catnav { display: flex; overflow-x: auto; gap: 8px; padding: 4px 16px 14px; scrollbar-width: none; }
  #catnav::-webkit-scrollbar { display: none; }
  .navgroup { flex: none; }
  .navlink { border: 1px solid var(--border); background: var(--surface); }
}

/* --------------------------------------------------------------- catalog */
body[data-view="markdown"] .view-visual { display: none; }
body[data-view="visual"] .view-markdown { display: none; }

.category { padding-top: 8px; margin-bottom: 56px; scroll-margin-top: 170px; }
.cat-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.cat-icon {
  flex: none; width: 60px; height: 60px; border-radius: 4px; display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #c026d3, #7700b5 55%, #4f46e5);
}
.cat-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 900; letter-spacing: -.025em; margin-top: 6px; }
.cat-desc { margin-top: 8px; color: var(--text-2); max-width: 75ch; }
.cat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.count { display: inline-flex; align-items: center; height: var(--chip-h); font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 10px; }

.features { display: grid; gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 22px 24px;
  box-shadow: var(--shadow-sm); scroll-margin-top: 170px; transition: border-color .2s ease, box-shadow .2s ease;
}
.feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.feat-head { display: flex; gap: 14px; align-items: center; }
.feat-icon {
  flex: none; width: 44px; height: 44px; border-radius: 4px; display: grid; place-items: center; font-size: 19px;
  color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.feat-title { min-width: 0; flex: 1; }
.feat-title h3 { font-size: 1.28rem; font-weight: 800; letter-spacing: -.015em; }
.feat-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.feat-desc { margin-top: 12px; color: var(--text-2); }

.caps { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--border); }
.cap { padding: 14px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 180px; border-radius: 4px; }
.cap:last-child { border-bottom: 0; padding-bottom: 2px; }
.cap-head { display: flex; justify-content: space-between; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.cap h4 { font-size: 1.05rem; font-weight: 700; }
.cap-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cap p { margin-top: 4px; color: var(--text-2); font-size: .98rem; }

.id-chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--chip-h); border: 1px solid var(--border-strong); background: var(--surface-2);
  font-family: var(--mono); font-size: .74rem; font-weight: 500; color: var(--text-2); padding: 0 8px; border-radius: 4px;
  cursor: pointer; transition: all .15s ease; max-width: 100%;
}
.id-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-chip i { font-size: .9em; color: var(--muted); }
.id-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--tint); }
.id-chip:hover i { color: var(--brand); }
.link-btn { height: var(--chip-h); display: inline-flex; align-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 6px; border-radius: 4px; opacity: 0; transition: opacity .15s ease; }
.cap:hover .link-btn, .link-btn:focus-visible { opacity: 1; }
.link-btn:hover { color: var(--brand); }
@media (hover: none) { .link-btn { opacity: .7; } }

.plans { display: inline-flex; height: var(--chip-h); border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.plan { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 0 7px; color: color-mix(in srgb, var(--muted) 45%, transparent); }
.plans .plan + .plan { border-left: 1px solid var(--border-strong); }
.plan.on { color: var(--brand); background: var(--tint-strong); }
.plan-m { color: var(--muted); height: var(--chip-h); border: 1px solid var(--border-strong); border-radius: 4px; display: inline-flex; gap: 5px; align-items: center; }

details.more { margin-top: 8px; }
details.more summary {
  list-style: none; cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--brand);
  display: inline-flex; gap: 6px; align-items: center; user-select: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary i { font-size: .7em; transition: transform .2s ease; }
details.more[open] summary i { transform: rotate(90deg); }
details.more ul { margin: 8px 0 0; padding: 12px 14px 12px 32px; list-style: disc; background: var(--surface-2); border-radius: 4px; color: var(--text-2); font-size: .94rem; display: grid; gap: 4px; }
details.more li { display: list-item; }
details.more li::marker { color: var(--brand); }

.flash { animation: flash 1.8s ease; }
@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--ring), 0 0 0 10px color-mix(in srgb, var(--brand) 12%, transparent); background-color: var(--brand-soft); }
  100% { box-shadow: none; }
}

.empty { text-align: center; padding: 80px 20px; border: 1px dashed var(--border-strong); border-radius: 4px; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--brand); }
.empty h3 { margin: 14px 0 6px; color: var(--text); font-size: 1.3rem; }

/* -------------------------------------------------------------- markdown */
.md-panel { border-radius: 4px; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow); background: var(--surface); }
.md-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.md-head h2 { font-size: 1.35rem; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.md-head h2 i { color: var(--brand); }
.md-head p { margin-top: 6px; color: var(--muted); font-size: .95rem; max-width: 70ch; }
.md-stats { display: inline-block; margin-left: 4px; font-family: var(--mono); font-size: .78rem; color: var(--brand); }
.md-actions { display: flex; gap: 8px; align-items: flex-start; }
.md-output {
  margin: 0; padding: 22px 24px; background: var(--code-bg); color: #d9cfe6; font-size: 13px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; max-height: 78vh; overflow: auto; tab-size: 2;
}
.md-output .md-h { color: #f0abfc; font-weight: 600; }
.md-output .md-q { color: #9b8db0; font-style: italic; }
.md-output .md-t { color: #a5b4fc; }
.md-output .md-l { color: #e6dcf2; }
.md-output .md-c { color: #67e8f9; }
.md-output .md-b { color: #ffffff; font-weight: 600; }

/* ---------------------------------------------------------------- agents */
.agents { padding: 96px 0; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); border-top: 1px solid var(--border); }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.agent-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
}
.agent-top { display: flex; justify-content: space-between; align-items: center; }
.agent-icon {
  width: 52px; height: 52px; border-radius: 4px; display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, #c026d3, #7700b5 55%, #4f46e5);
}
.agent-card h3 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; }
.agent-card > p { color: var(--text-2); }
.term { border-radius: 4px; overflow: hidden; background: var(--code-bg); border: 1px solid rgba(255, 255, 255, .06); }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: rgba(255, 255, 255, .05); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { font-style: normal; font-family: var(--mono); font-size: .74rem; color: #9b8db0; margin-left: 8px; }
.term-copy { margin-left: auto; border: 0; background: rgba(255, 255, 255, .08); color: #d9cfe6; border-radius: 4px; padding: 3px 8px; cursor: pointer; }
.term-copy:hover { background: rgba(255, 255, 255, .16); }
.term pre { margin: 0; padding: 14px 16px; color: #e6dcf2; font-size: 13px; line-height: 1.6; overflow-x: auto; }
.t-dim { color: #8a7ca0; }
.t-acc { color: #f0abfc; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--text-2); font-size: .95rem; }
.ticks i { color: var(--m-y); margin-right: 8px; }
.ticks code { font-size: .82rem; color: var(--brand); }
.agent-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.skill-flow { display: grid; gap: 8px; }
.sf-step { display: flex; gap: 12px; align-items: center; font-size: .95rem; color: var(--text-2); }
.sf-step code { font-size: .82rem; color: var(--brand); }
.code-link { display: inline-flex; align-items: center; gap: 5px; border-bottom: 1px dashed currentColor; }
.code-link:hover { text-decoration: none; border-bottom-style: solid; }
.code-link i { font-size: .7em; }
.sf-n { flex: none; width: 26px; height: 26px; border-radius: 4px; display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: var(--brand); background: var(--brand-soft); }
@media (max-width: 900px) { .agent-grid { grid-template-columns: 1fr; } .agents { padding: 64px 0; } }

/* ---------------------------------------------------------------- footer */
.footer { background: #12051f; color: rgba(240, 228, 255, .75); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.brand-foot .logo { height: 34px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: rgba(240, 228, 255, .85); font-weight: 600; font-size: .92rem; }
.foot-links a i { color: #d8b4fe; }
.fine { font-size: .8rem; color: var(--muted); margin-top: 12px; }
.footer .fine { width: 100%; color: rgba(240, 228, 255, .5); }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1b0d2c; color: #fff; padding: 10px 16px; border-radius: 4px; font-weight: 700; font-size: .92rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .1);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 32px);
}
.toast i { color: #86efac; margin-right: 6px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ print */
@media print {
  .topbar, .toolbar, .sidebar, .highlights, .agents, .toast, .hero-cta, .link-btn { display: none !important; }
  .layout { display: block; }
  .feature { break-inside: avoid; box-shadow: none; }
  details.more ul { display: grid; }
}
