/* =========================================================
   即时互联 · Landing
   Style system: Anthropic-inspired warm-canvas editorial.
   Tokens from DESIGN.md.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Colors */
  --primary: #cc785c;
  --primary-active: #a9583e;
  --primary-disabled: #e6dfd8;
  --ink: #141413;
  --body: #3d3d3a;
  --body-strong: #252523;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --surface-dark-soft: #1f1e1b;
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --accent-teal: #5db8a6;
  --accent-amber: #e8a55a;
  --success: #5db872;

  /* Type */
  --serif: 'Cormorant Garamond', 'EB Garamond', 'Noto Serif SC', Garamond,
    'Times New Roman', serif;
  --sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius */
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  /* Spacing */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;
  --s-section: 96px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

code,
pre {
  font-family: var(--mono);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- Type utilities ---------- */
.serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.serif-it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.display-xl {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.display-lg {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display-md {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.on-dark {
  color: var(--on-dark);
}

.on-dark-soft {
  color: var(--on-dark-soft);
}

.on-coral {
  color: var(--on-primary);
}

.on-coral-soft {
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  margin-top: var(--s-md);
  max-width: 540px;
}

.caption-eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-md);
}

.caption-on-dark {
  color: var(--on-dark-soft);
}

.caption-on-coral {
  color: rgba(255, 255, 255, 0.78);
}

.lead {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--body);
  max-width: 540px;
}

.lead strong {
  color: var(--ink);
  font-weight: 500;
}

.section-lead {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
  margin-top: var(--s-md);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-active);
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-on-coral {
  background: var(--canvas);
  color: var(--ink);
}
.btn-on-coral:hover {
  background: var(--surface-card);
}

.btn-text-on-coral {
  background: transparent;
  color: var(--on-primary);
  padding: 0;
  height: auto;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0;
}
.btn-text-on-coral:hover {
  border-bottom-color: var(--on-primary);
}

.link-quiet {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.link-quiet:hover {
  color: var(--primary);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

.badge-pill {
  background: var(--surface-card);
  color: var(--ink);
  padding: 5px 12px;
  border-radius: var(--r-pill);
}

/* ---------- Top Nav ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 245, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline-soft);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.brand-on-dark .brand-mark,
.brand-on-dark .brand-text {
  color: var(--on-dark);
}

.nav-links {
  display: flex;
  gap: var(--s-lg);
}

.nav-links a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--s-md);
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--s-section) 0 calc(var(--s-section) - 8px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-xxl);
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.eyebrow {
  margin-bottom: var(--s-lg);
}

.hero-copy h1 {
  margin: var(--s-md) 0 var(--s-lg);
}

.hero-cta-row {
  display: flex;
  gap: var(--s-md);
  margin-top: var(--s-xl);
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg);
  margin-top: var(--s-xxl);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-soft);
  display: inline-block;
}
.dot-success {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(93, 184, 114, 0.18);
}
.dot-teal {
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(93, 184, 166, 0.18);
}
.dot-amber {
  background: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(232, 165, 90, 0.18);
}

/* ---------- Hero Mockup ---------- */
.hero-mockup {
  position: relative;
}

/* ---------- Generic Mockup Card ---------- */
.mockup-card {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-dark);
  color: var(--on-dark);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px -28px rgba(20, 20, 19, 0.45),
    0 8px 18px -8px rgba(20, 20, 19, 0.18);
}

.mockup-card-dark {
  background: var(--surface-dark);
}

.mockup-tall {
  min-height: 460px;
  display: flex;
  flex-direction: column;
}

.mockup-code-tall {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.mockup-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface-dark-elevated);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dot-window {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-r {
  background: #ff5f57;
}
.dot-y {
  background: #febc2e;
}
.dot-g {
  background: #28c840;
}

.mockup-title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--on-dark-soft);
  letter-spacing: 0.02em;
}

/* ---------- Chat stream ---------- */
.chat-stream {
  padding: var(--s-lg) var(--s-lg) var(--s-md);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  flex: 1;
}

.chat-stream-roomy {
  padding: var(--s-xl) var(--s-xl) var(--s-lg);
  gap: var(--s-lg);
}

.chat-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--s-md);
  align-items: start;
}

.chat-tag {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 6px;
  border-radius: var(--r-md);
  text-align: center;
  align-self: start;
}

