:root {
  /* Shared brand palette. Mirrors apps/chat/lib/core/theme/app_theme.dart and
     apps/chat/assets/brand/aegischat-icon.svg; keep in sync or tests fail. */
  --brand-jade: #0f7b63;
  --brand-jade-accent: #14a57f;
  --brand-jade-deep: #0b5f4a;
  --brand-jade-bright: #4fe0ae;
  /* Shield stops sampled from aegischat-icon.svg so marketing accents cannot drift from the product mark. */
  --brand-jade-start: #5be7b7;
  --brand-jade-mid: #21b789;
  --brand-jade-glow: #36d6a2;
  --brand-jade-highlight: #b7ffe3;
  --brand-amber: #ffc857;
  --brand-plate: #080b0d;
  --brand-canvas: #f4f7f5;
  --brand-mint: #e5f5ef;
  --brand-ink: #10231f;
  --brand-amber-ink: #8a5a00;

  --bg: var(--brand-canvas);
  --bg-2: #eaf3ef;
  --surface: #ffffff;
  --surface-2: #f9fcfb;
  --surface-3: #eef5f2;
  --line: #d7e4df;
  --line-2: #b8cec7;
  --text: var(--brand-ink);
  --text-soft: #4a5f59;
  --text-dim: #5d6f6a;
  --accent: var(--brand-jade);
  --accent-2: var(--brand-jade-deep);
  --accent-soft: color-mix(in srgb, var(--brand-jade) 10%, transparent);
  --ok: #0b6b51;
  --part: var(--brand-amber-ink);
  --plan: #5c6b66;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 28px 80px rgba(16, 35, 31, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1180px 640px at 84% -10%, color-mix(in srgb, var(--brand-mint) 76%, transparent), transparent 63%),
    radial-gradient(800px 500px at 4% 4%, color-mix(in srgb, var(--brand-jade-highlight) 12%, transparent), transparent 58%),
    var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

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

:where(a, button, input, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-jade) 42%, transparent);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 24%, color-mix(in srgb, var(--brand-jade-mid) 7%, transparent), transparent 26%),
    radial-gradient(circle at 86% 4%, color-mix(in srgb, var(--brand-jade-start) 9%, transparent), transparent 24%);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 10px 30px rgba(16, 35, 31, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 9px;
  background: var(--brand-plate);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-jade-glow) 24%, transparent);
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
}

nav {
  display: flex;
  gap: 28px;
  color: var(--text-soft);
  font-size: 14px;
}

nav a {
  transition: color 160ms ease;
}

nav a:hover {
  color: var(--text);
}

.button {
  min-height: 52px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  color: white;
  /* Match the product's solid jade primary action; deep jade remains the
     hover state so the white label keeps WCAG AA contrast. */
  background: var(--brand-jade);
  box-shadow: 0 12px 28px rgba(15, 123, 99, 0.22);
  font-weight: 750;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  background: var(--brand-jade-deep);
  box-shadow: 0 18px 40px rgba(15, 123, 99, 0.28);
}

.button-small {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
}

/* ---------- hero ---------- */

.hero {
  width: min(1180px, calc(100% - 32px));
  min-height: 720px;
  margin: 0 auto;
  padding: 96px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.9fr);
  align-items: center;
  gap: 64px;
}

.eyebrow {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-2);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1 {
  max-width: 640px;
  margin-bottom: 20px;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

h1 span {
  background: linear-gradient(120deg, var(--brand-jade-deep), var(--brand-jade));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 540px;
  text-wrap: pretty;
  color: var(--text-soft);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.75;
}

.hero-proof {
  max-width: 620px;
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-proof span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-boundary {
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 12px;
}

.hero-boundary summary {
  width: fit-content;
  color: var(--accent-2);
  font-weight: 750;
  cursor: pointer;
}

.hero-boundary summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-jade-start) 40%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}

.hero-boundary p {
  max-width: 620px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--brand-mint) 72%, transparent);
  line-height: 1.65;
}

.text-link {
  color: var(--accent-2);
  font-weight: 750;
}

.text-link span {
  display: inline-block;
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translateX(5px);
}

