/* MPower GEO Lens — research-desk editorial system.
   Tokens per DESIGN.md: pure white ground, ink text, committed claret,
   steel as the West data series. */

:root {
  --bg: oklch(1 0 0);
  --ink: oklch(0.22 0.015 355);
  --ink-2: oklch(0.40 0.02 355);
  --claret: oklch(0.42 0.145 355);
  --claret-bright: oklch(0.50 0.17 355);
  --claret-deep: oklch(0.30 0.12 355);
  --claret-deeper: oklch(0.24 0.10 355);
  --steel: oklch(0.42 0.07 250);
  --steel-soft: oklch(0.62 0.05 250);
  --line: oklch(0.895 0.01 355);
  --line-soft: oklch(0.93 0.008 355);
  --wash: oklch(0.968 0.007 355);
  --on-drench: oklch(0.97 0.01 355);
  --on-drench-muted: oklch(0.82 0.045 355);
  --focus: oklch(0.50 0.17 355);

  --serif: 'Besley', 'Songti SC', 'SimSun', Georgia, serif;
  --sans: 'Public Sans', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;

  --measure: 70ch;
  --col: 1120px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7.5rem);

  --z-nav: 30;
  --z-skip: 40;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); font-weight: 750; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.3125rem; line-height: 1.3; }