.chat-tag-user {
  background: rgba(250, 249, 245, 0.08);
  color: var(--on-dark);
}
.chat-tag-ai {
  background: rgba(204, 120, 92, 0.16);
  color: var(--primary);
}
.chat-tag-sys {
  background: rgba(93, 184, 166, 0.14);
  color: var(--accent-teal);
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--on-dark);
}

.chat-bubble code {
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-amber);
}

.chat-bubble-ai {
  background: rgba(204, 120, 92, 0.08);
  border-color: rgba(204, 120, 92, 0.18);
}

.chat-bubble-sys {
  background: rgba(93, 184, 166, 0.06);
  border-color: rgba(93, 184, 166, 0.18);
  color: var(--on-dark-soft);
  font-size: 13px;
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble p + .tool-call,
.chat-bubble p + .ai-steps {
  margin-top: 10px;
}

.tool-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 12.5px;
}

.tool-name {
  color: var(--accent-teal);
}
.tool-arg {
  color: var(--on-dark-soft);
}
.tool-status {
  margin-left: auto;
  color: var(--accent-amber);
}

.ai-steps {
  margin-top: 10px;
  padding-left: 0;
  counter-reset: aistep;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-steps li {
  position: relative;
  padding-left: 28px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--on-dark);
  counter-increment: aistep;
}
.ai-steps li::before {
  content: counter(aistep, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}
.ai-steps li code {
  font-size: 12px;
  color: var(--accent-amber);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Mockup footer ---------- */
.mockup-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--on-dark-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--surface-dark-elevated);
}
.mockup-footer-pad {
  padding: 14px 22px;
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--on-dark);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.status-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(93, 184, 166, 0.2);
  display: inline-block;
  margin-right: 4px;
}

/* ---------- Stats band ---------- */
.stats-band {
  background: var(--surface-soft);
  padding: var(--s-xxl) 0;
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-xl);
}

.stat-value {
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.stat-suffix {
  font-size: 22px;
  margin-left: 2px;
  color: var(--primary);
  font-family: var(--serif);
  font-weight: 500;
}

.stat-label {
  margin-top: var(--s-sm);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Section heads ---------- */
.section-head {
  max-width: 720px;
  margin-bottom: var(--s-xxl);
}
.section-head-dark .display-lg {
  color: var(--on-dark);
}

/* ---------- Features ---------- */
.features {
  padding: var(--s-section) 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-lg);
}

.feature-card {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  min-height: 280px;
}

.feature-index {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.12em;
}

.feature-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.feature-body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--body);
}

.feature-hint {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-md);
}

/* ---------- Product band (dark) ---------- */
.product-band {
  background: var(--surface-dark);
  padding: var(--s-section) 0;
  color: var(--on-dark);
}

.mockup-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-lg);
}

/* code block (used in product mockup + connector) */
.code-block {
  flex: 1;
  margin: 0;
  padding: var(--s-lg) var(--s-xl);
  background: var(--surface-dark-soft);
  color: var(--on-dark);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow: auto;
  white-space: pre;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.code-line {
  display: block;
}

.code-prompt {
  color: var(--accent-teal);
  margin-right: 6px;
}
.code-cmd {
  color: var(--on-dark);
}
.code-comment {
  color: var(--muted-soft);
}
.code-dim {
  color: var(--on-dark-soft);
}
.code-ok {
  color: var(--success);
}
.code-warn {
  color: var(--primary);
}
.code-accent {
  color: var(--accent-amber);
}
.code-key {
  color: var(--primary);
  font-weight: 500;
}
.code-type {
  color: var(--accent-teal);
}
.code-fn {
  color: var(--accent-amber);
}

/* ---------- Connector band ---------- */
.connector-band {
  padding: var(--s-section) 0;
  background: var(--canvas);
  border-top: 1px solid var(--hairline-soft);
}

.connector-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-xxl);
  align-items: center;
}

.connector-copy h2 {
  margin: var(--s-md) 0 var(--s-lg);
}

.connector-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--s-lg);
  margin-top: var(--s-xl);
}

.connector-bullets li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--s-md);
  align-items: start;
}

.bullet-num {
  font-family: var(--mono);
  color: var(--primary);
  font-size: 18px;
  line-height: 1.2;
}

.connector-bullets h4 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.connector-bullets p {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
}

/* ---------- Philosophy ---------- */
.philosophy-band {
  background: var(--surface-soft);
  padding: var(--s-section) 0;
  border-top: 1px solid var(--hairline-soft);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--s-xxl);
  align-items: start;
}

