:root {
  --c-bg-0: #07181f;
  --c-bg-1: #0a2a36;
  --c-bg-2: #0e3848;
  --c-teal: #1fb6a5;
  --c-teal-deep: #0f7a74;
  --c-emerald: #2ee8b4;
  --c-coral: #ff7a7a;
  --c-amber: #f4c430;
  --c-lime: #c7f05c;
  --c-rose: #ffb5c7;
  --c-violet: #9d7cff;
  --c-text: #eaf5f5;
  --c-text-dim: #9cb6b8;
  --c-glass: rgba(255, 255, 255, 0.06);
  --c-glass-strong: rgba(255, 255, 255, 0.1);
  --c-border: rgba(255, 255, 255, 0.12);
  --grad-hero: linear-gradient(135deg, #0a2a36 0%, #0f4a5a 40%, #13445a 70%, #1a6b6b 100%);
  --grad-accent: linear-gradient(135deg, #1fb6a5 0%, #2ee8b4 50%, #c7f05c 100%);
  --grad-coral: linear-gradient(135deg, #ff7a7a 0%, #ffb5c7 100%);
  --grad-amber: linear-gradient(135deg, #f4c430 0%, #ff7a7a 100%);
  --shadow-glow: 0 0 40px rgba(46, 232, 180, 0.25);
  --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.4);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg-0);
  color: var(--c-text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(31, 182, 165, 0.15), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(157, 124, 255, 0.12), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255, 122, 122, 0.1), transparent 50%);
}

a { color: var(--c-emerald); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--c-lime); }
a:focus-visible { outline: 2px solid var(--c-emerald); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 1rem; background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
h3 { font-size: 1.35rem; margin: 1.5rem 0 0.75rem; color: var(--c-text); }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--c-lime); }

p { margin-bottom: 1rem; color: var(--c-text-dim); }
ul, ol { margin: 1rem 0 1.5rem 1.5rem; color: var(--c-text-dim); }
li { margin-bottom: 0.5rem; }
strong { color: var(--c-text); font-weight: 600; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(7, 24, 31, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
}
.logo {
  font-weight: 800; font-size: 1.3rem; color: var(--c-text) !important;
  display: flex; align-items: center; gap: 0.5rem;
}
.logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad-accent);
  box-shadow: 0 0 12px var(--c-emerald);
  animation: pulse 2s ease-in-out infinite;
}
.nav-cta {
  padding: 0.6rem 1.2rem;
  background: var(--grad-accent);
  color: var(--c-bg-0) !important;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(46, 232, 180, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(46, 232, 180, 0.5); color: var(--c-bg-0) !important; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 8rem 2rem 4rem;
  background: var(--grad-hero);
  perspective: 1200px;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(46, 232, 180, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 232, 180, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
  animation: gridMove 20s linear infinite;
}
.hero-particles {
  position: absolute; inset: 0;
  pointer-events: none;
}
.hero-particles .particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}
.floating-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
  animation: shapeFloat 15s ease-in-out infinite;
}
.shape-1 { width: 300px; height: 300px; background: var(--c-teal); top: 10%; left: 5%; }
.shape-2 { width: 250px; height: 250px; background: var(--c-coral); top: 60%; right: 10%; animation-delay: -5s; }
.shape-3 { width: 200px; height: 200px; background: var(--c-violet); bottom: 10%; left: 20%; animation-delay: -10s; }
.shape-4 { width: 180px; height: 180px; background: var(--c-amber); top: 30%; right: 30%; animation-delay: -7s; }

.hero-scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.7;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 120px; height: 120px; background: var(--c-emerald); top: 20%; left: 15%; }
.orb-2 { width: 100px; height: 100px; background: var(--c-coral); bottom: 25%; right: 20%; animation-delay: -3s; }
.orb-3 { width: 80px; height: 80px; background: var(--c-amber); top: 50%; right: 40%; animation-delay: -6s; }

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--c-emerald);
  border-right-color: var(--c-lime);
  animation: ringRotate 12s linear infinite;
}
.ring-1 { width: 500px; height: 500px; opacity: 0.5; }
.ring-2 { width: 620px; height: 620px; opacity: 0.3; animation-duration: 18s; animation-direction: reverse; border-top-color: var(--c-coral); border-right-color: var(--c-rose); }
.ring-3 { width: 740px; height: 740px; opacity: 0.2; animation-duration: 24s; border-top-color: var(--c-violet); border-right-color: var(--c-amber); }

