/* ========================================================
   Project Silk — Home v0 Prototype Styles
   Tokens mirror packages/shared-ui/src/tokens/tokens.css
   ======================================================== */

:root {
  /* Brand palette (locked) */
  --rich-black: #18181B;
  --deep-navy: #1E3A5F;
  --deep-navy-2: #15263F;
  --light-blue: #60A5FA;
  --light-blue-soft: #93C5FD;
  --white: #FAFAFA;
  --copper: #B45309;
  --copper-hot: #D97706;

  /* Semantic */
  --text-primary: var(--white);
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --surface-border: rgba(255, 255, 255, 0.06);
  --surface-border-strong: rgba(255, 255, 255, 0.12);

  /* Glows */
  --glow-copper-low: rgba(180, 83, 9, 0.14);
  --glow-copper: rgba(180, 83, 9, 0.28);
  --glow-copper-high: rgba(217, 119, 6, 0.42);
  --glow-blue: rgba(96, 165, 250, 0.22);
  --glow-blue-high: rgba(96, 165, 250, 0.38);

  /* Fonts */
  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-zh: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Density (overridden via data-density) */
  --section-py: 140px;
  --container-max: 1280px;
  --container-px: 48px;
}

[data-density="compact"] {
  --section-py: 96px;
  --container-px: 40px;
}
[data-density="spacious"] {
  --section-py: 180px;
  --container-px: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--rich-black); }
body {
  background: var(--rich-black);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--light-blue); color: var(--rich-black); }

/* ─── Layout primitives ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}
.section { padding-block: var(--section-py); position: relative; }
.section--navy { background: var(--deep-navy-2); }
.section--black { background: var(--rich-black); }

/* ─── Typography ─── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--light-blue);
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--light-blue);
  opacity: 0.6;
}
.eyebrow-zh {
  font-family: var(--font-zh);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--light-blue);
  opacity: 0.85;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 4px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
  border: 1px solid transparent;
  position: relative;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--copper-hot) 0%, var(--copper) 100%);
  color: var(--white);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset,
              0 12px 32px var(--glow-copper),
              0 2px 0 rgba(0,0,0,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset,
              0 16px 40px var(--glow-copper-high),
              0 2px 0 rgba(0,0,0,0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--surface-border-strong);
}
.btn-ghost:hover {
  border-color: var(--light-blue);
  color: var(--light-blue);
}
.btn .arrow {
  display: inline-block;
  transition: transform .25s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ─── Cards ─── */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.005) 100%);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 28px;
  transition: transform .35s ease, border-color .25s ease, box-shadow .35s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--light-blue) 50%, transparent 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--surface-border-strong);
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 80px -40px var(--glow-blue);
}
.card:hover::before { opacity: 1; }

/* ─── Living animations (Pattern A) ─── */
@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes drift-x {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}
@keyframes pulse-line {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}
@keyframes traveler {
  0% { transform: translateX(-10%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0; }
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}
.glow-blue { background: var(--glow-blue-high); }
.glow-copper { background: var(--glow-copper-high); }

[data-motion="off"] .glow-orb,
[data-motion="off"] .ambient-line,
[data-motion="off"] .traveler-dot {
  animation: none !important;
}
[data-motion="off"] #hero-canvas {
  opacity: 0.5;
}

[data-copper="low"]  { --copper-active: var(--glow-copper-low); }
[data-copper="normal"] { --copper-active: var(--glow-copper); }
[data-copper="high"] { --copper-active: var(--glow-copper-high); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
