/* ========== Reset & Variables ========== */
:root {
  --midnight: #0B1026;
  --abyss: #1E1240;
  --neon: #9B4DFF;
  --gold: #C9A23D;
  --cyan: #00E5FF;
  --smoke: #F2EDE9;
  --mist: #A99FAD;
  --alert: #8C1C2C;

  --font-serif: "Noto Serif SC", "Songti SC", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --font-mono: "Source Code Pro", "SFMono-Regular", monospace;

  --container-w: 1360px;
  --header-h: 84px;
  --radius: 2px;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(155, 77, 255, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.4s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  background: var(--midnight);
}

body {
  background: var(--midnight);
  color: var(--smoke);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
figure,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

a:hover {
  color: var(--neon);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--neon);
  color: var(--midnight);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ========== Layout & utilities ========== */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--cyan);
  color: var(--midnight);
  font-weight: 700;
  font-size: 14px;
  border-radius: 2px;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all 0.35s var(--ease);
  border: 1px solid transparent;
  line-height: 1.4;
  text-align: center;
}

.btn-primary {
  background: var(--neon);
  color: #fff;
  border-color: var(--neon);
  box-shadow: 0 8px 30px rgba(155, 77, 255, 0.3);
}

.btn-primary:hover {
  background: transparent;
  color: var(--neon);
  border-color: var(--neon);
  box-shadow: 0 8px 40px rgba(155, 77, 255, 0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--smoke);
  border-color: rgba(242, 237, 233, 0.3);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 61, 0.06);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
  font-size: 13px;
  color: var(--mist);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb-list a {
  color: var(--mist);
  border-bottom: 1px solid transparent;
}

.breadcrumb-list a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--smoke);
}

.section-heading {
  margin: 0 0 48px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--smoke);
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
  background: transparent;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(11, 16, 38, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(155, 77, 255, 0.2);
}

.header-inner {
  max-width: var(--container-w);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  min-height: var(--header-h);
  transition: min-height 0.4s var(--ease);
}

.site-header.is-scrolled .header-inner {
  min-height: 68px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: var(--smoke);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--neon), var(--abyss));
  color: var(--smoke);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 900;
  transform: skewX(-8deg);
  border-radius: 0;
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 24px rgba(155, 77, 255, 0.25);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand-lockup:hover .brand-mark {
  transform: skewX(-8deg) scale(1.06);
  box-shadow: 0 0 36px rgba(0, 229, 255, 0.35);
}

.brand-lockup:hover .brand-name {
  color: var(--cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--smoke);
  transition: color 0.3s var(--ease);
}

.brand-tagline {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mist);
  margin-top: 2px;
}

/* ========== Navigation ========== */
.main-nav {
  position: relative;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-menu a {
  position: relative;
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(242, 237, 233, 0.85);
  border-radius: 2px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-menu a::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 16px;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.35s var(--ease);
}

.site-menu a:hover {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.06);
}

.site-menu a:hover::after,
.site-menu a[aria-current="page"]::after,
.site-menu a.is-active::after {
  width: calc(100% - 32px);
}

.site-menu a[aria-current="page"],
.site-menu a.is-active {
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 910;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(242, 237, 233, 0.25);
  border-radius: 2px;
  background: rgba(11, 16, 38, 0.7);
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--smoke);
  transition: transform 0.3s var(--ease), opacity 0.2s, background 0.3s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background: var(--neon);
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background: var(--neon);
}

.header-scrollbar {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--neon), var(--cyan));
  transition: width 0.2s linear;
  z-index: 2;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

/* ========== Footer ========== */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, var(--midnight) 0%, var(--abyss) 100%);
  margin-top: 80px;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--neon) 20%, var(--gold) 50%, var(--neon) 80%, transparent 100%);
  opacity: 0.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 56px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-mark-light {
  background: linear-gradient(135deg, var(--gold), var(--neon));
  border-color: rgba(201, 162, 61, 0.4);
  box-shadow: 0 0 30px rgba(201, 162, 61, 0.2);
}

.footer-brand .brand-name {
  font-size: 24px;
  color: var(--smoke);
}

.footer-quote {
  font-size: 14px;
  color: var(--mist);
  max-width: 360px;
  line-height: 1.9;
  border-left: 2px solid rgba(201, 162, 61, 0.5);
  padding-left: 16px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201, 162, 61, 0.2);
}

.footer-col-title-sub {
  margin-top: 28px;
}

.footer-nav,
.footer-contact,
.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a,
.shortcut-list a,
.footer-contact a {
  display: inline-block;
  font-size: 14px;
  color: rgba(242, 237, 233, 0.75);
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.footer-nav a:hover,
.shortcut-list a:hover,
.footer-contact a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  padding-left: 6px;
}