.cabinet-3d {
  position: relative;
  width: 280px; height: 320px;
  transform-style: preserve-3d;
  animation: cabinetRotate 20s ease-in-out infinite;
}
.cabinet-face {
  position: absolute;
  width: 280px; height: 320px;
  background: linear-gradient(145deg, #1a5550, #0d3836);
  border: 2px solid rgba(46, 232, 180, 0.4);
  box-shadow: inset 0 0 40px rgba(46, 232, 180, 0.2), 0 0 60px rgba(46, 232, 180, 0.3);
  backface-visibility: visible;
}
.face-front {
  transform: translateZ(40px);
  background: linear-gradient(145deg, #1fb6a5, #0f7a74);
  display: flex; gap: 4px; padding: 4px;
  box-shadow: inset 0 0 40px rgba(199, 240, 92, 0.3), 0 0 80px rgba(46, 232, 180, 0.5);
}
.face-back { transform: translateZ(-40px) rotateY(180deg); }
.face-left { width: 80px; left: -40px; transform: rotateY(-90deg) translateZ(100px); }
.face-right { width: 80px; right: -40px; transform: rotateY(90deg) translateZ(100px); }
.face-top { height: 80px; top: -40px; transform: rotateX(90deg) translateZ(100px); }
.face-bottom { height: 80px; bottom: -40px; transform: rotateX(-90deg) translateZ(100px); }

.door {
  flex: 1;
  background: linear-gradient(145deg, #2ee8b4, #1fb6a5);
  border: 1px solid rgba(199, 240, 92, 0.5);
  position: relative;
  box-shadow: inset 0 0 20px rgba(199, 240, 92, 0.2);
  animation: doorGlow 3s ease-in-out infinite alternate;
}
.handle {
  position: absolute; top: 50%; width: 4px; height: 40px;
  background: var(--c-amber); border-radius: 2px;
  transform: translateY(-50%);
  box-shadow: 0 0 15px var(--c-amber);
}
.handle-left { left: calc(25% - 10px); }
.handle-right { right: calc(25% - 10px); }

.hero-content {
  position: relative; z-index: 5;
  max-width: 800px; text-align: center;
  padding: 2rem;
  background: rgba(7, 24, 31, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-deep);
}
.hero-eyebrow {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(46, 232, 180, 0.15);
  border: 1px solid rgba(46, 232, 180, 0.3);
  border-radius: 100px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--c-emerald);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #c7f05c 50%, #2ee8b4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(46, 232, 180, 0.3);
}
.hero-sub {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  color: var(--c-text);
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--grad-accent);
  color: var(--c-bg-0) !important;
  box-shadow: 0 8px 30px rgba(46, 232, 180, 0.4);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 40px rgba(46, 232, 180, 0.6); color: var(--c-bg-0) !important; }
.btn-outline {
  background: transparent;
  color: var(--c-text) !important;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}
.btn-outline:hover { border-color: var(--c-emerald); color: var(--c-emerald) !important; background: rgba(46, 232, 180, 0.08); }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== MAIN LAYOUT ===== */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ===== TOC ===== */
.toc {
  position: sticky; top: 100px;
  background: var(--c-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-deep);
}
.toc-toggle { display: none; }
.toc-title {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--c-emerald); margin-bottom: 1rem;
}
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; margin-bottom: 0.6rem; }
.toc-list a {
  display: block; padding: 0.4rem 0.6rem;
  font-size: 0.92rem; color: var(--c-text-dim);
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  position: relative;
  padding-left: 2rem;
}
.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0.6rem;
  font-size: 0.75rem; color: var(--c-teal);
  font-weight: 600;
}
.toc-list a:hover { color: var(--c-emerald); background: rgba(46, 232, 180, 0.08); }
.toc-list a.active { color: var(--c-lime); background: rgba(199, 240, 92, 0.1); font-weight: 600; }

/* ===== ARTICLE ===== */
.article { min-width: 0; }
.article section { margin-bottom: 3rem; }
.article section h2 { position: relative; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.article section h2::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 80px; height: 3px;
  background: var(--grad-accent);
  border-radius: 2px;
}

/* ===== PROCESS ANIMATION ===== */
.process-anim {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  margin: 2.5rem 0;
  padding: 2rem 1rem;
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: thin;
}
.process-stage {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem;
  opacity: 0.35;
  transform: translateY(10px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.process-stage.revealed {
  opacity: 1;
  transform: translateY(0);
}
.process-stage.active {
  filter: drop-shadow(0 0 15px var(--c-emerald));
}
.stage-visual {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(31, 182, 165, 0.2), rgba(15, 122, 116, 0.3));
  border: 1px solid var(--c-border);
  color: var(--c-emerald);
  transition: all 0.6s ease;
  position: relative;
  overflow: hidden;
}
.stage-visual svg { width: 60%; height: 60%; }
.process-stage.revealed .stage-visual {
  background: linear-gradient(145deg, rgba(46, 232, 180, 0.3), rgba(199, 240, 92, 0.2));
  border-color: var(--c-emerald);
  color: var(--c-lime);
}
.process-stage.active .stage-visual {
  background: var(--grad-accent);
  color: var(--c-bg-0);
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(46, 232, 180, 0.6);
}
.stage-label {
  font-size: 0.85rem; font-weight: 600;
  color: var(--c-text-dim);
  text-align: center;
}
.process-stage.revealed .stage-label { color: var(--c-text); }
.process-stage.active .stage-label { color: var(--c-lime); }

.process-connector {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  min-width: 30px;
  position: relative;
  overflow: hidden;
}
.process-connector::before {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-accent);
  transform: translateX(-100%);
  transition: transform 1s ease;
}
.process-connector.filled::before { transform: translateX(0); }

