/* =========================================================
   PENTEST FRAMEWORK — тёмный серебристый минимализм
   Монохром, стекло, кинематика.
   ========================================================= */

:root {
  --bg-obsidian: #080a0d;
  --bg-surface: #0c0f13;
  --bg-panel: #0f1318;
  --bg-card: #11151b;
  --bg-hover: #171c24;

  --silver-bright: #e6eaef;
  --silver-primary: #9aa4b2;
  --silver-muted: #5e6875;
  --steel-dark: #1a212c;

  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --border-active: rgba(255, 255, 255, 0.22);

  --accent: #ffffff;

  --link-grad-a: rgba(180, 192, 208, 0.45);
  --link-grad-b: rgba(180, 192, 208, 0.05);
  --root-grad-a: rgba(230, 234, 239, 0.95);
  --root-grad-b: rgba(180, 192, 208, 0.1);

  --node-hover-stroke: #ffffff;
  --node-hover-fill: rgba(255, 255, 255, 0.08);

  --font-display: 'Outfit', 'Geist Mono', 'Consolas', monospace;
  --mono-font: 'Geist Mono', 'JetBrains Mono', 'Consolas', monospace;

  --maxw: 1240px;
  --radius: 16px;
  --shadow-lift: 0 24px 60px rgba(0, 0, 0, 0.45);
  --glass: rgba(15, 19, 24, 0.6);
}

[data-theme="light"] {
  --bg-obsidian: #eceef1;
  --bg-surface: #f5f7f9;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e3e8ee;

  --silver-bright: #0e141d;
  --silver-primary: #333f50;
  --silver-muted: #64748b;
  --steel-dark: #c3ccd9;

  --border: rgba(15, 30, 55, 0.12);
  --border-soft: rgba(15, 30, 55, 0.07);
  --border-active: rgba(15, 30, 55, 0.32);

  --accent: #0e141d;

  --link-grad-a: rgba(40, 60, 90, 0.4);
  --link-grad-b: rgba(40, 60, 90, 0.06);
  --root-grad-a: rgba(20, 30, 45, 0.95);
  --root-grad-b: rgba(40, 60, 90, 0.1);

  --node-hover-stroke: #0e141d;
  --node-hover-fill: rgba(10, 20, 35, 0.06);

  --shadow-lift: 0 24px 60px rgba(20, 40, 70, 0.18);
  --glass: rgba(255, 255, 255, 0.62);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--mono-font);
  font-size: 12px;
  background-color: var(--bg-obsidian);
  color: var(--silver-primary);
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.02;
  mix-blend-mode: overlay;
}

main, section, header, footer, nav {
  position: relative;
  z-index: 2;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(154, 164, 178, 0.3);
  color: var(--silver-bright);
}

/* =========================================================
   NAV — плавающая стеклянная капсула
   ========================================================= */
.nav-shell {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 10px 12px 10px 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  transition: background-color 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.nav-shell.is-scrolled .nav-pill {
  background: rgba(8, 11, 15, 0.82);
  border-color: var(--border-active);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .nav-shell.is-scrolled .nav-pill {
  background: rgba(255, 255, 255, 0.85);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--silver-bright);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--silver-bright), var(--silver-muted));
  box-shadow: 0 0 10px rgba(200, 210, 224, 0.3);
  flex-shrink: 0;
}

.silver-text {
  color: var(--silver-muted);
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-link {
  font-size: 11px;
  color: var(--silver-muted);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.nav-link:hover {
  color: var(--silver-bright);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  padding: 7px 12px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--silver-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.lang-toggle:hover {
  color: var(--silver-bright);
  border-color: var(--silver-bright);
  background: var(--bg-hover);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: linear-gradient(180deg, #f0f3f7, var(--silver-bright));
  color: #0a0c0e;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(230, 234, 239, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #ffffff, #e8ecf1);
  box-shadow: 0 10px 34px rgba(230, 234, 239, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #1b2534, #0e141d);
  color: #f4f7fb;
  border-color: rgba(14, 20, 29, 0.6);
  box-shadow: 0 4px 20px rgba(15, 30, 55, 0.18);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(180deg, #26344a, #141c28);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  color: var(--silver-bright);
  border: 1px solid var(--border-active);
  backdrop-filter: blur(8px);
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--silver-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(154, 164, 178, 0.12);
}

.btn-silver {
  padding: 7px 16px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--silver-bright);
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-silver:hover {
  background: var(--silver-bright);
  color: #0a0c0e;
  transform: translateY(-1px);
}

[data-theme="light"] .btn-silver:hover {
  color: #fff;
  background: var(--silver-primary);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}

.theme-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--silver-bright), var(--silver-muted));
  box-shadow: 0 0 8px rgba(230, 234, 239, 0.25);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 140px 24px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 214, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 214, 230, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 42%, black 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 42%, black 25%, transparent 78%);
}

.hero-radial {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 42% at 50% 28%, rgba(180, 192, 208, 0.07), transparent 72%),
    radial-gradient(ellipse 45% 38% at 50% 80%, rgba(180, 192, 208, 0.04), transparent 72%);
}

.hero-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 1080px;
  width: 100%;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--silver-bright);
  max-width: 1040px;
  margin: 0 auto;
}

