/* ============================================================
   Graphify — shared stylesheet
============================================================ */
:root {
  --blue: #3b5bfd;
  --blue-dark: #2745e0;
  --blue-soft: #e3e9ff;
  --navy: #131b33;
  --ink: #1a2340;
  --muted: #5b6478;
  --bg: #f5f7fc;
  --bg-alt: #eef1f9;
  --card: #ffffff;
  --border: #e3e7f2;
  --radius: 14px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}
body.fine-pointer { cursor: none; }
body.fine-pointer a, body.fine-pointer button { cursor: none; }

::selection { background: var(--blue); color: #fff; }

/* ---------- Custom cursor ---------- */
#cursor, #cursor-ring { display: none; }
body.fine-pointer #cursor {
  display: block; position: fixed; width: 8px; height: 8px; background: var(--blue);
  z-index: 10000; pointer-events: none; transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .15s;
}
body.fine-pointer #cursor-ring {
  display: block; position: fixed; width: 34px; height: 34px; border: 1.5px solid rgba(59,91,253,.55);
  z-index: 9999; pointer-events: none; transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease, border-color .2s, border-radius .2s;
  border-radius: 2px;
}
body.cursor-hover #cursor { width: 14px; height: 14px; background: var(--navy); }
body.cursor-hover #cursor-ring { width: 52px; height: 52px; border-color: rgba(19,27,51,.5); border-radius: 10px; }

/* ---------- Nav ---------- */
nav.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 48px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, padding .3s;
}
nav.site-nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 8px 30px rgba(19,27,51,.06); padding: 10px 48px; }
.nav-left { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 30px; height: 30px; }
.logo-name { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.nav-links { display: flex; align-items: center; gap: 30px; flex-wrap: nowrap; }
@media (max-width: 1140px) and (min-width: 901px) { .nav-links { gap: 20px; } }
.nav-links a:not(.btn) {
  text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--blue); transform: scaleX(0); transform-origin: right;
  transition: transform .3s cubic-bezier(.65,.05,.36,1);
}
.nav-links a:not(.btn):hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--blue); }
.nav-links a.btn, .nav-links a.btn:hover { color: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;                 /* never shrink below its own text */
  white-space: nowrap;
  background: linear-gradient(180deg, #4a67fd 0%, var(--blue) 55%, var(--blue-dark) 100%);
  color: #fff; border: none;
  padding: 12px 24px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .1px; line-height: 1;
  font-family: var(--font); text-decoration: none;
  position: relative; isolation: isolate; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
              0 6px 16px -6px rgba(59,91,253,.55);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 12px 26px -8px rgba(59,91,253,.65); }
.btn:active { transform: translateY(0); transition-duration: .08s; }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

/* sheen that sweeps across on hover (reuses the existing .btn-fill span) */
.btn .btn-fill {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%);
  transform: translateX(-110%);
  transition: transform .6s cubic-bezier(.4,.1,.2,1);
}
.btn:hover .btn-fill { transform: translateX(110%); }

.btn .btn-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; }
.btn .btn-label::after {
  content: "→"; font-size: 15px; line-height: 1;
  transform: translateX(0); opacity: .85;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), opacity .25s;
}
.btn:hover .btn-label::after { transform: translateX(4px); opacity: 1; }
@media (max-width: 900px) { .nav-links a:not(.btn) { display: none; } nav.site-nav { padding: 14px 22px; } }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  position: relative; padding: 170px 48px 80px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #f7f9fe 0%, #f0f3fb 100%);
  border-bottom: 1px solid var(--border);
}
.page-hero .crumb {
  font-family: var(--mono); font-size: 13px; color: #97a0b8; letter-spacing: 1px;
  margin-bottom: 20px; display: block;
}
.page-hero .crumb b { color: var(--blue); font-weight: 500; }
.page-hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -1.2px; color: var(--navy); margin-bottom: 18px; }
.page-hero p { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0 auto; line-height: 1.7; }
.page-hero .hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-hero > :not(.hero-canvas) { position: relative; z-index: 1; }
@media (max-width: 820px) { .page-hero { padding: 140px 22px 60px; } }

