/* AI&ENERGY OS — Shared stylesheet for /legal/* pages.
   Inherits the same paper/ink palette and Fraunces/Inter/JetBrains Mono
   stack used by the homepage. Kept in a shared file to ensure the five
   legal documents stay visually consistent and easy to update. */

:root {
  --paper: #F4F1EA;
  --ink:   #0A0A0A;
  --mute:  #4A4338;
  --soft:  #cdc2af;
  --rule:  #d8cfb9;
  --accent:#5b2c1a;
  --serif: 'Fraunces', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem; /* 17px — book-grade prose */
  line-height: 1.78;
  font-weight: 400;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1, "calt" 1;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 1.75rem; }

/* ── Brand bar (top sticky) ─────────────────────────── */
.brand-bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244,241,234,.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: .85rem 0;
}
.brand-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
}
.brand-link {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.18rem; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.brand-os {
  font-family: var(--mono);
  font-size: .58em; letter-spacing: .16em;
  margin-left: .45em; padding-left: .55em;
  border-left: 1px solid var(--soft);
  color: var(--mute); vertical-align: 0.18em;
}
.legal-nav { display: flex; gap: 1.1rem; font-family: var(--sans); font-size: .82rem; }
.legal-nav a {
  color: var(--mute); text-decoration: none; letter-spacing: .02em;
  padding: .25rem 0; border-bottom: 1px solid transparent;
}
.legal-nav a:hover, .legal-nav a.is-current {
  color: var(--ink); border-bottom-color: var(--ink);
}

/* ── Document head ──────────────────────────────────── */
.legal-doc { padding: clamp(3rem, 8vh, 6rem) 0 clamp(5rem, 10vh, 8rem); }
.doc-head {
  margin-bottom: clamp(3rem, 6vh, 5rem);
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--rule);
}
.eyebrow {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .28em; color: var(--mute);
  text-transform: uppercase;
  margin: 0 0 1.3rem;
}
.doc-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}
.meta {
  font-family: var(--sans); font-size: .78rem;
  letter-spacing: .03em;
  color: var(--mute); margin: 0;
}

/* ── Prose body ─────────────────────────────────────── */
.prose section { margin-bottom: clamp(2.6rem, 5vh, 4rem); }

.prose section.lead p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.55;
  letter-spacing: -.005em;
  color: var(--ink);
  margin: 0 0 1.4rem;
  max-width: 36em;
  text-wrap: pretty;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
  line-height: 1.22;
  letter-spacing: -.012em;
  font-variation-settings: "opsz" 60;
  margin: clamp(2.6rem, 5vh, 4rem) 0 1.4rem;
  color: var(--ink);
  text-wrap: balance;
}
.prose h2 .num {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: .58rem;
  letter-spacing: .28em;
  color: var(--mute);
  margin: 0 0 .7rem;
}
.prose h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.18rem;
  letter-spacing: -.003em;
  margin: 2rem 0 .7rem;
  color: var(--ink);
  text-wrap: balance;
}
.prose p {
  margin: 0 0 1.3rem;
  text-wrap: pretty;
  hyphens: auto;
  hanging-punctuation: first last;
}
.prose ul, .prose ol { padding-left: 1.5rem; margin: 0 0 1.3rem; }
.prose li { margin-bottom: .55rem; text-wrap: pretty; }
.prose ul ul, .prose ol ol { margin-top: .55rem; margin-bottom: 0; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose em { font-style: italic; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--soft);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.prose a:hover {
  text-decoration-color: var(--ink);
}

/* Callouts ──────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--ink);
  padding: .95rem 1.25rem;
  margin: 1.6rem 0;
  background: rgba(10,10,10,.025);
  font-size: .98rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout.dark {
  background: var(--ink); color: var(--paper);
  border-left-color: var(--paper);
}
.callout.dark a { color: var(--paper); }
.callout.strong {
  border-left-width: 4px;
  border-left-color: var(--accent);
  background: rgba(91,44,26,.05);
}

/* Keyword chips (STOP, HELP, etc.) ─────────────────── */
.keyword {
  display: inline-block;
  font-family: var(--mono);
  background: var(--ink); color: var(--paper);
  padding: .08rem .5rem; border-radius: 2px;
  font-size: .82em; letter-spacing: .06em;
  vertical-align: 1px;
}

/* Definition lists ─────────────────────────────────── */
.prose dl { margin: 0 0 1.2rem; }
.prose dt {
  font-family: var(--sans); font-weight: 500;
  font-size: .92rem; color: var(--ink); margin-top: .9rem;
}
.prose dd {
  margin: .25rem 0 .8rem;
  padding-left: 1.2rem;
  color: var(--mute);
}

/* Sub-heading note for sections that need bilingual confirmation */
.prose .zh {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92em;
  color: var(--mute);
  margin-top: .3rem;
}

/* Table of contents — no box, just hairline-framed, generously spaced */
.toc {
  border: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 2rem 0;
  margin: 0 0 4rem;
  background: transparent;
}
.toc h3 {
  font-family: var(--mono); font-weight: 400;
  font-size: .64rem; letter-spacing: .3em;
  color: var(--mute); margin: 0 0 1.4rem;
  text-transform: uppercase;
}
.toc ol {
  margin: 0; padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  columns: 2;
  column-gap: 3rem;
  counter-reset: toc;
}
.toc ol li {
  margin-bottom: .15rem;
  break-inside: avoid;
  counter-increment: toc;
  padding-left: 2.2rem;
  position: relative;
}
.toc ol li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .12em;
  font-family: var(--mono);
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--mute);
}
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 720px) { .toc ol { columns: 1; column-gap: 0; } }