.hero-title-accent {
  color: var(--silver-muted);
  font-weight: 300;
}

.hero-sub {
  margin: 30px auto 0;
  max-width: 600px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--silver-muted);
}

.hero-num {
  color: var(--silver-bright);
  font-weight: 600;
  position: relative;
}

.hero-num::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: linear-gradient(90deg, var(--silver-primary), transparent);
  border-radius: 2px;
}

.hero-ctas {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  width: 24px;
  height: 52px;
  z-index: 3;
}

.hero-scroll-line {
  width: 1.5px;
  height: 52px;
  background: linear-gradient(180deg, transparent, var(--silver-muted) 30%);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--silver-bright), var(--silver-primary));
  animation: scrollLine 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* =========================================================
   STATS
   ========================================================= */
.stats {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

.stats-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 76px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 42px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}

.stat-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(180, 192, 208, 0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-cell:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
}

.stat-cell:hover::before {
  opacity: 1;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  background: linear-gradient(160deg, var(--silver-bright), var(--silver-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 12px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--silver-muted);
}

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee-shell {
  overflow: hidden;
  background: var(--bg-obsidian);
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}

.marquee-shell::before,
.marquee-shell::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.marquee-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-obsidian), transparent);
}

.marquee-shell::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-obsidian), transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 44s linear infinite;
  will-change: transform;
}

.marquee-shell:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track > span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 20px 26px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-muted);
  white-space: nowrap;
}

.marquee-track > span i {
  font-style: normal;
  color: var(--silver-primary);
  font-size: 8px;
}

@keyframes marqueeScroll {
  to { transform: translateX(-50%); }
}

/* =========================================================
   SECTIONS (общее)
   ========================================================= */
.map-section,
.categories,
.footer-shell {
  max-width: 100%;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  letter-spacing: -0.02em;
  color: var(--silver-bright);
  line-height: 1.1;
}

.section-title em {
  font-style: normal;
  color: var(--silver-muted);
  font-weight: 300;
}

.section-sub {
  margin-top: 16px;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--silver-muted);
}

/* =========================================================
   MAP
   ========================================================= */
.map-section {
  padding: 130px 0 150px;
}

.map-head,
.cat-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.map-controls {
  max-width: 920px;
  margin: 48px auto 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-ico {
  position: absolute;
  left: 16px;
  color: var(--silver-muted);
  pointer-events: none;
  z-index: 2;
}

#search {
  width: 100%;
  padding: 16px 56px 16px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--silver-bright);
  font-family: var(--mono-font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

#search::placeholder {
  color: var(--silver-muted);
  opacity: 0.75;
}

#search:focus {
  border-color: var(--border-active);
  background: var(--bg-panel);
  box-shadow: 0 0 0 4px rgba(180, 192, 208, 0.07), 0 8px 30px rgba(0, 0, 0, 0.25);
}

.search-shortcut {
  position: absolute;
  right: 48px;
  font-size: 11px;
  color: var(--silver-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 16px;
  pointer-events: none;
  background: var(--bg-card);
  font-family: var(--mono-font);
}

#search-clear {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--silver-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: none;
  z-index: 2;
  transition: color 0.2s, transform 0.2s;
}

#search-clear:hover {
  color: var(--silver-bright);
  transform: rotate(90deg);
}