h4 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
p, li { max-width: var(--measure); text-wrap: pretty; }
a { color: var(--claret); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--claret-deep); }
strong { font-weight: 650; }
.lede { font-size: clamp(1.125rem, 1.8vw, 1.3125rem); line-height: 1.6; color: var(--ink-2); }
.small { font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

::selection { background: var(--claret); color: var(--on-drench); }

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

.skip {
  position: absolute; left: -9999px; z-index: var(--z-skip);
  background: var(--claret-deep); color: var(--on-drench); padding: 0.6rem 1rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- layout ---------- */
.wrap { max-width: var(--col); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5em; margin-bottom: 0.5em; }
.prose h3 { margin-top: 1.8em; margin-bottom: 0.4em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { margin-block: 1.5em; }
.prose figure { margin-block: 2em; }
.prose figcaption { font-size: 0.875rem; color: var(--ink-2); margin-top: 0.6rem; }
.prose blockquote {
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.5;
  padding-block: 0.5rem; margin-block: 1.6em; color: var(--claret-deep);
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .bar {
  display: flex; align-items: center; gap: 2rem;
  min-height: 4rem;
}
.wordmark {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.wordmark .seal {
  width: 1.65rem; height: 1.65rem; flex: none;
}
.wordmark small {
  font-family: var(--sans); font-weight: 500; font-size: 0.8125rem;
  color: var(--ink-2); letter-spacing: 0.01em; align-self: end; padding-bottom: 0.1rem;
}
.site-nav { display: flex; gap: 1.6rem; margin-left: auto; align-items: center; }
.site-nav a:not(.btn) {
  color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  padding-block: 0.4rem;
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--claret); }

.btn {
  display: inline-block; background: var(--claret); color: var(--on-drench);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  padding: 0.65rem 1.25rem; border: 0; cursor: pointer;
  transition: background 160ms ease-out;
}
.btn:hover { background: var(--claret-deep); color: var(--on-drench); }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-on-drench { background: var(--on-drench); color: var(--claret-deep); }
.btn-on-drench:hover { background: #fff; color: var(--claret-deeper); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem var(--pad) 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding-block: 0.7rem; border-bottom: 1px solid var(--line-soft); }
  .site-nav .btn { margin-top: 0.8rem; text-align: center; }
  .nav-toggle {
    display: block; margin-left: auto; background: none; border: 1px solid var(--line);
    padding: 0.45rem 0.7rem; cursor: pointer; font-size: 0.875rem; font-weight: 600;
  }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(4rem, 10vw, 8rem) clamp(3rem, 7vw, 5.5rem); }
.hero h1 { max-width: 21ch; }
.hero .lede { margin-top: 1.4rem; max-width: 58ch; }
.hero-actions { display: flex; gap: 1rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-rule {
  height: 4px; background: var(--claret); width: clamp(4rem, 9vw, 7rem);
  margin-bottom: 2.2rem;
}

/* ---------- stat figures ---------- */
.figs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0; border-block: 1px solid var(--line);
}
.fig {
  padding: 1.6rem 1.5rem 1.5rem;
  border-left: 1px solid var(--line);
}
.fig:first-child { border-left: 0; padding-left: 0; }
.fig b {
  display: block; font-family: var(--serif); font-weight: 750;
  font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.fig b .unit { font-size: 0.55em; font-weight: 600; }
.fig span { display: block; margin-top: 0.55rem; font-size: 0.9075rem; line-height: 1.45; color: var(--ink-2); max-width: 26ch; }
.fig.cn b { color: var(--claret); }
.fig.west b { color: var(--steel); }
@media (max-width: 700px) {
  .figs { grid-template-columns: 1fr 1fr; }
  .fig { border-left: 0; border-top: 1px solid var(--line-soft); padding-left: 0; }
  .fig:nth-child(-n+2) { border-top: 0; }
}

/* ---------- engine wall ---------- */
.engine-wall { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); }
.engine-col h3 { display: flex; align-items: baseline; gap: 0.7rem; padding-bottom: 0.9rem; border-bottom: 2px solid currentColor; }
.engine-col.cn h3 { color: var(--claret); }
.engine-col.west h3 { color: var(--steel); }
.engine-col h3 .count { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; margin-left: auto; }
.engine-col ul { list-style: none; padding: 0; }
.engine-col li {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 1.0625rem; color: var(--ink); max-width: none;
}
.engine-col li small { font-weight: 400; color: var(--ink-2); font-size: 0.875rem; margin-left: auto; text-align: right; }
@media (max-width: 700px) { .engine-wall { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption { text-align: left; font-weight: 600; padding-bottom: 0.7rem; font-size: 1rem; }
th, td { text-align: left; padding: 0.65rem 0.9rem 0.65rem 0; vertical-align: top; }
th { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--ink); white-space: nowrap; }
td { border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--wash); }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 560px; }

/* ---------- chart frames ---------- */
.chart { margin-block: 1rem; }
.chart svg { width: 100%; height: auto; }
.chart-caption { font-size: 0.875rem; color: var(--ink-2); margin-top: 0.7rem; max-width: var(--measure); }
.legend { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.875rem; color: var(--ink-2); margin-bottom: 0.8rem; }
.legend i { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.45rem; vertical-align: -1px; }
.legend .cn i { background: var(--claret); }
.legend .west i { background: var(--steel); }

/* ---------- demo dashboard ---------- */
.demo-frame { border: 1px solid var(--line); }
.demo-head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--wash);
}
.demo-head .title { font-weight: 700; font-size: 0.9375rem; }
.demo-head .meta { font-size: 0.8125rem; color: var(--ink-2); margin-left: auto; }
.tab-rail { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-rail button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 0.85rem 1.15rem; font-size: 0.9375rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.tab-rail button[aria-selected="true"] { color: var(--claret-deep); border-bottom-color: var(--claret); }
.tab-rail button:hover { color: var(--ink); }
.tab-panel { padding: clamp(1.25rem, 3vw, 2.25rem); }
.tab-panel[hidden] { display: none; }
.pivots { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pivots button {
  border: 1px solid var(--line); background: var(--bg); font-size: 0.8125rem; font-weight: 600;
  padding: 0.35rem 0.8rem; cursor: pointer; color: var(--ink-2); border-radius: 99px;
}
.pivots button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.answer-quote {
  border: 1px solid var(--line); padding: 1.1rem 1.25rem; margin-top: 1rem;
}
.answer-quote .src { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.4rem; }
.answer-quote p { font-size: 0.9375rem; line-height: 1.6; }

/* theme cloud */
.cloud { display: flex; flex-wrap: wrap; gap: 0.55rem 0.9rem; align-items: baseline; max-width: 60ch; }
.cloud span { line-height: 1.2; font-weight: 600; }
.cloud .s1 { font-size: 0.8125rem; color: var(--ink-2); font-weight: 500; }
.cloud .s2 { font-size: 1rem; color: var(--ink-2); }
.cloud .s3 { font-size: 1.25rem; color: var(--ink); }
.cloud .s4 { font-size: 1.6rem; color: var(--claret-deep); font-family: var(--serif); }
.cloud .s5 { font-size: 2.1rem; color: var(--claret); font-family: var(--serif); font-weight: 700; }

/* ---------- split panel rows ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.duo > * { min-width: 0; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }

.hemis { border-top: 4px solid; padding-top: 1.1rem; }
.hemis.cn { border-color: var(--claret); }
.hemis.west { border-color: var(--steel); }
.hemis h3 { margin-bottom: 0.6rem; }

/* ---------- solutions ---------- */
.sol-list { border-top: 1px solid var(--line); }
.sol-row {
  display: grid; grid-template-columns: minmax(180px, 1fr) 2fr auto;
  gap: clamp(1rem, 3vw, 3rem); align-items: baseline;
  padding: 1.9rem 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.sol-row h3 { font-size: 1.5rem; transition: color 160ms ease-out; }
.sol-row:hover h3 { color: var(--claret); }
.sol-row p { color: var(--ink-2); font-size: 0.9875rem; }
.sol-row .go { font-weight: 600; color: var(--claret); white-space: nowrap; font-size: 0.9375rem; }
@media (max-width: 700px) { .sol-row { grid-template-columns: 1fr; gap: 0.5rem; } }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 650; font-size: 1.125rem; padding: 1.2rem 2.2rem 1.2rem 0;
  list-style: none; position: relative; font-family: var(--serif);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%; translate: 0 -50%;
  font-family: var(--sans); font-weight: 400; font-size: 1.4rem; color: var(--claret);
  transition: rotate 200ms ease-out;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details > div { padding: 0 0 1.4rem; }

/* ---------- CTA band + footer ---------- */
.cta-band { background: var(--claret-deep); color: var(--on-drench); }
.cta-band h2 { color: #fff; max-width: 24ch; }
.cta-band p { color: var(--on-drench-muted); margin-top: 0.9rem; }
.cta-band .email {
  font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-weight: 600;
  color: #fff; text-decoration-color: var(--on-drench-muted);
}
.cta-band .inner { padding-block: clamp(3.5rem, 7vw, 5.5rem); display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
@media (max-width: 820px) { .cta-band .inner { grid-template-columns: 1fr; } }

.site-foot { background: var(--claret-deeper); color: var(--on-drench-muted); font-size: 0.9075rem; }
.site-foot .cols {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
}
.site-foot h4 { color: #fff; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.9rem; }
.site-foot ul { list-style: none; padding: 0; }
.site-foot li { padding: 0.22rem 0; }
.site-foot a { color: var(--on-drench-muted); text-decoration: none; }
.site-foot a:hover { color: #fff; }
.site-foot .brand p { max-width: 34ch; margin-top: 0.8rem; }
.site-foot .legal {
  border-top: 1px solid oklch(0.35 0.09 355); padding-block: 1.2rem 1.6rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.8125rem;
}
@media (max-width: 820px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- forms ---------- */
.lead-form { max-width: 34rem; }
.lead-form label { display: block; font-weight: 600; font-size: 0.9075rem; margin: 1.1rem 0 0.35rem; }
.lead-form input, .lead-form select, .lead-form textarea {
  width: 100%; border: 1px solid var(--ink-2); background: var(--bg);
  padding: 0.65rem 0.8rem; font-size: 1rem; border-radius: 0;
}
.lead-form input:focus, .lead-form select:focus, .lead-form textarea:focus {
  outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus);
}
.lead-form .hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.lead-form button { margin-top: 1.5rem; }
.form-note { font-size: 0.875rem; color: var(--ink-2); margin-top: 0.9rem; }
.form-ok { border: 1px solid var(--claret); padding: 1.2rem 1.4rem; font-weight: 600; color: var(--claret-deep); }
.form-err { color: var(--claret); font-weight: 600; margin-top: 0.8rem; }

/* ---------- code + compare table ---------- */
pre {
  background: var(--ink); color: oklch(0.93 0.01 355);
  padding: 1.2rem 1.4rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.6;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
pre .c { color: oklch(0.62 0.03 355); }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; }
.compare td.yes { color: var(--claret-deep); font-weight: 700; }
.compare td.no { color: var(--ink-2); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; padding-inline: 0.9rem; }
.compare th:not(:first-child) { white-space: normal; }

.engine-brief { border-top: 1px solid var(--line); }
.engine-brief > div {
  display: grid; grid-template-columns: minmax(170px, 1fr) 2.6fr;
  gap: clamp(1rem, 3vw, 2.5rem); padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.engine-brief h3 { font-size: 1.25rem; }
.engine-brief h3 small { display: block; font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); margin-top: 0.3rem; }
.engine-brief p { font-size: 0.9875rem; color: var(--ink-2); max-width: 62ch; }
@media (max-width: 700px) { .engine-brief > div { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; translate: 0 14px; }
.js .reveal.in { opacity: 1; translate: 0 0; transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1), translate 500ms cubic-bezier(0.22, 1, 0.36, 1); }
.js .reveal.d1.in { transition-delay: 90ms; }
.js .reveal.d2.in { transition-delay: 180ms; }
.js .reveal.d3.in { transition-delay: 270ms; }
.js .bars-grow rect.bar { transform: scaleY(0); transform-origin: bottom; }
.js .bars-grow.in rect.bar { transform: scaleY(1); transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.tab-panel { animation: none; }
.js .tab-panel.fade { animation: panel-in 160ms ease-out; }
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
  .js .bars-grow rect.bar { transform: none; transition: none; }
  .js .tab-panel.fade { animation: none; }
  .btn, .sol-row h3, .faq summary::after { transition: none; }
}

/* ---------- print ---------- */
@media print {
  .site-head, .cta-band, .site-foot, .nav-toggle { display: none; }
}
