@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&family=Varela+Round&display=swap');

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: #1c1726;
  color: #f0ebff;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input { font: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --c-primary: #6514ff;
  --c-accent: #bf00ff;
  --c-dark: #1c1726;
  --c-dark2: #231d35;
  --c-dark3: #2e2747;
  --c-light: #f0ebff;
  --c-muted: #9d8ec4;
  --c-border: rgba(101, 20, 255, 0.25);
  --sidebar-w: 260px;
  --radius-card: 28px;
  --radius-sm: 12px;
  --gap-xl: 64px;
  --gap-lg: 48px;
  --gap-md: 32px;
  --gap-sm: 20px;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   ANIMATED BACKGROUND PATTERN
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(101, 20, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(191, 0, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(28, 23, 38, 0.96);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
}

.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--c-border);
}

.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.logo-text-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 14px;
  font-family: 'Varela Round', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.site-logo-img {
  width: 48px; height: 48px;
  border-radius: 14px;
}

/* sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.sidebar-nav li {
  --i: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-muted);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
  line-height: 1.4;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
  background: linear-gradient(90deg, rgba(101,20,255,0.25), rgba(191,0,255,0.1));
  transform: translateX(4px);
}

.nav-link:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* sidebar search */
.sidebar-search {
  padding: 16px 12px 24px;
  border-top: 1px solid var(--c-border);
}

.search-form {
  display: flex;
  gap: 0;
  background: var(--c-dark3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.search-form:focus-within {
  border-color: var(--c-primary);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--c-light);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  min-width: 0;
  min-height: 44px;
}

.search-input::placeholder { color: var(--c-muted); }

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  color: var(--c-muted);
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}

.search-btn:hover { color: var(--c-accent); background: rgba(191,0,255,0.1); }

/* sidebar toggle (desktop collapse) */
.sidebar-toggle {
  display: none;
}

/* ============================================================
   MAIN WRAP
   ============================================================ */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.site-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(28,23,38,0.97);
  border-bottom: 1px solid var(--c-border);
  padding: 0 20px;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
}

.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.mobile-menu-btn span,
.sidebar-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--c-light);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header-brand-mobile a {
  font-family: 'Varela Round', sans-serif;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  padding: 10px 0;
  min-height: 44px;
  line-height: 24px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1726 0%, #2a1545 50%, #1c1726 100%);
  padding: var(--gap-xl) var(--gap-xl) 100px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: 680px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: rgba(191,0,255,0.12);
  border: 1px solid rgba(191,0,255,0.3);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: 24px;
}

.hero-h1 {
  font-family: 'Varela Round', sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 30%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--c-muted);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 100px;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 8px 32px rgba(101,20,255,0.4);
  min-height: 48px;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 48px rgba(101,20,255,0.6);
  filter: brightness(1.1);
}

/* hero geometric decorations */
.hero-geo {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.geo-1 {
  width: 400px; height: 400px;
  top: -80px; left: -60px;
  background: radial-gradient(circle, rgba(101,20,255,0.25) 0%, transparent 70%);
  animation: geoFloat 6s ease-in-out infinite;
}

.geo-2 {
  width: 280px; height: 280px;
  bottom: 40px; left: 120px;
  background: radial-gradient(circle, rgba(191,0,255,0.2) 0%, transparent 70%);
  animation: geoFloat 8s ease-in-out infinite reverse;
}

.geo-3 {
  width: 160px; height: 160px;
  top: 40%; left: 35%;
  background: linear-gradient(135deg, rgba(101,20,255,0.15), rgba(191,0,255,0.15));
  border-radius: 28px;
  transform: rotate(20deg);
  animation: geoRotate 12s linear infinite;
}

@keyframes geoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
}

@keyframes geoRotate {
  from { transform: rotate(20deg); }
  to { transform: rotate(380deg); }
}

/* hero slash divider */
.hero-slash {
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 100px;
  background: var(--c-dark);
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 3;
}

.hero-slash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  clip-path: polygon(0 60%, 100% 0%, 100% 4px, 0 calc(60% + 4px));
  opacity: 0.7;
}

/* ============================================================
   CONTENT SECTION
   ============================================================ */
.content-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-areas: "deco aside" "body aside";
  gap: 0 var(--gap-lg);
  padding: var(--gap-xl) var(--gap-xl);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

.content-deco-figure {
  grid-area: deco;
  display: flex;
  gap: 12px;
  margin-bottom: var(--gap-md);
  pointer-events: none;
}

.deco-block {
  height: 6px;
  border-radius: 3px;
}

.deco-block-a {
  width: 60px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
}

.deco-block-b {
  width: 30px;
  background: var(--c-primary);
  opacity: 0.4;
}

.content-body {
  grid-area: body;
  min-width: 0;
}

/* ============================================================
   CONTENT BODY TYPOGRAPHY & SECTIONS
   ============================================================ */
.content-body h2 {
  font-family: 'Varela Round', sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: #fff;
  margin-top: var(--gap-xl);
  margin-bottom: 16px;
  line-height: 1.25;
}

.content-body h2:first-child {
  margin-top: 0;
}

.content-body h2 + hr,
.content-body h3 + hr {
  border: none;
  border-top: 2px solid;
  border-image: linear-gradient(90deg, var(--c-primary), var(--c-accent), transparent) 1;
  margin-bottom: 24px;
}

.content-body h3 {
  font-family: 'Varela Round', sans-serif;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 700;
  color: var(--c-light);
  margin-top: var(--gap-md);
  margin-bottom: 12px;
  line-height: 1.3;
}

