/* Cay website. Light theme only. */

@font-face {
  font-family: "Urbanist";
  src: url("/assets/fonts/urbanist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --base: #F3F4F7;
  --dot: #D3D7E0;
  --ink: #1F2847;
  --soft: #5D6478;
  --soft2: #4A5470;
  --mute: #9AA1B2;
  --card: #FFFFFF;
  --line: #E4E7EE;
  --chip: #FAFAFB;
  --chip2: #EEF0F4;
  --panel: #E7E9F0;
  --lagoon: #00DACE;
  --lagoon-ink: #00B8AE;
  --amber: #E6C14A;
  --island: #0E0D0C;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  font-family: "Urbanist", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--base);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--soft2); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lagoon-ink);
  outline-offset: 3px;
  border-radius: 6px;
}
img, svg { display: block; max-width: 100%; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */

.site-nav {
  max-width: 1200px; margin: 0 auto;
  padding: 28px var(--gutter) 0;
  display: flex; align-items: center; gap: 24px;
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand svg { width: 28px; height: 28px; }
.brand span { font-size: 24px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.nav-links {
  margin: 0 auto; display: flex; align-items: center; gap: 28px;
  font-size: 15px; font-weight: 600;
}
.nav-links a { color: var(--soft2); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-end { display: flex; align-items: center; gap: 24px; }
.nav-end .gh { font-size: 15px; font-weight: 600; color: var(--soft2); }

.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--ink);
  border-radius: 999px; padding: 10px 18px; white-space: nowrap;
}
.pill-btn:hover { color: #fff; background: #2A3560; }

.menu-btn {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line);
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 0;
}
.menu-btn span { width: 16px; height: 2px; border-radius: 1px; background: var(--ink); transition: transform 200ms var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + 10px);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 50px rgba(31, 40, 71, 0.14);
  padding: 8px;
}
.mobile-menu a {
  display: block; padding: 14px 16px; font-size: 18px; font-weight: 700; border-radius: 12px;
}
.mobile-menu a:hover { background: var(--base); color: var(--ink); }
.mobile-menu .pill-btn { display: flex; justify-content: center; margin-top: 6px; padding: 14px 16px; border-radius: 14px; }
.site-nav.open .mobile-menu { display: block; }

/* ---------- Shared type ---------- */

.eyebrow {
  font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft);
}
.h2 {
  margin: 0; font-size: clamp(40px, 6vw, 88px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.94;
}
.lead { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; max-width: 540px; }
.note { font-size: 14px; color: var(--soft); line-height: 1.5; }

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

.hero { display: flex; flex-direction: column; align-items: center; padding-top: 24px; text-align: center; }

.scene {
  width: min(720px, 100%); aspect-ratio: 16 / 9; border-radius: clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, #C6D8E7 0%, #DCE4EC 55%, #F1E7DB 100%);
  position: relative; overflow: hidden;
  box-shadow: 0 30px 80px rgba(31, 40, 71, 0.14);
}
.scene .win {
  position: absolute; left: 8%; right: 8%; top: 34%; bottom: -6%;
  border-radius: 14px 14px 0 0; border: 1px solid rgba(31, 40, 71, 0.08);
  background: repeating-linear-gradient(135deg, #F6F7F9 0 14px, #EEF0F4 14px 28px);
}
.scene .island-wrap {
  position: absolute; left: 50%; top: 0; width: min(360px, 90%);
  transform: translateX(-50%);
}
.drop { animation: cayDrop 900ms var(--ease) both; }

/* The island (always a black pill) */
.island {
  background: var(--island); color: #F3F3F3; border-radius: 0 0 22px 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding-bottom: 8px; text-align: left;
}
.island .bar { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; }
.island .state { font-size: 14px; font-weight: 600; }
.island .face { position: relative; width: 30px; height: 25px; flex: none; margin-left: auto; }
.island .face::before {
  content: ""; position: absolute; inset: -4px -8px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), rgba(0, 0, 0, 0));
}
.island .face svg { position: relative; overflow: visible; width: 30px; height: 25px; }
.island .body { border-top: 1px solid #222120; padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 10px; }
.island .to { display: flex; gap: 8px; align-items: center; font-size: 16px; font-weight: 600; }
.island .to .ic { width: 20px; height: 20px; border-radius: 6px; background: repeating-linear-gradient(135deg, #3A3A3A 0 3px, #262626 3px 6px); flex: none; }
.island .to small { font-size: 12px; color: #A8A8A8; font-weight: 400; }
.island .msg { font-size: 14px; line-height: 20px; background: #1A1918; border-radius: 12px; padding: 10px 12px; }
.island .code { font-family: Consolas, ui-monospace, monospace; font-size: 13px; background: #1A1918; border-radius: 10px; padding: 10px 12px; }
.island .warn { font-size: 12.5px; color: var(--amber); }
.island .acts { display: flex; gap: 8px; justify-content: flex-end; }
.island .acts span { font-size: 14px; background: #2A2928; border-radius: 10px; padding: 8px 16px; }
.island .acts .go { font-weight: 600; color: var(--island); background: var(--lagoon); }

.hero h1 {
  margin: 56px 0 0; font-size: clamp(56px, 11vw, 168px); font-weight: 800;
  letter-spacing: -0.055em; line-height: 0.86;
  animation: cayRise 900ms var(--ease) 150ms both;
}
.hero h1 .pre {
  display: block; font-size: 0.42em; font-weight: 700; letter-spacing: -0.02em; color: var(--soft); margin-bottom: 0.25em;
}
.hero .lead { margin-top: 28px; max-width: 620px; font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }

.get {
  margin-top: 36px; display: flex; align-items: center; gap: 16px;
  padding: 8px 8px 8px 24px; border-radius: 16px; background: var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); text-align: left;
}
.get .t { display: flex; flex-direction: column; gap: 2px; }
.get .t b { font-size: 18px; }
.get .t span { font-size: 13.5px; color: var(--soft); }

.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #fff; background: var(--ink);
  border-radius: 12px; padding: 16px 22px; box-shadow: 0 8px 20px rgba(31, 40, 71, 0.22);
  text-align: center;
}
.big-btn:hover { color: #fff; background: #2A3560; }
.soon-dot {
  width: 8px; height: 8px; border-radius: 4px; background: var(--lagoon); flex: none;
  box-shadow: 0 0 0 0 rgba(0, 218, 206, 0.6); animation: pulse 2.4s ease-out infinite;
}

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

.stack { display: flex; flex-direction: column; gap: clamp(96px, 14vw, 180px); padding-top: clamp(110px, 15vw, 200px); padding-bottom: clamp(96px, 12vw, 160px); }

.split {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: center;
}
.split .copy { display: flex; flex-direction: column; gap: 24px; }
.c-1-5 { grid-column: 1 / span 5; }
.c-7-6 { grid-column: 7 / span 6; }
.c-1-6 { grid-column: 1 / span 6; }
.c-8-5 { grid-column: 8 / span 5; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--chip); }

.talk-card {
  aspect-ratio: 4 / 5; border-radius: clamp(28px, 4vw, 40px); background: var(--card); border: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column;
}
.talk-card .listen {
  align-self: center; width: min(380px, 92%); min-height: 88px; background: var(--island);
  border-radius: 0 0 26px 26px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 18px; color: #F3F3F3; flex: none;
}
.talk-card .listen .face { width: 45px; height: 38px; flex: none; position: relative; }
.talk-card .listen .face::before {
  content: ""; position: absolute; inset: -6px -10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 218, 206, 0.42), rgba(0, 0, 0, 0));
}
.talk-card .listen .face svg { position: relative; width: 45px; height: 38px; overflow: visible; }
.talk-card .listen .face .eyes { transform-origin: center 12px; animation: cayBlink 4.5s infinite; }
.talk-card .listen .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.talk-card .listen .words small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lagoon); }
.talk-card .listen .words span { font-size: 17px; font-weight: 600; line-height: 23px; }
.talk-card .listen .words i { font-style: normal; color: #7A7A7A; }
.talk-card .log { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 28px 9% 36px; }
.talk-card .log .when { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); align-self: flex-end; }
.bubble { align-self: flex-end; max-width: 86%; background: var(--base); border-radius: 18px 18px 4px 18px; padding: 12px 16px; font-size: 16px; }

.memory { display: flex; flex-direction: column; gap: 12px; }
.memory div {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  box-shadow: 0 1px 2px rgba(31, 40, 71, 0.05); font-size: 16px;
}
.memory div small { font-size: 13px; color: var(--soft); }
.memory div.never { background: var(--base); border-color: transparent; box-shadow: none; color: var(--soft2); }

.rule { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.rule .inner {
  grid-column: 4 / span 6; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 72px 40px; display: flex; flex-direction: column; gap: 24px;
}
.rule .h2 { font-size: clamp(40px, 6vw, 84px); }

.dark-card {
  min-height: 480px; border-radius: clamp(28px, 4vw, 40px); background: #0F1426;
  background-image: radial-gradient(#1E2540 1px, transparent 1px); background-size: 24px 24px;
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding-bottom: 32px;
}
.dark-card .island { width: min(360px, 100%); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.dark-card .island .bar { padding: 0 12px 0 20px; }
.term {
  width: 84%; border-radius: 18px; background: #151B30; border: 1px solid #232B47; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  font-family: Consolas, ui-monospace, monospace; font-size: 13.5px; color: #AEB6CC;
}
.term .hd {
  display: flex; align-items: center; gap: 8px; font-family: "Urbanist", sans-serif; font-size: 13px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E7794;
}
.term .hd::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--amber); }
.term .ok { color: #5BD68A; }
.term .wait { color: var(--amber); }

.speed { display: flex; flex-direction: column; gap: 48px; }
.speed .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.speed .num { padding: 36px 32px 0; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); }
.speed .num:first-child { padding-left: 0; border-left: 0; }
.speed .num:last-child { padding-right: 0; }
.speed .num b { font-size: clamp(52px, 7vw, 104px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.speed .num b small { font-size: 0.4em; vertical-align: top; color: var(--mute); }
.speed .num span { font-size: 17px; color: var(--soft2); }

.private {
  background: var(--card); border: 1px solid var(--line); border-radius: clamp(28px, 4vw, 40px);
  padding: clamp(56px, 10vw, 120px) clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px;
}
.private .copy { grid-column: 2 / span 7; display: flex; flex-direction: column; gap: 24px; }
.private .h2 { font-size: clamp(48px, 8vw, 128px); letter-spacing: -0.055em; line-height: 0.88; }
.private .lead { max-width: 620px; font-size: clamp(18px, 1.8vw, 22px); }

.reqs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.reqs > div {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 3vw, 36px);
  display: flex; flex-direction: column; gap: 14px;
}
.reqs b { font-size: clamp(21px, 2.2vw, 26px); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.reqs p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--soft2); }
.ghost-btn {
  align-self: flex-start; font-size: 15px; font-weight: 700; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px; background: var(--chip);
}

.closer { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.closer svg { width: 96px; height: 96px; }
.closer .h2 { font-size: clamp(48px, 8vw, 120px); letter-spacing: -0.055em; line-height: 0.9; }

/* ---------- Inner pages ---------- */

.page-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
  padding-top: clamp(48px, 7vw, 96px);
}
.page-hero h1 {
  margin: 0; font-size: clamp(48px, 8vw, 104px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.92; max-width: 900px;
}
.page-hero .lead { max-width: 620px; color: var(--soft2); }
.page-body { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 80px); padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(64px, 8vw, 96px); }
.block { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 24px; }
.block-head { display: flex; flex-direction: column; gap: 10px; }
.block-head .eyebrow { font-size: 14px; letter-spacing: .1em; }
.block-head h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }

.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 2.4vw, 28px);
  display: flex; flex-direction: column; gap: 10px;
}
.card .n { font-size: 14px; font-weight: 700; color: var(--mute); }
.card h3 { margin: 0; font-size: clamp(19px, 1.8vw, 22px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--soft2); }

