/* ============================================================
   YunZhongTech · Design System
   探索星辰大海 · Exploring the Cosmos
   ============================================================ */

/* --- Self-Hosted Fonts ---
   自托管可变字体（拉丁字符集），替代被大陆网络阻断的 Google Fonts 外链；
   中文字形回退至系统字体栈（PingFang SC / Microsoft YaHei），零网络开销。 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900; /* 可变字体：单文件覆盖全部字重 */
  font-display: swap;
  src: url('../fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- CSS Custom Properties --- */
:root {
  /* ── Color System: Abyssal Intelligence ── */
  --color-void:        #05070b;
  --color-deep-space:  #08111a;
  --color-nebula-dark: #0c1723;
  --color-surface:     #101d2b;
  --color-surface-alt: #12283a;
  --color-border:      rgba(184, 217, 255, 0.1);
  --color-border-glow: rgba(70, 211, 220, 0.34);

  /* Primary Gradient: Nebula Spectrum */
  --gradient-nebula: linear-gradient(135deg, #18d6c6, #2f8dff, #8e7cff);
  --gradient-nebula-text: linear-gradient(135deg, #fff3c4 0%, #78f0e5 42%, #8db8ff 100%);
  --gradient-aurora: linear-gradient(135deg, #1dd6b5, #2d8cff, #a889ff);
  --gradient-sunset: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  --gradient-cosmic: linear-gradient(180deg, #05070b 0%, #08111a 42%, #0d1b2a 100%);

  /* Text Colors */
  --text-primary:   #f7fbff;
  --text-secondary: #b8c7d7;
  --text-tertiary:  #75889b;
  --text-accent:    #75e9df;
  --text-highlight: #d8c27a;

  /* Accent Colors */
  --accent-indigo:   #5f78ff;
  --accent-blue:     #2f8dff;
  --accent-cyan:     #18d6c6;
  --accent-purple:   #8e7cff;
  --accent-rose:     #f43f5e;
  --accent-amber:    #f59e0b;
  --accent-emerald:  #10b981;

  /* ── Typography ── */
  /* 中文回退链：PingFang SC (macOS/iOS) → Microsoft YaHei (Windows) → 系统默认 */
  --font-display: 'Space Grotesk', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --font-body:    'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Font Sizes (modular scale ~1.25) */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px */
  --text-8xl:  6rem;       /* 96px */

  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;
  --weight-black:     900;

  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.1em;
  --tracking-widest:  0.2em;

  /* ── Spacing (8px base) ── */
  --space-1:   0.25rem;  /* 4px */
  --space-2:   0.5rem;   /* 8px */
  --space-3:   0.75rem;  /* 12px */
  --space-4:   1rem;     /* 16px */
  --space-5:   1.25rem;  /* 20px */
  --space-6:   1.5rem;   /* 24px */
  --space-8:   2rem;     /* 32px */
  --space-10:  2.5rem;   /* 40px */
  --space-12:  3rem;     /* 48px */
  --space-16:  4rem;     /* 64px */
  --space-20:  5rem;     /* 80px */
  --space-24:  6rem;     /* 96px */
  --space-32:  8rem;     /* 128px */

  /* ── Layout ── */
  --max-width:     1280px;
  --max-width-lg:  1440px;
  --max-width-sm:  960px;
  --content-padding: var(--space-6);

  /* ── Border Radius ── */
  --radius-sm:   0.375rem;  /* 6px */
  --radius-md:   0.5rem;    /* 8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.25rem;   /* 20px */
  --radius-full: 9999px;

  /* ── Glassmorphism ── */
  --glass-bg:       rgba(9, 22, 34, 0.64);
  --glass-bg-hover: rgba(14, 37, 54, 0.82);
  --glass-blur:     24px;
  --glass-border:   1px solid rgba(184, 217, 255, 0.12);

  /* ── Shadows ── */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl:   0 16px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 18px 70px rgba(0, 0, 0, 0.38),
                 0 0 42px rgba(24, 214, 198, 0.1);
  --shadow-glow-cyan: 0 0 24px rgba(24, 214, 198, 0.22),
                      0 0 80px rgba(47, 141, 255, 0.08);

  /* ── Animation ── */
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart:   cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:    150ms;
  --duration-normal:  300ms;
  --duration-slow:    500ms;
  --duration-slower:  800ms;
  --duration-slowest: 1200ms;

  /* ── Z-Index Scale ── */
  --z-base:       1;
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-overlay:    300;
  --z-modal:      400;
  --z-popover:    500;
  --z-toast:      600;
  --z-nav:        700;
  --z-particles:  -1;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast:    0ms;
    --duration-normal:  0ms;
    --duration-slow:    0ms;
    --duration-slower:  0ms;
    --duration-slowest: 0ms;
  }
}

/* ============================================================
   Global Reset & Base
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background:
    radial-gradient(circle at 78% 8%, rgba(24, 214, 198, 0.08), transparent 30rem),
    radial-gradient(circle at 8% 28%, rgba(47, 141, 255, 0.08), transparent 34rem),
    linear-gradient(180deg, #05070b 0%, #07111b 46%, #05070b 100%);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-void);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* Links */
a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out-quart);
}

a:hover {
  color: var(--text-highlight);
}

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

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* Paragraph */
p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   Utility Classes
   ============================================================ */

/* Text Gradient — Biotech Gold */
.text-gradient {
  background: var(--gradient-nebula-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glow Text */
.text-glow {
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.4),
               0 0 40px rgba(99, 102, 241, 0.1);
}

/* Glass Card */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

.container--lg {
  max-width: var(--max-width-lg);
}

.container--sm {
  max-width: var(--max-width-sm);
}

/* Section */
.section {
  padding-block: var(--space-24);
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(184, 217, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 217, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  opacity: 0.45;
}

.section--hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: var(--space-4);
}

.section-header__title {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.section-header__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin-inline: auto;
}

/* Divider */
.divider {
  width: 60px;
  height: 2px;
  background: var(--gradient-nebula);
  border: none;
  margin: var(--space-8) auto;
  border-radius: var(--radius-full);
}

/* Visually Hidden (SR 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;
}

/* Scroll Reveal (animate-on-scroll) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-slower) var(--ease-out-expo),
              transform var(--duration-slower) var(--ease-out-expo);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }
.reveal--delay-5 { transition-delay: 500ms; }

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-quart);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, #e8cf83 0%, #58e8d8 48%, #4d8fff 100%);
  color: #061019;
  box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.3),
              0 0 80px rgba(99, 102, 241, 0.1);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-highlight);
}

/* Tag / Badge */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  background: rgba(24, 214, 198, 0.08);
  color: #a9f9ef;
  border: 1px solid rgba(24, 214, 198, 0.2);
}
