:root {
    --black: #020408;
    --deep: #050d1a;
    --blue-dark: #0a1628;
    --blue: #0066ff;
    --blue-bright: #00aaff;
    --cyan: #00e5ff;
    --white: #f0f4ff;
    --gray: #8899bb;
    --glow: 0 0 20px rgba(0,170,255,0.4), 0 0 60px rgba(0,102,255,0.2);
    --glow-sm: 0 0 10px rgba(0,170,255,0.3);
    --font-display: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 18px;
    overflow-x: hidden;
  }

  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: var(--deep); }
  ::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 2px; }

  /* ── CANVAS ── */
  #bg-canvas {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none; opacity: 0.2;
  }

  /* ── NAV ── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 16px 40px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(2,4,8,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,170,255,0.15);
  }
  .nav-logo {
    font-family: var(--font-display); font-weight: 900;
    font-size: 1.3rem; color: var(--white);
    text-decoration: none; letter-spacing: 2px;
  }
  .nav-logo span { color: var(--cyan); }
  .nav-back {
    display: flex; align-items: center; gap: 8px;
    color: var(--gray); text-decoration: none;
    font-family: var(--font-mono); font-size: 0.75rem;
    letter-spacing: 2px; text-transform: uppercase;
    transition: color 0.2s;
  }
  .nav-back:hover { color: var(--cyan); }
  .nav-back::before { content: '←'; font-size: 1rem; }

  /* ── HERO ── */
  .page-hero {
    padding: 140px 40px 60px;
    position: relative;
    border-bottom: 1px solid rgba(0,170,255,0.1);
    background: linear-gradient(180deg, rgba(0,102,255,0.05) 0%, transparent 100%);
  }
  .page-hero-inner { max-width: 860px; margin: 0 auto; }
  .page-tag {
    font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 4px; text-transform: uppercase;
    color: var(--blue-bright); margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
  }
  .page-tag::before { content: '//'; color: var(--blue); }
  .page-title {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1; margin-bottom: 20px;
  }
  .page-title span { color: var(--cyan); }
  .page-divider {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    margin-bottom: 20px;
  }
  .page-meta {
    display: flex; gap: 24px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 0.72rem;
    color: var(--gray); letter-spacing: 1px;
  }
  .page-meta span { display: flex; align-items: center; gap: 6px; }
  .page-meta span::before { color: var(--blue); }

  /* ── CONTENT ── */
  .content-wrap {
    max-width: 860px; margin: 0 auto;
    padding: 60px 40px 100px;
  }

  /* TOC */
  .toc {
    background: rgba(0,102,255,0.05);
    border: 1px solid rgba(0,170,255,0.15);
    padding: 28px 32px; margin-bottom: 60px;
    clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  }
  .toc-title {
    font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--blue-bright); margin-bottom: 16px;
  }
  .toc ol {
    list-style: none; counter-reset: toc-counter;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
  }
  .toc ol li { counter-increment: toc-counter; }
  .toc ol li a {
    color: var(--gray); text-decoration: none;
    font-size: 0.9rem; transition: color 0.2s;
    display: flex; align-items: center; gap: 8px;
  }
  .toc ol li a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-family: var(--font-mono); font-size: 0.65rem;
    color: var(--blue); flex-shrink: 0;
  }
  .toc ol li a:hover { color: var(--cyan); }

  /* SECTIONS */
  .tc-section {
    margin-bottom: 56px;
    scroll-margin-top: 90px;
  }
  .tc-section-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,170,255,0.12);
  }
  .tc-num {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--cyan); letter-spacing: 2px; flex-shrink: 0;
  }
  .tc-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--white); letter-spacing: 0.5px;
  }
  .tc-body {
    color: var(--gray); line-height: 1.8;
    font-size: 1rem;
  }
  .tc-body p { margin-bottom: 14px; }
  .tc-body p:last-child { margin-bottom: 0; }
  .tc-body strong { color: var(--white); font-weight: 600; }
  .tc-body a { color: var(--cyan); text-decoration: none; }
  .tc-body a:hover { text-decoration: underline; }
  .tc-body ul {
    list-style: none; margin: 14px 0;
    display: flex; flex-direction: column; gap: 8px;
  }
  .tc-body ul li {
    padding-left: 20px; position: relative;
  }
  .tc-body ul li::before {
    content: '›'; position: absolute; left: 0;
    color: var(--blue); font-size: 1.1rem; line-height: 1.6;
  }

  /* HIGHLIGHT BOX */
  .tc-highlight {
    background: rgba(0,102,255,0.07);
    border-left: 3px solid var(--blue);
    padding: 16px 20px; margin: 20px 0;
    font-size: 0.95rem; color: var(--gray);
    line-height: 1.7;
  }
  .tc-highlight strong { color: var(--cyan); }

  /* FOOTER */
  .page-footer {
    background: var(--deep);
    border-top: 1px solid rgba(0,170,255,0.12);
    padding: 32px 40px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
  }
  .page-footer .footer-logo {
    font-family: var(--font-display); font-weight: 900;
    font-size: 1rem; color: var(--white);
    text-decoration: none;
  }
  .page-footer .footer-logo span { color: var(--cyan); }
  .page-footer p {
    color: var(--gray); font-size: 0.8rem;
    font-family: var(--font-mono); letter-spacing: 1px;
  }
  .page-footer a {
    color: var(--cyan); text-decoration: none; font-size: 0.8rem;
    font-family: var(--font-mono);
  }
  .page-footer a:hover { text-decoration: underline; }

  /* BACK TO TOP */
  .back-top {
    position: fixed; bottom: 28px; right: 28px; z-index: 900;
    width: 44px; height: 44px;
    background: rgba(0,102,255,0.15);
    border: 1px solid rgba(0,170,255,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--cyan); font-size: 1.1rem;
    cursor: pointer; text-decoration: none;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
    transition: all 0.3s;
    opacity: 0; pointer-events: none;
  }
  .back-top.visible { opacity: 1; pointer-events: all; }
  .back-top:hover {
    background: rgba(0,102,255,0.3);
    border-color: var(--cyan);
    box-shadow: var(--glow-sm);
  }

  /* REVEAL */
  .reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.visible { opacity: 1; transform: none; }

  /* MOBILE */
  @media (max-width: 768px) {
    nav { padding: 14px 20px; }
    .page-hero { padding: 110px 20px 48px; }
    .content-wrap { padding: 40px 20px 80px; }
    .toc ol { grid-template-columns: 1fr; }
    .page-footer { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  }