.philosophy-text h2 {
  margin-top: var(--s-md);
}

.philosophy-body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}

.philosophy-body p:first-letter {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4em;
}

.philosophy-tag {
  margin-top: var(--s-md);
}

.brand-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--primary);
}

/* ---------- Coral CTA ---------- */
.cta-section {
  padding: 0 0 var(--s-section);
}

.callout-card-coral {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-lg);
  padding: 64px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-xl);
  align-items: end;
}

.callout-card-coral .display-md {
  color: var(--on-primary);
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  align-items: flex-start;
  justify-content: flex-end;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--surface-dark);
  color: var(--on-dark-soft);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-xl);
  padding-bottom: var(--s-xxl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}

.footer-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--on-dark-soft);
  max-width: 280px;
}

.footer-col h5 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--on-dark);
  margin-bottom: var(--s-md);
}

.footer-col a {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--on-dark-soft);
  padding: 5px 0;
  transition: color 0.18s ease;
}

.footer-col a:hover {
  color: var(--on-dark);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-md);
  padding-top: var(--s-lg);
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--on-dark-soft);
}

.footer-meta {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid,
  .connector-grid,
  .philosophy-grid,
  .mockup-grid {
    grid-template-columns: 1fr;
    gap: var(--s-xxl);
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .callout-card-coral {
    grid-template-columns: 1fr;
    padding: 48px;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 22px;
    padding-right: 22px;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding: 56px 0;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-xl);
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .features,
  .product-band,
  .connector-band,
  .philosophy-band {
    padding: 64px 0;
  }
  .callout-card-coral {
    padding: 36px 28px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta-row .btn {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .chat-row {
    grid-template-columns: 44px 1fr;
    gap: 10px;
  }
}

/* =========================================================
   ANIMATION SYSTEM
   editorial-paced motion — slow, low-contrast, deliberate
   ========================================================= */

/* ---------- Keyframes ---------- */
@keyframes oc-breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.06); }
}

@keyframes oc-pulse-ring {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 0.7; }
  70%  { box-shadow: 0 0 0 10px currentColor; opacity: 0; }
  100% { box-shadow: 0 0 0 0 currentColor; opacity: 0; }
}

@keyframes oc-pulse-soft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.18); opacity: 0.7; }
}

@keyframes oc-spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes oc-cursor-blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes oc-shimmer {
  0%   { background-position: -180% 0; }
  100% { background-position: 280% 0; }
}

@keyframes oc-orb-drift-a {
  0%   { transform: translate3d(-8%, -6%, 0) scale(1); }
  50%  { transform: translate3d(10%, 6%, 0) scale(1.15); }
  100% { transform: translate3d(-8%, -6%, 0) scale(1); }
}

@keyframes oc-orb-drift-b {
  0%   { transform: translate3d(6%, 10%, 0) scale(1.05); }
  50%  { transform: translate3d(-8%, -4%, 0) scale(1); }
  100% { transform: translate3d(6%, 10%, 0) scale(1.05); }
}

@keyframes oc-orb-drift-c {
  0%   { transform: translate3d(0, 4%, 0) scale(0.95); }
  50%  { transform: translate3d(2%, -6%, 0) scale(1.1); }
  100% { transform: translate3d(0, 4%, 0) scale(0.95); }
}

@keyframes oc-coral-mesh {
  0%   { background-position: 0% 50%, 100% 50%, 50% 100%; }
  50%  { background-position: 100% 50%, 0% 50%, 50% 0%; }
  100% { background-position: 0% 50%, 100% 50%, 50% 100%; }
}

@keyframes oc-coral-sweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(160%); }
}

@keyframes oc-char-rise {
  0%   { transform: translate3d(0, 0.55em, 0); opacity: 0; filter: blur(2px); }
  100% { transform: translate3d(0, 0, 0); opacity: 1; filter: blur(0); }
}

@keyframes oc-bubble-in {
  0%   { transform: translate3d(0, 8px, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes oc-line-in {
  0%   { transform: translate3d(-6px, 0, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes oc-status-flow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes oc-tool-heartbeat {
  0%, 60%, 100% { opacity: 0.55; transform: scale(1); }
  20%, 40%      { opacity: 1;    transform: scale(1.5); }
}

@keyframes oc-conn-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.8; }
  50%      { transform: scaleX(1.15); opacity: 1; }
}

@keyframes oc-spike-pulse {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(45deg); }
}

@keyframes oc-eyebrow-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 120, 92, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(204, 120, 92, 0.12); }
}

@keyframes oc-scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(800%); opacity: 0; }
}

