/* ============================================
   TimeWitness Base Styles — Ethereal Time-Capsule System
   ============================================ */

/* ── Google Fonts — Oxanium + DM Sans ── */
@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@200..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Noto+Sans+SC:wght@300;400;500;600;700;800;900&display=swap');

/* ── Modern Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--display-ink);
  background-color: var(--sky-lightest);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar — Ethereal Blue ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--sky-light);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-glow), var(--primary));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-display);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-display);
  color: var(--display-ink);
}

h1 {
  font-size: var(--text-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--ls-hero);
  font-weight: var(--fw-bold);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--fw-semibold);
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-semibold);
}

p {
  margin-bottom: 1em;
}

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

/* ── Links ── */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--primary-light);
}

/* ── Focus States ── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--gradient-btn);
  color: var(--inverse-white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-bold);
  z-index: 999;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: 1rem;
  color: var(--inverse-white);
}

/* ── Selection ── */
::selection {
  background: rgba(10, 132, 196, 0.15);
  color: var(--display-ink);
}

/* ── Chinese text class ── */
.cn-heading {
  font-family: var(--font-chinese-heading);
}

.cn-body {
  font-family: var(--font-chinese-body);
}

/* ── Utility: Screen reader only ── */
.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;
}