.content-body p {
  font-size: 17px;
  line-height: 1.8;
  color: #c8bfe8;
  margin-bottom: 18px;
}

.content-body ul,
.content-body ol {
  margin: 0 0 20px 0;
  padding-left: 0;
  list-style: none;
}

.content-body ul li,
.content-body ol li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 16px;
  color: #c8bfe8;
  line-height: 1.7;
}

.content-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
}

.content-body ol {
  counter-reset: ol-counter;
}

.content-body ol li {
  counter-increment: ol-counter;
}

.content-body ol li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--c-primary);
  font-size: 14px;
}

.content-body strong {
  color: #fff;
  font-weight: 700;
}

.content-body em {
  color: var(--c-accent);
  font-style: normal;
}

.content-body a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.content-body a:hover { color: #fff; }

.content-body code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 14px;
  background: var(--c-dark3);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--c-accent);
}

.content-body pre {
  background: var(--c-dark3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}

.content-body blockquote {
  border-left: 4px solid var(--c-primary);
  margin: 24px 0;
  padding: 16px 24px;
  background: rgba(101,20,255,0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 17px;
  color: var(--c-muted);
}

/* sections within content-body */
.content-body article {
  padding: var(--gap-lg) 0;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: 80px;
}

.content-body article:last-child {
  border-bottom: none;
}

/* ============================================================
   ASIDE (RIGHT COLUMN)
   ============================================================ */
.content-aside {
  grid-area: aside;
  position: sticky;
  top: 80px;
}

.aside-inner {
  background: var(--c-dark2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  border-bottom: 4px solid var(--c-primary);
}

.aside-title {
  font-family: 'Varela Round', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.aside-inner hr {
  border: none;
  border-top: 2px solid;
  border-image: linear-gradient(90deg, var(--c-primary), var(--c-accent)) 1;
  margin-bottom: 20px;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.aside-link {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-muted);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  min-height: 40px;
}

.aside-link:hover {
  color: #fff;
  background: rgba(101,20,255,0.2);
  transform: translateX(4px);
}

.aside-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-muted);
  font-weight: 600;
}

.badge-dot {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #140f20;
  border-top: 1px solid var(--c-border);
  margin-top: auto;
}

/* footer CTA block */
.footer-cta-block {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  padding: var(--gap-lg) var(--gap-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

.footer-cta-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}

.footer-cta-headline {
  font-family: 'Varela Round', sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: #fff;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 100px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  min-height: 48px;
}

.footer-cta-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: #fff;
  transform: translateY(-2px);
}

/* footer columns */
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap-lg);
  padding: var(--gap-lg) var(--gap-xl);
}

.footer-col-title {
  font-family: 'Varela Round', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.footer-brand-name {
  display: block;
  font-family: 'Varela Round', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.7;
}

.footer-col-nav ul,
.footer-col-contact ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-col-nav li a,
.footer-legal-links li a {
  font-size: 14px;
  color: var(--c-muted);
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
}

.footer-col-nav li a:hover,
.footer-legal-links li a:hover {
  color: var(--c-accent);
}

.footer-col-contact address {
  font-style: normal;
  margin-bottom: 16px;
}

.footer-contact-link {
  font-size: 14px;
  color: var(--c-muted);
  transition: color var(--transition);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
}

.footer-contact-link:hover { color: var(--c-accent); }

.footer-legal-links {
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
  margin-top: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 20px var(--gap-xl);
  text-align: center;
  font-size: 13px;
  color: var(--c-muted);
}

/* ============================================================
   SCROLL MARGIN FOR FIXED NAV
   ============================================================ */
article[id] {
  scroll-margin-top: 80px;
}

/* ============================================================
   STAGGER LIST ANIMATION
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .sidebar-nav li {
    animation: slideInLeft 300ms ease both;
    animation-delay: calc(var(--i) * 50ms + 100ms);
  }

  @keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .content-body article {
    transition: opacity 0.4s ease;
  }
}

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

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }

  .content-section {
    grid-template-columns: 1fr 260px;
    padding: var(--gap-lg);
    gap: 0 var(--gap-md);
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    padding: var(--gap-md) var(--gap-lg);
  }

  .footer-cta-block {
    padding: var(--gap-md) var(--gap-lg);
  }
}

@media (max-width: 860px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-areas: "deco" "body" "aside";
    padding: var(--gap-md);
  }

  .content-aside {
    position: static;
    margin-top: var(--gap-md);
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 700px) {
  :root {
    --sidebar-w: 280px;
    --gap-xl: 40px;
    --gap-lg: 32px;
    --gap-md: 24px;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
  }

  .site-header {
    display: flex;
  }

  .hero-section {
    padding: var(--gap-lg) 24px 80px;
    min-height: 60vh;
    justify-content: flex-start;
  }

  .hero-inner {
    text-align: left;
    max-width: 100%;
  }

  .hero-sub {
    margin-left: 0;
  }

  .content-section {
    padding: var(--gap-md) 20px;
  }

  .footer-cta-block {
    padding: var(--gap-md) 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer-cols {
    padding: var(--gap-md) 20px;
  }

  .footer-bottom {
    padding: 16px 20px;
  }

  .content-body h2 {
    margin-top: var(--gap-lg);
  }

  .content-body p,
  .content-body ul li,
  .content-body ol li {
    font-size: 16px;
  }
}

/* mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,23,38,0.7);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.is-visible {
  display: block;
}

button[aria-expanded]{min-width:44px;min-height:44px}