.list { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 4px clamp(20px, 2.4vw, 28px); }
.list .row { display: flex; gap: 32px; padding: 18px 0; border-top: 1px solid var(--line); }
.list .row:first-child { border-top: 0; }
.list .row b { flex: 0 0 260px; font-size: 16px; }
.list .row span { flex: 1; font-size: 16px; line-height: 1.55; color: var(--soft2); }

.steps { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 8px clamp(20px, 2.4vw, 28px); margin: 0; list-style: none; }
.steps li { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .num {
  width: 32px; height: 32px; border-radius: 16px; flex: none; background: var(--chip2);
  font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.steps div { display: flex; flex-direction: column; gap: 4px; }
.steps b { font-size: 18px; }
.steps span { font-size: 15.5px; line-height: 1.55; color: var(--soft2); }

.band {
  background: var(--ink); color: #fff; border-radius: 28px; padding: clamp(32px, 5vw, 56px);
  display: flex; flex-direction: column; gap: 14px;
}
.band .eyebrow { color: #AEB6CC; font-size: 14px; letter-spacing: .1em; }
.band h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.band p { margin: 0; font-size: 17px; line-height: 1.6; color: #D3D8E6; max-width: 640px; }
.band a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.soon-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px;
}
.soon-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 24px;
}
.inline-link { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */

.site-foot {
  max-width: 1200px; margin: 0 auto; padding: 48px var(--gutter) 64px;
  border-top: 1px solid var(--line);
  display: flex; align-items: flex-end; gap: 32px;
}
.site-foot .word { font-size: clamp(80px, 14vw, 200px); font-weight: 800; letter-spacing: -0.06em; line-height: 0.8; }
.site-foot nav { margin-left: auto; display: grid; grid-template-columns: repeat(2, auto); gap: 10px 40px; font-size: 15px; padding-bottom: 12px; }
.site-foot { flex-wrap: wrap; }
.foot-small { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 28px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--soft); }
.foot-small p { margin: 0; }
.foot-small a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Motion ---------- */

@keyframes cayRise { 0% { opacity: 0; transform: translateY(28px) scale(.97); } 60% { opacity: 1; transform: translateY(-4px) scale(1.005); } 100% { opacity: 1; transform: none; } }
@keyframes cayDrop { 0% { translate: 0 -100%; } 70% { translate: 0 4%; } 100% { translate: 0 0; } }
@keyframes cayBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 218, 206, 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(0, 218, 206, 0); } }

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

