/* ==========================================================================
   Yuhang Display — shared design system
   Used by index.html and privacy.html. Keep this file in sync with both pages.
   Self-contained: system fonts only, no external requests.
   ========================================================================== */

/* ---------- 0. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  color-scheme: light;

  --ink-950: #040a19;
  --ink-900: #07122a;
  --ink-850: #0a1730;
  --ink-800: #0e1e3c;
  --ink-700: #16305a;

  --paper: #f4f6f9;
  --paper-2: #ffffff;
  --line: #e3e8f0;
  --line-2: #cfd7e4;

  --text: #0a1425;
  --text-soft: #45536f;
  --text-mute: #5b6780;

  --on-dark: #e9f1fc;
  --on-dark-soft: #a8b7d2;
  --on-dark-mute: #7c8cab;

  --cyan-700: #0369a1;
  --cyan-600: #0284c7;
  --cyan-500: #0ea5e9;
  --cyan-400: #38bdf8;
  --cyan-300: #7dd3fc;
  --cyan-200: #bae6fd;

  --amber-500: #f59e0b;
  --amber-300: #fcd34d;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --grad-cyan: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
  --grad-ink: linear-gradient(158deg, #040a19 0%, #0a1730 46%, #071127 100%);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow-1: 0 1px 2px rgba(9, 17, 33, .05), 0 1px 3px rgba(9, 17, 33, .04);
  --shadow-2: 0 14px 30px -18px rgba(9, 17, 33, .22), 0 2px 6px rgba(9, 17, 33, .05);
  --shadow-3: 0 40px 80px -40px rgba(6, 14, 30, .45), 0 16px 32px -24px rgba(6, 14, 30, .3);
  --shadow-cta: 0 12px 26px -10px rgba(2, 132, 199, .55);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --max-w: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.25rem);
  --section-y: clamp(3.75rem, 7vw, 6.5rem);
  --header-h: 70px;
}

/* ---------- 2. BASE ---------- */
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--cyan-600); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--cyan-700); }
:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(56, 189, 248, .25); color: var(--ink-950); }
code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(2, 132, 199, .08);
  color: var(--cyan-700);
  padding: .12em .38em;
  border-radius: 5px;
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink-900); color: #fff; padding: .75rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 3. LAYOUT ---------- */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section--paper { background: var(--paper); }
.section--white { background: var(--paper-2); border-block: 1px solid var(--line); }
.section-head { max-width: 780px; margin: 0 auto clamp(2.25rem, 4vw, 3.5rem); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-size: .71rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cyan-700);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; flex: none;
  background: linear-gradient(90deg, var(--cyan-500), rgba(14, 165, 233, .1));
}
.section-head .eyebrow { margin-bottom: 1rem; }
.section-title {
  font-size: clamp(1.65rem, 1.15rem + 1.6vw, 2.4rem);
  line-height: 1.16; font-weight: 800; letter-spacing: -.026em;
  color: var(--ink-900); text-wrap: balance;
}
.section-sub {
  margin-top: 1rem; color: var(--text-soft);
  font-size: clamp(.98rem, .95rem + .15vw, 1.06rem);
  text-wrap: pretty;
}

/* ---------- 4. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-sans); font-size: .94rem; font-weight: 650; line-height: 1;
  padding: .92rem 1.4rem; border-radius: var(--r-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease,
              border-color .18s ease, color .18s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--grad-cyan); color: var(--ink-950); box-shadow: var(--shadow-cta); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(2, 132, 199, .62); color: var(--ink-950); }
.btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(125, 211, 252, .38); color: var(--on-dark); }
.btn-ghost:hover { background: rgba(255, 255, 255, .13); border-color: rgba(125, 211, 252, .65); color: #fff; }
.btn-outline { background: var(--paper-2); border-color: var(--line-2); color: var(--ink-900); box-shadow: var(--shadow-1); }
.btn-outline:hover { border-color: var(--cyan-400); color: var(--cyan-700); transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* ---------- 5. TOP BAR ---------- */
.topbar {
  background: var(--ink-950);
  border-bottom: 1px solid rgba(56, 189, 248, .14);
  color: var(--on-dark-mute);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .055em;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem 1.25rem; flex-wrap: wrap; min-height: 38px; padding-block: .35rem;
}
.topbar-status {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--cyan-300); font-weight: 600; text-transform: uppercase;
}
.topbar-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}
.topbar-meta { display: flex; align-items: center; gap: .55rem 1.15rem; flex-wrap: wrap; }
.topbar-meta span { white-space: nowrap; }
.topbar a { color: var(--on-dark-soft); }
.topbar a:hover { color: var(--cyan-300); }