/* ===== TAKEAWAYS ===== */
.takeaways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.takeaway-card {
  padding: 1.5rem;
  background: var(--c-glass);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.takeaway-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.takeaway-card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 232, 180, 0.4);
  box-shadow: 0 10px 40px rgba(46, 232, 180, 0.2);
}
.takeaway-card:hover::before { transform: scaleX(1); }
.takeaway-card p { margin: 0; font-size: 0.95rem; }

/* ===== CTA ===== */
.cta {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #0a2a36 0%, #13445a 100%);
  position: relative;
  overflow: hidden;
}
.cta-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem;
  background: var(--c-glass-strong);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-deep);
  position: relative;
  text-align: center;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.cta-card:hover { transform: translateY(-5px); }
.cta-glow {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(46, 232, 180, 0.15) 0%, transparent 60%);
  pointer-events: none;
  animation: ctaGlow 8s ease-in-out infinite;
}
.cta h2 { margin-bottom: 1rem; }
.cta > .cta-card > p { font-size: 1.1rem; margin-bottom: 2rem; color: var(--c-text); }
.cta-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.cta-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  color: var(--c-text);
  transition: all 0.3s ease;
  justify-content: center;
}
.cta-item:hover {
  border-color: var(--c-emerald);
  background: rgba(46, 232, 180, 0.08);
  transform: translateY(-2px);
}
.cta-item svg { color: var(--c-emerald); flex-shrink: 0; }
.cta-item a { color: var(--c-text); font-weight: 500; font-size: 0.95rem; word-break: break-all; }
.cta-item a:hover { color: var(--c-lime); }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ===== FOOTER ===== */
.footer {
  padding: 3rem 2rem 2rem;
  background: var(--c-bg-0);
  border-top: 1px solid var(--c-border);
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  text-align: center;
}
.footer-brand h3 { color: var(--c-emerald); margin-bottom: 0.3rem; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  color: var(--c-text);
  transition: all 0.3s ease;
}
.footer-social a:hover {
  color: var(--c-bg-0);
  background: var(--grad-accent);
  border-color: var(--c-emerald);
  box-shadow: 0 0 20px rgba(46, 232, 180, 0.5);
  transform: translateY(-3px);
}
.footer-copy { color: var(--c-text-dim); font-size: 0.9rem; }

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}
@keyframes gridMove {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 60px 60px, 60px 60px; }
}
@keyframes particleFloat {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) translateX(50px); opacity: 0; }
}
@keyframes shapeFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}
@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes cabinetRotate {
  0%, 100% { transform: rotateY(-15deg) rotateX(5deg); }
  50% { transform: rotateY(15deg) rotateX(-5deg); }
}
@keyframes doorGlow {
  0% { box-shadow: inset 0 0 20px rgba(199, 240, 92, 0.2); }
  100% { box-shadow: inset 0 0 40px rgba(199, 240, 92, 0.5); }
}
@keyframes ctaGlow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10%, 10%) rotate(180deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; gap: 2rem; }
  .toc {
    position: relative; top: 0;
    padding: 0;
  }
  .toc-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    color: var(--c-text);
    border: none;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    text-align: left;
  }
  .toc-toggle svg { transition: transform 0.3s ease; }
  .toc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .toc-inner {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 1.5rem;
  }
  .toc-inner.open {
    max-height: 500px;
    padding-bottom: 1.5rem;
  }
  .cabinet-3d { width: 220px; height: 260px; }
  .ring-1 { width: 380px; height: 380px; }
  .ring-2 { width: 480px; height: 480px; }
  .ring-3 { width: 580px; height: 580px; }
  .cta-card { padding: 2rem 1.5rem; }
}

@media (max-width: 560px) {
  .nav { padding: 0.8rem 1rem; }
  .hero { padding: 7rem 1rem 3rem; }
  .main { padding: 2rem 1rem; }
  .cta { padding: 3rem 1rem; }
  .hero-btns { flex-direction: column; }
  .btn { width: 100%; text-align: center; }
  .cta-buttons { flex-direction: column; width: 100%; }
  .cta-buttons .btn { width: 100%; }
  .process-anim { justify-content: flex-start; }
  .cta-item { font-size: 0.85rem; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}