/* corporate-site baseline tokens
 * 用法：复制到 src/styles/tokens.css 或 public/shared/styles/tokens.css
 * 页面只允许使用变量，不要随手写 hex / px。
 */

:root {
  color-scheme: light;

  /* color */
  --color-bg: #f6f4ef;
  --color-surface: #ffffff;
  --color-surface-2: #efede7;
  --color-ink: #14171a;
  --color-muted: #5b6470;
  --color-line: rgba(20, 23, 26, 0.12);
  --color-brand: #e85d2a;
  --color-brand-ink: #ffffff;
  --color-accent: #1f4e79;
  --color-success: #1f7a4d;
  --color-danger: #b42318;

  /* type */
  --font-display: "Söhne", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  --text-3xl: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
  --text-4xl: clamp(3rem, 2rem + 4.5vw, 6rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.7;

  /* space: 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* layout */
  --container: 1200px;
  --container-wide: 1440px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(56px, 8vw, 120px);
  --grid-gap: clamp(16px, 2vw, 32px);

  /* shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.16);

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 640ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b0f14;
  --color-surface: #151b23;
  --color-surface-2: #1b232d;
  --color-ink: #f3f5f7;
  --color-muted: #9aa6b2;
  --color-line: rgba(255, 255, 255, 0.1);
  --color-brand: #5eead4;
  --color-brand-ink: #06201c;
  --color-accent: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

::selection {
  background: var(--color-brand);
  color: var(--color-brand-ink);
}

/* layout */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 2 * var(--gutter), var(--container-wide));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section-tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}

/* type helpers */
.display {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.muted {
  color: var(--color-muted);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: var(--color-brand-ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-line);
}

.btn-ghost:hover {
  border-color: var(--color-ink);
}

/* cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--color-brand) 40%, transparent);
    box-shadow: var(--shadow-md);
  }

  .card:hover img {
    transform: scale(1.03);
  }
}

.card img {
  transition: transform var(--dur-slow) var(--ease-out);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
