/* ==========================================================================
   ContextJemo — Semantic Layer AI
   Design system — dark editorial / infrastructure
   派生自 烁普智能 shuopu-site（同一家族语法），按 creed.md 收紧：
     · 6 档字阶 · 10 档间距 · 1 个强调色（琥珀）
     · 宋体只出现在纸面段（.sheet）
     · 版面主体只放真实产物（AET YAML / Kernel / 确认事件）
   ========================================================================== */

:root {
  /* ---- 明度阶梯 ---- */
  --ink-0: #060B11;
  --ink-1: #0E1A25;
  --ink-1h: #131F2B;
  --ink-1b: #0C1722;
  --ink-2: #16232F;
  --ink-console: #070E15;

  /* ---- 文字 ---- */
  --text: #EFEBE2;
  --text-2: #C6CCD3;
  --muted: #909BA8;
  --muted-2: #86929F;

  /* ---- 线 ---- */
  --line: rgba(232, 228, 218, 0.10);
  --line-2: rgba(232, 228, 218, 0.18);
  --line-3: rgba(232, 228, 218, 0.26);

  /* ---- 强调（唯一）---- */
  --amber: #DDA45C;
  --amber-2: #F0C48A;
  --amber-dim: rgba(221, 164, 92, 0.14);
  --teal: #7FB3AB;

  /* ---- 纸面（反相页）---- */
  --paper: #EFEBE3;
  --paper-2: #E8E3D9;
  --paper-ink: #16110C;
  --paper-ink-2: #3B3429;
  --paper-ink-3: #6A6255;
  --paper-line: rgba(22, 17, 12, 0.14);
  --paper-line-2: rgba(22, 17, 12, 0.26);
  --paper-amber: #7E5119;
  --paper-teal: #2C645E;

  /* ---- 字体 ---- */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC",
    "STSong", "SimSun", Georgia, serif;
  --mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace;

  /* ---- 6 档字阶（全站唯一）---- */
  --fs-1: clamp(32px, 4.4vw, 54px);   /* display */
  --fs-2: clamp(25px, 2.9vw, 36px);   /* h2 */
  --fs-3: 19px;                        /* h3 */
  --fs-4: 15px;                        /* body */
  --fs-5: 13.5px;                      /* small */
  --fs-6: 11px;                        /* label / mono */

  /* ---- 10 档间距（全站唯一）---- */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;  --sp-5: 24px;
  --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;  --sp-9: 96px;  --sp-10: 128px;

  --w: 1240px;
  --pad: 40px;
  --nav-h: 76px;
  --rh-1: var(--sp-9);
  --rh-2: var(--sp-8);
  --rh-3: var(--sp-7);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.24s;
  --t-mid: 0.4s;
  --rv: 0.7s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-4);
  line-height: 1.8;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* grid/flex 子项默认 min-width:auto 会被内容最小宽撑破视口 —— 统一放开 */
.hero-grid > *, .split > *, .g2 > *, .g3 > *, .g4 > *,
.pcards > *, .pillars > *, .steps > * { min-width: 0; }

::selection { background: var(--amber); color: #0A121B; }
.sheet ::selection { background: var(--paper-amber); color: var(--paper); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.sheet :focus-visible { outline-color: var(--paper-amber); }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 300;
  padding: 10px 16px; background: var(--amber); color: #14100A;
  font-size: var(--fs-5); font-weight: 500;
  transform: translateY(-160%); transition: transform var(--t-fast) var(--ease);
}
.skip:focus-visible { transform: none; }

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

/* ---------- layout ---------- */
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--rh-2) 0; position: relative; }
.section--xl { padding: var(--rh-1) 0; }
.section--tight { padding: var(--rh-3) 0; }
.bg-2 {
  background: linear-gradient(180deg, var(--ink-1h) 0%, var(--ink-1b) 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bg-3 { background: var(--ink-2); }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-8); align-items: start; }
.split--rev { grid-template-columns: 0.95fr 1.05fr; }
.hr { height: 1px; background: var(--line); border: 0; }

/* ---------- type（6 档）---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-6);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: var(--sp-3);
  font-weight:  500; flex-wrap: wrap; line-height: 1.9;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--line-3); flex: none;
}
h1, h2, h3 { font-weight: 400; line-height: 1.28; letter-spacing: 0.01em; }
.h-display {
  font-family: var(--sans);
  font-size: var(--fs-1);
  line-height: 1.16;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.h2 { font-family: var(--sans); font-size: var(--fs-2); line-height: 1.3; text-wrap: balance; }
.h3 { font-size: var(--fs-3); line-height: 1.55; font-weight: 500; letter-spacing: 0.01em; }
.lead { font-size: 17px; line-height: 1.85; color: var(--text-2); }
.small { font-size: var(--fs-5); line-height: 1.8; color: var(--muted); }
.body-sm { font-size: var(--fs-5); line-height: 1.85; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 琥珀全站只两处：.btn--solid（主 CTA 底色）· .trace（trace id 文字）
   其余出现（selection / focus / skip）属功能性反馈，非版面强调 */