.match-count {
  position: absolute;
  right: -132px;
  font-size: 10px;
  color: var(--silver-primary);
  white-space: nowrap;
  letter-spacing: 0.08em;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 11px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--silver-muted);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tag-filter:hover {
  color: var(--silver-bright);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.tag-filter.is-active {
  background: linear-gradient(180deg, #f0f3f7, var(--silver-bright));
  border-color: var(--silver-bright);
  color: #0a0c0e;
  box-shadow: 0 6px 20px rgba(230, 234, 239, 0.12);
}

[data-theme="light"] .tag-filter.is-active {
  background: linear-gradient(180deg, #1b2534, #0e141d);
  color: #fff;
  border-color: #0e141d;
}

.t-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  font-style: normal;
}

.tag-filter.is-active .t-ico { color: #0a0c0e; }
[data-theme="light"] .tag-filter.is-active .t-ico { color: #fff; }

.tag-free .t-ico { color: #9cc9a8; }
.tag-oss  .t-ico { color: #a3bcd4; }
.tag-paid .t-ico { color: #c9a3a3; }
.tag-reg  .t-ico { color: #b3a6c9; }
.tag-key  .t-ico { color: #c4b48d; }
.tag-dork .t-ico { color: #9cc4bc; }

.map-stage {
  position: relative;
  max-width: var(--maxw);
  height: 72vh;
  min-height: 540px;
  margin: 34px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(180, 192, 208, 0.04), transparent 70%),
    var(--bg-panel);
  overflow: hidden;
  cursor: grab;
  box-shadow: var(--shadow-lift);
  transition: border-color 0.3s;
}

.map-stage:hover {
  border-color: var(--border-active);
}

.map-stage:active {
  cursor: grabbing;
}

.map-stage:fullscreen,
.map-stage:-webkit-full-screen {
  max-width: 100%;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  cursor: grab;
  background: var(--bg-panel);
}

.map-stage:fullscreen .stage-hud,
.map-stage:-webkit-full-screen .stage-hud {
  border-radius: 0;
}

#tree {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

#viewport {
  will-change: transform;
  contain: layout style;
}

.stage-hud {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 70%, rgba(6, 8, 11, 0.5)),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(6, 8, 11, 0.55) 100%);
  border-radius: var(--radius);
}

[data-theme="light"] .stage-hud {
  background:
    linear-gradient(180deg, transparent 70%, rgba(238, 241, 245, 0.5)),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(238, 241, 245, 0.55) 100%);
}

.map-legend {
  max-width: var(--maxw);
  margin: 20px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
}

.tag-badge {
  font-size: 10px;
  color: var(--silver-primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

/* =========================================================
   CATEGORIES / BENTO
   ========================================================= */
.categories {
  padding: 150px 0;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

.bento {
  max-width: var(--maxw);
  margin: 56px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 14px;
}

.bento-card {
  background: var(--bg-card);
  min-height: 150px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.35s;
}

.bento-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 115%, rgba(180, 192, 208, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}

.bento-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-active);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

.bento-card:hover::after {
  opacity: 1;
}

.bento-card--7 { grid-column: span 7; }
.bento-card--6 { grid-column: span 6; }
.bento-card--5 { grid-column: span 5; }
.bento-card--4 { grid-column: span 4; }
.bento-card--3 { grid-column: span 3; }
.bento-card--tall { min-height: 220px; }

.bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bento-idx {
  font-size: 10px;
  color: var(--silver-muted);
  letter-spacing: 0.08em;
}

.bento-count {
  font-size: 10px;
  color: var(--silver-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  transition: color 0.3s, border-color 0.3s;
}

.bento-card:hover .bento-count {
  color: var(--silver-bright);
  border-color: var(--border-active);
}

.bento-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  color: var(--silver-bright);
  line-height: 1.2;
  margin-top: 14px;
  letter-spacing: -0.01em;
}

.bento-card--7 .bento-name,
.bento-card--6 .bento-name {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
}

.bento-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.bento-arrow {
  font-size: 15px;
  color: var(--silver-muted);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.35s, transform 0.35s, color 0.35s;
}

.bento-card:hover .bento-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--silver-bright);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer-shell {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}

.footer-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 50% at 50% 0%, rgba(180, 192, 208, 0.05), transparent 70%);
  pointer-events: none;
}

.footer-cta {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 150px 24px 110px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  color: var(--silver-bright);
  line-height: 1.05;
}

.footer-title em {
  font-style: normal;
  color: var(--silver-muted);
  font-weight: 300;
}

.footer-sub {
  margin: 22px auto 0;
  max-width: 460px;
  font-size: 13px;
  color: var(--silver-muted);
  line-height: 1.8;
}

.footer-btn {
  margin-top: 44px;
}

.footer-base {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 10px;
  color: var(--silver-muted);
  position: relative;
  z-index: 2;
}

/* =========================================================
   D3 TREE
   ========================================================= */
.node circle {
  fill: var(--bg-obsidian);
  stroke: var(--silver-muted);
  stroke-width: 1.5px;
  transition: r 0.18s ease, fill 0.18s ease, stroke 0.18s ease;
  cursor: pointer;
}

.node--internal circle {
  fill: var(--bg-obsidian);
  stroke: var(--silver-primary);
  stroke-width: 2px;
  r: 5px;
}

.node--collapsed circle {
  stroke: var(--silver-bright);
  stroke-width: 2px;
  r: 6px;
  stroke-dasharray: 2 2;
  filter: drop-shadow(0 0 4px rgba(200, 210, 224, 0.3));
}

.node--leaf circle {
  fill: var(--bg-obsidian);
  stroke: var(--silver-muted);
  stroke-width: 1.5px;
  r: 3px;
}

.node--root circle {
  fill: url(#rootGrad);
  stroke: var(--silver-bright);
  stroke-width: 2px;
  r: 7px;
  filter: drop-shadow(0 0 8px rgba(200, 210, 224, 0.35));
}

.node--root text {
  font-size: 13px;
  font-weight: 600;
  fill: var(--silver-bright);
}

.node:hover circle {
  fill: var(--node-hover-fill);
  stroke: var(--node-hover-stroke);
  stroke-width: 2px;
  r: 6.5px;
}

.node:focus circle {
  fill: var(--node-hover-fill);
  stroke: var(--node-hover-stroke);
  stroke-width: 2.5px;
  r: 7px;
  outline: none;
}

.node:focus text {
  fill: var(--silver-bright);
  font-weight: 600;
}

.node--matched circle {
  stroke: var(--node-hover-stroke);
  stroke-width: 2px;
  r: 6px;
  fill: var(--node-hover-fill);
}

.node text {
  font-family: var(--mono-font);
  font-size: 10.5px;
  fill: var(--silver-primary);
  user-select: none;
  paint-order: stroke fill;
  stroke: var(--bg-obsidian);
  stroke-width: 3px;
  stroke-linejoin: round;
  transition: fill 0.18s;
  cursor: pointer;
}

.node--leaf text {
  font-size: 12px;
  fill: var(--silver-muted);
}

.node--leaf:hover text {
  fill: var(--silver-bright);
}

.node--matched text {
  fill: var(--silver-bright) !important;
  font-weight: 600;
}

.node text tspan.badge {
  font-size: 8.5px;
  font-weight: 600;
  stroke: none;
  paint-order: normal;
}

.node text tspan.badge.tag-free { fill: #9cc9a8; }
.node text tspan.badge.tag-oss  { fill: #a3bcd4; }
.node text tspan.badge.tag-paid { fill: #c9a3a3; }
.node text tspan.badge.tag-reg  { fill: #b3a6c9; }
.node text tspan.badge.tag-key  { fill: #c4b48d; }
.node text tspan.badge.tag-dork { fill: #9cc4bc; }

.link {
  fill: none;
  stroke: url(#linkGrad);
  stroke-width: 1.4px;
  shape-rendering: auto;
  opacity: 0.85;
}

.link--highlighted {
  stroke: var(--silver-bright);
  stroke-width: 2px;
  stroke-dasharray: 4 3;
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(200, 210, 224, 0.4));
  animation: linePulse 1.1s linear infinite;
}

@keyframes linePulse {
  to { stroke-dashoffset: -7; }
}

.floating-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  z-index: 6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.floating-controls button {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  color: var(--silver-primary);
  font-family: var(--mono-font);
  font-size: 14px;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}

.floating-controls button:hover {
  background: var(--bg-hover);
  color: var(--silver-bright);
}

.ctrl-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 5px;
}

/* =========================================================
   TOOLTIP
   ========================================================= */
.silver-tooltip {
  position: absolute;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--border-active);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
  z-index: 200;
  max-width: 340px;
  border-top: 2px solid var(--silver-primary);
}

.silver-tooltip[hidden] {
  display: none;
}

.tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.tt-title {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--silver-bright);
}

.tt-badge {
  font-size: 8.5px;
  color: var(--silver-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.1em;
}

.tt-desc {
  font-size: 11px;
  color: var(--silver-muted);
  line-height: 1.6;
}

.tt-url {
  font-size: 10px;
  color: var(--silver-primary);
  margin-top: 8px;
  word-break: break-all;
}

/* =========================================================
   REVEAL (GSAP начальное состояние)
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .match-count { position: static; margin-left: 8px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .map-stage { height: 62vh; min-height: 440px; }
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento-card--7, .bento-card--6, .bento-card--5, .bento-card--4, .bento-card--3 { grid-column: span 6; }
  .footer-base { flex-direction: column; text-align: center; }
  .map-section { padding: 90px 0 110px; }
  .categories { padding: 110px 0; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .map-stage { height: 56vh; }
  .hero-title { font-size: clamp(2.4rem, 10vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .link--highlighted { animation: none; }
  .hero-scroll-line::after { animation: none; }
  .marquee-track { animation: none; }
}
