/* Base: design tokens, reset, typography, page atmosphere, a11y utilities. */
:root {
  color-scheme: dark;

  /* Type */
  --font-sans: "Inter", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Rajdhani", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --fs-label: .75rem;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1rem;
  --fs-lg: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --fs-xl: clamp(1.375rem, 1.2rem + .6vw, 1.75rem);
  --fs-2xl: clamp(2.5rem, 1.6rem + 4vw, 5rem);
  --lh-tight: .98;
  --lh-base: 1.65;
  --tracking-label: .22em;

  /* Spacing (4px base) */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --section-y: clamp(5rem, 3rem + 7vw, 9rem);
  --wrap-max: 80rem;
  --header-h: 4.5rem;
  --tap: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Colour: deep night with two neons and an acid accent */
  --bg: #060913;
  --bg-raise: #0A1020;
  --panel: rgba(9, 14, 28, .78);
  --text-strong: #EEF6FF;
  --text: #B9C6DA;
  --text-muted: #8D9AB1;
  --cyan: #00F0FF;
  --magenta: #FF2BD6;
  --acid: #E4FF3A;
  --line: rgba(0, 240, 255, .14);
  --line-strong: rgba(0, 240, 255, .36);
  --glow-cyan: rgba(0, 240, 255, .45);
  --glow-magenta: rgba(255, 43, 214, .42);
  --header-bg: rgba(6, 9, 19, .72);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background:
    radial-gradient(70rem 40rem at 90% 0%, rgba(255, 43, 214, .07), transparent 65%),
    radial-gradient(60rem 40rem at 0% 45%, rgba(0, 240, 255, .05), transparent 65%),
    var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-autospace: normal;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* Typography */
h1, h2, h3 { color: var(--text-strong); font-family: var(--font-display); font-weight: 600; text-wrap: balance; }
h2 {
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: .005em;
  text-transform: uppercase;
}
h3 { font-size: var(--fs-xl); line-height: 1.1; letter-spacing: .01em; }
p { text-wrap: pretty; }

/* Chinese & mixed text: Rajdhani has no CJK, so Noto Sans SC takes over — give it room. */
:lang(zh) h2 { font-weight: 500; line-height: 1.2; letter-spacing: .04em; }
:lang(zh) h3 { font-weight: 500; line-height: 1.35; letter-spacing: .03em; }
:lang(zh) p { line-height: 1.85; line-break: strict; }

/* Atmosphere: a fine grid under everything, faint scanlines over everything. */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 240, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
body::after {
  z-index: 50;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, .35));
}

/* Accessibility utilities */
::selection { color: var(--bg); background: var(--cyan); }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--acid);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

@media (forced-colors: active) {
  body::before, body::after { display: none; }
}
