/*
 * [INPUT]: 无外部 CSS 框架依赖，消费浏览器原生系统字体栈与 CSS 自定义属性
 * [OUTPUT]: 对外提供静界品牌官网全局色彩令牌、响应式流体排版、呼吸圆环动效与无障碍高对比度适配样式
 * [POS]: public/ 的唯一视觉样式表，被 index.html 加载并配合 app.js 状态属性驱动交互
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */

/* ======================== 1. DESIGN TOKENS ======================== */
:root {
  color-scheme: dark;
  --bg-obsidian: #07080a;
  --bg-elevated: #0e1015;
  --bg-card: #12151c;
  --bg-card-subtle: #0b0d12;
  --text-primary: #f2efe9;
  --text-secondary: #b5b0a6;
  --text-muted: #8d887e;
  --accent-warm: #dfd2bc;
  --accent-gold: #c8b28e;
  --border-subtle: rgba(242, 239, 233, 0.18);
  --border-interactive: rgba(223, 210, 188, 0.48);
  --badge-live-bg: rgba(142, 192, 156, 0.14);
  --badge-live-fg: #a9d8b6;
  --badge-live-border: rgba(169, 216, 182, 0.5);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --max-container: 72rem;
}

@media (prefers-contrast: more) {
  :root {
    --text-secondary: #dedad2;
    --text-muted: #c4bfb5;
    --border-subtle: rgba(242, 239, 233, 0.55);
    --border-interactive: #f2efe9;
  }
}

@media (forced-colors: active) {
  .card,
  .platform-card,
  .btn,
  .lang-btn,
  .status-pill,
  .compare-panel,
  dialog {
    border: 1px solid CanvasText;
  }
}

/* ======================== 2. BASE & TYPOGRAPHY ======================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

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

body {
  margin: 0;
  line-height: 1.65;
  text-align: start;
  overflow-wrap: break-word;
  background:
    radial-gradient(circle at 50% 12%, rgba(200, 178, 142, 0.08), transparent 48%),
    var(--bg-obsidian);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin-block: 0;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.section-heading,
.hero-title {
  font-family: var(--font-serif);
  text-wrap: balance;
}

p {
  margin-block: 0;
  max-width: 68ch;
  text-wrap: pretty;
}

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

/* Language Toggle Visibility */
html[data-lang="zh"] [data-i18n="en"] {
  display: none !important;
}

html[data-lang="en"] [data-i18n="zh"] {
  display: none !important;
}

/* ======================== 3. HEADER NAVIGATION ======================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 8, 10, 0.78);
  border-block-end: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: var(--max-container);
  margin-inline: auto;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent-warm);
  display: grid;
  place-items: center;
}

.brand-mark::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent-warm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.5vw, 2rem);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-primary);
}

@media (max-width: 44rem) {
  .nav-links .hide-mobile {
    display: none;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.lang-btn,
.motion-btn {
  appearance: none;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-interactive);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-btn:hover,
.motion-btn:hover,
.lang-btn:focus-visible,
.motion-btn:focus-visible {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(242, 239, 233, 0.06);
}

/* ======================== 4. HERO & BREATHING HALO ======================== */
.hero {
  min-height: calc(100dvh - 4.25rem);
  max-width: var(--max-container);
  margin-inline: auto;
  padding: clamp(3.5rem, 8dvh, 6.5rem) clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.halo-stage {
  position: relative;
  width: clamp(9.5rem, 22vw, 13.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-block-end: clamp(2rem, 4dvh, 3rem);
}

.halo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(223, 210, 188, 0.55);
  box-shadow:
    0 0 48px rgba(200, 178, 142, 0.16),
    inset 0 0 32px rgba(200, 178, 142, 0.1);
  opacity: 0.85;
}

.halo-ring-inner {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 1px solid rgba(242, 239, 233, 0.32);
  background: radial-gradient(circle, rgba(223, 210, 188, 0.14) 0%, transparent 72%);
}

.halo-core {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text-primary);
}

@keyframes breathe-outer {
  0%, 100% {
    scale: 0.94;
    opacity: 0.55;
  }
  50% {
    scale: 1.08;
    opacity: 0.95;
  }
}

@keyframes breathe-inner {
  0%, 100% {
    scale: 1.04;
    opacity: 0.45;
  }
  50% {
    scale: 0.92;
    opacity: 0.88;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="paused"]) .halo-ring {
    animation: breathe-outer 7.2s ease-in-out infinite;
  }
  html:not([data-motion="paused"]) .halo-ring-inner {
    animation: breathe-inner 7.2s ease-in-out infinite;
  }
}

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  margin-block-end: 1.125rem;
}

