/* =========================================================================
   AIMO Legal — standalone editorial page.
   Deep green-black brand surface (Black Bean / Gable), centered reading
   column, concentric-arc supergraphic. Reuses window.AIMO_LEGAL content;
   themes the docs.css prose components for the green field.
   ========================================================================= */

:root {
  --bean:    #06160D;   /* Black Bean — page base */
  --gable:   #153A25;   /* Gable Green — deep forest */
  --mineral: #48674C;   /* Mineral Green — muted sage */
  --acid:    #A7F932;   /* Acid Green — used very sparingly */
  --pearl:   #DEDEDE;

  --lp-head:   #ECF2EC;                       /* headings */
  --lp-body:   rgba(224, 230, 224, 0.80);     /* body copy */
  --lp-soft:   rgba(214, 224, 216, 0.55);     /* captions / meta */
  --lp-faint:  rgba(214, 224, 216, 0.40);
  --lp-line:   rgba(167, 200, 170, 0.16);     /* hairlines */
  --lp-line-2: rgba(167, 200, 170, 0.26);
  --lp-fill:   rgba(255, 255, 255, 0.022);    /* faint surface */

  --lp-col:   720px;
  --lp-dur:   200ms;
  --lp-ease:  cubic-bezier(.2,.6,.2,1);

  --font:     "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--lp-body);
  background: var(--bean);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
::selection { background: var(--acid); color: var(--bean); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ---- smooth cross-document page transitions (home ↔ Terms/Privacy) ---- */
@view-transition { navigation: auto; }
@keyframes page-in  { from { opacity: 0; transform: translateY(10px); } }
@keyframes page-out { to   { opacity: 0; transform: translateY(-10px); } }
::view-transition-old(root) { animation: page-out .32s var(--lp-ease) both; }
::view-transition-new(root) { animation: page-in  .42s var(--lp-ease) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---- ambient green field + supergraphic arcs ---- */
.lp-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(115% 70% at 50% -8%, rgba(21,58,37,0.55) 0%, rgba(6,22,13,0) 60%),
    radial-gradient(90% 60% at 92% 108%, rgba(72,103,76,0.18) 0%, rgba(6,22,13,0) 55%),
    var(--bean);
}
/* faint acid bloom behind the lower blob — the "liquid acid" hint */
.lp-glow {
  position: absolute; right: -6%; bottom: -14%;
  width: 60vw; height: 60vw; max-width: 920px; max-height: 920px;
  background: radial-gradient(circle, rgba(167,249,50,0.10) 0%, rgba(167,249,50,0) 64%);
  filter: blur(8px);
}
/* AIMO logomark blobs — large, cropped off-canvas, very low opacity */
.lp-blob {
  position: absolute; pointer-events: none; user-select: none;
  -webkit-user-drag: none;
  opacity: 0.05;
  filter: grayscale(1) brightness(1.4);
}
.lp-blob--br { right: -16vw; bottom: -16vw; width: 64vw; max-width: 1040px; transform: rotate(-8deg); }
.lp-blob--tl { left: -20vw; top: -16vw; width: 44vw; max-width: 680px; transform: rotate(168deg); opacity: 0.035; }

/* =========================================================================
   NAV — mirrors the home landing page top bar
   ========================================================================= */
.lp-nav {
  position: sticky; top: 0; z-index: 40;
  height: 72px; display: flex; align-items: center;
  background: rgba(6, 22, 13, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--lp-line);
}
.lp-nav__inner {
  width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.lp-nav__logo { display: flex; align-items: center; }
.lp-nav__logo img { height: 30px; width: auto; display: block; }
.lp-nav__links { display: flex; align-items: center; gap: 40px; }
.lp-nav__link {
  font-family: var(--font); font-size: 15px; font-weight: 400;
  color: var(--lp-soft); text-decoration: none;
  padding: 6px 0; position: relative; transition: color var(--lp-dur) var(--lp-ease);
}
.lp-nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px;
  background: var(--acid); transform: scaleX(0); transform-origin: left;
  transition: transform .2s var(--lp-ease);
}
.lp-nav__link:hover { color: var(--pearl); }
.lp-nav__link:hover::after { transform: scaleX(1); }
.lp-nav__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 22px; border-radius: 9999px;
  background: var(--acid); color: var(--bean);
  font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background var(--lp-dur) var(--lp-ease), transform .08s var(--lp-ease);
}
.lp-nav__cta:hover { background: #B8FF4E; }
.lp-nav__cta:active { transform: scale(.97); }
.lp-nav__arr { transition: transform .18s var(--lp-ease); }
.lp-nav__cta:hover .lp-nav__arr { transform: translateX(3px); }

/* =========================================================================
   PAGE / COLUMN
   ========================================================================= */
.lp-main { position: relative; z-index: 1; }

/* doc cross-fade */
#lp-doc { transition: opacity 220ms var(--lp-ease), transform 220ms var(--lp-ease); }
#lp-doc.is-leaving { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: reduce) { #lp-doc { transition: none; } }
.lp-wrap {
  max-width: var(--lp-col);
  margin: 0 auto;
  padding: 76px 28px 140px;
}

/* doc switch — discreet segmented control */
.lp-switch {
  display: inline-flex; gap: 3px; margin: 0 auto 56px; padding: 4px;
  background: var(--lp-fill); border: 1px solid var(--lp-line);
  border-radius: 9999px;
}
.lp-switch__row { display: flex; justify-content: center; }
.lp-switch button {
  appearance: none; border: 0; cursor: pointer; background: none;
  padding: 8px 20px; border-radius: 9999px;
  color: var(--lp-soft); font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  transition: color var(--lp-dur) var(--lp-ease), background var(--lp-dur) var(--lp-ease);
}
.lp-switch button:hover { color: var(--pearl); }
.lp-switch button[data-on="true"] { background: rgba(167,249,50,0.14); color: #C9F77C; }

/* title block */
.lp-title {
  text-align: center;
  font-family: var(--font);
  font-weight: 500; font-size: 64px; line-height: 1.02; letter-spacing: -0.035em;
  color: var(--lp-head); margin: 0;
}
.lp-updated {
  text-align: center; margin: 22px 0 0;
  font-size: 14.5px; font-weight: 500; color: var(--lp-soft);
  font-variant-numeric: tabular-nums;
}
.lp-version {
  display: inline-block; margin-left: 10px; padding: 2px 9px; border-radius: 9999px;
  border: 1px solid var(--lp-line-2); color: var(--lp-faint);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; vertical-align: 1px;
}

.lp-lead {
  margin: 40px 0 0;
  font-size: 18px; line-height: 1.6; letter-spacing: -0.01em;
  color: rgba(230, 236, 230, 0.88);
}

/* =========================================================================
   PROSE
   ========================================================================= */
.lp-prose { margin-top: 8px; font-size: 16px; line-height: 1.78; color: var(--lp-body); }
.lp-prose p { margin: 18px 0; }
.lp-prose strong { color: var(--lp-head); font-weight: 600; }
.lp-prose em { font-style: italic; color: rgba(230,236,230,0.9); }
.lp-prose a { color: #B6F35E; text-decoration: none; border-bottom: 1px solid rgba(167,249,50,0.35); transition: border-color var(--lp-dur) var(--lp-ease); }
.lp-prose a:hover { border-bottom-color: #B6F35E; }
.lp-prose ul, .lp-prose ol { margin: 16px 0; padding-left: 22px; }
.lp-prose li { margin: 9px 0; }
.lp-prose ul li::marker { color: var(--mineral); }
.lp-prose ol li::marker { color: var(--lp-soft); }

/* section heads — uppercase, numbered, like the reference */
.lp-sec {
  margin: 52px 0 0; padding-top: 6px;
  font-family: var(--font);
  font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lp-head);
  scroll-margin-top: 84px;
}
.lp-sec .lp-sec__n { color: #9ED15F; margin-right: 4px; }
.lp-prose h3.legal-h3 {
  margin: 30px 0 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--lp-head); text-transform: none;
}

/* statutory all-caps clause */
.lp-prose p.legal-caps {
  margin: 20px 0;
  padding: 16px 18px; border: 1px solid var(--lp-line); border-radius: 10px;
  background: var(--lp-fill);
  font-size: 13.5px; line-height: 1.7; color: var(--lp-body);
}
.lp-prose p.legal-caps strong { color: var(--lp-head); }

/* pill (inline path) */
.lp-prose .pill {
  display: inline-block; padding: 1px 8px; border-radius: 5px;
  background: var(--lp-fill); border: 1px solid var(--lp-line-2);
  color: var(--pearl); font-size: 14px; font-variant-numeric: tabular-nums;
}

/* =========================================================================
   THEMED COMPONENTS (reused from legal-data bodies)
   ========================================================================= */
/* callouts → quiet left-border notes */
.lp-prose .callout {
  display: flex; flex-direction: column; gap: 3px;
  margin: 22px 0; padding: 14px 18px;
  border: 1px solid var(--lp-line); border-left: 2px solid var(--mineral);
  border-radius: 8px; background: var(--lp-fill);
  font-size: 14.5px; line-height: 1.62;
}
.lp-prose .callout__title { font-weight: 600; color: var(--lp-head); }
.lp-prose .callout--info    { border-left-color: var(--info, #7AB3F0); }
.lp-prose .callout--warning { border-left-color: var(--warn, #FFB020); }
.lp-prose .callout--success { border-left-color: var(--acid); }

/* tables */
.lp-prose .doc-table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px;
  border: 1px solid var(--lp-line); border-radius: 10px; overflow: hidden;
}
.lp-prose .doc-table thead { background: rgba(255,255,255,0.03); }
.lp-prose .doc-table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--lp-soft); padding: 11px 14px; vertical-align: top;
}
.lp-prose .doc-table td { padding: 12px 14px; border-top: 1px solid var(--lp-line); color: var(--lp-body); vertical-align: top; }
.lp-prose .doc-table td:first-child { color: var(--lp-head); font-weight: 500; }

/* numbered steps */
.lp-prose ol.steps { list-style: none; counter-reset: step; margin: 24px 0; padding: 0; }
.lp-prose ol.steps > li { position: relative; padding: 0 0 22px 44px; counter-increment: step; }
.lp-prose ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 9999px;
  background: var(--lp-fill); border: 1px solid var(--lp-line-2);
  color: #9ED15F; font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
}
.lp-prose ol.steps > li::after {
  content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px;
  width: 1px; background: var(--lp-line);
}
.lp-prose ol.steps > li:last-child { padding-bottom: 0; }
.lp-prose ol.steps > li:last-child::after { display: none; }
.lp-prose ol.steps h4 { font-size: 15px; font-weight: 600; color: var(--lp-head); margin: 4px 0 4px; }
.lp-prose ol.steps p { font-size: 14.5px; color: var(--lp-body); margin: 0; line-height: 1.6; }

/* data-flow diagram */
.lp-prose .flow { margin: 26px 0; display: flex; flex-direction: column; align-items: center; }
.lp-prose .flow__device { width: 100%; max-width: 360px; }
.lp-prose .flow__node {
  border: 1px solid var(--lp-line); border-radius: 12px;
  background: var(--lp-fill); padding: 16px 18px; width: 100%; text-align: left;
}
.lp-prose .flow__node strong { display: block; color: var(--lp-head); font-size: 14.5px; font-weight: 600; margin: 7px 0 0; }
.lp-prose .flow__node ul { margin: 9px 0 0; padding-left: 16px; }
.lp-prose .flow__node ul li { font-size: 13px; color: var(--lp-body); margin: 3px 0; }
.lp-prose .flow__node p { margin: 7px 0 0; font-size: 12.5px; color: var(--lp-soft); }
.lp-prose .flow__node--device { border-color: rgba(167,249,50,0.45); background: rgba(167,249,50,0.08); }
.lp-prose .flow__node--chain { text-align: center; background: rgba(255,255,255,0.015); }
.lp-prose .flow__tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: #9ED15F; background: rgba(6,22,13,0.6); border: 1px solid var(--lp-line-2);
  border-radius: 5px; padding: 2px 8px;
}
.lp-prose .flow__node--chain .flow__tag { margin: 0 auto; }
.lp-prose .flow__tag--third { color: var(--lp-soft); }
/* connectors: centre stem from the device → horizontal bus → drop into each node */
.lp-prose .flow__rail { position: relative; display: flex; justify-content: space-around; width: 100%; max-width: 720px; height: 30px; }
.lp-prose .flow__rail::after {            /* centre stem: device bottom → bus */
  content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 13px; background: var(--lp-line-2);
}
.lp-prose .flow__rail::before {           /* horizontal bus linking the three drops */
  content: ""; position: absolute; top: 13px; left: 16.66%; right: 16.66%; height: 1px; background: var(--lp-line-2);
}
.lp-prose .flow__rail span { width: 1px; margin-top: 13px; background: var(--lp-line-2); } /* drop: bus → each node */
.lp-prose .flow__rail--single { justify-content: center; height: 22px; }
.lp-prose .flow__rail--single::before, .lp-prose .flow__rail--single::after { display: none; }
.lp-prose .flow__rail--single span { margin-top: 0; }
.lp-prose .flow__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; max-width: 720px; }

/* =========================================================================
   PLAIN-LANGUAGE SUMMARY (subtle lead block)
   ========================================================================= */
.lp-summary {
  margin: 40px 0 8px; padding: 22px 24px;
  border: 1px solid var(--lp-line); border-radius: 14px; background: var(--lp-fill);
}
.lp-summary__h {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #9ED15F; margin: 0 0 4px;
}
.lp-summary__note { font-size: 13.5px; line-height: 1.55; color: var(--lp-soft); margin: 0 0 14px; }
.lp-summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.lp-summary li {
  display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start;
  padding: 11px 0; border-top: 1px solid var(--lp-line); font-size: 14.5px; line-height: 1.55;
}
.lp-summary li:first-child { border-top: 0; }
.lp-summary__tick { margin-top: 3px; color: #9ED15F; }
.lp-summary__tick svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.6; }
.lp-summary b { color: var(--lp-head); font-weight: 600; }
.lp-summary__foot { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--lp-line); font-size: 13.5px; color: var(--lp-body); font-weight: 500; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.lp-foot { margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--lp-line); }
.lp-foot__note { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: var(--lp-soft); }
.lp-foot__note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; }
.lp-foot__next {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 24px; padding: 18px 22px;
  border: 1px solid var(--lp-line); border-radius: 14px; background: var(--lp-fill);
  text-decoration: none; transition: border-color var(--lp-dur) var(--lp-ease);
}
.lp-foot__next:hover { border-color: var(--lp-line-2); }
.lp-foot__next-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lp-soft); }
.lp-foot__next-title { display: block; font-size: 16px; font-weight: 600; color: var(--lp-head); margin-top: 4px; }
.lp-foot__next-go { display: inline-flex; align-items: center; gap: 7px; color: #9ED15F; font-size: 14px; font-weight: 600; white-space: nowrap; }
.lp-foot__next-go svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* =========================================================================
   BACK-TO-TOP
   ========================================================================= */
.lp-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  width: 42px; height: 42px; border-radius: 9999px;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(6,22,13,0.8); border: 1px solid var(--lp-line-2); color: var(--lp-soft);
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--lp-dur) var(--lp-ease), transform var(--lp-dur) var(--lp-ease), color var(--lp-dur) var(--lp-ease);
}
.lp-top.is-show { opacity: 1; transform: none; pointer-events: auto; }
.lp-top:hover { color: var(--pearl); }
.lp-top svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* toast */
.lp-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: rgba(6,22,13,0.94); border: 1px solid var(--lp-line-2); color: var(--pearl);
  font-size: 13px; font-weight: 500; padding: 11px 18px; border-radius: 9px;
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity var(--lp-dur) var(--lp-ease), transform var(--lp-dur) var(--lp-ease);
}
.lp-toast.is-show { opacity: 1; transform: translateX(-50%); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 760px) {
  .lp-wrap { padding: 48px 20px 110px; }
  .lp-title { font-size: 42px; }
  .lp-lead { font-size: 16.5px; }
  .lp-prose { font-size: 15.5px; }
  .lp-prose .flow__row { grid-template-columns: 1fr; }
  .lp-prose .flow__rail { display: none; }
  .lp-prose .flow__node { margin-top: 12px; }
  .lp-prose .flow__device { max-width: 100%; }
  .lp-prose .doc-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lp-foot__next { flex-direction: column; align-items: flex-start; }
  .lp-nav { height: 64px; }
  .lp-nav__inner { padding-inline: 16px; }
  .lp-nav__links { display: none; }
}

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