:root {
  --bg-0: #05040c;
  --bg-1: #0b0820;
  --bg-2: #120b2e;
  --glass: rgba(18, 12, 42, 0.62);
  --glass-border: rgba(168, 85, 247, 0.28);
  --text: #eef2ff;
  --muted: #b7b4d6;
  --purple: #c084fc;
  --purple-2: #a855f7;
  --blue: #38bdf8;
  --blue-2: #6366f1;
  --cyan: #22d3ee;
  --pink: #f0abfc;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 22px;
  --shadow: 0 0 40px rgba(99, 102, 241, 0.18);
  --max: 1240px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(168, 85, 247, 0.28), transparent 55%),
    radial-gradient(800px 480px at 92% 0%, rgba(56, 189, 248, 0.2), transparent 50%),
    radial-gradient(700px 400px at 50% 120%, rgba(99, 102, 241, 0.16), transparent 55%),
    linear-gradient(180deg, #07051a 0%, #05040c 40%, #080616 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--purple); }
img { max-width: 100%; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus, .skip:focus-visible {
  left: 12px;
  z-index: 80;
  background: #1e1b4b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(18px);
  background: rgba(5, 4, 12, 0.72);
  border-bottom: 1px solid rgba(168, 85, 247, 0.22);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: max-content;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6d28d9, #0891b2);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.65), inset 0 0 8px rgba(255,255,255,0.25);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 13.5px; letter-spacing: 0.02em; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--muted);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 999px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: rgba(168, 85, 247, 0.16);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.search-wrap {
  position: relative;
  min-width: 180px;
}
.search-wrap input {
  width: 220px;
  max-width: 36vw;
  background: rgba(15, 10, 36, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px 8px 36px;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2), 0 0 18px rgba(56, 189, 248, 0.15);
}
.search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  pointer-events: none;
}
.search-results {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, 86vw);
  background: #0d0a22;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  max-height: 360px;
  overflow: auto;
  box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.search-results a:hover { background: rgba(99, 102, 241, 0.15); }
.search-results small { color: var(--muted); display: block; }

.menu-btn {
  min-height: 44px;
  min-width: 44px;
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

/* HERO */
.hero {
  padding: 64px 0 36px;
  text-align: center;
}
.kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}
h1 {
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.05;
  margin: 18px 0 12px;
  letter-spacing: -0.03em;
}
.grad {
  background: linear-gradient(90deg, #e9d5ff 0%, #c084fc 28%, #38bdf8 68%, #a5f3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(168, 85, 247, 0.25);
}
.lede {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  max-width: 760px;
  margin: 0 auto 28px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid transparent;
  font-weight: 650;
  cursor: pointer;
  color: #fff;
}
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #0891b2);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.45);
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(56, 189, 248, 0.4); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--text);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 40px 0 10px;
}
.stat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
}
.stat b { display: block; font-size: 26px; color: #fff; }
.stat span { color: var(--muted); font-size: 13px; }

/* CARDS */
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 16px;
}
.section-title h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.section-title p { margin: 0; color: var(--muted); }

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

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(28, 16, 68, 0.65), rgba(10, 8, 28, 0.75));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 210px;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25), 0 0 30px rgba(168, 85, 247, 0.18);
  color: inherit;
}
.card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28), transparent 70%);
  pointer-events: none;
}

.icon-3d {
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  perspective: 240px;
}
.icon-3d .face {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(99,102,241,0.35), rgba(6,182,212,0.18) 55%, rgba(168,85,247,0.28));
  border: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow:
    0 10px 0 rgba(12, 8, 32, 0.55),
    0 0 22px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
  transform: rotateX(18deg) rotateY(-16deg);
  transition: transform 0.25s ease;
}
.card:hover .icon-3d .face {
  transform: rotateX(8deg) rotateY(12deg) translateY(-3px);
}
.icon-3d svg { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(56,189,248,0.85)); }

.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card .meta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--ok);
  background: rgba(52, 211, 153, 0.08);
}
.badge.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

/* TOOL PAGE */
.crumb { color: var(--muted); font-size: 13px; padding-top: 26px; }
.crumb a { color: var(--muted); }
.tool-hero {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px 0 10px;
}
.tool-hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 8px; }
.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin: 18px 0 28px;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"],
input[type="datetime-local"], input[type="date"], textarea, select {
  width: 100%;
  background: rgba(7, 6, 18, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.32);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}
textarea { min-height: 160px; resize: vertical; font-family: ui-monospace, Consolas, monospace; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.out {
  margin-top: 14px;
  background: #070714;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
  min-height: 72px;
}
.note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}
.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.kpi div {
  background: rgba(15, 10, 40, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 10px;
}
.kpi b { display: block; font-size: 22px; }

.privacy-strip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
  color: #d1fae5;
  font-size: 14px;
  margin: 8px 0 18px;
}

footer {
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  margin-top: 48px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 20px;
}
footer h3 { color: var(--text); margin: 0 0 8px; font-size: 15px; }
footer a { color: var(--muted); display: block; padding: 3px 0; }
footer a:hover { color: var(--cyan); }

.prose { max-width: 760px; }
.prose h1 { font-size: 42px; }
.prose h2 { margin-top: 28px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 900px) {
  .stats, .foot-grid, .row { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #0b081c;
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    align-items: stretch;
  }
  .menu-btn { display: inline-flex; }
  .search-wrap { display: none; }
  .search-wrap.mobile-show { display: block; width: 100%; margin-top: 8px; }
}
@media (max-width: 640px) {
  .stats, .foot-grid { grid-template-columns: 1fr; }
  .tool-hero { grid-template-columns: 1fr; }
}

@media print {
  .nav, footer, .hero-actions { display: none !important; }
  body { background: #fff; color: #111; }
}

/* finish-pass: a11y + motion */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
.btn:focus-visible,
.menu-btn:focus-visible,
.nav-links a:focus-visible,
.card:focus-visible,
.search-wrap input:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .icon-3d, .icon-3d .face {
    transform: none !important;
  }
}
