:root {
  --primary: #101010;
  --secondary: #191919;
  --panel: rgba(16, 16, 16, 0.62);
  --panel-strong: rgba(18, 18, 22, 0.88);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #9147ff;
  --accent-hover: #772ce8;
  --accent-hot: #ff47a6;
  --ok: #7cffc4;
  --radius: 20px;
  --blur: blur(14px);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: radial-gradient(circle at 22% 12%, rgba(145, 71, 255, 0.16), transparent 32%),
    radial-gradient(circle at 82% 4%, rgba(255, 71, 166, 0.13), transparent 28%),
    var(--primary);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a { color: inherit; }

img {
  max-width: 100%;
  height: auto;
}

.glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
  z-index: -1;
}

.glow-one { left: -80px; top: 90px; background: var(--accent); }
.glow-two { right: -120px; top: 45vh; background: var(--accent-hot); }

.glass-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  background: rgba(16, 16, 16, 0.72);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  backdrop-filter: var(--blur);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.nav-link {
  padding: 0.55rem 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(145, 71, 255, 0.22);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: white;
}

.hero,
.page-hero,
.section-shell,
.article-shell,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.7fr);
  gap: 3rem;
  align-items: center;
  padding: 5.5rem 0 3rem;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1,
.page-hero h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy h1 span,
.page-hero h1 {
  background: linear-gradient(45deg, #fff, #b993ff 50%, #ff8ccc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy p,
.page-hero p {
  max-width: 740px;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--ok);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.cta-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}

.cta-button {
  background: linear-gradient(45deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 12px 36px rgba(145, 71, 255, 0.36);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.cta-button:hover,
.ghost-button:hover,
.guide-card:hover {
  transform: translateY(-3px);
}

.cta-button:active,
.ghost-button:active,
.guide-card:active {
  transform: translateY(1px);
}

.motion-lab {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 26px;
  background: #050506;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform 220ms ease, border-color 220ms ease;
}

.motion-lab:hover {
  border-color: rgba(145, 71, 255, 0.44);
  transform: perspective(1200px) rotateX(1.5deg) rotateY(-2deg) translateY(-2px);
}

.motion-lab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(145,71,255,.18), transparent 38%),
    linear-gradient(315deg, rgba(255,71,166,.13), transparent 42%);
  pointer-events: none;
  z-index: 1;
}

.motion-lab::after {
  content: "";
  position: absolute;
  inset: 48px 0 0;
  z-index: 1;
  background-image: linear-gradient(rgba(145,71,255,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145,71,255,.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 52% 50%, black, transparent 70%);
  pointer-events: none;
}

.lab-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 48px;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.11);
  background: rgba(255,255,255,0.035);
  color: rgba(255,255,255,0.54);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}

.lab-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.24);
}

.lab-toolbar span:first-child { background: #ff6a9f; }
.lab-toolbar span:nth-child(2) { background: #ffc66a; }
.lab-toolbar span:nth-child(3) { background: #7cffc4; }

.warp-canvas {
  position: absolute;
  inset: 48px 0 0;
  width: 100%;
  height: calc(100% - 48px);
  z-index: 0;
}

.lab-node,
.lab-status {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(8,8,10,0.76);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.lab-node {
  min-width: 118px;
  min-height: 92px;
  padding: 1rem;
  border-radius: 20px;
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  animation: lab-float 7s ease-in-out infinite;
}

.lab-node img {
  width: 46px;
  height: 46px;
  margin-bottom: 0.55rem;
  border-radius: 14px;
  filter: drop-shadow(0 16px 32px rgba(145,71,255,.5));
}

.node-client {
  left: 34px;
  bottom: 52px;
}

.node-proxy {
  right: 44px;
  top: 118px;
  color: #d9caff;
  animation-delay: -1.7s;
}

.node-dns {
  right: 116px;
  bottom: 84px;
  color: #b7ffdf;
  animation-delay: -3.2s;
}

.lab-status {
  left: 28px;
  top: 68px;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: rgba(255,255,255,0.68);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

@keyframes lab-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -13px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .lab-node {
    animation: none;
  }
}

.page-hero {
  padding: 5rem 0 2.4rem;
}

.page-hero h1 {
  font-size: clamp(2.35rem, 6vw, 5.2rem);
}

.section-shell {
  padding: 4rem 0;
}

.compact-section {
  padding-top: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.4rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.setup-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: setup;
}

.setup-step {
  position: relative;
  min-height: 250px;
  padding: 1.35rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025));
  backdrop-filter: var(--blur);
}

.setup-step::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 28%;
  height: 120px;
  background: radial-gradient(circle, rgba(145,71,255,.24), transparent 68%);
  pointer-events: none;
}

.setup-step:nth-child(1) {
  grid-column: span 2;
  min-height: 220px;
  background: linear-gradient(145deg, rgba(145,71,255,.22), rgba(255,71,166,.08) 58%, rgba(255,255,255,.03));
}

.setup-step:nth-child(4) {
  transform: translateY(32px);
}

.setup-step:nth-child(6) {
  grid-column: span 2;
  min-height: 210px;
}

.step-number {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(0,0,0,.28);
  color: #d8c8ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.setup-step h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.setup-step p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
}

.step-shot {
  position: relative;
  z-index: 2;
  margin: 1.15rem 0 0;
  padding: 1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 20%, rgba(145,71,255,.18), transparent 45%),
    rgba(0,0,0,.22);
}

