:root {
  --bg: #050505;
  --bg-elev: #0b0b0b;
  --bg-card: #101010;
  --line: #1c1c1c;
  --text: #f3f3f3;
  --muted: #8a8a8a;
  --dim: #5c5c5c;
  --green: #00ff88;
  --blue: #00aaff;
  --amber: #ffaa00;
  --red: #ff5555;
  --purple: #aa55ff;
  --radius: 10px;
  --max: 1120px;
  --sidebar: 280px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--green); }
img { max-width: 100%; }
code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(5,5,5,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .04em;
  font-family: ui-monospace, Menlo, monospace;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.nav {
  display: flex;
  gap: 18px;
  margin-left: 12px;
}
.nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav a:hover, .nav a.active { color: var(--green); }
.nav-download { display: none; }
.header-cta { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: ui-monospace, Menlo, monospace;
}
.btn-primary {
  background: linear-gradient(90deg, #00ff88, #00cc6a);
  color: #05140c;
}
.btn-primary:hover { filter: brightness(1.08); color: #05140c; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 56px;
  background: #050505;
  border-bottom: 1px solid var(--line);
}
.hero-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .45;
  will-change: transform, background-color;
}
.orb-a {
  width: 560px;
  height: 560px;
  top: -220px;
  right: -120px;
  background: #00ff88;
  animation: orbA 8s ease-in-out infinite alternate;
}
.orb-b {
  width: 460px;
  height: 460px;
  bottom: -200px;
  left: -140px;
  background: #00aaff;
  animation: orbB 9s ease-in-out infinite alternate;
}
.orb-c {
  width: 280px;
  height: 280px;
  top: 38%;
  left: 42%;
  background: #7b5cff;
  opacity: .35;
  animation: orbC 7s ease-in-out infinite alternate;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 40% 30%, #000 15%, transparent 72%);
  opacity: .5;
  animation: gridDrift 28s linear infinite;
}
.hero-content { position: relative; z-index: 1; }
.hero .kicker,
.hero h1,
.hero .lead,
.hero .search-stage,
.hero-suggest {
  animation: rise .75s ease both;
}
.hero h1 { animation-delay: .08s; }
.hero .lead { animation-delay: .16s; }
.hero .search-stage { animation-delay: .2s; }
.hero-suggest { animation-delay: .34s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes orbA {
  0% { transform: translate(0, 0) scale(1); background-color: #00ff88; }
  50% { transform: translate(-50px, 36px) scale(1.12); background-color: #00e5ff; }
  100% { transform: translate(-16px, 64px) scale(.94); background-color: #7b5cff; }
}
@keyframes orbB {
  0% { transform: translate(0, 0) scale(1); background-color: #00aaff; }
  50% { transform: translate(40px, -28px) scale(1.14); background-color: #00ff88; }
  100% { transform: translate(18px, 20px) scale(.96); background-color: #ff00aa; }
}
@keyframes orbC {
  0% { transform: translate(0, 0) scale(1); opacity: .28; background-color: #7b5cff; }
  100% { transform: translate(-70px, 40px) scale(1.25); opacity: .5; background-color: #00ff88; }
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: 52px 52px; }
}
@keyframes kickerGlow {
  0%, 100% { color: var(--green); text-shadow: 0 0 0 transparent; }
  50% { color: #7dffc2; text-shadow: 0 0 18px rgba(0,255,136,.35); }
}
.kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, monospace;
}
.hero .kicker { animation: rise .75s ease both, kickerGlow 4s ease-in-out 1s infinite; }
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  margin: 12px 0 16px;
  letter-spacing: -0.03em;
}
.hero p.lead { color: #cfcfcf; font-size: 18px; max-width: 640px; }
article .lead { font-size: 18px; color: #cfcfcf; }
.search-box {
  margin-top: 28px;
  display: flex;
  gap: 0;
  max-width: 640px;
}
.search-box input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: ui-monospace, Menlo, monospace;
}
.search-box input:focus { outline: 1px solid var(--green); }

.search-stage {
  position: relative;
  margin-top: 32px;
  max-width: 640px;
  padding: 22px 0 10px;
  isolation: isolate;
}
.search-aurora {
  position: absolute;
  left: -12%;
  right: -12%;
  top: -30px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #00ff88, #00e5ff, #4d7cff, #c44dff, #00ff88);
  filter: blur(28px);
  opacity: .9;
  animation: auroraSpin 5s linear infinite;
  z-index: 0;
}
.search-aurora-2 {
  top: -10px;
  height: 110px;
  filter: blur(22px);
  opacity: .7;
  animation: auroraSpin 7s linear infinite reverse;
  background: conic-gradient(from 180deg, #00aaff, #00ff88, #ff2bd6, #00aaff);
}
.search-stage .search-box {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding: 2px;
  border-radius: 14px;
  background: linear-gradient(90deg, #00ff88, #00e5ff, #4d7cff, #c44dff, #00ff88);
  background-size: 300% 100%;
  animation: borderShift 2.2s linear infinite;
  box-shadow:
    0 0 32px rgba(0,255,136,.28),
    0 0 64px rgba(0,170,255,.18);
}
.search-stage .search-box input {
  background: #070707;
  border: 0;
  border-radius: 12px 0 0 12px;
}
.search-stage .search-box .btn {
  border-radius: 0 12px 12px 0;
}
.search-stage .search-box input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0,255,136,.35);
}
@keyframes auroraSpin {
  to { transform: rotate(360deg); }
}
@keyframes borderShift {
  to { background-position: 300% 0; }
}
.hero-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.hero-suggest span {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, monospace;
  margin-right: 4px;
}
.hero-suggest a {
  color: #ddd;
  background: rgba(16,16,16,.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.hero-suggest a:hover {
  color: var(--green);
  border-color: #00ff8855;
  background: #0d1610;
}

/* Layout with sidebar */
.page {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  gap: 28px;
  padding: 36px 0 80px;
  align-items: start;
}
.page.solo { grid-template-columns: 1fr; max-width: 820px; }

article h1 { font-size: 34px; line-height: 1.15; margin: 8px 0 12px; }
article h2 { font-size: 22px; margin: 32px 0 10px; }
article h3 { font-size: 16px; margin: 22px 0 8px; color: #ddd; }
article p, article li { color: #d4d4d4; }
article ul { padding-left: 18px; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, monospace;
}
.badge-p { background: #ff555522; color: var(--red); }
.badge-c { background: #ffaa0022; color: var(--amber); }
.badge-b { background: #00aaff22; color: var(--blue); }
.badge-u { background: #aa55ff22; color: var(--purple); }
.badge-sev-high { background: #ff555522; color: var(--red); }
.badge-sev-medium { background: #ffaa0022; color: var(--amber); }
.badge-sev-low { background: #00ff8822; color: var(--green); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-card h3 { margin: 8px 0 6px; }
.feature-card p { color: var(--muted); margin: 0; font-size: 14px; }
.icon-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  display: inline-block;
}

/* Code cards */
.code-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.code-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: inherit;
}
.code-card:hover { border-color: #00ff8855; color: inherit; }
.code-card .code {
  color: var(--green);
  font-size: 20px;
  font-weight: 800;
}
.code-card .title { color: #ddd; font-size: 13px; margin-top: 4px; }
.code-card .why { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Sidebar CTA */
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.app-cta {
  background: linear-gradient(180deg, #101a14, #0b0b0b);
  border: 1px solid #00ff8833;
  border-radius: 12px;
  padding: 18px;
}
.cta-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: block;
}
.app-hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 16px;
  display: block;
}
.app-cta h3 { margin: 0 0 8px; font-size: 16px; }
.app-cta p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.app-cta .btn { width: 100%; }
.mini-list { list-style: none; padding: 0; margin: 0 0 14px; }
.mini-list li { color: #ccc; font-size: 13px; padding: 4px 0 4px 16px; position: relative; }
.mini-list li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.related a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: #ddd; font-size: 13px; }
.related a span { color: var(--green); font-family: ui-monospace, Menlo, monospace; margin-right: 6px; }

/* FAQ */
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0;
}
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Symptom cards + PID table */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.symptom-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: inherit;
}
.symptom-card:hover { border-color: #00ff8855; color: inherit; }
.symptom-card .tag {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--green);
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.symptom-card strong { display: block; color: var(--text); font-size: 16px; }
.symptom-card p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.pid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
}
.pid-table th, .pid-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
.pid-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, monospace;
}
.pid-table a { color: var(--text); font-weight: 700; }
.pid-table a:hover { color: var(--green); }
.pid-table .unit {
  color: var(--green);
  font-family: ui-monospace, Menlo, monospace;
  white-space: nowrap;
}

/* Guides list */
.guide-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.guide-row:hover { color: inherit; }
.guide-row .tag {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--green);
  letter-spacing: .08em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; }
.site-footer h4 { color: var(--text); margin: 0 0 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.site-footer a { color: var(--muted); display: block; padding: 3px 0; }
.legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }

/* Breadcrumb */
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green); }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: ui-monospace, Menlo, monospace;
}
.chip.active, .chip:hover { border-color: var(--green); color: var(--green); }

/* Mobile bottom CTA */
.mobile-cta {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(5,5,5,.94);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.notice {
  background: #0f1408;
  border: 1px solid #00ff8822;
  color: #cde;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}

@media (min-width: 961px) {
  .header-cta {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
  }
}

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-cta { display: flex; gap: 8px; }
  .mobile-cta .btn { flex: 1; }
  .grid-3, .code-grid, .footer-grid, .grid-2, .symptom-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(8,8,8,.98);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
  }
  .nav.open a {
    padding: 12px 4px;
    font-size: 15px;
  }
  .nav-download {
    display: flex;
    margin-top: 10px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #00ff88, #00cc6a);
    color: #05140c;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 800;
    letter-spacing: .06em;
  }
  .nav-download:hover { color: #05140c; filter: brightness(1.06); }
  body { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .hero-grid, .hero .kicker, .hero h1, .hero .lead,
  .hero .search-stage, .hero-suggest, .search-aurora,
  .search-stage .search-box, .menu-toggle span {
    animation: none !important;
  }
}