/* ---------- Tablet ---------- */

@media (max-width: 960px) {
  .nav-links, .nav-end { display: none; }
  .menu-btn { display: inline-flex; }

  .split { grid-template-columns: 1fr; gap: 40px; }
  .c-1-5, .c-7-6, .c-1-6, .c-8-5 { grid-column: auto; }
  .split.flip .copy { order: -1; }
  .talk-card { aspect-ratio: auto; max-width: 560px; width: 100%; }
  .memory { max-width: 560px; }
  .dark-card { max-width: 640px; width: 100%; }

  .rule .inner { grid-column: 1 / -1; padding: 56px 24px; }

  .private .copy { grid-column: 1 / -1; }

  .reqs, .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reqs > div:last-child { grid-column: 1 / -1; }
}

/* ---------- Phone ---------- */

@media (max-width: 640px) {
  .site-nav { padding-top: 16px; }

  .hero { padding-top: 16px; }
  .scene { aspect-ratio: 4 / 3; }
  .hero h1 { margin-top: 40px; }

  .get { flex-direction: column; align-items: stretch; padding: 16px; text-align: center; gap: 12px; width: 100%; max-width: 420px; }
  .get .big-btn { width: 100%; }

  .rule { border-top: 0; }
  .rule .inner { border: 0; border-top: 1px solid var(--line); padding: 48px 0 0; }

  .speed .nums { grid-template-columns: 1fr; }
  .speed .num, .speed .num:first-child { padding: 28px 0; border-left: 0; border-top: 1px solid var(--line); }
  .speed .num:first-child { border-top: 0; }

  .reqs, .cards.three, .cards.two { grid-template-columns: 1fr; }
  .reqs > div:last-child { grid-column: auto; }

  .page-hero { align-items: flex-start; text-align: left; }
  .soon-box { align-items: flex-start; }
  .list .row { flex-direction: column; gap: 4px; }
  .list .row b { flex: none; }

  .site-foot { flex-direction: column; align-items: flex-start; gap: 24px; }
  .site-foot nav { margin-left: 0; }

  .term { width: calc(100% - 32px); }
  .dark-card { min-height: 0; }
}