/* 标题强调：中性处理，不占琥珀 */
.hl {
  color: var(--text-2);
  box-shadow: inset 0 -1px 0 var(--line-3);
}

/* trace id —— 全站唯一的琥珀文字（creed §记忆点）*/
.trace {
  font-family: var(--mono);
  font-size: var(--fs-6);
  color: var(--amber);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  transition: background var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 11, 17, 0.88);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-name { font-size: 16px; letter-spacing: 0.12em; font-weight: 500; }
.brand-name span {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--muted); display: block; margin-top: 1px; font-weight: 400;
}
.nav-links { display: flex; align-items: center; gap: var(--sp-6); }
.nav-links a {
  font-size: var(--fs-5); color: var(--text-2); letter-spacing: 0.04em;
  position: relative; padding: 4px 0; transition: color var(--t-fast);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--line-3);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }
.nav-links a:hover::after, .nav-links a:focus-visible::after { width: 100%; }
.nav-mobile-cta { display: none; }
.nav-cta {
  font-size: var(--fs-6); letter-spacing: 0.12em;
  border: 1px solid var(--line-2); padding: 11px 20px; color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  white-space: nowrap;
}
.nav-cta:hover, .nav-cta:focus-visible { border-color: var(--line-3); background: rgba(232, 228, 218, 0.05); }
.nav-lang {
  font-family: var(--mono); font-size: var(--fs-6); letter-spacing: 0.1em;
  color: var(--muted); border: 1px solid var(--line); padding: 10px 14px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.nav-lang:hover, .nav-lang:focus-visible { color: var(--text); border-color: var(--line-2); }
.burger {
  display: none; width: 40px; height: 40px; background: none; border: 0;
  cursor: pointer; position: relative;
}
.burger span {
  position: absolute; left: 9px; right: 9px; height: 1px; background: var(--text);
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast);
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 25px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-5); letter-spacing: 0.03em;
  padding: 14px 24px; border: 1px solid var(--line-2);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--solid { background: var(--amber); color: #14100A; border-color: var(--amber); font-weight: 500; }
.btn--solid:hover, .btn--solid:focus-visible { background: var(--amber-2); border-color: var(--amber-2); }
.btn--ghost { color: var(--text); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--line-3); background: rgba(232, 228, 218, 0.05); }

/* ---------- hero ---------- */
.hero { padding: calc(var(--nav-h) + var(--sp-9)) 0 var(--rh-1); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }
.hero-sub { font-size: 17px; line-height: 1.85; color: var(--text-2); margin-top: var(--sp-5); max-width: 34em; }
.hero-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }
.hero-note { margin-top: var(--sp-5); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }

/* ---------- 真实产物：代码面板 ---------- */
.art {
  background: var(--ink-console);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.art-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: rgba(232, 228, 218, 0.02);
}
.art-dots { display: flex; gap: 6px; flex: none; }
.art-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); display: block; }
.art-path {
  font-family: var(--mono); font-size: var(--fs-6); color: var(--muted-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.art-body { padding: var(--sp-4); overflow-x: auto; }
.art-body pre {
  font-family: var(--mono); font-size: var(--fs-5); line-height: 1.85;
  color: var(--text-2); white-space: pre;
}
.art-body pre .k { color: var(--teal); }
.art-body pre .v { color: var(--text); }
.art-body pre .c { color: var(--muted-2); }
.art-body pre .w { color: var(--text); font-weight: 600; }
.art-foot {
  border-top: 1px solid var(--line);
  padding: var(--sp-3) var(--sp-4);
  display: flex; justify-content: space-between; gap: var(--sp-4);
  align-items: center; flex-wrap: wrap;
}

/* ---------- cards ---------- */
.pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.pcards--duo { grid-template-columns: 1fr 1fr; }
.pcard {
  border: 1px solid var(--line);
  padding: var(--sp-6);
  background: var(--ink-1);
  display: flex; flex-direction: column;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pcard:hover { border-color: var(--line-3); }
.pcard .kicker {
  font-family: var(--mono); font-size: var(--fs-6); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--sp-3);
}
.pcard h3 { font-size: var(--fs-3); font-weight: 500; margin-bottom: var(--sp-3); }
.pcard p { font-size: var(--fs-5); line-height: 1.85; color: var(--muted); }
.pcard .trace { margin-top: var(--sp-5); }

/* ---------- 语义三支柱 ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); }
.pillar { padding: var(--sp-6); border-right: 1px solid var(--line); }
.pillar:last-child { border-right: 0; }
.pillar .num {
  font-family: var(--mono); font-size: var(--fs-6); color: var(--muted-2);
  letter-spacing: 0.16em; margin-bottom: var(--sp-4);
}
.pillar h3 { font-size: var(--fs-3); font-weight: 500; margin-bottom: var(--sp-3); }
.pillar p { font-size: var(--fs-5); line-height: 1.85; color: var(--muted); }
.pillar .trace { display: inline-block; margin-top: var(--sp-4); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); }
.step { border-top: 2px solid var(--line-2); padding-top: var(--sp-4); }
.step .n { font-family: var(--mono); font-size: var(--fs-6); color: var(--muted-2); letter-spacing: 0.14em; }
.step h4 { font-size: var(--fs-5); font-weight: 500; margin: var(--sp-3) 0 var(--sp-2); }
.step p { font-size: var(--fs-5); line-height: 1.8; color: var(--muted); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th, .tbl td {
  text-align: left; padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-5); line-height: 1.75;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.tbl thead th {
  font-family: var(--mono); font-size: var(--fs-6); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  border-bottom-color: var(--line-2);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--muted); }
.tbl td.ours { color: var(--text); }

/* ---------- 纸面段（宋体只在这里）---------- */
.sheet {
  background: var(--paper);
  color: var(--paper-ink);
  padding: var(--rh-2) 0;
  border-top: 1px solid var(--paper-edge);
  border-bottom: 1px solid var(--paper-edge);
}
.sheet .eyebrow { color: var(--paper-ink-3); }
.sheet .eyebrow::before { background: var(--paper-line-2); }
.sheet .h2 { font-family: var(--serif); }
.sheet .lead, .sheet .small { color: var(--paper-ink-2); }
.sheet .trace { color: var(--paper-amber); }
.sheet .art { background: #FBF9F4; border-color: var(--paper-line-2); }
.sheet .art-body pre { color: var(--paper-ink-2); }
.sheet .art-body pre .k { color: var(--paper-teal); }
.sheet .art-body pre .v { color: var(--paper-ink); }
.sheet .art-body pre .c { color: var(--paper-ink-3); }
.sheet .art-body pre .w { color: var(--paper-ink); font-weight: 600; }
.sheet .art-head { border-bottom-color: var(--paper-line); background: rgba(22, 17, 12, 0.03); }
.sheet .art-path { color: var(--paper-ink-3); }
.sheet .art-foot { border-top-color: var(--paper-line); }
.sheet .tbl-wrap { border-color: var(--paper-line); }
.sheet .tbl th, .sheet .tbl td { border-bottom-color: var(--paper-line); }
.sheet .tbl thead th { color: var(--paper-ink-3); border-bottom-color: var(--paper-line-2); }
.sheet .tbl td:first-child { color: var(--paper-ink-3); }
.sheet .tbl td.ours { color: var(--paper-ink); }
.sheet .lede-note { color: var(--paper-ink-2); }
.sheet .btn--ghost { border-color: var(--paper-line-2); color: var(--paper-ink); }
.sheet .btn--ghost:hover { background: rgba(22, 17, 12, 0.05); }

/* ---------- CTA ---------- */
.cta { padding: var(--rh-1) 0; border-top: 1px solid var(--line); }
.cta-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: var(--sp-8) 0 var(--sp-6); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-7); }
.foot-brand .brand-name { font-size: 15px; }
.foot-col h5 {
  font-family: var(--mono); font-size: var(--fs-6); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: var(--sp-4);
}
.foot-col li { margin-bottom: var(--sp-2); }
.foot-col a { font-size: var(--fs-5); color: var(--muted); transition: color var(--t-fast); }
.foot-col a:hover, .foot-col a:focus-visible { color: var(--text); }
.foot-bot {
  margin-top: var(--sp-7); padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--fs-6); color: var(--muted-2); font-family: var(--mono);
}

/* ---------- reveal ---------- */
.js .rv { opacity: 0; transform: translateY(18px); }
.js .rv.in { opacity: 1; transform: none; transition: opacity var(--rv) var(--ease), transform var(--rv) var(--ease); }
.js .rv-d1 { transition-delay: 0.06s; }
.js .rv-d2 { transition-delay: 0.12s; }
.js .rv-d3 { transition-delay: 0.18s; }

/* ---------- 声明条 ---------- */
.statement {
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.42; letter-spacing: -0.003em;
  max-width: 26em; text-wrap: balance;
}
.lede-note { font-size: var(--fs-5); color: var(--muted); margin-top: var(--sp-5); max-width: 42em; line-height: 1.85; }

.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-5); }
.chip {
  font-family: var(--mono); font-size: var(--fs-6); letter-spacing: 0.08em;
  border: 1px solid var(--line); padding: 7px 12px; color: var(--muted-2);
}

.sec-head { margin-bottom: var(--rh-3); }
.sec-head .h2 { margin-top: var(--sp-4); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .split, .split--rev { grid-template-columns: 1fr; gap: var(--sp-6); }
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: 0; border-bottom: 1px solid var(--line); }
  .pillar:last-child { border-bottom: 0; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .pcards, .pcards--duo { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --pad: 22px; }
  .nav-links {
    display: none; position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: rgba(6, 11, 17, 0.98); border-bottom: 1px solid var(--line);
    padding: var(--sp-4) var(--pad) var(--sp-5);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: var(--sp-3) 0; width: 100%; }
  .nav-mobile-cta { display: block; }
  .nav-cta { display: none; }
  .burger { display: block; }
  .burger.on span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .burger.on span:nth-child(2) { opacity: 0; }
  .burger.on span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .steps { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--nav-h) + var(--sp-7)); }
}