/* ---------- hero visual ---------- */

.hero-visual {
  position: relative;
  min-height: 600px;
  display: grid;
  place-items: center;
  /* Contain the decorative orbit rings so they can never spill past the
     hero column and create a page-level horizontal scrollbar at tablet and
     small-laptop widths. */
  overflow: clip;
}

.orbit {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--brand-jade-start) 16%, transparent);
  border-radius: 50%;
}

.orbit-one {
  width: 540px;
  height: 540px;
}

.orbit-two {
  width: 410px;
  height: 410px;
  border-style: dashed;
}

.phone {
  position: relative;
  z-index: 2;
  width: 390px;
  min-height: 560px;
  padding: 18px;
  border: 8px solid #0e1a17;
  border-radius: 44px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.phone-top {
  padding: 4px 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 14%, transparent);
}

.secure-pill {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  font-size: 9px;
}

.chat-thread {
  display: grid;
  gap: 12px;
}

.raw-message,
.optimized-message {
  border-radius: 18px;
  background: var(--surface);
}

.raw-message {
  padding: 16px;
  border: 1px dashed var(--line-2);
  background: var(--surface-3);
}

.raw-message span {
  font-size: 10px;
  color: var(--text-dim);
}

.raw-message p {
  margin: 7px 0;
  font-size: 13px;
}

.raw-message code {
  display: block;
  overflow: hidden;
  padding: 10px;
  border-radius: 10px;
  color: #143a31;
  background: #e7f0ec;
  font-size: 10px;
  white-space: nowrap;
}

.arrow-flow {
  text-align: center;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.optimized-message {
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--brand-jade-start) 28%, transparent);
  background: linear-gradient(150deg, #ecf8f3, #e0f2ea);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.spark {
  color: var(--accent-2);
}

.risk {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--part);
  background: color-mix(in srgb, var(--brand-amber) 30%, transparent);
  font-size: 9px;
}

.optimized-message code {
  display: block;
  margin: 13px 0 10px;
  color: var(--accent-2);
  font-weight: 750;
}

.optimized-message p {
  font-size: 13px;
  color: var(--text-soft);
}

.optimized-message button,
.after-card button {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--brand-jade);
  font-weight: 750;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.optimized-message button:hover,
.after-card button:hover {
  background: var(--brand-jade-deep);
  transform: translateY(-1px);
}

/* ---------- sections ---------- */

section[id] {
  scroll-margin-top: 104px;
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 104px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 52px;
}

.section-heading h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.section-heading p {
  text-wrap: pretty;
  color: var(--text-soft);
  font-size: 17px;
}

/* ---------- protocol ---------- */

.protocol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.protocol-tier {
  list-style: none;
}

