/* Colony landing page, Colony 3.0 look (Manrope, ink and lilac, the field).
   Behaviour comes from the existing scripts: hero.js (dialogs), colony-r16.js (motion),
   helix-motion-r11.js (helix video), demos-r23.js (demos), together-r16.js (conversation),
   early-access.js (application). colony3.js adds video cards and the launch film player. */

@font-face {
  font-family: "Manrope";
  src: url("/assets/manrope-variable-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #fffdfa;
  --raised: #f8f5f2;
  --wash: #f5f1f8;
  --track: #f3eff4;
  --card: #ffffff;
  --row: #f7f3fa;
  --ink: #25222c;
  --ink-2: #4b4654;
  --muted: #68626f;
  --line: #ede7ef;
  --line-strong: #e0d8e5;
  --pale: #cfc6da;
  --accent: #5b45be;
  --accent-ink: #4a36a6;
  --accent-soft: #efeafb;
  --accent-line: #d9cff5;
  --brand-ink: #36257f;
  --person: #efe7e1;
  --online: #2e9a62;
  --sidebar-ink-soft: #4a4453;
  --agent-tile: #ddd6ea;
  --font: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --shadow-card: 0 0 0 1px var(--line), 0 1px 2px rgba(40, 20, 60, 0.04);
  --shadow-window: 0 0 0 1px var(--line), 0 40px 80px -50px rgba(60, 40, 90, 0.45);
  --shadow-glass: 0 1px 2px rgba(70, 40, 90, 0.1), 0 14px 34px -14px rgba(70, 40, 90, 0.4);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, figure, ol, ul { margin: 0; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.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: absolute; left: 16px; top: -64px; z-index: 50;
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--canvas); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--canvas); }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */
.display { font-size: clamp(40px, 5.2vw, 75px); line-height: 0.96; font-weight: 800; letter-spacing: -0.05em; }
.h2 { font-size: clamp(34px, 3.9vw, 56px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; }
.lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; font-weight: 500; color: var(--ink-2); text-wrap: pretty; }
h1, h2, h3, .center-head p, .close .lead { text-wrap: balance; }
.accent { color: var(--accent); }
.caps { font-size: 13px; line-height: 1.3; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  font-size: 15.5px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { flex: none; }
.btn--lg { min-height: 56px; padding: 0 20px; font-size: 16px; }
.btn--ink { background: var(--ink); color: var(--canvas); }
.btn--ink:hover { background: #3a3644; color: var(--canvas); }
.btn--light { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--light:hover { background: var(--row); color: var(--ink); }
.text-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none;
}
.text-link:hover { color: var(--accent-ink); }

/* ---------- The field (sidebar material from the app) ---------- */
.field {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(172deg, rgba(245, 164, 213, 0.55) 0%, rgba(198, 179, 244, 0.5) 50%, rgba(148, 180, 250, 0.55) 100%), #f8f4f8;
}
.field::before, .field::after, .field > i {
  content: ""; position: absolute; border-radius: 50%; aspect-ratio: 1;
}
.field::before { width: 58%; left: -14%; top: -38%; background: #f5a4d5; filter: blur(80px); opacity: 0.85; }
.field > i { width: 50%; left: 30%; top: 12%; background: #c6b3f4; filter: blur(84px); opacity: 0.8; }
.field::after { width: 58%; right: -16%; bottom: -48%; background: #94b4fa; filter: blur(84px); opacity: 0.85; }
.field > b {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.36));
}
.field > svg { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: multiply; opacity: 0.14; }

/* ---------- Avatars ---------- */
/* Agents are ant pictures on a soft tile, as in the Colony 3.0 app; people stay round. */
.ant { flex: none; display: block; overflow: hidden; border-radius: 7px; background: var(--agent-tile); }
.ant img { display: block; width: 100%; height: 100%; margin-top: 6.5%; }
.ant--mina { background: #ece6fa; }
.ant--theo { background: #e3ecfa; }
.person { border-radius: 50%; background: var(--person); display: grid; place-items: center; font-weight: 800; color: var(--ink); flex: none; }
.mention { padding: 1px 6px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

/* ---------- Header and hero ---------- */
.hero-shell {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: clamp(700px, 100svh, 920px);
}
.site-header {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px 28px;
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: 18px var(--gutter);
}
.brand {
  flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none;
  font-size: 25px; font-weight: 800; letter-spacing: -0.05em; line-height: 1;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 36px; height: 24px; }
.site-nav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.site-nav a, .nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--ink-2); font-size: 15.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.site-nav a:hover, .nav-link:hover { background: rgba(255, 255, 255, 0.72); color: var(--ink); }
.nav-link--accent { color: var(--accent-ink); font-weight: 700; }
.motion-toggle {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 253, 250, 0.82); box-shadow: inset 0 0 0 1px var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink-2); font-size: 14.5px; font-weight: 700; white-space: nowrap;
}
.motion-toggle::before {
  content: ""; width: 12px; height: 13px; flex: none;
  background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}
.motion-toggle[aria-pressed="true"]::before { background: currentColor; clip-path: polygon(8% 0, 100% 50%, 8% 100%); }
.header-download { flex: none; }

.hero {
  flex: 1; display: flex; align-items: center;
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: calc(80px + clamp(24px, 3.4vw, 48px)) var(--gutter) clamp(56px, 6vw, 96px);
}
.hero__copy { position: relative; z-index: 2; max-width: 660px; display: flex; flex-direction: column; gap: 28px; }
.hero__copy .lead { max-width: 470px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* The helix fills the right of the hero and rises behind the nav. */
.hero__media { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; width: 64%; }
.helix { position: absolute; inset: 0; }
.helix img, .helix video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 85% 100%; }
.helix video { opacity: 0; transition: opacity 0.6s ease; }
.helix video.is-playing { opacity: 1; }
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--canvas) 0%, rgba(255, 253, 250, 0) 30%),
    linear-gradient(180deg, var(--canvas) 0%, rgba(255, 253, 250, 0) 13%, rgba(255, 253, 250, 0) 86%, var(--canvas) 100%);
}
.film-pill {
  position: absolute; z-index: 2; left: 67%; top: 52%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 8px;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: rgba(255, 253, 250, 0.9); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.film-pill:hover { background: #fff; transform: translate(-50%, -50%) scale(1.03); }
.film-pill__dot { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--canvas); display: grid; place-items: center; }
.film-pill__title { font-size: 16px; font-weight: 800; }
.film-pill__time { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.helix-play {
  position: absolute; z-index: 2; right: var(--gutter); bottom: 28px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 253, 250, 0.9); box-shadow: var(--shadow-glass); color: var(--ink-2); font-weight: 700;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 8vw, 120px); }
