/* Base — reset, typography, layout utilities */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: var(--leading-body);
  color: var(--mist);
  background-color: var(--void);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(142, 182, 217, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(212, 165, 116, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(142, 182, 217, 0.05), transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle film grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

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

figure {
  margin: 0;
}

blockquote {
  margin: 0;
}

a {
  color: var(--ice);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out-expo);
}

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

a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
.theme-card:focus-visible,
.scene-card:focus-visible,
.visual-card:focus-visible,
.quote-dot:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--flare);
  letter-spacing: 0.04em;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-3) var(--space-5);
  background: var(--ink);
  color: var(--flare);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: top var(--dur-fast) var(--ease-out-expo);
}

.skip-link:focus {
  top: var(--space-4);
  box-shadow: var(--focus-ring);
}

/* Layout helpers */
.container {
  width: min(100% - var(--space-gutter) * 2, var(--content-max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - var(--space-gutter) * 2, var(--content-narrow));
}

.section {
  position: relative;
  padding-block: var(--space-section);
}

.section-kicker {
  display: block;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--ember);
}

.section-title {
  margin-bottom: var(--space-5);
  font-size: var(--text-xl);
  font-weight: 400;
}

.section-lead {
  max-width: var(--content-reading);
  color: var(--ghost);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  font-weight: 300;
}

/* Chinese site language — refined Han pair aligned with Cinzel + Outfit */
html[data-lang="zh"] body {
  font-family: var(--font-body-zh);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.85;
}

html[data-lang="zh"] h1,
html[data-lang="zh"] h2,
html[data-lang="zh"] h3,
html[data-lang="zh"] h4 {
  font-family: var(--font-display-zh);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

html[data-lang="zh"] .section-kicker,
html[data-lang="zh"] .hero-kicker,
html[data-lang="zh"] .scene-label,
html[data-lang="zh"] .nav-link,
html[data-lang="zh"] .hero-cta,
html[data-lang="zh"] .hero-scroll,
html[data-lang="zh"] .hero-meta,
html[data-lang="zh"] .synopsis-caption,
html[data-lang="zh"] .visual-meta p,
html[data-lang="zh"] .quote-attr {
  font-family: var(--font-body-zh);
  letter-spacing: 0.18em;
  text-transform: none;
}

html[data-lang="zh"] .hero-title {
  font-family: var(--font-display-zh);
  letter-spacing: 0.18em;
  text-transform: none;
  font-weight: 500;
  font-size: clamp(2.4rem, 1.5rem + 4.2vw, 5.5rem);
}

html[data-lang="zh"] .hero-tagline {
  font-family: var(--font-display-zh);
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.75;
}

html[data-lang="zh"] .nav-brand {
  font-family: var(--font-display-zh);
  letter-spacing: 0.2em;
  text-transform: none;
}

html[data-lang="zh"] .footer-title {
  font-family: var(--font-display-zh);
  letter-spacing: 0.2em;
  text-transform: none;
}

html[data-lang="zh"] .section-title {
  letter-spacing: 0.1em;
}

html[data-lang="zh"] .section-lead,
html[data-lang="zh"] .theme-card p,
html[data-lang="zh"] .scene-body p,
html[data-lang="zh"] .synopsis-copy p {
  letter-spacing: 0.04em;
  line-height: 1.95;
}

html[data-lang="zh"] .quote-text {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.02em;
}

html[data-lang="zh"] .quote-zh {
  font-family: var(--font-body-zh);
}

/* Visually hidden (a11y) */
.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;
}

/* Reduced motion base shell — enhanced in motion.css */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