/* ---------- Landing hero ---------- */
header.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 140px 24px 100px;
  background: linear-gradient(180deg, #f7f9fe 0%, #f0f3fb 100%);
  overflow: hidden;
}
#graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; max-width: 900px; pointer-events: none; }
.hero-inner a, .hero-inner .terminal, .hero-inner .badge, .hero-inner .hero-hint { pointer-events: auto; }

.badge {
  display: inline-block; background: #e6ebff; color: var(--blue);
  font-size: 12.5px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase;
  padding: 9px 22px; border-radius: 100px; margin-bottom: 34px;
  border: 1px solid rgba(59,91,253,.18);
  animation: badge-pulse 3.2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,91,253,.22); }
  50% { box-shadow: 0 0 0 12px rgba(59,91,253,0); }
}

h1.hero-title {
  font-size: clamp(42px, 6.6vw, 76px); font-weight: 800; line-height: 1.08;
  letter-spacing: -1.5px; margin-bottom: 30px; color: var(--navy);
}
h1 .scramble { display: inline-block; }
h1 .accent { color: var(--blue); }

.hero-sub {
  font-size: clamp(16px, 2vw, 20px); color: var(--muted); line-height: 1.65;
  max-width: 760px; margin: 0 auto 52px;
  opacity: 0; animation: fade-up .8s ease .9s forwards;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Terminal / install box ---------- */
.terminal {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: min(620px, 100%); margin-left: auto; margin-right: auto;
  text-align: left;
  border: 2px solid transparent; border-radius: 14px; padding: 11px 11px 11px 22px;
  background:
    linear-gradient(#10162b, #10162b) padding-box,
    conic-gradient(from var(--ang, 0deg),
      rgba(124,147,255,.25) 0%, rgba(124,147,255,.25) 68%,
      #7c93ff 80%, #3b5bfd 86%,
      rgba(124,147,255,.25) 94%, rgba(124,147,255,.25) 100%) border-box;
  font-family: var(--mono); font-size: 15px; color: #e8ecff;
  box-shadow: 0 24px 60px -18px rgba(16,22,43,.55);
  transition: transform .2s;
  animation: spin-border 4s linear infinite;
}
.hero .terminal {
  opacity: 0;
  animation: fade-up .8s ease 1.15s forwards, spin-border 4s linear infinite;
}
.terminal:hover { transform: translateY(-3px); }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin-border { to { --ang: 360deg; } }

.t-prompt { flex: 0 0 auto; color: #5b6b9e; user-select: none; }

/* scroll port — long commands scroll horizontally instead of wrapping */
.t-scroll {
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  padding: 6px 0;
  scrollbar-width: none; -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}
.t-scroll::-webkit-scrollbar { display: none; }
.t-cmd { display: inline-block; white-space: pre; }

/* soft fade-out at the clipped edge(s), like a real terminal overflow */
.terminal[data-fade="right"] .t-scroll {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 54px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 calc(100% - 54px), transparent 100%);
}
.terminal[data-fade="left"] .t-scroll {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38px);
          mask-image: linear-gradient(90deg, transparent 0, #000 38px);
}
.terminal[data-fade="both"] .t-scroll {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38px, #000 calc(100% - 54px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 38px, #000 calc(100% - 54px), transparent 100%);
}

/* icon copy button */
.t-copy {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border: none; border-radius: 10px; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.09); color: #cfd8ff;
  transition: background .2s, color .2s, transform .12s;
}
body.fine-pointer .t-copy { cursor: none; }
.t-copy:hover { background: rgba(255,255,255,.18); color: #fff; }
.t-copy:active { transform: scale(.9); }
.t-copy:focus-visible { outline: 2px solid #7c93ff; outline-offset: 2px; }
.t-copy.copied { background: #16a34a; color: #fff; }
.t-copy svg { width: 17px; height: 17px; display: block; }

@media (max-width: 520px) {
  .terminal { font-size: 13.5px; padding-left: 16px; gap: 8px; }
  .t-copy { width: 34px; height: 34px; }
}

/* legacy text copy button (skill cards) */
.copy-btn {
  background: var(--blue); color: #fff; border: none; font-family: var(--font);
  font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 8px;
  cursor: pointer; position: relative; transition: background .2s, transform .15s;
}
body.fine-pointer .copy-btn { cursor: none; }
.copy-btn:hover { background: var(--blue-dark); transform: scale(1.05); }
.copy-btn:active { transform: scale(.96); }
.copy-btn.copied { background: #16a34a; }

.hero-hint {
  margin-top: 40px; font-size: 13px; color: #97a0b8; letter-spacing: .4px;
  opacity: 0; animation: fade-up .8s ease 1.5s forwards;
}
body.hero-settled .hero-sub, body.hero-settled .hero .terminal, body.hero-settled .hero-hint { opacity: 1; }
.hero-hint kbd {
  background: #fff; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 7px; font-family: var(--mono); font-size: 12px; color: var(--muted);
}

.scroll-down {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid #b9c2dc; border-radius: 14px; z-index: 2;
}
.scroll-down::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 4px; height: 8px;
  background: var(--blue); border-radius: 2px; transform: translateX(-50%);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 1; top: 7px; } 70% { opacity: 0; top: 22px; } 100% { opacity: 0; top: 7px; } }

/* ---------- Smooth word-by-word headline reveal ---------- */
.scramble .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  filter: blur(10px);
  transition: opacity .9s cubic-bezier(.2,.65,.3,1),
              transform .9s cubic-bezier(.2,.65,.3,1),
              filter .9s ease;
  will-change: opacity, transform, filter;
}
.scramble .w.in { opacity: 1; transform: translateY(0); filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .scramble .w { opacity: 1; transform: none; filter: none; transition: none; } }

/* ---------- Sections ---------- */
section { padding: 110px 48px; position: relative; }
@media (max-width: 820px) { section { padding: 80px 22px; } }
.container { max-width: 1180px; margin: 0 auto; }
.tag {
  display: inline-block; background: #e6ebff; color: var(--blue);
  font-size: 11.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 8px 18px; border-radius: 100px; margin-bottom: 22px;
}
h2.section-title {
  font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -1px;
  color: var(--navy); line-height: 1.15; margin-bottom: 16px;
}
.section-desc { font-size: 17px; color: var(--muted); line-height: 1.7; max-width: 560px; }
.center { text-align: center; }
.center .section-desc { margin: 0 auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.65,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .12s; } .reveal-d2 { transition-delay: .24s; } .reveal-d3 { transition-delay: .36s; }

/* ---------- Stats strip ---------- */
.stats-strip { background: var(--navy); padding: 0; position: relative; overflow: hidden; }
#pixel-wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .35; image-rendering: pixelated; }
.stats-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1180px; margin: 0 auto; padding: 64px 48px;
}
@media (max-width: 820px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 0; padding: 48px 22px; } }
.stat { text-align: center; color: #fff; }
.stat .num { font-size: clamp(34px, 4vw, 52px); font-weight: 800; font-family: var(--mono); letter-spacing: -1px; }
.stat .num .plus { color: #7c93ff; }
.stat .lbl { margin-top: 6px; font-size: 13.5px; color: #93a0c8; letter-spacing: 1.4px; text-transform: uppercase; }

/* ---------- Cards ---------- */
.two-col-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 52px; }
@media (max-width: 820px) { .two-col-head { grid-template-columns: 1fr; gap: 18px; } }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .cards-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 38px; position: relative; overflow: hidden;
  transition: box-shadow .3s, border-color .3s;
  transform-style: preserve-3d; will-change: transform;
}
.card:hover { box-shadow: 0 24px 55px -18px rgba(19,27,51,.18); border-color: #c9d4f5; }
.card .pixel-noise {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  image-rendering: pixelated; opacity: 0; transition: opacity .35s;
}
.card:hover .pixel-noise { opacity: .5; }
.card-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--blue); margin-bottom: 16px; }
.card h3 { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 12px; letter-spacing: -.4px; }
.card p { font-size: 15.5px; color: var(--muted); line-height: 1.65; margin-bottom: 22px; }
.card .link, a.link {
  color: var(--blue); font-weight: 600; font-size: 15px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.link .arr { transition: transform .25s; display: inline-block; }
.link:hover .arr { transform: translateX(6px); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 56px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 30px; position: relative; overflow: hidden;
}
.step .step-num {
  position: absolute; top: 18px; right: 22px; font-family: var(--mono);
  font-size: 60px; font-weight: 700; color: #eef1fb; z-index: 0; line-height: 1;
}
.step h3, .step p, .step .pix-icon { position: relative; z-index: 1; }
.step h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 22px 0 10px; }
.step p { font-size: 15px; color: var(--muted); line-height: 1.65; }
.pix-icon { width: 56px; height: 56px; image-rendering: pixelated; }

