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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.6;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[class],
ol[class] {
  list-style: none;
}

/* ============ 2. VARIABLES ============ */
:root {
  --color-bg: #0d0f1a;
  --color-bg-elevated: #1e293b;
  --color-bg-footer: #111422;
  --color-primary: #a855f7;
  --color-secondary: #00d4ff;
  --color-accent: #ff2a75;
  --color-cta: #ff9f1c;
  --color-text: #e2e8f0;
  --color-text-dim: #94a3b8;
  --color-glow: #7c3aed;
  --color-success: #22c55e;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  --container-w: 1240px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --header-h: 68px;
  --transition: 0.25s ease;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
}

@media (min-width: 768px) {
  :root {
    --header-h: 76px;
  }
}

/* ============ 3. BASE TYPOGRAPHY ============ */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  font-weight: 800;
  color: #fff;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

::selection {
  background: rgba(168, 85, 247, 0.4);
  color: #fff;
}

/* ============ 4. LAYOUT UTILITIES ============ */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

.container--narrow {
  max-width: 760px;
}

.site-main {
  min-height: 70vh;
}

#main-content {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

body.nav-open {
  overflow: hidden;
}

/* ============ 5. SKIP LINK ============ */
.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 300;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: none;
}

/* ============ 6. HEADER ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(
    to bottom,
    rgba(13, 15, 26, 0.9),
    rgba(13, 15, 26, 0.55),
    rgba(13, 15, 26, 0)
  );
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.site-header[data-scrolled] {
  background: rgba(13, 15, 26, 0.96);
  border-bottom-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
  .site-header[data-scrolled] {
    background: rgba(13, 15, 26, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
  position: relative;
}

.site-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 2;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

/* ============ 6.1 BRAND ============ */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--color-text);
}

.site-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 42, 117, 0.85) 0 3px, transparent 4px),
    linear-gradient(135deg, var(--color-primary), #6d28d9 60%, #312e81);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
}

.site-brand__mark::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-cta);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 10px rgba(255, 159, 28, 0.55);
}

.site-brand:hover .site-brand__mark {
  transform: rotate(-2deg) scale(1.03);
  box-shadow: 0 0 26px rgba(168, 85, 247, 0.6);
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand__name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
}

.site-brand__slogan {
  font-size: 11px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

/* ============ 7. NAVIGATION ============ */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dim);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease,
    background 0.25s ease, box-shadow 0.25s ease;
}

.site-nav__link::before {
  content: attr(data-index);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--color-secondary);
  opacity: 0.65;
  line-height: 1;
}

.site-nav__link:hover {
  color: #fff;
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.15);
}

.site-nav__link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.24),
    rgba(0, 212, 255, 0.14)
  );
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.site-nav__link[aria-current="page"]::before {
  opacity: 1;
  color: var(--color-secondary);
}

.site-nav__link--cta {
  background: var(--color-cta);
  color: var(--color-bg);
  font-weight: 800;
  border-color: transparent;
}

.site-nav__link--cta::before {
  color: rgba(13, 15, 26, 0.6);
  opacity: 1;
}

.site-nav__link--cta:hover {
  background: #ffb347;
  color: var(--color-bg);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(255, 159, 28, 0.4);
}

.site-nav__link--cta[aria-current="page"] {
  background: var(--color-cta);
  color: var(--color-bg);
  box-shadow: 0 0 20px rgba(255, 159, 28, 0.4);
}

.site-nav__link--cta[aria-current="page"]::before {
  color: rgba(13, 15, 26, 0.6);
}

/* ============ 7.1 NAV TOGGLE ============ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  background: rgba(13, 15, 26, 0.7);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--color-primary);
  background: rgba(168, 85, 247, 0.12);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ 8. FOOTER ============ */