/* ---------- How it works demo ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.demo { display: flex; flex-direction: column; gap: 48px; scroll-margin-top: 24px; }
.d-head { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.d-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

.d-device { width: 100%; max-width: 760px; justify-self: center; filter: drop-shadow(0 30px 50px rgba(31, 40, 71, 0.18)); }
.d-lid { background: #1B1F2A; border-radius: clamp(10px, 2vw, 18px) clamp(10px, 2vw, 18px) 4px 4px; padding: 2.4% 2.4% 3%; position: relative; }
.d-lid::before { content: ""; position: absolute; top: 1.1%; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #3A4050; }
.d-screen {
  --z: 0.5;
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 3px;
  background: linear-gradient(180deg, #C6D8E7 0%, #DCE4EC 55%, #F1E7DB 100%);
}
.d-canvas {
  position: absolute; left: 0; top: 0; width: 1000px; height: 625px;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--z)); transform-origin: 0 0;
  transition: transform 1100ms cubic-bezier(.65, 0, .25, 1);
}
.d-win {
  position: absolute; left: 0; right: 0; top: 0; bottom: 48px; border-radius: 0; overflow: hidden;
  background: #FBFBFC; border: 1px solid rgba(31, 40, 71, 0.10); box-shadow: 0 20px 50px rgba(31, 40, 71, 0.14);
  display: flex; flex-direction: column;
}
.d-winbar { height: 34px; flex: none; background: #EEF0F4; display: flex; align-items: center; gap: 18px; padding: 0 16px; font-size: 13px; font-weight: 600; color: #5D6478; }
.d-winbar span { margin-right: auto; }
.d-winbar i { width: 10px; height: 10px; border: 1.5px solid #9AA1B2; border-radius: 2px; }
.d-chat { flex: 1; display: flex; min-height: 0; }
.d-list { width: 30%; border-right: 1px solid #E4E7EE; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.d-list .c { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; font-size: 15px; color: #4A5470; }
.d-list .c.on { background: #ECEEF3; color: #1F2847; font-weight: 600; }
.d-list .c b { width: 30px; height: 30px; border-radius: 50%; background: #DADEE7; flex: none; }
.d-thread { flex: 1; padding: 12px 48px 12px 20px; display: flex; flex-direction: column; gap: 8px; background: #F6F7F9; min-width: 0; }
.d-th { font-size: 16px; font-weight: 700; color: #1F2847; padding-bottom: 10px; border-bottom: 1px solid #E4E7EE; margin-bottom: 6px; }
.d-thread .m { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.d-thread .in { align-self: flex-start; background: #FFFFFF; border: 1px solid #E4E7EE; color: #1F2847; }
.d-thread .out { align-self: flex-end; background: #CBF1ED; color: #1F2847; }
.d-thread .d-new { opacity: 0; transform: translateY(8px); transition: opacity 300ms ease-out, transform 300ms ease-out; }
.d-canvas.sent .d-new { opacity: 1; transform: none; }
.d-thread .d-new small { margin-left: 8px; font-size: 11px; color: #2BA39A; letter-spacing: -2px; }
.d-thread .m.first { margin-top: auto; }
.d-compose { margin-top: 4px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 20px; background: #FFFFFF; border: 1px solid #E4E7EE; transition: border-color 200ms, box-shadow 200ms; }
.d-compose .ct { flex: 1; min-width: 0; font-size: 13.5px; color: #1F2847; white-space: nowrap; overflow: hidden; display: flex; justify-content: flex-start; }
.d-compose .ct > span { flex: none; }
.d-compose .ct .ph { color: #9AA1B2; margin-right: auto; }
.d-compose .snd { width: 28px; height: 28px; border-radius: 50%; background: #DADEE7; flex: none; position: relative; transition: background 200ms, transform 150ms; }
.d-compose .snd::after { content: ""; position: absolute; left: 10px; top: 8px; border-left: 10px solid #FFFFFF; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.d-canvas.typing .d-compose { border-color: #2BA39A; box-shadow: 0 0 0 3px rgba(43, 163, 154, 0.15); }
.d-canvas.ready .d-compose .snd { background: #2BA39A; }
.d-canvas.press .d-compose .snd { transform: scale(0.85); }
.d-island .acts span.go.press { transform: scale(0.94); filter: brightness(1.15); }
.d-taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(243, 244, 247, 0.92); border-top: 1px solid rgba(31, 40, 71, 0.08);
}
.d-taskbar .tb-start { width: 26px; height: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.d-taskbar .tb-start i { background: #4A5470; border-radius: 1.5px; }
.d-taskbar .tb-app { width: 30px; height: 30px; border-radius: 8px; background: #DADEE7; }
.d-taskbar .tb-app.on, .d-taskbar .tb-wa { background: #C6CCDA; box-shadow: inset 0 -3px 0 #4A5470; }
.d-taskbar .tb-wa { background: #BFE8D2; transition: background 300ms, box-shadow 300ms; }
/* With the script running, the desktop starts empty and each step shows up in turn. */
.d-pick { display: none; }
.demo.ready .d-taskbar .tb-wa { box-shadow: none; }
.demo.ready .d-canvas.app-open .tb-wa { box-shadow: inset 0 -3px 0 #2BA39A; }
.demo.ready .d-win { opacity: 0; transform: translateY(30px) scale(0.92); transform-origin: 52% 100%; transition: opacity 280ms ease-out, transform 520ms var(--ease); }
.demo.ready .d-canvas.app-open .d-win { opacity: 1; transform: none; }
.demo.ready .d-thread { position: relative; }
.demo.ready .d-th, .demo.ready .d-thread .m.old, .demo.ready .d-compose { opacity: 0; transition: opacity 260ms ease-out; }
.demo.ready .d-canvas.chat-open .d-th, .demo.ready .d-canvas.chat-open .d-thread .m.old, .demo.ready .d-canvas.chat-open .d-compose { opacity: 1; }
.demo.ready .d-pick { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 14px; color: #9AA1B2; transition: opacity 200ms; }
.demo.ready .d-canvas.chat-open .d-pick { opacity: 0; }
.demo.ready .d-list .c { transition: background 250ms, color 250ms; }
.demo.ready .d-canvas:not(.chat-open) .d-list .c.on { background: transparent; color: #4A5470; font-weight: 400; }
.d-taskbar .tb-clock { position: absolute; right: 18px; font-size: 13px; color: #4A5470; font-weight: 600; }
.d-base { position: relative; height: clamp(10px, 1.8vw, 16px); margin: 0 -6%; background: linear-gradient(180deg, #DCDFE6 0%, #B4B9C5 100%); border-radius: 2px 2px 14px 14px / 2px 2px 100% 100%; }
.d-base span { position: absolute; top: 0; left: 50%; width: 16%; height: 40%; margin-left: -8%; border-radius: 0 0 8px 8px; background: #A7ADBA; }
.d-island {
  position: absolute; left: 50%; top: 0; width: 168px; height: 44px; padding: 0;
  border-radius: 0 0 22px 22px; overflow: hidden; z-index: 3;
  transform: translateX(-50%) scale(var(--is, 1)); transform-origin: top center;
  transition: transform 1100ms cubic-bezier(.65, 0, .25, 1);
}
.d-face {
  position: absolute; left: 0; top: 9.5px; width: 30px; height: 25px; z-index: 2;
  transition: top 400ms var(--ease);
}
.d-face::before {
  content: ""; position: absolute; inset: -4px -8px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow, rgba(0,218,206,0.14)), rgba(0, 0, 0, 0));
  transition: background 240ms ease-out;
}
.d-face svg { position: relative; width: 30px; height: 25px; overflow: visible; }
.d-face path { transition: fill 240ms ease-out; }
.d-island.big .d-face { top: 31px; }

.d-content {
  position: absolute; left: 0; right: 0; top: 0;
  transition: opacity 180ms ease-out 60ms, transform 180ms ease-out 60ms, filter 180ms ease-out 60ms;
}
.d-content.out { opacity: 0; transform: translateY(4px); filter: blur(4px); transition-duration: 90ms; transition-delay: 0ms; }

.d-line { height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.d-line.l { padding: 0 18px 0 56px; }
.d-line.r { padding: 0 56px 0 18px; }
.d-line em { font-style: normal; font-weight: 400; color: #8C8C8C; margin-left: auto; }
.d-voice { position: absolute; left: 82px; right: 18px; top: 14px; display: flex; flex-direction: column; gap: 2px; }
.d-voice small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lagoon); }
.d-voice .heard { font-size: 16px; font-weight: 600; line-height: 21px; max-height: 42px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.d-voice .heard i { font-style: normal; color: #7A7A7A; }
.d-card { border-top: 1px solid #222120; padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 10px; }
.d-island .acts span { cursor: default; transition: transform 150ms, filter 150ms; }

.d-side { display: flex; flex-direction: column; gap: 28px; }
.d-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.d-step {
  width: 100%; display: flex; align-items: center; gap: 16px; text-align: left;
  font: inherit; font-size: clamp(18px, 1.7vw, 22px); font-weight: 600; line-height: 1.35; letter-spacing: -0.01em;
  color: var(--mute); background: none; border: 0; padding: 10px 0; cursor: pointer;
  transition: color 240ms ease-out;
}
.d-step:hover { color: var(--soft2); }
.d-step.done { color: var(--soft); }
.d-step.now { color: var(--ink); }
.d-step .ring { width: 24px; height: 24px; flex: none; }
.d-step .ring svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.d-step .ring circle { fill: none; stroke-width: 2.5; }
.d-step .ring .bg { stroke: var(--line); }
.d-step .ring .fg { stroke: var(--lagoon-ink); stroke-dasharray: 63; stroke-dashoffset: 63; stroke-linecap: round; }
.d-step.done .ring .bg { stroke: var(--lagoon-ink); }

.d-play {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px 10px 14px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 40, 71, 0.05);
}
.d-play:hover { border-color: var(--line); background: var(--chip); }
.d-play svg { width: 16px; height: 16px; fill: currentColor; }
.d-play .i-pause { display: none; }
.demo.is-playing .d-play .i-pause { display: block; }
.demo.is-playing .d-play .i-play { display: none; }
.demo:not(.ready) .d-play { display: none; }

@media (max-width: 960px) {
  .d-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .d-device { width: calc(100% - 24px); }
  .d-side { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-canvas { transition: none; }
}