.section--wash { background: var(--wash); }
.section--raised { background: var(--raised); }
.section--rule { border-top: 1px solid var(--line); }
.split-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; margin-bottom: clamp(32px, 4vw, 56px); }
.split-head h2 { flex: 1 1 520px; }
.split-head p { flex: 0 1 440px; }
.center-head { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.center-head p { max-width: 560px; }
.stack-head { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }

/* ---------- 2 · The workspace ---------- */
.app-window { display: flex; min-height: 560px; border-radius: 24px; overflow: hidden; background: var(--canvas); box-shadow: var(--shadow-window); }
.app-side { position: relative; flex: 0 0 240px; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; }
.app-side > :not(.field) { position: relative; }
.app-ws { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.app-ws__tile { width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: var(--canvas); display: grid; place-items: center; font-size: 15px; }
.app-row { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 11px; font-size: 15.5px; font-weight: 600; }
.app-row--active { background: rgba(255, 255, 255, 0.84); box-shadow: 0 1px 2px rgba(70, 40, 90, 0.1), 0 8px 20px -10px rgba(70, 40, 90, 0.22); font-weight: 700; }
.app-row__hash { width: 22px; text-align: center; font-size: 17px; font-weight: 800; color: var(--sidebar-ink-soft); }
.app-row .ant { width: 24px; height: 24px; border-radius: 7px; }
.app-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.6); }
.app-user .person { width: 34px; height: 34px; font-size: 12px; }
.app-user b { display: block; font-size: 15px; font-weight: 800; }
.app-user small { display: block; font-size: 13px; font-weight: 600; color: var(--sidebar-ink-soft); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding: 24px clamp(18px, 3vw, 36px); }
.app-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.app-title { font-size: clamp(19px, 5vw, 22px); font-weight: 800; letter-spacing: -0.02em; }
.app-title span { margin-right: 6px; color: var(--muted); }
.avatar-stack { margin-left: auto; display: flex; align-items: center; }
.avatar-stack > * + * { margin-left: -6px; }
.avatar-stack .person { width: 30px; height: 30px; font-size: 11px; box-shadow: 0 0 0 2px var(--canvas); }
.avatar-stack .ant { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 2px var(--canvas); }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.agent-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-card); }
.agent-card__avatar { position: relative; width: 52px; height: 52px; }
.agent-card__avatar .ant { width: 52px; height: 52px; border-radius: 14px; }
.presence { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px var(--card); }
.agent-card b { display: block; font-size: 18px; font-weight: 800; }
.agent-card small { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.agent-add { display: grid; place-items: center; min-height: 140px; border-radius: 20px; border: 1.5px dashed var(--pale); color: var(--ink-2); }
.agent-add span { width: 44px; height: 44px; border-radius: 12px; background: var(--track); display: grid; place-items: center; }
.composer { margin-top: auto; display: flex; align-items: flex-end; gap: 10px; padding: 14px 12px 12px 18px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1.5px var(--line-strong), 0 12px 30px -18px rgba(60, 40, 90, 0.25); }
.composer p { flex: 1; min-width: 0; padding-bottom: 8px; font-size: 17px; line-height: 1.5; font-weight: 500; }
.caret { display: inline-block; width: 2px; height: 20px; margin-left: 2px; vertical-align: -4px; background: var(--accent); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.send { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }

/* ---------- 3 · Your colony ---------- */
.together { display: flex; flex-wrap: wrap; align-items: center; gap: 48px clamp(40px, 5vw, 80px); }
.together__copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.together__copy .lead { max-width: 460px; }
.together__copy .video-card { margin-top: 16px; max-width: 520px; }
.convo { flex: 1.2 1 520px; min-width: 0; border-radius: 24px; overflow: hidden; background: var(--canvas); box-shadow: var(--shadow-window); }
.convo__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 24px; border-bottom: 1px solid var(--line); }
.convo__head h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.convo__head h3 span { margin-right: 6px; color: var(--muted); }
.icon-btn {
  margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--ink-2); display: grid; place-items: center; font-size: 19px; line-height: 1;
}
.icon-btn:hover { background: var(--track); }
.r10-messages { list-style: none; padding: 18px clamp(10px, 1.6vw, 20px) 22px; display: flex; flex-direction: column; gap: 6px; }
.r10-messages li { display: flex; gap: 14px; padding: 12px; border-radius: 18px; transition: opacity 0.35s ease; }
.r10-messages li:last-child { background: var(--row); }
.r10-messages .person { width: 40px; height: 40px; font-size: 14px; }
.r10-messages .ant { width: 42px; height: 42px; border-radius: 12px; }
.msg { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.msg h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 16.5px; font-weight: 800; }
.msg h4 small { font-size: 14px; font-weight: 600; color: var(--muted); }
.msg p { font-size: 17px; line-height: 1.6; font-weight: 500; }
.attachment {
  align-self: flex-start; margin-top: 6px; display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px; border: 0; border-radius: 16px; text-align: left;
  background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink);
  transition: box-shadow 0.15s ease, opacity 0.35s ease;
}
.attachment__thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: flex; gap: 2px; background: var(--line); }
.attachment__thumb i { flex: 1; }
.attachment__thumb i:nth-child(1) { background: linear-gradient(180deg, #ffe08f, #ffb38f); }
.attachment__thumb i:nth-child(2) { background: linear-gradient(180deg, #f6a6cf, #bba7f5); }
.attachment__thumb i:nth-child(3) { background: linear-gradient(180deg, #9fe3d6, #bfe9a8); }
.attachment b { display: block; font-size: 15.5px; font-weight: 800; }
.attachment small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
/* States set by together-r16.js while the conversation plays */
.r16-waiting { opacity: 0; }
.r16-art-waiting { opacity: 0; }
.r16-typing { display: inline-flex; gap: 5px; padding: 10px 0 6px; }
.r16-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s ease-in-out infinite; }
.r16-typing i:nth-child(2) { animation-delay: 0.15s; }
.r16-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 0.9; transform: translateY(-2px); } }
.r16-scene-video, .r16-play-scene { display: none !important; }

/* ---------- 4 · A whole business (demos) ---------- */
.demos { display: flex; flex-direction: column; gap: 36px; }
.tabs {
  align-self: center; max-width: 100%;
  display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--track);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink-2); font-size: 15.5px; font-weight: 600; white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(60, 40, 80, 0.12); color: var(--ink); font-weight: 700; }
.demo-window { width: 100%; max-width: 1040px; margin-inline: auto; border-radius: 24px; overflow: hidden; background: var(--card); box-shadow: var(--shadow-window); }
.demo-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.demo-bar__dots { display: flex; gap: 7px; margin-right: auto; }
.demo-bar__dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.demo-play {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--canvas); font-size: 14.5px; font-weight: 700; white-space: nowrap;
}
.demo-play:disabled, .demo-icon:disabled { opacity: 0.45; cursor: default; }
.demo-icon { width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; background: var(--track); color: var(--ink-2); font-size: 17px; line-height: 1; }
.demo-display { position: relative; aspect-ratio: 1280 / 800; overflow: hidden; background: var(--wash); }
.demo-display iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; background: var(--canvas); }