.site-footer {
  position: relative;
  margin-top: var(--space-8);
  background:
    radial-gradient(circle at 82% 12%, rgba(168, 85, 247, 0.12), transparent 32%),
    radial-gradient(circle at 12% 80%, rgba(0, 212, 255, 0.07), transparent 40%),
    var(--color-bg-footer);
  border-top: 1px solid rgba(168, 85, 247, 0.22);
  box-shadow: 0 -18px 50px rgba(124, 58, 237, 0.08);
  padding-top: var(--space-7);
  overflow: hidden;
}

.site-footer *,
.site-footer *::before,
.site-footer *::after {
  box-sizing: inherit;
}

.container--footer {
  position: relative;
  z-index: 1;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-5);
}

/* ---------- footer brand ---------- */
.footer-brand {
  padding-right: var(--space-4);
}

.footer-brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 42, 117, 0.8) 0 3px, transparent 4px),
    linear-gradient(135deg, var(--color-primary), #6d28d9 60%, #312e81);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-10deg);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
  margin-bottom: var(--space-3);
}

.footer-brand__mark::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-cta);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 10px rgba(255, 159, 28, 0.5);
}

.footer-brand__name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.footer-brand__slogan {
  font-size: 13px;
  color: var(--color-secondary);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 1px;
}

.footer-brand__desc {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.7;
  margin-top: var(--space-3);
  max-width: 36ch;
}

/* ---------- footer columns ---------- */
.footer-col {
  min-width: 0;
}

.footer-heading {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-heading::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  flex-shrink: 0;
}

.footer-links,
.footer-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.footer-links a {
  color: var(--color-text-dim);
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.25s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--color-secondary);
  padding-left: 4px;
}

.footer-meta {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.6;
}

.footer-meta li {
  position: relative;
  padding-left: 14px;
}

.footer-meta li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px rgba(255, 42, 117, 0.5);
}

/* ---------- footer bar ---------- */
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13px;
  color: var(--color-text-dim);
}

.footer-bar p {
  margin: 0;
}

/* ============ 9. BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.btn--primary:hover {
  background: #c084fc;
  color: #fff;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(168, 85, 247, 0.55);
}

.btn--ghost:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
}

/* ============ 10. BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0 0 var(--space-5);
  list-style: none;
  font-size: 13px;
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--color-text-dim);
  margin-right: 6px;
  font-weight: 300;
}

.breadcrumb__link {
  color: var(--color-text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb__link:hover {
  color: var(--color-secondary);
}

.breadcrumb__item[aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

/* ============ 11. CARDS ============ */
.card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: var(--space-5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 26px rgba(124, 58, 237, 0.15);
}

/* ============ 12. SECTION HEADINGS ============ */
.section-heading {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: #fff;
  position: relative;
}

.section-sub {
  font-size: 15px;
  color: var(--color-text-dim);
  line-height: 1.7;
  margin-top: var(--space-2);
}

/* ============ 13. IMAGE FRAMES ============ */
.image-frame {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.image-frame--16-9 {
  aspect-ratio: 16 / 9;
}

.image-frame--4-3 {
  aspect-ratio: 4 / 3;
}

.image-frame--1-1 {
  aspect-ratio: 1 / 1;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============ 15. RESPONSIVE ============ */
@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5) var(--space-4);
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  .site-nav__link {
    padding: 8px 13px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-h) - 4px);
    right: 16px;
    left: 16px;
    background: rgba(20, 23, 40, 0.97);
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease,
      visibility 0.3s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }

  @supports (backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px)) {
    .site-nav {
      background: rgba(20, 23, 40, 0.9);
      -webkit-backdrop-filter: blur(16px);
      backdrop-filter: blur(16px);
    }
  }

  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .site-nav__link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 15px;
    width: 100%;
  }

  .site-nav__link--cta {
    margin-top: 6px;
    justify-content: center;
  }

  .site-brand__slogan {
    display: none;
  }
}

@media (max-width: 560px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-meta {
    gap: 8px;
  }
}

/* ============ 16. 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;
  }

  .site-progress {
    transition: none;
  }
}
