/* ==========================================================================
   base.css —— 设计变量 / 重置 / 排版 / 通用工具类
   ========================================================================== */

/* ------------------------------------------------------------- 设计变量 */
:root {
  color-scheme: light;

  /* 品牌色：取自 igami Logo 的橙 / 蓝 / 绿 */
  --brand-orange: #ff7a1a;
  --brand-amber: #ffb020;
  --brand-blue: #2563eb;
  --brand-violet: #6d5bf7;
  --brand-teal: #0f9d8e;
  --brand-green: #41c86b;

  --accent: var(--brand-orange);
  --accent-contrast: #ffffff;
  --accent-soft: #fff3e6;
  --gradient: linear-gradient(135deg, #ff7a1a 0%, #ffb020 48%, #41c86b 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255, 122, 26, 0.12), rgba(65, 200, 107, 0.12));

  --bg: #f4f6fb;
  --bg-glow-a: rgba(255, 122, 26, 0.22);
  --bg-glow-b: rgba(37, 99, 235, 0.16);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;

  --text: #0f172a;
  --text-soft: #46536b;
  --muted: #7d8799;
  --border: #e4e8f0;
  --border-strong: #d2dae7;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 34px -18px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 34px 70px -34px rgba(15, 23, 42, 0.34);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Courier New", monospace;

  --maxw: 1180px;
  --header-h: 66px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --accent: #ff9a4d;
  --accent-contrast: #1a1206;
  --accent-soft: rgba(255, 154, 77, 0.14);

  --bg: #080c17;
  --bg-glow-a: rgba(255, 122, 26, 0.22);
  --bg-glow-b: rgba(37, 99, 235, 0.24);
  --surface: #111726;
  --surface-2: #161d2f;
  --surface-3: #1c2438;

  --text: #eaeef7;
  --text-soft: #b3bed2;
  --muted: #8593aa;
  --border: #232c42;
  --border-strong: #2f3a54;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 36px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 36px 72px -36px rgba(0, 0, 0, 0.8);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

/* 背景氛围光斑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 30rem at 12% -8%, var(--bg-glow-a), transparent 62%),
    radial-gradient(40rem 26rem at 92% 4%, var(--bg-glow-b), transparent 60%);
  opacity: 0.85;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ---------------------------------------------------------------- 排版 */
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- 布局 */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.page {
  padding-top: 28px;
  padding-bottom: 72px;
}

/* ------------------------------------------------------------ 通用工具 */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.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;
}

.is-hidden {
  display: none !important;
}

/* -------------------------------------------------------------- 动效 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------ 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 3px solid var(--bg);
}

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