/* ---------- Marquee ---------- */
.marquee-wrap {
  overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: #fff; padding: 22px 0; position: relative;
}
.marquee { display: flex; gap: 64px; width: max-content; animation: marquee 30s linear infinite; }
.marquee-wrap:hover .marquee { animation-play-state: paused; }
.marquee span {
  font-family: var(--mono); font-size: 15px; color: #9aa3bd; white-space: nowrap;
  display: flex; align-items: center; gap: 12px;
}
.marquee span::before { content: "◆"; color: var(--blue); font-size: 9px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Terminal demo ---------- */
.demo-section { background: var(--bg-alt); }
.demo-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: center; }
@media (max-width: 960px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-terminal {
  background: #0d1226; border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px -22px rgba(13,18,38,.55);
  font-family: var(--mono); font-size: 14px;
}
.demo-bar { display: flex; align-items: center; gap: 8px; background: #171f3d; padding: 12px 16px; }
.demo-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.demo-bar i:nth-child(1) { background: #ff5f57; } .demo-bar i:nth-child(2) { background: #febc2e; } .demo-bar i:nth-child(3) { background: #28c840; }
.demo-bar b { margin-left: 10px; color: #8ea0d4; font-weight: 500; font-size: 12.5px; }
.demo-body { padding: 22px 24px; min-height: 320px; color: #cdd6f4; line-height: 1.8; }
.demo-body .p { color: #7c93ff; }
.demo-body .ok { color: #4ade80; }
.demo-body .dim { color: #5b6b9e; }
.demo-body .warn { color: #fbbf24; }

.feature-list { list-style: none; margin-top: 34px; display: grid; gap: 18px; }
.feature-list li { display: flex; gap: 14px; font-size: 15.5px; color: var(--ink); line-height: 1.6; }
.feature-list li b { font-weight: 600; }
.feature-list .dot {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px;
  background: var(--blue); color: #fff; border-radius: 6px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

/* ---------- Skills grid ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 54px; }
@media (max-width: 960px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .25s, box-shadow .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -16px rgba(19,27,51,.16); border-color: #c9d4f5; }
.skill-card .ico {
  width: 42px; height: 42px; border-radius: 10px; background: var(--blue-soft);
  display: grid; place-items: center; margin-bottom: 16px; font-size: 19px;
}
.skill-card h4 { font-size: 16.5px; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.skill-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.skill-card .install {
  margin-top: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--blue);
  background: var(--blue-soft); border-radius: 7px; padding: 8px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.skill-card .install button {
  background: none; border: none; color: var(--blue); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
body.fine-pointer .skill-card .install button { cursor: none; }
.skill-card .cat {
  position: absolute; top: 20px; right: 20px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: #97a0b8;
}

/* ---------- Directory (guides / mcp) ---------- */
.dir-section { padding-top: 60px; }
.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 38px;
}
.search-box {
  flex: 1 1 260px; max-width: 380px; position: relative;
}
.search-box input {
  width: 100%; padding: 13px 18px 13px 44px; border: 1px solid var(--border);
  border-radius: 10px; font-family: var(--font); font-size: 15px; color: var(--ink);
  background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59,91,253,.12); }
.search-box::before {
  content: "⌕"; position: absolute; left: 15px; top: 50%; transform: translateY(-58%);
  font-size: 20px; color: #97a0b8;
}
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 100px; cursor: pointer;
  transition: all .2s;
}
body.fine-pointer .chip { cursor: none; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.result-count { margin-left: auto; font-size: 13.5px; color: #97a0b8; font-family: var(--mono); }

.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1000px) { .dir-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .dir-grid { grid-template-columns: 1fr; } }
.dir-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s, opacity .3s;
}
.dir-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -16px rgba(19,27,51,.16); border-color: #c9d4f5; }
.dir-card.hidden-card { display: none; }
.dir-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dir-card .avatar {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  image-rendering: pixelated;
}
.dir-card h4 { font-size: 16.5px; font-weight: 700; color: var(--navy); }
.dir-card .sub { font-size: 12px; color: #97a0b8; font-family: var(--mono); }
.dir-card p { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.dir-card .tags { display: flex; flex-wrap: wrap; gap: 7px; }
.dir-card .tags i {
  font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: var(--bg-alt); border-radius: 5px; padding: 4px 9px;
}
.dir-card .tags i.hl { color: var(--blue); background: var(--blue-soft); }
.dir-card .meta {
  display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border); font-size: 12.5px; color: #97a0b8;
  font-family: var(--mono);
}
.dir-card .meta b { color: var(--ink); font-weight: 600; }

/* ---------- Repo cards ---------- */
.repo-list { display: grid; gap: 18px; }
.repo-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 30px; display: grid; grid-template-columns: 1.4fr 1fr 220px; gap: 30px;
  align-items: center; transition: box-shadow .25s, border-color .25s;
}
.repo-card:hover { box-shadow: 0 18px 40px -16px rgba(19,27,51,.14); border-color: #c9d4f5; }
@media (max-width: 960px) { .repo-card { grid-template-columns: 1fr; gap: 18px; } }
.repo-card h4 { font-family: var(--mono); font-size: 16px; color: var(--navy); margin-bottom: 6px; }
.repo-card h4 .org { color: #97a0b8; font-weight: 400; }
.repo-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.repo-stats { display: flex; gap: 26px; font-family: var(--mono); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.repo-stats b { display: block; font-size: 18px; color: var(--navy); font-weight: 700; }
.lang-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; margin-bottom: 8px; }
.lang-bar i { display: block; height: 100%; }
.lang-legend { display: flex; gap: 14px; font-size: 11.5px; color: #97a0b8; flex-wrap: wrap; }
.lang-legend s { text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.lang-legend s::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--dot, #ccc); display: inline-block; }

/* ---------- Compare table ---------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table.compare { width: 100%; border-collapse: collapse; min-width: 720px; }
table.compare th, table.compare td { padding: 18px 22px; text-align: left; font-size: 14.5px; vertical-align: top; }
table.compare thead th {
  background: var(--navy); color: #fff; font-size: 15px; position: sticky; top: 0;
}
table.compare thead th:first-child { width: 220px; }
table.compare tbody th {
  font-weight: 600; color: var(--navy); background: var(--bg-alt); font-size: 13.5px;
  white-space: nowrap;
}
table.compare tbody tr { border-top: 1px solid var(--border); }
table.compare tbody tr.diff td { background: #fffbe9; }
table.compare td { color: var(--muted); line-height: 1.6; }
table.compare td .ev { display: block; margin-top: 6px; font-size: 12px; color: var(--blue); font-family: var(--mono); }
table.compare td.unknown { color: #b45309; font-style: italic; }
.compare-controls { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- CTA ---------- */
.cta { background: var(--navy); text-align: center; overflow: hidden; position: relative; }
.cta-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.cta .container { position: relative; z-index: 1; }
.cta h2 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); font-weight: 800; letter-spacing: -1px; margin-bottom: 18px; }
.cta p { color: #93a0c8; font-size: 17px; max-width: 540px; margin: 0 auto 42px; line-height: 1.7; }
.cta .terminal { animation: none; opacity: 1; }

/* ---------- Footer ---------- */
footer { background: #0d1226; color: #8b96b8; padding: 60px 48px 40px; }
.footer-grid { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 19px; text-decoration: none; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { color: #8b96b8; text-decoration: none; font-size: 14px; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { max-width: 1180px; margin: 36px auto 0; padding-top: 24px; border-top: 1px solid #1d2748; font-size: 13px; color: #5b6b9e; }

/* pixel burst particles */
.pixel-bit { position: fixed; width: 7px; height: 7px; z-index: 15000; pointer-events: none; }

/* below-fold rendering optimization */
.cv-auto { content-visibility: auto; contain-intrinsic-size: auto 700px; }

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