/* ---------- 6. HEADER / NAV ---------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 16px 34px -28px rgba(8, 17, 35, .55); border-color: var(--line-2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; flex: none; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; box-shadow: 0 8px 18px -10px rgba(2, 132, 199, .85); }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-size: 1.05rem; font-weight: 800; letter-spacing: .065em; color: var(--ink-900); white-space: nowrap; }
.brand-tag { margin-top: .18rem; font-family: var(--font-mono); font-size: .645rem; letter-spacing: .045em; color: var(--text-mute); }
.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-list { display: flex; align-items: center; gap: .2rem; }
.nav-list a {
  position: relative; display: inline-flex; align-items: center; white-space: nowrap;
  padding: .5rem .7rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; color: var(--text-soft);
  transition: color .18s ease, background-color .18s ease;
}
.nav-list a::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .12rem; height: 2px;
  border-radius: 2px; background: var(--grad-cyan);
  transform: scaleX(0); transform-origin: left; transition: transform .28s cubic-bezier(.22,.61,.36,1);
}
.nav-list a:hover { color: var(--ink-900); background: var(--paper); }
.nav-list a:hover::after { transform: scaleX(1); }
.nav-legal {
  margin-left: .35rem; padding: .42rem .7rem !important;
  border: 1px solid var(--line-2); border-radius: 7px;
  font-family: var(--font-mono); font-size: .72rem !important; font-weight: 500;
  letter-spacing: .01em; color: var(--text-mute) !important;
}
.nav-legal:hover { border-color: var(--cyan-400); color: var(--cyan-700) !important; background: rgba(2, 132, 199, .05); }
.nav-legal::after { display: none; }
.header-cta { font-size: .865rem; padding: .68rem 1.05rem; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-900);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .ico-close { display: none; }
.site-header.nav-open .nav-toggle .ico-open { display: none; }
.site-header.nav-open .nav-toggle .ico-close { display: block; }

/* ---------- 7. FOOTER ---------- */
.site-footer {
  background: var(--ink-950); color: var(--on-dark-mute);
  font-size: .855rem; line-height: 1.6;
  border-top: 1px solid rgba(125, 211, 252, .12);
  padding-block: clamp(3rem, 5vw, 4.5rem) 1.75rem;
}
.footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(125, 211, 252, .1); margin-bottom: 2.75rem;
}
.footer-brand { display: flex; align-items: center; gap: .85rem; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-tag { color: var(--on-dark-mute); }
.footer-note { max-width: 46ch; font-size: .82rem; color: var(--on-dark-mute); }
.footer-grid { display: grid; grid-template-columns: 1.45fr 1fr .95fr; gap: clamp(2rem, 4vw, 3.5rem); }
.footer-heading {
  font-family: var(--font-mono); font-size: .675rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cyan-300);
  margin-bottom: 1.05rem;
}
.footer-col p { margin-bottom: .55rem; }
.footer-col strong { color: var(--on-dark-soft); font-weight: 600; }
.footer-col code { background: rgba(255, 255, 255, .07); color: var(--cyan-200); }
.footer-col a { color: var(--on-dark-soft); }
.footer-col p a { display: inline-flex; align-items: center; min-height: 34px; }
.footer-col a:hover { color: var(--cyan-300); }
.footer-links { display: flex; flex-direction: column; gap: .7rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; }
.footer-links a::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%; flex: none;
  background: var(--cyan-500); opacity: .55; transition: opacity .18s ease;
}
.footer-links a:hover::before { opacity: 1; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
  flex-wrap: wrap; padding-top: 2rem; margin-top: 2.75rem;
  border-top: 1px solid rgba(125, 211, 252, .1);
  font-family: var(--font-mono); font-size: .715rem; color: var(--on-dark-mute);
}

/* ---------- 8. REVEAL ANIMATION ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); }
.js [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .75s cubic-bezier(.22, .61, .36, 1), transform .75s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--d, 0s);
}

/* ---------- 9. RESPONSIVE SHELL ---------- */
@media (max-width: 1120px) {
  .brand-tag { display: none; }
  .main-nav { gap: 1rem; }
  .nav-list a { font-size: .83rem; padding: .5rem .55rem; }
  .nav-legal { font-size: .68rem !important; padding: .4rem .55rem !important; }
  .header-cta { font-size: .82rem; padding: .6rem .85rem; }
}
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper-2); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2); padding: .6rem var(--gutter) 1.25rem;
  }
  .site-header.nav-open .main-nav { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav-list a { padding: .75rem .5rem; font-size: .95rem; }
  .nav-list a::after { display: none; }
  .nav-legal { margin: .35rem 0 0; align-self: flex-start; font-size: .76rem !important; }
  .header-cta { width: 100%; margin-top: .7rem; }
  .topbar-meta { gap: .25rem .9rem; }
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .topbar-inner { justify-content: flex-start; }
  .topbar-meta span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