/* ---------- 5 · Watch Colony ---------- */
.videos-top { display: flex; flex-wrap: wrap; align-items: stretch; gap: 32px 24px; margin-block: 44px; }
.video-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.video-card--lead { flex: 2 1 560px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--wash); box-shadow: 0 0 0 1px var(--line); }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-card--lead .video-frame { border-radius: 24px; box-shadow: 0 0 0 1px var(--line), 0 30px 70px -48px rgba(70, 40, 110, 0.5); }
/* The play button sits in the corner so it never covers the words in a poster. */
.video-play {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: clamp(10px, 1.3vw, 16px); border: 0; border-radius: inherit; background: transparent; cursor: pointer;
}
.video-play:focus-visible { outline-offset: -4px; }
.video-play span {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 10px 30px -12px rgba(60, 40, 90, 0.55);
  transition: transform 0.15s ease;
}
.video-play:hover span { transform: scale(1.07); }
.video-card--lead .video-play { padding: clamp(14px, 1.8vw, 22px); }
.video-card--lead .video-play span { width: 60px; height: 60px; }
.video-card h3, .video-card h4 { font-size: clamp(15.5px, 1.25vw, 18px); line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; }
.video-card--lead h3 { font-size: 22px; letter-spacing: -0.02em; }
.video-card p { margin-top: 3px; font-size: 14px; font-weight: 500; color: var(--muted); }
.video-card__copy { display: flex; flex-direction: column; }
.phone-box { flex: 1 1 300px; min-width: 0; padding: 20px; border-radius: 24px; background: var(--wash); display: flex; flex-direction: column; gap: 16px; }
.phone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.phone-grid .video-frame { aspect-ratio: 9 / 16; border-radius: 18px; }
.phone-grid .video-play span { width: 44px; height: 44px; }
.phone-grid h4 { font-size: 15.5px; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; }