@keyframes oc-underline-grow {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@keyframes oc-drop-cap {
  0%   { font-size: 1em; color: var(--body); }
  100% { font-size: 1.4em; color: var(--ink); }
}

/* ---------- Ambient background (cream orbs) ---------- */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-canvas::before,
.ambient-canvas::after,
.ambient-orb {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}

.ambient-canvas::before {
  top: -10%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(closest-side, rgba(204, 120, 92, 0.18), transparent 70%);
  animation: oc-orb-drift-a 22s ease-in-out infinite;
}

.ambient-canvas::after {
  top: 30%;
  right: -10%;
  width: 460px;
  height: 460px;
  background: radial-gradient(closest-side, rgba(232, 165, 90, 0.16), transparent 70%);
  animation: oc-orb-drift-b 28s ease-in-out infinite;
}

.ambient-orb {
  bottom: -8%;
  left: 28%;
  width: 540px;
  height: 540px;
  background: radial-gradient(closest-side, rgba(93, 184, 166, 0.13), transparent 70%);
  animation: oc-orb-drift-c 26s ease-in-out infinite;
}

/* Make sure all sections sit above ambient */
.top-nav, .hero, .stats-band, .features, .product-band,
.connector-band, .philosophy-band, .cta-section, .footer {
  position: relative;
  z-index: 1;
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-reveal='fade'] {
  transform: none;
}

[data-reveal='slide-l'] {
  transform: translate3d(-28px, 0, 0);
}

[data-reveal='slide-l'].is-in {
  transform: translate3d(0, 0, 0);
}

[data-reveal='scale'] {
  transform: scale(0.96);
}

[data-reveal='scale'].is-in {
  transform: scale(1);
}

/* ---------- Split-char display ---------- */
.split-line {
  display: block;
  overflow: hidden;
}

.split-char {
  display: inline-block;
  transform: translate3d(0, 0.6em, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.split-ready .split-char {
  animation: oc-char-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--char-idx, 0) * 0.028s + 0.15s);
}

/* The italic accent serif word breathes coral */
.serif-it {
  color: var(--primary);
  animation: oc-shimmer-color 7s ease-in-out infinite;
}

@keyframes oc-shimmer-color {
  0%, 100% { color: var(--primary); }
  50%      { color: var(--primary-active); }
}

/* When the italic accent lives on a dark surface, brighten it slightly */
.on-dark .serif-it,
.section-head-dark .serif-it {
  color: var(--accent-amber);
  animation-name: oc-shimmer-amber;
}

@keyframes oc-shimmer-amber {
  0%, 100% { color: var(--accent-amber); }
  50%      { color: var(--primary); }
}

/* Split chars inside the italic accent inherit color directly */
.serif-it .split-char {
  color: inherit;
}

/* ---------- Brand mark animation ---------- */
.brand-mark {
  animation: oc-spin-slow 90s linear infinite;
  transform-origin: center;
  transition: transform 0.6s ease;
}

.brand:hover .brand-mark {
  animation-duration: 8s;
}

.footer-brand .brand-mark {
  animation: oc-spike-pulse 14s ease-in-out infinite;
}

/* ---------- Top nav scroll-shrink ---------- */
.top-nav.is-scrolled {
  background: rgba(250, 249, 245, 0.94);
  border-bottom-color: var(--hairline);
  box-shadow: 0 4px 24px -16px rgba(20, 20, 19, 0.18);
}

.top-nav.is-scrolled .nav-inner {
  height: 60px;
}

.nav-inner {
  transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a {
  position: relative;
  padding-bottom: 3px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* ---------- Magnetic primary button ---------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(
    140px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.32),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.32s ease;
  z-index: 0;
  pointer-events: none;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary > * {
  position: relative;
  z-index: 1;
}

.btn-primary {
  transition:
    background-color 0.2s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -16px rgba(204, 120, 92, 0.55);
}

/* secondary subtle glow */
.btn-secondary {
  position: relative;
  overflow: hidden;
}

.btn-secondary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(204, 120, 92, 0.12) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary:hover::after {
  transform: translateX(120%);
}

/* ---------- 3D tilt card ---------- */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

[data-tilt] > * {
  transform: translateZ(0);
}

/* ---------- Status dots (pulse) ---------- */
.dot-success,
.dot-teal,
.dot-amber {
  position: relative;
}

.dot-success::after,
.dot-teal::after,
.dot-amber::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: oc-pulse-ring 2.4s ease-out infinite;
}

.dot-success::after { color: var(--success); }
.dot-teal::after    { color: var(--accent-teal); }
.dot-amber::after   { color: var(--accent-amber); animation-delay: 0.7s; }

.dot-success { animation: oc-pulse-soft 2.4s ease-in-out infinite; }
.dot-teal    { animation: oc-pulse-soft 2.4s ease-in-out 0.4s infinite; }
.dot-amber   { animation: oc-pulse-soft 2.4s ease-in-out 0.9s infinite; }

.status-ring {
  position: relative;
}

.status-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  color: var(--accent-teal);
  animation: oc-pulse-ring 2.6s ease-out infinite;
}

/* ---------- Eyebrow badge pulse ---------- */
.badge-pill {
  animation: oc-eyebrow-glow 4.2s ease-in-out infinite;
}

/* ---------- Stats count-up suffix ---------- */
.stat-value {
  position: relative;
}

.stat-suffix {
  display: inline-block;
  animation: oc-pulse-soft 3s ease-in-out infinite;
}

.stat:nth-child(2) .stat-suffix { animation-delay: 0.4s; }
.stat:nth-child(3) .stat-suffix { animation-delay: 0.8s; }
.stat:nth-child(4) .stat-suffix { animation-delay: 1.2s; }

/* ---------- Mockup chrome window dots ---------- */
.dot-window {
  transition: transform 0.32s ease;
}

.mockup-card:hover .dot-r { transform: scale(1.18); }
.mockup-card:hover .dot-y { transform: scale(1.18); transition-delay: 0.06s; }
.mockup-card:hover .dot-g { transform: scale(1.18); transition-delay: 0.12s; }

/* ---------- Chat bubbles staged reveal ---------- */
.chat-stream .chat-row {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-stream .chat-row.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.chat-stream .chat-row.is-typing .chat-bubble::after {
  content: '▎';
  display: inline-block;
  margin-left: 2px;
  color: var(--primary);
  animation: oc-cursor-blink 0.9s steps(2, start) infinite;
}

/* tool_call heartbeat dot */
.tool-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tool-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: oc-tool-heartbeat 1.4s ease-in-out infinite;
}

/* Hide the leading bullet character from old markup */
.tool-status {
  font-size: 0;
}
.tool-status::after {
  content: '待授权';
  font-size: 12.5px;
  color: var(--accent-amber);
  font-family: var(--mono);
}

/* ---------- Code block scan line ---------- */
.code-block {
  position: relative;
}

.code-block::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: linear-gradient(
    180deg,
    rgba(204, 120, 92, 0.18),
    transparent
  );
  pointer-events: none;
  animation: oc-scan-line 9s ease-in-out infinite;
  animation-delay: 3s;
}