.tier-label {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.node-grid {
  display: grid;
  gap: 16px;
}

.node-grid.cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.node-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.node-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.node {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(16, 35, 31, 0.045);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.node:hover {
  border-color: color-mix(in srgb, var(--brand-jade) 24%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(16, 35, 31, 0.08);
}

.node-core {
  border-color: color-mix(in srgb, var(--brand-jade) 30%, transparent);
  background: linear-gradient(160deg, var(--surface), var(--brand-mint));
  box-shadow: 0 20px 60px color-mix(in srgb, var(--brand-jade) 12%, transparent);
}

.node-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-head h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.node p {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-meta span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(16, 35, 31, 0.04);
  font-size: 11px;
}

.pill {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pill-ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
}

.pill-part {
  color: var(--part);
  background: color-mix(in srgb, var(--brand-amber) 26%, transparent);
}

.pill-plan {
  color: var(--plan);
  background: color-mix(in srgb, var(--plan) 14%, transparent);
}

.protocol-connector {
  position: relative;
  height: 56px;
  display: grid;
  place-items: center;
  list-style: none;
}

.protocol-connector::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

.protocol-connector span {
  position: relative;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--bg);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.status-note {
  margin: 36px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.ok-text {
  color: var(--ok);
}

.part-text {
  color: var(--part);
}

.plan-text {
  color: var(--plan);
}

/* ---------- experience ---------- */

.experience-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(16, 35, 31, 0.055);
}

.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.scenario-tab {
  padding: 18px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--text-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.scenario-tab:last-child {
  border-right: 0;
}

.scenario-tab:hover {
  color: var(--text);
}

.scenario-tab.is-active {
  color: var(--brand-jade-deep);
  background: var(--accent-soft);
}

.scenario-stage {
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.before-card,
.after-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.before-card {
  border-style: dashed;
  background: var(--surface-3);
}

.after-card {
  border-color: color-mix(in srgb, var(--brand-jade-start) 34%, transparent);
  background: linear-gradient(160deg, #f2fbf7, var(--brand-mint));
}

.stage-label {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.after-card .stage-label {
  color: var(--accent-2);
}

.before-card h3,
.after-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.before-card p,
.after-card p {
  color: var(--text-soft);
  font-size: 14px;
}

.after-card ul {
  margin: 14px 0 18px;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14px;
}

.after-card li {
  margin-bottom: 6px;
}

.route-marker {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  color: var(--text-dim);
}

.route-marker span {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.route-marker b {
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- security ---------- */

.security-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 104px 0;
}

.security-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 60px;
  align-items: start;
}

.security-section h2 {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.security-section .eyebrow {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 24%, transparent);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.security-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.security-list li {
  padding: 22px 0;
  text-wrap: pretty;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 17px;
}

.security-list span {
  color: var(--ok);
  font-size: 12px;
  font-weight: 850;
}

/* ---------- footer ---------- */

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
}

footer span:first-child {
  color: var(--text-soft);
  font-weight: 750;
}

/* ---------- motion + a11y ---------- */

.reveal {
  animation: rise-in 680ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .node-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 78px;
  }

  .hero-visual {
    min-height: 560px;
  }

  .scenario-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-marker span {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, var(--line-2), transparent);
  }

  .security-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
}

@media (max-width: 720px) {
  .node-grid.cols-2,
  .node-grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .scenario-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .scenario-tab:nth-child(2) {
    border-right: 0;
  }

  .scenario-tab:nth-child(1),
  .scenario-tab:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .site-header {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .site-header .button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .hero {
    width: calc(100% - 36px);
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 56px;
    gap: 26px;
  }

  .hero-copy,
  .hero-visual {
    width: 100%;
    min-width: 0;
  }

  .hero-visual {
    min-height: 540px;
  }

  .phone {
    width: min(350px, calc(100% - 16px));
  }

  .orbit-one {
    width: min(540px, 150%);
    height: auto;
    aspect-ratio: 1;
  }

  .orbit-two {
    width: min(410px, 114%);
    height: auto;
    aspect-ratio: 1;
  }

  h1 {
    font-size: 44px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-lead {
    font-size: 16px;
    line-height: 1.72;
  }

  .section,
  .security-section {
    width: calc(100% - 36px);
    padding: 80px 0;
  }

  .scenario-stage {
    padding: 20px;
    gap: 22px;
  }

  footer {
    align-items: flex-start;
    gap: 6px;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .phone {
    padding: 14px;
    border-width: 6px;
    border-radius: 34px;
  }

  .phone-top {
    gap: 6px;
    font-size: 11px;
  }

  .secure-pill {
    padding-inline: 6px;
    font-size: 8px;
  }

  .raw-message,
  .optimized-message {
    padding: 13px;
  }
}

/* ---------- not found ---------- */

.not-found {
  width: min(760px, calc(100% - 32px));
  min-height: calc(100dvh - 96px);
  margin: 0 auto;
  padding: 96px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.not-found h1 {
  margin-bottom: 18px;
}

.not-found > p:not(.eyebrow) {
  max-width: 560px;
  color: var(--text-soft);
  font-size: 17px;
}

.not-found .hero-actions {
  flex-wrap: wrap;
}

.not-found .hero-actions > a:not(.button) {
  color: var(--brand-jade-deep);
  font-weight: 700;
}

@media (max-width: 640px) {
  .not-found {
    padding: 64px 0;
  }

  .site-header .button-small {
    padding: 0 14px;
  }
}