/* ── Footer ─────────────────────────────────────────── */
.doc-foot {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .85rem;
  line-height: 1.7;
  color: var(--mute);
}
.doc-foot .contact { margin: 0 0 1.5rem; }
.doc-foot .contact a { color: var(--ink); text-decoration: none; }
.doc-foot .contact a:hover { text-decoration: underline; }
.doc-foot .cross-links { margin: 0 0 1.5rem; }
.doc-foot .cross-links a { color: var(--ink); margin: 0 .12rem; text-decoration: none; }
.doc-foot .cross-links a:hover { text-decoration: underline; }
.doc-foot .back a {
  font-family: var(--sans); font-size: .85rem;
  color: var(--mute); text-decoration: none;
}
.doc-foot .back a:hover { color: var(--ink); }

/* ── Configurations page (tier cards) ───────────────── */
.config-tier {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
.config-tier:last-of-type {
  border-bottom: none;
}

.config-tier-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.config-tier-eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 .6rem;
}
.config-tier-name {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -.015em;
  margin: 0 0 .6rem;
  color: var(--ink);
}
.config-tier-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--mute);
  margin: 0;
  max-width: 38ch;
}

.config-tier-price {
  font-family: var(--serif);
  text-align: right;
  white-space: nowrap;
  padding-top: 1.6rem;
}
.config-price-from {
  display: block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: .25rem;
}
.config-price-amount {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.9rem;
  letter-spacing: -.01em;
  color: var(--ink);
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.config-price-currency {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--mute);
  margin-left: .3rem;
  vertical-align: .25em;
}
.config-price-custom {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}

.config-spec {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 2rem;
  row-gap: .9rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.config-spec dt {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
  padding-top: .25rem;
  margin: 0;
}
.config-spec dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Foundation spine — names the core components in one prose paragraph,
   never an itemized spec table. The HNW move: name the spine, leave
   the rest implied. */
.config-foundation-spine {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 64ch;
}

/* "Beyond Foundation" — no spec table, single paragraph */
.config-beyond {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
}
.config-beyond-body {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: 64ch;
}

/* Mobile collapse: tier price drops below name; specs become single column */
@media (max-width: 720px) {
  .config-tier-head {
    flex-direction: column;
    gap: 1.2rem;
  }
  .config-tier-price {
    text-align: left;
    padding-top: 0;
    border-top: 1px solid var(--rule);
    padding-top: 1.2rem;
    width: 100%;
  }
  .config-spec {
    grid-template-columns: 1fr;
    row-gap: .35rem;
  }
  .config-spec dt {
    margin-top: 1.1rem;
  }
  .config-spec dt:first-of-type {
    margin-top: 0;
  }
}

/* ── FAQ list — editorial Q&A, no boxes ──────────────── */
.faq-list {
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.faq-q {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 1.8rem 0 .55rem;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.faq-q::before {
  content: "— ";
  color: var(--mute);
  margin-right: .15em;
}
.faq-a {
  margin: 0 0 0 0;
  padding: 0 0 1.8rem 1.4rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  text-wrap: pretty;
}
.faq-list dt:first-of-type { margin-top: 1.4rem; }
.faq-list dd:last-of-type { border-bottom: none; }
@media (max-width: 720px) {
  .faq-q { font-size: 1.08rem; }
  .faq-a { font-size: 1rem; padding-left: 1rem; }
}

/* ── Back-to-top — quiet hairline circle, bottom-right ─ */
.back-to-top {
  position: fixed;
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  right: clamp(1.5rem, 4vw, 2.5rem);
  z-index: 90;
  width: 44px;
  height: 44px;
  border: 1px solid var(--soft);
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  color: var(--mute);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease,
              color .15s ease, border-color .15s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--ink);
  border-color: var(--ink);
}
html { scroll-behavior: smooth; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 1rem; line-height: 1.7; }
  .container { padding: 0 1.3rem; }
  .legal-nav { gap: .7rem; font-size: .76rem; }
  .doc-head { margin-bottom: 2.4rem; padding-bottom: 1.4rem; }
  .prose section { margin-bottom: 2.6rem; }
  .prose section.lead p { font-size: 1.15rem; line-height: 1.55; }
  .prose h2 { margin-top: 2.6rem; margin-bottom: 1rem; }
  .prose h3 { font-size: 1.08rem; }

  .config-tier-name { font-size: 1.55rem; }
  .config-price-amount { font-size: 1.5rem; }
}