.code-line {
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
}

.code-line.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.code-line.is-cursor::after {
  content: '▎';
  margin-left: 2px;
  color: var(--accent-amber);
  animation: oc-cursor-blink 0.9s steps(2, start) infinite;
}

/* In the connector code block we keep all lines visible by default */
.code-block-syntax .code-line {
  opacity: 1;
  transform: none;
}

/* Subtle shimmer on syntax keywords in connector window */
.code-block-syntax .code-key,
.code-block-syntax .code-type,
.code-block-syntax .code-fn {
  background-image: linear-gradient(
    90deg,
    currentColor 0%,
    rgba(255, 255, 255, 0.85) 50%,
    currentColor 100%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  animation: oc-shimmer 8s linear infinite;
}

.code-block-syntax .code-type { animation-delay: 1.4s; }
.code-block-syntax .code-fn   { animation-delay: 2.8s; }

/* ---------- Feature card hover lift ---------- */
.feature-card {
  position: relative;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s ease,
    background-color 0.42s ease;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(204, 120, 92, 0.16),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.feature-card:hover {
  background: var(--surface-cream-strong);
  box-shadow: 0 24px 60px -32px rgba(20, 20, 19, 0.22);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card .feature-index {
  display: inline-block;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), color 0.42s ease;
}

.feature-card:hover .feature-index {
  transform: translateX(3px);
  color: var(--primary-active);
}

.feature-card > * {
  position: relative;
  z-index: 1;
}

/* ---------- Connector bullets ---------- */
.connector-bullets li {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.connector-bullets.is-in li {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.connector-bullets.is-in li:nth-child(1) { transition-delay: 0.15s; }
.connector-bullets.is-in li:nth-child(2) { transition-delay: 0.30s; }
.connector-bullets.is-in li:nth-child(3) { transition-delay: 0.45s; }

.bullet-num {
  display: inline-block;
  animation: oc-conn-pulse 3s ease-in-out infinite;
  transform-origin: left center;
}

.connector-bullets li:nth-child(2) .bullet-num { animation-delay: 0.6s; }
.connector-bullets li:nth-child(3) .bullet-num { animation-delay: 1.2s; }

/* ---------- Philosophy drop cap shimmer ---------- */
.philosophy-body p:first-of-type::first-letter {
  background: linear-gradient(180deg, var(--primary) 0%, var(--ink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 4px;
}

/* ---------- Coral callout band animated mesh ---------- */
.callout-card-coral {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.22), transparent 50%),
    radial-gradient(circle at 88% 76%, rgba(232, 165, 90, 0.45), transparent 55%),
    radial-gradient(circle at 50% 110%, rgba(169, 88, 62, 0.6), transparent 60%),
    var(--primary);
  background-size: 200% 200%, 200% 200%, 200% 200%;
  animation: oc-coral-mesh 14s ease-in-out infinite;
}

.callout-card-coral::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 80%
  );
  transform: translateX(-110%);
  animation: oc-coral-sweep 7s ease-in-out infinite;
  animation-delay: 2s;
  pointer-events: none;
}

.callout-card-coral > * {
  position: relative;
  z-index: 1;
}

/* ---------- Hover glow on CTAs over coral ---------- */
.btn-on-coral {
  transition:
    background-color 0.2s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease;
}

.btn-on-coral:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -18px rgba(20, 20, 19, 0.4);
}

.btn-text-on-coral {
  position: relative;
  overflow: hidden;
}

.btn-text-on-coral::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--on-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-text-on-coral:hover::after {
  transform: scaleX(1);
}

/* ---------- Footer link underline draw ---------- */
.footer-col a {
  position: relative;
  display: inline-block;
  padding-right: 2px;
}

.footer-col a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--on-dark);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-col a:hover::after {
  transform: scaleX(1);
}