/* ---------- 6 · Download ---------- */
.download-cards { list-style: none; padding: 0; width: 100%; max-width: 920px; margin: 32px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.download-card { display: flex; flex-direction: column; gap: 20px; padding: 28px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-card); }
.download-card h3 { font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.download-meta { margin-top: 6px; font-size: 15px; line-height: 1.45; font-weight: 500; color: var(--muted); }
.download-card .btn { align-self: flex-start; }
.download-note { padding: 14px 16px; border-radius: 16px; background: var(--raised); font-size: 14.5px; line-height: 1.5; font-weight: 500; color: var(--ink-2); }
.install-help { width: 100%; max-width: 920px; margin: 20px auto 0; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-card); }
.install-help summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 0 24px; border-radius: 20px; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
}
.install-help summary::-webkit-details-marker { display: none; }
.install-help summary svg { flex: none; transition: transform 0.2s ease; }
.install-help[open] summary svg { transform: rotate(180deg); }
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; padding: 0 24px 24px; }
.install-grid > div { padding: 20px; border-radius: 16px; background: var(--raised); display: flex; flex-direction: column; gap: 10px; }
.install-grid h4 { font-size: 16px; font-weight: 800; }
.install-grid ol { padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; font-weight: 500; color: var(--ink-2); }
.download-foot { margin-top: 32px; text-align: center; font-size: 14.5px; line-height: 1.6; font-weight: 500; color: var(--muted); }
.download-foot a { font-weight: 700; }

/* ---------- 7 · Close and footer ---------- */
.close { position: relative; overflow: hidden; text-align: center; }
.close__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; padding-block: clamp(80px, 10vw, 150px); }
.close h2 { font-size: clamp(38px, 5vw, 72px); line-height: 0.98; font-weight: 800; letter-spacing: -0.05em; }
.close .lead { max-width: 520px; }
.close__actions { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-block: 28px; }
.site-footer .brand { font-size: 22px; }
.site-footer .brand svg { width: 33px; height: 22px; }
.legal { display: flex; flex-wrap: wrap; gap: 0 4px; }
.legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.legal a:hover { color: var(--ink); }
.site-footer small { font-size: 14.5px; font-weight: 600; color: var(--muted); }

