/* Castiri site: design tokens and styles.
   Owner: Iris (design). The visual system is the app's own: macOS neutrals and
   Apple's system tints (Castiri/Views/Common/RoleStyle.swift). Colour is used for two
   things only: the agents and the Download button. No fonts or scripts from CDNs. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Neutrals: from AgentSession.swift (page) and MarkdownView.swift (text) */
  --page: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --faint: #aeaeb2;
  --line: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 40px rgba(0, 0, 0, .10);
  --frame-bg: #e9e9ec;

  /* Agent tints: macOS system colours, light appearance */
  --blue: #007aff;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --green: #28cd41;
  --mint: #00c7be;
  --teal: #59adc4;
  --gray: #8e8e93;

  /* The one primary action: the app's accent blue, as a soft gradient like Color.blue.gradient */
  --accent: var(--blue);
  --accent-fg: #ffffff;
  --accent-grad: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), var(--accent));

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);  /* 36 → 60 */
  --h2: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);          /* 28 → 40 */
  --h3: 1.25rem;                                          /* 20 */
  --body: 1.0625rem;                                      /* 17 */
  --small: .9375rem;                                      /* 15 */
  --caption: .8125rem;                                    /* 13 */

  /* Space and shape */
  --gutter: 16px;
  --max: 1120px;
  --section: clamp(64px, 5vw + 40px, 112px);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #131417;
    --surface: #1e1e20;
    --surface-2: #26262a;
    --fg: #f2f2f7;
    --muted: #98989d;
    --faint: #6e6e73;
    --line: rgba(255, 255, 255, .1);
    --line-strong: rgba(255, 255, 255, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px rgba(0, 0, 0, .5);
    --frame-bg: #0c0c0e;

    --blue: #0a84ff;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --pink: #ff375f;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --green: #32d74b;
    --mint: #66d4cf;
    --teal: #6ac4dc;
    --gray: #98989d;
  }
}
:root[data-theme="dark"] {
  --page: #131417;
  --surface: #1e1e20;
  --surface-2: #26262a;
  --fg: #f2f2f7;
  --muted: #98989d;
  --faint: #6e6e73;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px rgba(0, 0, 0, .5);
  --frame-bg: #0c0c0e;
  --blue: #0a84ff; --indigo: #5e5ce6; --purple: #bf5af2; --pink: #ff375f; --red: #ff453a;
  --orange: #ff9f0a; --yellow: #ffd60a; --green: #32d74b; --mint: #66d4cf; --teal: #6ac4dc; --gray: #98989d;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--fg);
  font: 400 var(--body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 600; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sprite { position: absolute; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1 { font-size: var(--display); line-height: 1.04; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
h2 { font-size: var(--h2); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h3 { font-size: var(--h3); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.lede { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.eyebrow { display: block; font-size: var(--caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Buttons: one primary, used three times ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 0;
  background: var(--accent-grad);
  color: var(--accent-fg);
  font: 600 1.0625rem/1 var(--font);
  letter-spacing: -0.005em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 4px rgba(0, 0, 0, .2), 0 12px 32px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn:active { transform: translateY(1px); filter: brightness(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: var(--small); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .2); }
.btn--lg { min-height: 58px; padding: 0 32px; font-size: 1.125rem; }

.fineprint { font-size: var(--caption); color: var(--muted); line-height: 1.5; }
/* The separators are text, not the round colour dots .dot draws elsewhere */
.fineprint .dot, .checksum .dot { display: inline; width: auto; height: auto; background: none; border-radius: 0; margin: 0 .5em; color: var(--faint); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 28px; margin-left: auto; font-size: var(--small); color: var(--muted); }
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.site-header .btn { margin-left: auto; }
.site-nav + .btn { margin-left: 0; }
@media (max-width: 760px) { .site-nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 88px) var(--section); }
.hero .wrap {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 980px) {
  .hero .wrap { grid-template-columns: minmax(380px, 5fr) minmax(0, 7fr); gap: 56px; }
}
.hero-copy { display: grid; gap: 22px; max-width: 560px; }
.hero-copy .lede { max-width: 48ch; }
.hero-cta { display: grid; gap: 14px; justify-items: start; margin-top: 6px; }
.trust { font-size: var(--caption); color: var(--muted); max-width: 52ch; line-height: 1.5; }

.hero-figure { min-width: 0; display: grid; gap: 12px; }
.app-caption { font-size: var(--caption); color: var(--muted); text-align: center; text-wrap: balance; }

/* ---------- The app frame (hero visual) ----------
   An HTML/CSS recreation of the Castiri workspace. It is complete without motion;
   the loop below is progressive enhancement and is removed under reduced motion. */
.app {
  container-type: inline-size;
  width: 100%;
  font-size: 11px; line-height: 1.35;
  color: var(--fg);
  border-radius: var(--r-xl);
  background: var(--frame-bg);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  overflow: hidden;
}
.app-bar {
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.lights { display: inline-flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.app-title { font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title svg { width: 12px; height: 12px; }
.faces { display: flex; margin-left: auto; align-items: center; gap: 8px; }
.faces .stack { display: flex; }
.faces .stack .avatar { width: 20px; height: 20px; margin-left: -2px; box-shadow: 0 0 0 2px var(--surface-2); }
.faces .stack .avatar:first-child { margin-left: 0; }
.faces .count { color: var(--muted); font-weight: 600; white-space: nowrap; }

.app-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 196px;
  min-height: 330px;
}
.app-side, .app-inspector { background: var(--surface); }
.app-side { border-right: 1px solid var(--line); padding: 10px 8px; }
.app-inspector { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.app-main { display: flex; flex-direction: column; background: var(--page); min-width: 0; }

.pane-head { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 2px 6px 8px; }
.agents { display: grid; gap: 2px; }
.agents li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; }
.agents li.selected { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.agents .who { min-width: 0; display: grid; }
.agents .name { font-weight: 600; font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.agents .name .crown { width: 9px; height: 9px; color: var(--yellow); }
.agents .role { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avatar: the role's tint as a soft gradient with a white symbol, as RoleAvatar draws it */
.avatar {
  --tint: var(--gray);
  position: relative; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 82%, white), var(--tint));
  display: grid; place-items: center; color: #fff;
}
.avatar svg { width: 55%; height: 55%; }
.avatar.lg { width: 44px; height: 44px; }
.avatar.xl { width: 56px; height: 56px; }
/* Tint classes: one per agent colour */
.tint-blue { --tint: var(--blue); }
.tint-indigo { --tint: var(--indigo); }
.tint-purple { --tint: var(--purple); }
.tint-pink { --tint: var(--pink); }
.tint-red { --tint: var(--red); }
.tint-orange { --tint: var(--orange); }
.tint-yellow { --tint: var(--yellow); }
.tint-green { --tint: var(--green); }
.tint-mint { --tint: var(--mint); }
.tint-teal { --tint: var(--teal); }
.tint-gray { --tint: var(--gray); }

/* Status ring around the avatar: blue working, green idle, orange needs you */
.avatar[data-status]::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--ring, transparent);
}
.avatar[data-status="working"] { --ring: var(--blue); }
.avatar[data-status="idle"] { --ring: var(--green); }
.avatar[data-status="needs-you"] { --ring: var(--orange); }
.avatar[data-status="working"]::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--blue); opacity: 0;
}
/* Vote ring: green agree, gray pending */
.avatar[data-vote="agree"] { box-shadow: 0 0 0 1.5px var(--green); }
.avatar[data-vote="pending"] { box-shadow: 0 0 0 1.5px var(--line-strong); }

.tabs { display: flex; gap: 10px; padding: 9px 10px 0; font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tabs > * { padding-bottom: 7px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs > b { color: var(--fg); font-weight: 600; border-bottom-color: var(--fg); }
.tabs .badge { display: inline-grid; place-items: center; min-width: 14px; height: 14px; padding: 0 4px; border-radius: 7px; background: var(--orange); color: #fff; font-size: 9px; font-weight: 700; margin-left: 4px; vertical-align: middle; }

.terms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; flex: 1; }
.term { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; min-height: 104px; }
.term-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 10.5px; }
.term-head .avatar { width: 14px; height: 14px; }
.term-head .state { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 9.5px; }
.term pre { margin: 0; padding: 7px 8px; font: 10px/1.5 var(--mono); color: var(--muted); white-space: pre-wrap; overflow: hidden; }
.term pre b { color: var(--fg); font-weight: 500; }
.cursor { display: inline-block; width: 6px; height: 11px; vertical-align: -2px; background: var(--fg); }
.statusbar { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); background: var(--surface); }
.statusbar .okdot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.posts { display: grid; gap: 10px; padding: 10px; align-content: start; flex: 1; }
.posts li { display: flex; gap: 7px; align-items: flex-start; }
.posts .avatar { width: 18px; height: 18px; margin-top: 1px; }
.posts .msg { display: grid; gap: 1px; min-width: 0; }
.posts .by { font-weight: 600; font-size: 10.5px; }
.posts .by span { color: var(--faint); font-weight: 500; margin-left: 4px; }
.posts .text { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.signoff { border-top: 1px solid var(--line); padding: 9px 10px; display: grid; gap: 6px; }
.signoff .row { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); }
.signoff .row b { color: var(--fg); font-weight: 600; }
.signoff .stack { display: flex; gap: 5px; }
.signoff .avatar { width: 14px; height: 14px; }

/* Narrower frames: drop the inspector, then the sidebar text */
@container (max-width: 620px) {
  .app-body { grid-template-columns: 136px minmax(0, 1fr); }
  .app-inspector { display: none; }
}
@container (max-width: 420px) {
  .app-body { grid-template-columns: 44px minmax(0, 1fr); }
  .agents .who, .pane-head { display: none; }
  .agents li { justify-content: center; padding: 5px 0; }
  .terms { grid-template-columns: 1fr; }
  .term:nth-child(n+3) { display: none; }
  .faces .count { display: none; }
}

/* The crew loop: posts arrive, votes flip to Agree, cursors blink. CSS only, 14 s cycle.
   Motion exists only when the visitor allows it; otherwise the final state shows. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn { transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
  .avatar[data-status="working"]::before { animation: pulse 1.8s ease-out infinite; }
  .cursor { animation: blink 1.1s steps(1) infinite; }
  .posts li:nth-child(1) { animation: post1 14s ease-out infinite; }
  .posts li:nth-child(2) { animation: post2 14s ease-out infinite; }
  .posts li:nth-child(3) { animation: post3 14s ease-out infinite; }
  .posts li:nth-child(4) { animation: post4 14s ease-out infinite; }
  @keyframes post1 { 0%, 4% { opacity: 0; transform: translateY(6px); } 8%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes post2 { 0%, 24% { opacity: 0; transform: translateY(6px); } 28%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes post3 { 0%, 46% { opacity: 0; transform: translateY(6px); } 50%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes post4 { 0%, 68% { opacity: 0; transform: translateY(6px); } 72%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
  @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); scroll-margin-top: 72px; }
.section + .section { padding-top: 0; }
.section-head { display: grid; gap: 14px; max-width: 720px; margin-bottom: clamp(32px, 4vw, 56px); }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section--tint + .section { padding-top: var(--section); }
.section + .section--tint { padding-top: var(--section); }  /* a tinted band keeps its own top padding */

/* Team roster */
.roster { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .roster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.member {
  display: grid; gap: 12px; align-content: start;
  padding: 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.member .avatar { --tint: inherit; }
.member h3 { font-size: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.member h3 .role { font-size: var(--caption); font-weight: 500; color: color-mix(in srgb, var(--tint) 85%, var(--fg)); }
.member p { font-size: var(--small); color: var(--muted); line-height: 1.45; }
.roster-note { margin-top: 20px; font-size: var(--small); color: var(--muted); }

/* Benefits */
.benefits { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.benefit {
  display: grid; gap: 18px; align-content: start;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.benefit h3 { font-size: 1.1875rem; }
.benefit p { color: var(--muted); font-size: var(--small); line-height: 1.5; }
.benefit-art {
  height: 148px; border-radius: var(--r-md);
  background: var(--page); border: 1px solid var(--line);
  padding: 14px; display: grid; align-content: center; gap: 8px; overflow: hidden;
  font-size: 11px; color: var(--muted);
}
.art-term { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); }
.art-term .avatar { width: 14px; height: 14px; }
.art-term b { color: var(--fg); font-weight: 600; }
.art-term code { margin-left: auto; font: 10px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.art-chat { display: flex; gap: 7px; align-items: flex-start; }
.art-chat .avatar { width: 16px; height: 16px; }
.art-chat .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; color: var(--fg); font-size: 11px; line-height: 1.35; }
.art-chat .bubble.me { margin-left: auto; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.art-sign { display: grid; gap: 8px; }
.art-sign .row { display: flex; align-items: center; gap: 8px; }
.art-sign .avatar { width: 16px; height: 16px; }
.art-sign .vote { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 10.5px; }
.art-sign .vote.agree { color: var(--green); }
.art-sign .vote svg { width: 11px; height: 11px; }
.art-sign .label { color: var(--fg); font-weight: 600; }

/* Who it's for */
.audience { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .audience { grid-template-columns: 1fr 1fr; } }
.who-card { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.who-card .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.who-card .eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.who-card.not .eyebrow i { background: var(--faint); }
.who-card p { color: var(--muted); font-size: var(--small); }
.who-card h3 { font-size: 1.1875rem; }

/* How it works */
.steps { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); counter-reset: step; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { position: relative; display: grid; gap: 10px; align-content: start; padding: 22px 22px 22px 64px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fg); color: var(--page);
  font-weight: 700; font-size: .9375rem;
}
.step h3 { font-size: 1.1875rem; }
.step p { color: var(--muted); font-size: var(--small); line-height: 1.5; }

/* FAQ */
.faq { display: grid; gap: 0; max-width: 760px; }
.faq > div { padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.faq dd { margin: 0; color: var(--muted); line-height: 1.55; }

/* Final CTA */
.closing { text-align: center; padding-block: var(--section); scroll-margin-top: 72px; }
.closing .wrap { display: grid; gap: 22px; justify-items: center; max-width: 720px; }
.closing .mark { width: 72px; height: 72px; }
.closing .lede { max-width: 44ch; }
.checksum {
  font: 12px/1.6 var(--mono); color: var(--muted);
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  word-break: break-all; max-width: 100%;
}
.checksum b { color: var(--fg); font-weight: 600; }
.checksum .row { display: block; }
.checksum .row + .row { margin-top: 4px; }

/* Footer */

/* ---------- Inner pages: /team/ and /how-it-works/ ---------- */
.site-nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.more svg { width: 16px; height: 16px; flex: none; }
.more:hover { text-decoration: none; }
.more:hover svg { transform: translateX(2px); }
.section-more { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px; margin-top: 20px; }
.section-more .roster-note { margin-top: 0; max-width: 64ch; }

.page-head { padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px); }
.page-head .wrap { display: grid; gap: 16px; max-width: 820px; margin-inline: auto; }
.page-head .lede { max-width: 62ch; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jump a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: var(--caption); font-weight: 600; color: var(--fg); }
.jump a:hover { text-decoration: none; border-color: var(--line-strong); }
.jump a b { font-weight: 700; color: var(--muted); }
.dot { --tint: var(--gray); display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tint); flex: none; }

/* Team page: categories */
.roles .wrap { display: grid; gap: clamp(40px, 5vw, 64px); }
.category { scroll-margin-top: 80px; }
.cat-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-bottom: 18px; }
.cat-head h2 { font-size: 1.5rem; }
.cat-head p { color: var(--muted); font-size: var(--small); margin-top: 2px; }
.cat-icon { --tint: var(--gray); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 82%, white), var(--tint)); }
.cat-icon svg { width: 20px; height: 20px; }
.cat-count { font-size: var(--caption); font-weight: 600; color: var(--muted); white-space: nowrap; }
.roster--auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .roster--auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.roles .member { background: var(--page); }

/* Team page: templates */
.templates { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .templates { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.template { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); }
.tpl-icon svg { width: 17px; height: 17px; }
.tpl-cat { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.template h3 { font-size: 1.0625rem; }
.template p { font-size: var(--small); color: var(--muted); line-height: 1.45; }
.tpl-team { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: var(--caption); font-weight: 600; }
.tpl-team li { display: inline-flex; align-items: center; gap: 5px; }
.tpl-team .avatar { width: 18px; height: 18px; }
.template--blank .tpl-icon { background: none; border: 1.5px dashed var(--line-strong); }

.trio { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trio-card { display: grid; gap: 10px; align-content: start; padding: 22px; border-radius: var(--r-lg); background: var(--page); border: 1px solid var(--line); }
.trio-card h3 { font-size: 1.1875rem; }
.trio-card p { color: var(--muted); font-size: var(--small); line-height: 1.5; }

/* How it works: the walkthrough */
.walkthrough { counter-reset: walk; }
.phase-head { display: grid; gap: 12px; max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.walk { display: grid; gap: clamp(28px, 4vw, 48px); }
.walk-step { position: relative; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); padding-left: 52px; }
.walk-step::before {
  counter-increment: walk; content: counter(walk);
  position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fg); color: var(--page);
  font-weight: 700; font-size: 1rem;
}
@media (min-width: 900px) {
  .walk-step { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; padding-left: 56px; }
  .walk-step--wide { grid-template-columns: minmax(0, 1fr); }
  .walk-step--wide .walk-text { max-width: 760px; }
}
.walk-text { display: grid; gap: 12px; align-content: start; }
.walk-text h3 { font-size: 1.375rem; letter-spacing: -0.015em; }
.walk-text p { color: var(--muted); line-height: 1.55; text-wrap: pretty; }
.walk-text p .more { font-size: var(--small); }
.app--shot { max-width: 920px; }

/* Mini screens: HTML/CSS stand-ins for the app's windows, in the same style as the hero frame */
.shot { font-size: 11px; line-height: 1.35; color: var(--fg); border-radius: var(--r-lg); background: var(--frame-bg); box-shadow: var(--shadow), 0 0 0 1px var(--line); overflow: hidden; min-width: 0; }
.shot-bar { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-bar .bar-icon { width: 13px; height: 13px; }
.shot-bar .pill { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 9.5px; font-weight: 700; }
.shot-bar .pill--ok { background: var(--green); }
.shot-body { padding: 14px; background: var(--surface); display: grid; gap: 10px; align-content: start; }
.shot-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); border-top: 1px solid var(--line); font-size: 10.5px; font-weight: 600; color: var(--muted); }
.shot-foot .spacer { flex: 1; }
.shot-foot > span:not(.spacer, .ok) { padding: 4px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }
.shot-foot > span.primary { background: var(--accent-grad); color: var(--accent-fg); border-color: transparent; }
.shot-foot .ok { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.shot-foot .ok i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.shot-title { font-weight: 600; font-size: 11.5px; }
.shot-hint { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.shot-hint .dot { display: inline; width: auto; height: auto; background: none; margin: 0 .4em; color: var(--faint); }
.shot-note { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.shot-note b { color: var(--fg); font-weight: 600; }
.shot .avatar svg { width: 55%; height: 55%; }

.welcome { justify-items: center; text-align: center; padding-block: 22px 18px; }
.welcome-mark { width: 64px; height: 64px; }
.welcome-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: -2px; }
.actions { display: grid; gap: 6px; width: min(100%, 300px); margin-top: 10px; text-align: left; }
.actions li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.actions li:first-child { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.actions li i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--muted); flex: none; }
.actions li i svg { width: 14px; height: 14px; }
.actions li span { display: grid; }
.actions li b { font-weight: 600; font-size: 11px; }
.actions li small { color: var(--muted); font-size: 9.5px; }

.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tpl-grid li { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 10px 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--page); font-weight: 600; font-size: 10px; line-height: 1.2; }
.tpl-grid li i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); }
.tpl-grid li i svg { width: 15px; height: 15px; }
.tpl-grid li.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.tpl-grid li.selected i { background: var(--accent-grad); color: #fff; }
@container (max-width: 380px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.shot .row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; }
.shot .row--top { align-items: start; }
.shot .label { font-weight: 600; color: var(--muted); text-align: right; font-size: 10.5px; padding-top: 1px; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 2px; border-radius: 7px; background: color-mix(in srgb, var(--fg) 7%, transparent); font-size: 10px; font-weight: 500; }
.seg > * { padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.seg > b { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.15); font-weight: 600; }
.field { display: block; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--page); font-size: 11px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; }
.toggle i { width: 24px; height: 14px; border-radius: 7px; background: var(--green); position: relative; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.modes { display: grid; gap: 6px; }
.modes li { display: flex; gap: 8px; align-items: flex-start; }
.modes li span { display: grid; gap: 1px; }
.modes li b { font-weight: 600; font-size: 10.5px; }
.modes li small { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.radio { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); margin-top: 1px; }
.modes li.on .radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px); }

.box { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--page); }
.box b { font-weight: 600; font-size: 10.5px; }
.box p { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.box--lead { border-style: dashed; }

.libs { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
.lib-cats { display: grid; gap: 2px; align-content: start; font-size: 10px; font-weight: 500; }
.lib-cats li { display: flex; align-items: center; gap: 7px; padding: 4px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-cats li.on { background: color-mix(in srgb, var(--fg) 7%, transparent); font-weight: 600; }
.lib-roles { display: grid; gap: 4px; align-content: start; font-size: 10.5px; font-weight: 500; }
.lib-roles li { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--page); }
.lib-roles li.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.lib-roles .avatar { width: 16px; height: 16px; }
.lib-roles .tick { margin-left: auto; width: 11px; height: 11px; color: var(--accent); }
@container (max-width: 380px) { .libs { grid-template-columns: minmax(0, 1fr); } .lib-cats { display: none; } }
@container (max-width: 380px) { .shot .row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .shot .label { text-align: left; } .shot .label:empty { display: none; } }
.team-row { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.team-row > b { font-weight: 600; font-size: 10.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--page); font-weight: 600; font-size: 10.5px; }
.chips .avatar { width: 16px; height: 16px; }
.chips .crown { width: 10px; height: 10px; color: var(--yellow); }

.attach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.attach li { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--page); }
.attach li i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--muted); flex: none; }
.attach li i svg { width: 13px; height: 13px; }
.attach li span { display: grid; min-width: 0; }
.attach li b { font-weight: 600; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach li small { color: var(--muted); font-size: 9.5px; }
.attach li.add { border-style: dashed; background: none; }

.tree { display: grid; gap: 5px; }
.tree li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 10px; align-items: baseline; }
.tree code { font: 10.5px var(--mono); color: var(--fg); white-space: nowrap; }
.tree span { color: var(--muted); font-size: 10.5px; }
@container (max-width: 380px) { .tree li { grid-template-columns: minmax(0, 1fr); gap: 1px; } }

.ask { display: grid; gap: 8px; padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--page); }
.ask-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.ask-head .avatar { width: 16px; height: 16px; }
.ask-head b { font-weight: 600; }
.ask-head span { color: var(--faint); }
.ask > p { font-size: 11px; color: var(--fg); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts li { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 10px; font-weight: 600; }
.opts li.rec { border-color: var(--accent); color: var(--accent); }
.reply { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 10.5px; }
.reply span { flex: 1; min-width: 0; }
.reply b { color: var(--accent); font-weight: 600; }

.sign { display: grid; gap: 6px; }
.sign li { display: flex; align-items: center; gap: 7px; font-size: 10.5px; }
.sign .avatar { width: 16px; height: 16px; }
.sign b { font-weight: 600; }
.sign span { color: var(--muted); }
.sign .vote { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 600; }
.sign .vote.agree { color: var(--green); }
.sign .vote svg { width: 11px; height: 11px; }
.next { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; font-weight: 600; }
.next li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--page); }
.next li svg { width: 12px; height: 12px; }
.next li.primary { background: var(--accent-grad); color: var(--accent-fg); border-color: transparent; }
.shot { container-type: inline-size; }

/* Terms, privacy and security pages */
.legal-wrap { max-width: 820px; margin-inline: auto; }
.legal { max-width: 70ch; font-size: 1rem; line-height: 1.7; color: var(--fg); }
.legal h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.2em 0 .5em; scroll-margin-top: 80px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal ul { margin: 0 0 1em; color: var(--muted); }
.legal ul { padding-left: 1.2em; list-style: disc; }
.legal li::marker { color: var(--faint); }
.legal li { margin-bottom: .5em; }
.legal b { color: var(--fg); font-weight: 600; }
.legal a { color: var(--blue); text-underline-offset: 2px; }
.legal code { font: .88em var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 4px; word-break: break-all; }

/* Footer: brand and columns, a legal line, and a faint outlined wordmark, as on Farnor Labs and Gaitro */
.site-footer { position: relative; overflow: hidden; border-top: 1px solid var(--line); padding: 56px 0 0; font-size: var(--caption); color: var(--muted); }
.site-footer .wrap { display: grid; gap: 28px; }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.foot-brand { display: grid; gap: 14px; justify-items: start; max-width: 300px; }
.foot-brand p { margin: 0; line-height: 1.55; }
.site-footer .brand { font-size: 1.05rem; color: var(--fg); }
.site-footer .brand svg { width: 24px; height: 24px; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.foot-cols div { display: grid; gap: 10px; align-content: start; }
.foot-cols h2 { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.foot-cols a { color: var(--muted); }
.foot-cols a:hover, .foot-bottom a:hover { color: var(--fg); }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot-bottom p { margin: 0; }
.foot-bottom a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.foot-note { margin: 0; max-width: 70ch; line-height: 1.55; color: var(--faint); }
.foot-mark { font-size: clamp(90px, 21vw, 300px); font-weight: 700; letter-spacing: -.04em; line-height: 1; text-align: center; color: color-mix(in srgb, var(--fg) 5%, transparent); margin-top: 28px; padding-bottom: .1em; user-select: none; white-space: nowrap; }

/* Beta tag beside the name in the header */
.beta-tag { align-self: center; margin-left: -2px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; color: var(--muted); }