.footer-contact li {
  font-size: 14px;
  color: var(--mist);
}

.footer-note {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(169, 159, 173, 0.75);
  line-height: 1.8;
  border-left: 2px solid rgba(140, 28, 44, 0.5);
  padding-left: 12px;
}

.footer-legal {
  background: rgba(6, 9, 20, 0.6);
  border-top: 1px solid rgba(155, 77, 255, 0.15);
}

.footer-legal-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
  font-size: 12px;
  color: var(--mist);
}

.footer-legal-inner p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icp-link {
  color: var(--mist);
  border-bottom: 1px solid rgba(201, 162, 61, 0.3);
}

.icp-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ========== Back to top ========== */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 32px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 48px;
  background: rgba(30, 18, 64, 0.85);
  border: 1px solid rgba(155, 77, 255, 0.4);
  color: var(--neon);
  border-radius: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s, background 0.3s, color 0.3s;
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--neon);
  color: var(--smoke);
  border-color: var(--neon);
  box-shadow: 0 0 35px rgba(155, 77, 255, 0.5);
}

.back-to-top svg {
  transition: transform 0.3s var(--ease);
}

.back-to-top:hover svg {
  transform: translateY(-3px);
}

/* ========== Grids ========== */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ========== Cards ========== */
.card {
  position: relative;
  background: rgba(30, 18, 64, 0.5);
  border: 1px solid rgba(155, 77, 255, 0.15);
  border-radius: var(--radius);
  padding: 32px;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 40px;
  background: var(--neon);
  transition: height 0.4s var(--ease);
}

.card:hover {
  border-color: rgba(201, 162, 61, 0.35);
  box-shadow: var(--shadow-card), 0 0 40px rgba(155, 77, 255, 0.1);
  transform: translateY(-3px);
}

.card:hover::before {
  height: 100%;
}

.card-dark {
  background: rgba(11, 16, 38, 0.8);
}

.card-accent {
  background: linear-gradient(135deg, rgba(155, 77, 255, 0.12), rgba(11, 16, 38, 0.9));
  border-color: rgba(155, 77, 255, 0.3);
}

/* ========== Image frames ========== */
.img-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 18, 64, 0.8), rgba(11, 16, 38, 0.6));
  border: 1px solid rgba(155, 77, 255, 0.12);
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(155, 77, 255, 0.12), transparent 70%);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.5s ease;
}

.img-frame:hover img {
  transform: scale(1.04);
}

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

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

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

/* ========== Chips / dividers / notes ========== */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 2px;
}

.divider-light {
  height: 1px;
  background: linear-gradient(90deg, rgba(30, 18, 64, 0.9), rgba(201, 162, 61, 0.3), rgba(30, 18, 64, 0.9));
  border: none;
  margin: 40px 0;
}

.note-box {
  background: rgba(140, 28, 44, 0.08);
  border-left: 3px solid var(--alert);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--mist);
  border-radius: 0 2px 2px 0;
  line-height: 1.8;
}

.glow-band {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon), var(--cyan), var(--neon), transparent);
  width: 100%;
  opacity: 0.5;
}

.gold-line {
  display: inline-block;
  width: 48px;
  height: 2px;
  background: var(--gold);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    padding-inline: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .brand-tagline {
    display: none;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(78vw, 360px);
    height: 100dvh;
    background: rgba(11, 16, 38, 0.97);
    backdrop-filter: blur(24px);
    border-left: 1px solid rgba(155, 77, 255, 0.3);
    transform: translateX(102%);
    transition: transform 0.5s var(--ease);
    padding-top: calc(var(--header-h) + 28px);
    padding-inline: 28px;
    overflow-y: auto;
    z-index: 905;
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  }

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

  .site-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-menu a {
    display: block;
    font-size: 20px;
    padding: 12px 8px;
    color: var(--smoke);
  }

  .site-menu a::after {
    left: 8px;
    bottom: 8px;
    width: 0;
  }

  .site-menu a:hover::after,
  .site-menu a[aria-current="page"]::after,
  .site-menu a.is-active::after {
    width: 36px;
  }

  .site-menu a[aria-current="page"],
  .site-menu a.is-active {
    color: var(--gold);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 48px;
    padding-bottom: 36px;
  }

  .footer-quote {
    max-width: 100%;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .footer-legal-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
  }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }

  .back-to-top,
  .main-nav,
  .skip-link,
  .header-scrollbar {
    transition: none !important;
  }
}