.step-shot img {
  width: auto;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(0,0,0,.35);
}

.setup-step:first-child .step-shot img {
  width: 120px;
  height: 120px;
}

.step-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.step-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: var(--transition);
}

.step-actions a:hover {
  color: white;
  border-color: rgba(145,71,255,.5);
  background: rgba(145,71,255,.14);
}

.step-actions .step-primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(45deg, var(--accent), var(--accent-hover));
}

.step-nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.step-nav a {
  min-height: 86px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.step-nav a:hover {
  transform: translateY(-2px);
  border-color: rgba(145,71,255,.45);
  background: rgba(145,71,255,.12);
}

.step-nav span {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 1rem;
}

.guide-card:nth-child(1) { grid-row: span 2; }
.guide-card:nth-child(5) { grid-column: span 2; min-height: 180px; }
.guide-card:nth-child(9) { background: linear-gradient(135deg, rgba(145,71,255,.28), rgba(255,71,166,.12)); }

.guide-card {
  min-height: 212px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: var(--blur);
  transition: var(--transition);
}

.guide-card span {
  color: var(--accent);
  font-weight: 900;
}

.guide-card h3 {
  margin: 1.1rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.15;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
}

.article-shell {
  margin-top: 1rem;
  margin-bottom: 5rem;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-strong);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.article-shell.compact {
  margin-top: 0;
}

.article-shell h1,
.article-shell h2,
.article-shell h3,
.article-shell h4 {
  margin: 2.1rem 0 0.8rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.article-shell h1:first-child,
.article-shell h2:first-child,
.article-shell h3:first-child {
  margin-top: 0;
}

.article-shell h1 { font-size: clamp(2rem, 4vw, 3.8rem); }
.article-shell h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.article-shell h3 { font-size: 1.35rem; color: #d7c5ff; }

.article-shell p,
.article-shell li {
  color: var(--muted);
}

.article-shell strong {
  color: var(--text);
}

.article-shell a {
  color: #b993ff;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.article-shell ul,
.article-shell ol {
  padding-left: 1.35rem;
}

.article-shell blockquote,
.article-shell table,
.article-shell pre,
.article-shell figure,
.article-shell .note {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
}

.article-shell blockquote,
.article-shell pre {
  margin: 1rem 0;
  padding: 1rem;
}

.article-shell code {
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
  background: rgba(145, 71, 255, 0.16);
  color: #e4d8ff;
}

.article-shell figure {
  margin: 1.35rem 0;
  padding: 1rem;
  overflow: hidden;
}

.article-shell figure img,
.article-shell > img {
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}

.article-shell figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.article-shell table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.article-shell th,
.article-shell td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-shell th {
  color: white;
  background: rgba(145, 71, 255, 0.14);
}

.site-footer {
  padding: 2.4rem 0 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .glass-nav {
    width: min(1180px, calc(100% - 20px));
    margin-top: 10px;
    border-radius: 20px;
  }

  .menu-toggle { display: block; }

  .nav-menu {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 10px);
    display: none;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(16, 16, 16, 0.96);
    backdrop-filter: var(--blur);
  }

  .nav-menu.open {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 3.5rem;
  }

  .motion-lab {
    min-height: 330px;
    width: 100%;
    max-width: 100%;
  }

  .lab-node {
    min-width: 92px;
    min-height: 72px;
    padding: 0.75rem;
    font-size: 0.86rem;
  }

  .lab-node img {
    width: 38px;
    height: 38px;
  }

  .node-client {
    left: 28px;
    bottom: 28px;
  }

  .node-proxy {
    display: none;
  }

  .node-dns {
    display: none;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .setup-flow {
    grid-template-columns: 1fr;
  }

  .setup-step,
  .setup-step:nth-child(1),
  .setup-step:nth-child(4),
  .setup-step:nth-child(6) {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    transform: none;
  }

  .step-shot img {
    max-height: 320px;
  }

  .step-nav {
    width: min(1180px, calc(100% - 20px));
    grid-template-columns: 1fr;
  }

  .guide-card:nth-child(1),
  .guide-card:nth-child(5) {
    grid-row: auto;
    grid-column: auto;
  }

  .section-heading {
    display: block;
  }
}

@media (max-width: 520px) {
  .hero,
  .page-hero,
  .section-shell,
  .article-shell,
  .site-footer {
    width: calc(100vw - 20px);
    max-width: 1180px;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(2.15rem, 10vw, 2.8rem);
    line-height: 1.03;
    overflow-wrap: normal;
  }

  .hero-copy p,
  .page-hero p {
    font-size: 1rem;
  }

  .hero-actions {
    display: grid;
    width: calc(100% - 10px);
  }

  .cta-button,
  .ghost-button {
    width: 100%;
  }

  .nav-menu.open {
    grid-template-columns: 1fr;
  }

  .article-shell {
    border-radius: 20px;
  }
}
