@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Patrick+Hand&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: #000;
  color: #fff;
}

body {
  font-family: 'Patrick Hand', 'Kalam', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* =====================
   SCROLL MARGIN
===================== */
div[id] {
  scroll-margin-top: 120px;
}

/* =====================
   OVERLAY MENU
===================== */
.overlay-menu {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.overlay-menu.is-open {
  opacity: 1;
  pointer-events: all;
}

.overlay-close {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  background: none;
  border: 2px solid #fff;
  color: #fff;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.overlay-close:hover {
  background: #fff;
  color: #000;
}

.overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.overlay-link {
  font-family: 'Kalam', cursive;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  transition: color 0.2s, transform 0.2s;
  display: block;
  text-align: center;
}

.overlay-link:hover {
  color: #ccc;
  transform: translateX(8px);
}

/* =====================
   HEADER
===================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  min-height: 40px;
  justify-content: center;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: background 0.2s;
}

.hamburger:hover span {
  background: #ccc;
}

.header-nav-left,
.header-nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav-link:hover {
  color: #fff;
}

.header-brand {
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
}

.brand-text {
  font-family: 'Kalam', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
}

.logo-img {
  height: 36px;
  width: auto;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  min-height: 40px;
  border: 2px solid #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.cta-btn:hover {
  background: #000;
  color: #fff;
  transform: translateY(-2px);
}

.header-cta {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* =====================
   STICKY ANCHOR BAR
===================== */
.sticky-anchor {
  position: sticky;
  top: 64px;
  z-index: 190;
  background: rgba(0,0,0,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sticky-anchor::-webkit-scrollbar {
  display: none;
}

.sticky-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
}

.anchor-link {
  font-size: 0.8rem;
  padding: 0 1rem;
  height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.6);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.anchor-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* =====================
   MAIN LAYOUT
===================== */
main {
  padding-top: 108px;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
}

/* =====================
   HERO
===================== */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-article {
  display: flex;
  align-items: flex-start;
  gap: 4rem;
  width: 100%;
}

.hero-aside {
  flex-shrink: 0;
  width: 120px;
  padding-top: 1rem;
}

.aside-decoration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: 2px solid rgba(255,255,255,0.2);
  padding: 1rem 0.75rem;
}

.aside-mark {
  font-family: 'Kalam', cursive;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.05em;
}

.aside-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: horizontal-tb;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-h1 {
  font-family: 'Kalam', cursive;
  font-size: clamp(3rem, 10vw, 10rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: #fff;
  margin-bottom: 2rem;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 3rem;
}

.hero-cta {
  font-size: 1rem;
  padding: 0.875rem 2rem;
  min-height: 48px;
}

/* =====================
   CONTENT SECTION
===================== */
.content-section {
  padding: 4rem 2rem 6rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.page-article {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.content-aside {
  flex-shrink: 0;
  width: 200px;
  position: sticky;
  top: 120px;
  align-self: flex-start;
}

.aside-toc {
  border: 1px solid rgba(255,255,255,0.12);
  padding: 1.25rem;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.aside-toc-title {
  font-family: 'Kalam', cursive;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toc-link {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.4;
}

.toc-link:hover {
  color: #fff;
  border-left-color: #fff;
}

/* =====================
   ARTICLE BODY (page.content)
===================== */
.article-body {
  flex: 1;
  min-width: 0;
}

.article-body h2 {
  font-family: 'Kalam', cursive;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

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

.article-body h3 {
  font-family: 'Kalam', cursive;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.article-body p {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,0.8);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  max-width: 72ch;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body li {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.article-body strong,
.article-body b {
  color: #fff;
  font-weight: 700;
}

.article-body a {
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  transition: border-color 0.2s;
}

.article-body a:hover {
  border-bottom-color: #fff;
}

.article-body blockquote {
  border-left: 3px solid #fff;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(255,255,255,0.04);
  font-style: italic;
  color: rgba(255,255,255,0.7);
}

.article-body div {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.article-body div:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Glass card style for sections */
.article-body div {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 2.5rem;
  margin-bottom: 2rem;
}

/* =====================
   FOOTER
===================== */
footer {
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-cta-section {
  background: #fff;
  color: #000;
  padding: 6rem 2rem;
  text-align: center;
}

.footer-cta-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-cta-h2 {
  font-family: 'Kalam', cursive;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #000;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.footer-cta-label {
  display: inline;
}

.footer-cta-desc {
  font-size: 1.1rem;
  color: rgba(0,0,0,0.65);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.footer-cta-btn {
  background: #000;
  color: #fff;
  border-color: #000;
  font-size: 1rem;
  padding: 0.875rem 2.5rem;
  min-height: 48px;
}

.footer-cta-btn:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

.footer-bottom-section {
  background: #000;
  padding: 1.5rem 2rem;
}

.footer-bottom-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

.footer-nav {
  flex-shrink: 0;
}

.footer-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  list-style: none;
}

.footer-dl dt,
.footer-dl dd {
  display: inline;
}

.footer-dl a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  padding: 0.35rem 0.6rem;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  transition: color 0.2s;
}

.footer-dl a:hover {
  color: #fff;
}

/* =====================
   ANIMATIONS
===================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-h1 {
  animation: fadeUp 0.7s ease both;
}

.hero-desc {
  animation: fadeUp 0.7s 0.1s ease both;
}

.hero-cta {
  animation: fadeUp 0.7s 0.2s ease both;
}

.aside-decoration {
  animation: fadeIn 0.9s 0.3s ease both;
}

/* Stagger for article sections via JS class */
.article-body div.is-visible {
  animation: fadeUp 0.6s ease both;
}

/* Parallax handled in JS */
.hero-section {
  transform-style: preserve-3d;
}

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

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 960px) {
  .header-nav-left,
  .header-nav-right {
    display: none;
  }

  .hero-aside {
    width: 80px;
  }

  .content-aside {
    display: none;
  }

  .page-article {
    flex-direction: column;
  }

  .hero-article {
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 1rem;
    height: 56px;
  }

  .sticky-anchor {
    top: 56px;
  }

  main {
    padding-top: 100px;
  }

  div[id] {
    scroll-margin-top: 100px;
  }

  .hero-section {
    padding: 4rem 1.25rem 3rem;
    min-height: 60vh;
  }

  .hero-article {
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero-aside {
    width: auto;
    display: flex;
  }

  .aside-decoration {
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
  }

  .aside-mark {
    font-size: 2rem;
  }

  .content-section {
    padding: 2rem 1.25rem 4rem;
  }

  .article-body div {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .footer-cta-section {
    padding: 4rem 1.25rem;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer-dl {
    flex-wrap: wrap;
  }

  .sticky-inner {
    padding: 0 1rem;
  }

  .anchor-link {
    padding: 0 0.6rem;
    font-size: 0.72rem;
  }

  .header-cta {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }
}
