:root {
  color-scheme: light;
  --canvas: #f4f2ea;
  --paper: #fbfaf6;
  --ink: #14201d;
  --muted: #65706c;
  --line: #d8d9d1;
  --soft-line: #e7e6df;
  --night: #101a17;
  --night-2: #17231f;
  --acid: #c7f36a;
  --green: #2e6a4e;
  --green-soft: #dcebdc;
  --danger: #a53e34;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(20, 32, 29, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
section { scroll-margin-top: 92px; }
.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; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; transform: translateY(-160%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #2672ff; outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 12px clamp(24px, 5vw, 80px); border-bottom: 1px solid rgba(216,217,209,.9); background: rgba(244,242,234,.88); backdrop-filter: blur(16px); }
.site-header.compact { position: relative; }
.brand { width: max-content; display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--acid); font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a { color: #3f4c47; text-decoration: none; font-size: 14px; font-weight: 650; }
.site-header nav a:hover { color: var(--ink); }
.header-cta { justify-self: end; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 999px; padding: 0 20px; text-decoration: none; font-weight: 760; font-size: 14px; transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .56; cursor: progress; transform: none; }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: #293934; }
.button.primary.inverse { background: var(--acid); color: var(--ink); }
.button.primary.inverse:hover { background: #d3fa80; }
.button.ghost { border-color: #c8cbc3; background: rgba(255,255,255,.25); color: var(--ink); }
.button.dark { background: var(--night); color: white; }
.button.small { min-height: 38px; padding: 0 15px; font-size: 12px; }
.text-link, .profile-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-underline-offset: 4px; font-weight: 720; }
.text-button { padding: 4px; border: 0; background: transparent; color: var(--green); font-weight: 720; text-decoration: underline; text-underline-offset: 4px; }

.hero { min-height: 690px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); align-items: center; gap: clamp(50px, 8vw, 130px); padding: 92px clamp(24px, 7vw, 112px) 82px; overflow: hidden; }
.hero-copy { max-width: 780px; }
.eyebrow { margin: 0 0 22px; color: var(--green); font-size: 12px; line-height: 1.2; letter-spacing: .14em; font-weight: 850; }
.live-dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #50a46f; box-shadow: 0 0 0 5px rgba(80,164,111,.13); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 800px; margin-bottom: 26px; font-size: clamp(52px, 7vw, 104px); line-height: .92; letter-spacing: -.072em; font-weight: 780; }
h2 { margin-bottom: 18px; font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.058em; }
h3 { letter-spacing: -.025em; }
.lede { max-width: 690px; color: #4f5b56; font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 38px; }
.trust-list { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 46px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; font-weight: 650; }
.trust-list li::before { content: "✓"; margin-right: 8px; color: var(--green); }

.routing-card { position: relative; padding: 26px; border-radius: 24px; background: var(--night); color: white; box-shadow: var(--shadow); transform: rotate(1.2deg); }
.routing-card::before { content: ""; position: absolute; inset: -14px 18px 14px -18px; z-index: -1; border: 1px solid #c9cac2; border-radius: 28px; transform: rotate(-2deg); }
.routing-head, .routing-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.routing-head { padding-bottom: 20px; border-bottom: 1px solid #34413d; font-size: 13px; font-weight: 760; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #3c4a45; border-radius: 99px; color: #c4cec9; font-size: 10px; }
.status-badge i { width: 7px; height: 7px; border-radius: 50%; background: #e6b65a; }
.status-badge.ready i { background: var(--acid); }
.objective-preview, .team-preview { padding: 24px 2px; }
.objective-preview > span, .team-preview > span, .routing-foot > span, .example-brief > span { color: #84918c; font-size: 10px; letter-spacing: .14em; font-weight: 800; }
.objective-preview p { max-width: 420px; margin: 12px 0 0; font-size: 18px; line-height: 1.45; }
.route-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.route-line span { height: 1px; background: #34413d; }
.route-line i { width: 12px; height: 12px; border: 2px solid var(--acid); border-radius: 50%; }
.team-preview > div { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid #2b3834; }
.team-preview b { font-size: 14px; }
.team-preview small { color: #92a09a; font-size: 11px; }
.routing-foot { margin: 0 -26px -26px; padding: 20px 26px; border-radius: 0 0 24px 24px; background: var(--acid); color: var(--ink); }
.routing-foot > span { color: #52623e; }
.routing-foot b { font-size: 12px; }

.signal-bar { display: grid; grid-template-columns: repeat(4, 1fr) 1.35fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.signal-bar > div, .signal-bar > p { min-height: 128px; margin: 0; padding: 25px clamp(18px, 2.3vw, 38px); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.signal-bar strong { font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.signal-bar span:not(.live-dot), .signal-bar small { margin-top: 8px; color: var(--muted); font-size: 12px; }
.signal-bar > p { border-right: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 7px; }
.signal-bar > p .live-dot { grid-row: 1 / 3; align-self: center; }
.signal-bar > p b { font-size: 13px; }
.signal-bar > p small { margin: 2px 0 0; }

.catalog-section, .active-section, .answers-section, .profile-main { padding: 120px clamp(24px, 7vw, 112px); }
.section-intro { display: grid; grid-template-columns: minmax(170px, .55fr) 1.45fr; gap: 40px; align-items: start; }
.section-intro h2 { max-width: 760px; }
.section-intro p:not(.eyebrow) { max-width: 610px; color: var(--muted); font-size: 17px; }
.catalog-controls { position: sticky; top: 76px; z-index: 10; margin-top: 58px; padding: 18px 0; background: var(--canvas); }
.search { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 18px; border: 1px solid #bec2b9; border-radius: 14px; background: var(--paper); }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,106,78,.12); }
.search svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; color: var(--muted); }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search input::placeholder, textarea::placeholder { color: #87908c; }
kbd { padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #efeee8; font: 11px/1.5 ui-monospace, monospace; }
.service-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.filter { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: #57635e; font-size: 12px; font-weight: 720; }
.filter:hover, .filter.active { border-color: var(--ink); background: var(--ink); color: white; }
.filter span { margin-left: 5px; color: #46534e; }
.filter.active span, .filter:hover span { color: white; }
.catalog-meta { display: flex; align-items: center; justify-content: space-between; padding: 7px 2px 16px; }
.catalog-meta p { margin: 0; color: var(--muted); font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.role-card { min-height: 315px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(251,250,246,.54); transition: background-color .18s ease; }
.role-card:hover { background: var(--paper); }
.role-card-top { display: flex; align-items: center; justify-content: space-between; }
.role-index { color: #626e69; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.role-service { padding: 5px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.role-card h3 { margin: 36px 0 14px; font-size: 22px; line-height: 1.12; }
.role-card h3 a { text-decoration: none; }
.role-card h3 a::after { content: ""; position: absolute; }
.role-card p { display: -webkit-box; overflow: hidden; margin-bottom: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.role-domains { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .tool-chip { padding: 5px 8px; border: 1px solid var(--soft-line); border-radius: 6px; color: #5d6864; background: rgba(255,255,255,.45); font-size: 10px; }
.role-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--soft-line); }
.profile-link { font-size: 12px; }
.activate { min-height: 34px; padding: 0 11px; border: 1px solid #bdc2b9; border-radius: 8px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 760; }
.activate.is-active { border-color: #b8d6c0; background: #e5f2e6; color: var(--green); }
.load-more { margin: 28px auto 0; }

.method-section { padding: 120px clamp(24px, 7vw, 112px); background: var(--night); color: white; }
.section-intro.light p:not(.eyebrow) { color: #9ca9a3; }
.section-intro.light .eyebrow { color: var(--acid); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 70px 0 0; padding: 0; list-style: none; border-top: 1px solid #35423e; }
.method-grid li { min-height: 290px; padding: 28px 30px 20px 0; border-right: 1px solid #35423e; }
.method-grid li + li { padding-left: 30px; }
.method-grid li:last-child { border-right: 0; }
.method-grid span { color: var(--acid); font: 12px/1.4 ui-monospace, monospace; }
.method-grid h3 { margin: 88px 0 14px; font-size: 22px; }
.method-grid p { color: #99a69f; font-size: 14px; line-height: 1.65; }

.console-section { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(50px, 8vw, 130px); padding: 120px clamp(24px, 7vw, 112px); background: var(--paper); }
.console-copy > p:not(.eyebrow) { max-width: 540px; color: var(--muted); font-size: 16px; }
.example-brief { margin-top: 46px; padding: 20px; border-left: 3px solid var(--green); background: #eff0e9; }
.example-brief > span { color: var(--green); }
.example-brief p { margin: 10px 0 0; color: #45514c; font-size: 13px; line-height: 1.65; }
.mission-form { align-self: start; padding: 24px; border-radius: 20px; background: var(--night); color: white; box-shadow: var(--shadow); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.field-head label { font-weight: 750; }
.field-head span { color: #8f9d97; font-size: 10px; }
textarea { width: 100%; resize: vertical; border: 1px solid #3b4944; border-radius: 12px; outline: 0; padding: 17px; background: var(--night-2); color: white; line-height: 1.6; }
textarea:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(199,243,106,.10); }
.mission-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; }
.mission-form-footer > span { color: #94a19b; font-size: 11px; }

.result-section { padding: 100px clamp(24px, 7vw, 112px); background: #e7eadf; }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.result-agents { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.result-agents span { padding: 7px 11px; border: 1px solid #b9cdbd; border-radius: 99px; color: var(--green); background: rgba(255,255,255,.35); font-size: 11px; font-weight: 700; }
pre { max-height: 720px; overflow: auto; margin: 0; padding: 25px; border-radius: 14px; background: var(--night); color: #d9e2dd; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; }

.active-section { background: var(--canvas); }
.roster-panel { margin-top: 52px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.roster-head { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.roster-head > div { display: flex; align-items: center; gap: 10px; }
.roster-head p { margin: 0; }
.roster-head strong, .roster-head small { display: block; }
.roster-head small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.active-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.active-row { min-height: 62px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--soft-line); }
.active-row:nth-child(odd) { border-right: 1px solid var(--soft-line); }
.active-row strong { font-size: 13px; }
.active-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.active-row em { color: var(--green); font-style: normal; font-size: 9px; letter-spacing: .1em; }
.empty { grid-column: 1 / -1; margin: 0; padding: 28px 22px; color: var(--muted); }
.roster-toggle { display: block; margin: 16px auto; }

.answers-section { display: grid; grid-template-columns: .75fr 1.25fr; gap: 80px; border-top: 1px solid var(--line); }
.answer-list { border-top: 1px solid var(--line); }
.answer-list details { border-bottom: 1px solid var(--line); }
.answer-list summary { display: flex; justify-content: space-between; gap: 20px; padding: 22px 2px; cursor: pointer; font-weight: 760; list-style: none; }
.answer-list summary::-webkit-details-marker { display: none; }
.answer-list summary::after { content: "+"; color: var(--green); font-size: 22px; font-weight: 400; }
.answer-list details[open] summary::after { content: "−"; }
.answer-list details p { max-width: 700px; padding: 0 38px 22px 2px; color: var(--muted); line-height: 1.7; }

.site-footer { min-height: 170px; display: grid; grid-template-columns: .7fr .9fr 1.4fr; align-items: center; gap: 35px; padding: 40px clamp(24px, 7vw, 112px); background: var(--night); color: white; }
.footer-brand { color: white; }
.footer-brand .brand-mark { background: var(--acid); color: var(--ink); }
.site-footer > p { margin: 0; color: #95a39d; font-size: 13px; }
.site-footer > div { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 20px; }
.site-footer > div a { color: #c4cec9; font-size: 12px; text-underline-offset: 4px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(400px, calc(100vw - 48px)); transform: translateY(100px); opacity: 0; padding: 13px 16px; border: 1px solid #3b4944; border-radius: 10px; background: var(--night); color: white; box-shadow: var(--shadow); font-size: 13px; transition: .2s ease; }
.toast.show { transform: none; opacity: 1; }
.toast.error { border-color: #cc746b; color: #ffd0ca; }

/* Server-rendered agent profiles */
.profile-main { padding-top: 58px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb a { text-underline-offset: 3px; }
.profile-hero { display: grid; grid-template-columns: 1.4fr .6fr; gap: 70px; align-items: end; padding: 70px 0 90px; }
.profile-hero h1 { max-width: 950px; font-size: clamp(50px, 7vw, 100px); }
.profile-hero .lede { max-width: 850px; }
.trust-note { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.trust-note strong { font-size: 13px; }
.trust-note p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.profile-grid article { min-height: 330px; padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(251,250,246,.5); }
.section-number { color: var(--green); font: 11px/1.4 ui-monospace, monospace; }
.profile-grid h2 { margin-top: 80px; font-size: 28px; }
.profile-grid ul { padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.profile-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; padding: 90px 0; }
.profile-tools h2 { font-size: clamp(36px, 4vw, 58px); }
.profile-tools p:not(.eyebrow) { max-width: 580px; color: var(--muted); }
.tool-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-chip { padding: 11px 13px; background: var(--paper); font-size: 12px; }
.profile-cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 48px; border-radius: 22px; background: var(--acid); }
.profile-cta .eyebrow { color: #52623e; }
.profile-cta h2 { margin: 0; font-size: clamp(30px, 4vw, 52px); }
.source-note { margin: 34px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; }
  .routing-card { max-width: 680px; transform: none; }
  .signal-bar { grid-template-columns: repeat(4, 1fr); }
  .signal-bar > p { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-section { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { min-height: 68px; grid-template-columns: 1fr auto; padding: 10px 18px; }
  .site-header nav { display: none; }
  .header-cta { min-height: 38px; padding: 0 14px; font-size: 11px; }
  .hero { min-height: auto; padding: 68px 20px 72px; gap: 60px; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .routing-card { margin: 0 6px; padding: 20px; }
  .routing-card::before { inset: -9px 10px 9px -10px; }
  .routing-foot { margin: 0 -20px -20px; padding: 18px 20px; }
  .signal-bar { grid-template-columns: repeat(2, 1fr); }
  .signal-bar > div:nth-child(2) { border-right: 0; }
  .signal-bar > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .catalog-section, .active-section, .answers-section, .profile-main, .method-section, .console-section, .result-section { padding: 82px 20px; }
  .section-intro, .answers-section { grid-template-columns: 1fr; gap: 18px; }
  .catalog-controls { top: 68px; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card { min-height: 285px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid li, .method-grid li + li { min-height: auto; padding: 28px 0; border-right: 0; border-bottom: 1px solid #35423e; }
  .method-grid h3 { margin-top: 44px; }
  .mission-form-footer, .result-head, .roster-head, .profile-cta { align-items: stretch; flex-direction: column; }
  .active-list { grid-template-columns: 1fr; }
  .active-row:nth-child(odd) { border-right: 0; }
  .site-footer { grid-template-columns: 1fr; padding: 45px 20px; }
  .site-footer > div { justify-content: flex-start; }
  .profile-hero { padding: 50px 0 65px; gap: 34px; }
  .profile-grid, .profile-tools { grid-template-columns: 1fr; }
  .profile-grid article { min-height: auto; }
  .profile-grid h2 { margin-top: 45px; }
  .profile-tools { gap: 30px; }
  .profile-cta { padding: 30px; }
}

@media (max-width: 430px) {
  .brand small { display: none; }
  .signal-bar > div { min-height: 105px; }
  .signal-bar strong { font-size: 29px; }
  .routing-foot { align-items: flex-start; flex-direction: column; }
  .search kbd { display: none; }
}

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