.hero-title {
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.65rem);
  max-width: 18ch;
  margin-block-end: 1.35rem;
}

.hero-lead {
  font-size: clamp(1rem, 0.92rem + 0.45vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 44ch;
  margin-inline: auto;
  margin-block-end: 2.5rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.65rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--border-interactive);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-obsidian);
  border-color: var(--text-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(242, 239, 233, 0.04);
  color: var(--text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(242, 239, 233, 0.1);
  border-color: var(--text-primary);
}

/* ======================== 5. SECTIONS & SCROLL REVEAL ======================== */
.section {
  max-width: var(--max-container);
  margin-inline: auto;
  padding: clamp(4rem, 9dvh, 6.5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-block-start: 1px solid var(--border-subtle);
}

.section-header {
  margin-block-end: clamp(2.25rem, 5dvh, 3.5rem);
}

.section-heading {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  margin-block-end: 0.85rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Scroll Entry Effect + Fallback */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0.15;
        transform: translateY(1.5rem);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    .reveal-item {
      animation: reveal-up auto ease-out backwards;
      animation-timeline: view(block);
      animation-range: entry 5% cover 24%;
    }
  }
}

.reveal-fallback-init {
  opacity: 0.15;
  transform: translateY(1.25rem);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.reveal-fallback-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======================== 6. DIALOGUE MIRROR COMPARISON ======================== */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 1.5rem;
}

.compare-panel {
  border-radius: 1.125rem;
  padding: clamp(1.5rem, 3vw, 2.15rem);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.compare-panel.is-jingjie {
  background: linear-gradient(165deg, rgba(200, 178, 142, 0.1), var(--bg-card));
  border-color: var(--border-interactive);
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.compare-panel.is-jingjie .panel-tag {
  color: var(--accent-warm);
}

.chat-bubble {
  padding: 0.95rem 1.15rem;
  border-radius: 0.85rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(242, 239, 233, 0.12);
}

.chat-user {
  color: var(--text-secondary);
}

.chat-reply {
  color: var(--text-primary);
  border-inline-start: 3px solid var(--accent-gold);
}

.compare-panel:not(.is-jingjie) .chat-reply {
  color: var(--text-muted);
  border-inline-start-color: rgba(242, 239, 233, 0.25);
}

/* ======================== 7. PILLAR CARDS (CONTAINER QUERIES) ======================== */
.pillars-wrapper {
  container-type: inline-size;
}

.pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@container (min-width: 48rem) {
  .pillars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.125rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-index {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
}

.card h3 {
  font-size: 1.225rem;
  font-family: var(--font-serif);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ======================== 8. PRIVACY SANCTUARY BANNER ======================== */
.sanctuary-box {
  background: linear-gradient(135deg, var(--bg-elevated), #141821);
  border: 1px solid var(--border-interactive);
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 2rem;
  align-items: center;
}

.sanctuary-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.sanctuary-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.sanctuary-icon {
  color: var(--accent-warm);
  flex-shrink: 0;
  margin-block-start: 0.15rem;
}

/* ======================== 9. MULTI-PLATFORM MATRIX ======================== */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: 1.125rem;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.platform-card.is-live {
  border-color: var(--badge-live-border);
  cursor: pointer;
}

.platform-card.is-live:hover,
.platform-card.is-live:focus-visible {
  transform: translateY(-2px);
  border-color: var(--badge-live-fg);
}

.platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.platform-name {
  font-size: 1.0625rem;
  font-weight: 500;
}

.platform-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.status-pill.live {
  background: var(--badge-live-bg);
  color: var(--badge-live-fg);
  border-color: var(--badge-live-border);
}

/* ======================== 10. DIALOG & FOOTER ======================== */
dialog {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-interactive);
  border-radius: 1.125rem;
  padding: 2rem;
  max-width: min(92vw, 28rem);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 1rem;
}

.dialog-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: grid;
  gap: 0.85rem;
  margin-block-end: 1.5rem;
}

.site-footer {
  border-block-start: 1px solid var(--border-subtle);
  padding: 2.5rem clamp(1.25rem, 4vw, 2.5rem);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  max-width: var(--max-container);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links button,
.footer-links a {
  background: none;
  border: none;
  color: var(--text-secondary);
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.footer-links button:hover,
.footer-links a:hover {
  color: var(--text-primary);
}