/* ---------- Launch film player ---------- */
.film-dialog {
  /* As wide as fits, and never taller than the screen once the close button is counted */
  width: min(980px, calc(100vw - 32px), calc((100vh - 120px) * 16 / 9));
  width: min(980px, calc(100vw - 32px), calc((100dvh - 120px) * 16 / 9));
  max-width: none; max-height: none;
  padding: 56px 0 0; border: 0; background: transparent; overflow: visible; color: var(--ink);
}
.film-dialog::backdrop { background: rgba(37, 34, 44, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.film-dialog__close {
  position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; border-radius: 12px; cursor: pointer;
  background: rgba(255, 253, 250, 0.94); color: var(--ink); display: grid; place-items: center;
}
.film-dialog video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 20px; background: #000; box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.6); }

/* ---------- Early access dialog, restyled to Colony 3.0 ---------- */
#access-dialog {
  border: 0; border-radius: 24px; background: var(--canvas); color: var(--ink); font-family: var(--font);
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(40, 20, 60, 0.45);
}
#access-dialog::backdrop { background: rgba(37, 34, 44, 0.55); }
.early-access__eyebrow { color: var(--accent-ink); font-size: 13px; font-weight: 800; letter-spacing: 0.09em; }
.early-access__header h2 { font-size: clamp(28px, 5vw, 34px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.early-access__intro, .early-access__draft > p { color: var(--ink-2); font-weight: 500; }
.early-access__close { width: 44px; height: 44px; flex-basis: 44px; border: 0; border-radius: 12px; color: var(--ink-2); }
.early-access__close:hover { background: var(--track); }
.early-access__form label, .early-access__draft label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.early-access__form input, .early-access__form select, .early-access__form textarea, .early-access__draft textarea {
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 16px; font-weight: 500;
}
.early-access__draft textarea { font-size: 14.5px; }
.early-access__primary { border-radius: 12px; background: var(--ink); color: var(--canvas); font-weight: 700; }
.early-access__primary:hover { background: #3a3644; color: var(--canvas); }
.early-access__secondary { border-radius: 12px; border-color: var(--line-strong); background: var(--card); color: var(--ink); font-weight: 700; }
.early-access__note, .early-access__status { color: var(--muted); font-size: 13.5px; }
.early-access__text-button { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
#access-dialog :focus-visible { outline-color: var(--accent); }

/* ---------- Motion ---------- */
body.r10-paused .caret, body.r10-paused .r16-typing i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret, .r16-typing i { animation: none; }
  .helix video { transition: none; }
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 1080px) {
  .hero__media { width: 58%; }
}
@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; }
  .site-nav {
    order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: calc(var(--gutter) - 12px);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .header-download { margin-left: auto; }
  .motion-toggle { margin-left: 4px; }
  .hero-shell { min-height: 0; }
  .hero { flex-direction: column; align-items: stretch; padding-top: 156px; padding-bottom: 0; }
  .hero__media {
    position: relative; inset: auto; width: auto; height: clamp(340px, 88vw, 560px);
    margin: 36px calc(-1 * var(--gutter)) 0;
  }
  .hero__media::after {
    background: linear-gradient(180deg, var(--canvas) 0%, rgba(255, 253, 250, 0) 14%, rgba(255, 253, 250, 0) 86%, var(--canvas) 100%);
  }
  .film-pill { left: 62%; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-window { flex-direction: column; min-height: 0; }
  .app-side { flex-basis: auto; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  /* demos-r23.js loads the phone demo below 700px */
  .demo-window { max-width: 400px; }
  .demo-display { aspect-ratio: 390 / 800; }
  .demo-display iframe { width: 390px; }
}
@media (max-width: 540px) {
  .film-pill { left: 50%; height: 52px; }
  .video-grid { gap: 24px 14px; }
  .video-play { padding: 8px; }
  .video-grid .video-play span { width: 36px; height: 36px; }
  .video-grid .video-play svg { width: 14px; height: 14px; }
  .phone-grid .video-play span { width: 40px; height: 40px; }
  .video-card--lead .video-play { padding: 12px; }
  .video-card--lead .video-play span { width: 52px; height: 52px; }
  .r10-messages li { gap: 10px; padding: 10px; }
  .install-help summary { font-size: 16.5px; padding: 0 18px; }
  .install-grid { padding: 0 14px 14px; }
}