/* ---------- Mockup tilt glow underlay ---------- */
.mockup-card {
  position: relative;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.mockup-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg,
      rgba(204, 120, 92, 0) 30%,
      rgba(204, 120, 92, 0.3) 50%,
      rgba(204, 120, 92, 0) 70%
    );
  background-size: 200% 200%;
  background-position: -50% -50%;
  opacity: 0;
  transition: opacity 0.42s ease;
  z-index: -1;
  filter: blur(20px);
  pointer-events: none;
}

.mockup-card:hover::after {
  opacity: 0.8;
  background-position: 150% 150%;
  transition: background-position 1.6s ease;
}

/* ---------- Code line accent: connector data flow strip ---------- */
.code-block-syntax::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary) 50%,
    transparent
  );
  background-size: 200% 100%;
  animation: oc-shimmer 5s linear infinite;
  pointer-events: none;
}

/* ---------- Brand link sweep on the eyebrow tag ---------- */
.brand-tag {
  position: relative;
  display: inline-block;
}

.brand-tag::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left center;
  animation: oc-underline-grow 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

/* ---------- Eyebrow caption inline accent line ---------- */
.caption-eyebrow {
  position: relative;
  padding-left: 28px;
}

.caption-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--primary);
  transform: translateY(-50%) scaleX(1);
  transform-origin: left center;
  animation: oc-conn-pulse 3.6s ease-in-out infinite;
}

.caption-on-dark::before {
  background: var(--accent-amber);
}

.caption-on-coral::before {
  background: var(--on-primary);
}

/* ---------- Hover micro-lift on stat cells ---------- */
.stat {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat:hover {
  transform: translateY(-3px);
}

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

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .split-char {
    opacity: 1 !important;
    transform: none !important;
  }

  .chat-stream .chat-row {
    opacity: 1 !important;
    transform: none !important;
  }

  .code-line {
    opacity: 1 !important;
    transform: none !important;
  }

  .ambient-canvas {
    display: none;
  }
}
