/* ============================================
   ADG Design System — Phase 2
   CSS Variables + Self-hosted Fonts + Product Lines
   ============================================ */

/* ── Fonts: Inter (Latin) ── */
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:400; src:url(./fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:500; src:url(./fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:600; src:url(./fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:700; src:url(./fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:800; src:url(./fonts/inter-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-display:swap; font-weight:900; src:url(./fonts/inter-latin-900-normal.woff2) format('woff2'); }

/* ── Fonts: Noto Sans TC (CJK — common subsets only) ── */
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:400;
  src:url(./fonts/noto-sans-tc-102-400-normal.woff2) format('woff2');
  unicode-range: U+4E00-9FFF; /* CJK Unified Ideographs — covers 99% of TC usage */
}
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:400;
  src:url(./fonts/noto-sans-tc-103-400-normal.woff2) format('woff2');
  unicode-range: U+3000-303F, U+3100-312F, U+FE30-FE4F; /* CJK Symbols, Bopomofo, Compatibility */
}
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:400;
  src:url(./fonts/noto-sans-tc-104-400-normal.woff2) format('woff2');
  unicode-range: U+FF00-FFEF; /* Halfwidth and Fullwidth Forms */
}
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:700;
  src:url(./fonts/noto-sans-tc-102-700-normal.woff2) format('woff2');
  unicode-range: U+4E00-9FFF;
}
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:700;
  src:url(./fonts/noto-sans-tc-103-700-normal.woff2) format('woff2');
  unicode-range: U+3000-303F, U+3100-312F, U+FE30-FE4F;
}
@font-face {
  font-family:'Noto Sans TC'; font-style:normal; font-display:swap; font-weight:700;
  src:url(./fonts/noto-sans-tc-104-700-normal.woff2) format('woff2');
  unicode-range: U+FF00-FFEF;
}

/* ── Root Variables ── */
:root {
  /* Brand */
  --c-brand: #7c6aff;
  --c-brand-rgb: 124, 106, 255;

  /* 7 Product Lines (from categories.json) */
  --c-proav: #fb923c;
  --c-proav-rgb: 251, 146, 60;
  --c-creative: #ec4899;
  --c-creative-rgb: 236, 72, 153;
  --c-oracle: #8b5cf6;
  --c-oracle-rgb: 139, 92, 246;
  --c-academy: #14b8a6;
  --c-academy-rgb: 20, 184, 166;
  --c-playground: #f59e0b;
  --c-playground-rgb: 245, 158, 11;
  --c-tools: #22c55e;
  --c-tools-rgb: 34, 197, 94;
  --c-ailab: #06b6d4;
  --c-ailab-rgb: 6, 182, 212;

  /* Backgrounds */
  --bg: #02040a;
  --bg-card: rgba(13, 17, 23, 0.7);
  --bg-elevated: rgba(255, 255, 255, 0.03);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #8b949e;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-zh: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

  /* Glassmorphism */
  --glass-bg: rgba(13, 17, 23, 0.6);
  --glass-blur: 20px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 100px;

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* Nav */
  --nav-height: 72px;
  --nav-height-scrolled: 60px;
}

/* ── Apply fonts globally ── */
body, html {
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6,
.hero-title, .hero-desc, .hero-badge,
.capability-card h3, .capability-card p,
.stat-label, .cat-content h3, .cat-content p,
.chinese-sub, .nav-link span, .mobile-link span {
  font-family: var(--font-zh), var(--font-sans);
}

/* ── Nav scroll state ── */
.site-nav {
  height: var(--nav-height);
  transition: height var(--duration-normal) var(--ease-smooth),
              background var(--duration-normal) var(--ease-smooth),
              border-color var(--duration-normal) var(--ease-smooth);
}
.site-nav.scrolled {
  height: var(--nav-height-scrolled);
  background: rgba(2, 4, 10, 0.92);
  border-bottom-color: rgba(124, 106, 255, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ── Typewriter cursor ── */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--c-brand);
  margin-left: 2px;
  animation: typewriter-blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes typewriter-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Brand gradient text utility ── */
.gradient-brand {
  background: linear-gradient(135deg, var(--c-brand), var(--c-ailab));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-proav {
  background: linear-gradient(135deg, #fb923c, #ff5722);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Product line nav dropdown ── */
.nav-products-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  min-width: 420px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-smooth),
              transform var(--duration-fast) var(--ease-smooth),
              visibility var(--duration-fast);
  z-index: 1001;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.nav-link-wrapper { position: relative; }
.nav-link-wrapper:hover .nav-products-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.dropdown-item .dd-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.dropdown-item .dd-label {
  font-weight: 500;
}
.dropdown-item .dd-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── ⌘K Search hint button ── */
.search-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.search-hint-btn:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}
.search-hint-btn kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.4;
}

/* ── Experience Center CTA ── */
.hero-cta-experience {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(124, 106, 255, 0.12);
  color: var(--c-brand);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(124, 106, 255, 0.25);
  transition: transform var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}
.hero-cta-experience:hover {
  transform: translateY(-2px);
  background: rgba(124, 106, 255, 0.2);
  box-shadow: 0 8px 24px rgba(124, 106, 255, 0.2);
}
