/* The opening screen. Everything is visible by default; while html[data-hero="intro"] the
   opening hides each part until the timeline (hero.js) adds that part's class to the section. */

:root {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  color-scheme: light;
  --brand-ink: #1b1626;
  --mark: #a7a5ad;
  --ink-rgb: 27 22 38;
  --surface-rgb: 255 255 255;
  --accent-rgb: 0 168 112;
  --on-accent: #fff;
  --ring-mint: #00a870;
  --ring-sand: #c9a774;
  --ring-mist: #7e9bb0;
  --ring-k: 1;
  --texture-filter: none;
  --texture-opacity: 1;
  transition: background-color .6s ease;
}
/* night: the page and the pet's own bubbles go dark together (pet-ui.css has the pet's half) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111316;
  --ink: #eceef2;
  --ink-soft: #a9adb6;
  --ink-dim: #737884;
  --accent: #2fd59b;
  --brand-ink: #f4f5f7;
  --mark: #6b6f79;
  --ink-rgb: 233 237 242;
  --surface-rgb: 30 33 40;
  --accent-rgb: 47 213 155;
  --on-accent: #07261b;
  --ring-k: .8;
  --texture-filter: invert(1);
  --texture-opacity: .45;
  /* the console tokens the wardrobe's tabs use */
  --sheet: #1b1e24;
  --sheet-2: #22262d;
  --sheet-3: #2a2f37;
  --line: #2a2e36;
  --line-2: #363b44;
}
/* the DeepSeek whale's blue, once it is chosen on the dressing screen; for the rest of the visit */
:root[data-skin="whale"] {
  --paper: #f2f4fa;
  --accent: #4d6bfe;
  --accent-rgb: 77 107 254;
  --ring-mint: #4d6bfe;
  --ring-sand: #8ea2f2;
  --ring-mist: #6c86c9;
}
:root[data-skin="whale"][data-theme="dark"] {
  --paper: #0e1120;
  --accent: #7d94ff;
  --accent-rgb: 125 148 255;
  --on-accent: #0b1030;
  --ring-mint: #6f88ff;
  --ring-sand: #5c6fb8;
  --ring-mist: #4a62a8;
}

* { box-sizing: border-box; }

/* hidden means hidden, whatever display a class gives (the package list is display:grid) */
[hidden] { display: none !important; }

/* one screen at a time */
html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }

/* the scrollbar: its room is kept from the first paint (so the page never jumps sideways when it turns up),
   and it is a thin translucent thumb on no track, hidden while the opening plays */
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--ink-rgb) / .2) transparent;
}
html[data-hero="intro"] { scrollbar-color: transparent transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: rgb(var(--ink-rgb) / .2) content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgb(var(--ink-rgb) / .35); }
html[data-hero="intro"] ::-webkit-scrollbar-thumb { background: transparent; }
main > section { scroll-snap-align: start; }

body {
  margin: 0;
  background: var(--paper);
  isolation: isolate;
  font: 15px/1.72 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('../../assets/companion-texture.svg') 0 0 / 640px 480px repeat;
  filter: var(--texture-filter);
  opacity: var(--texture-opacity);
}

/* While the opening plays nothing scrolls under it. */
html[data-hero="intro"],
html[data-hero="intro"] body { overflow: hidden; }
/* English words go in as the page starts (i18n.js); until then nothing shows, so no Chinese flashes */
html[data-lang="en"]:not([data-i18n-ready]) body { visibility: hidden; }

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

/* line breaking: headings balance their lines, text avoids a lone last word, Chinese keeps its punctuation rules */
h1, h2, h3, .feat-title, .sum-title, .dl-title, .hero-tagline, .sum-grid b { text-wrap: balance; }
p, .sum-grid span, .dress-pack span, .bubble .b-text { text-wrap: pretty; }
:lang(zh) body { line-break: strict; }
:lang(en) body { overflow-wrap: break-word; hyphens: manual; }

.icon { display: inline-flex; }
.icon svg { width: 100%; height: 100%; }

/* ---------- the section ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
}

.hero-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px 9vh;
}

/* ---------- background rings: fixed, so they stay behind every screen ---------- */
.hero-rings {
  position: fixed;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 2.4s ease;
}
.ring {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: var(--dash) 100;
  transform-origin: var(--cx) var(--cy);
  animation: ring-turn var(--turn) linear infinite var(--dir, normal);
}
.ring { transition: stroke .8s ease; }
.ring.mint { stroke: var(--ring-mint); opacity: calc(.1 * var(--ring-k)); }
.ring.sand { stroke: var(--ring-sand); opacity: calc(.14 * var(--ring-k)); }
.ring.mist { stroke: var(--ring-mist); opacity: calc(.11 * var(--ring-k)); }
@keyframes ring-turn { to { transform: rotate(360deg); } }

/* ---------- the brand, and the typing that comes before it ---------- */
.hero-brand {
  position: relative;
  margin: 0;
  width: min(620px, 84vw);
  line-height: 0;
}
.hero-brand svg { width: 100%; height: auto; overflow: visible; }
.brand-c { stroke: var(--brand-ink); }
.brand-o { stroke: var(--accent); }
.brand-tail { stroke: var(--brand-ink); }
.brand-c, .brand-o, .brand-tail path {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset calc(.5s * var(--intro-slow, 1)) cubic-bezier(.45, 0, .2, 1), visibility 0s;
  transition-delay: calc(var(--draw-delay, 0ms) * var(--intro-slow, 1));
}
.brand-dot { fill: var(--brand-ink); stroke: none; transform-box: fill-box; transform-origin: center; transition: transform calc(.45s * var(--intro-slow, 1)) cubic-bezier(.3, 1.6, .5, 1); }
.brand-o { --draw-delay: 110ms; }
.brand-o + .brand-o { --draw-delay: 220ms; }
.brand-tail > g:nth-child(1) { --draw-delay: 330ms; }
.brand-tail > g:nth-child(2) { --draw-delay: 440ms; }
.brand-tail > g:nth-child(3) { --draw-delay: 550ms; }
.brand-tail > g:nth-child(4) { --draw-delay: 660ms; }
.brand-tail > g:nth-child(4) .brand-dot { transition-delay: calc(.89s * var(--intro-slow, 1)); }
.brand-tail > g:nth-child(5) { --draw-delay: 770ms; }
.brand-tail > g:nth-child(6) { --draw-delay: 880ms; }

/* "Coo... Coo?" is drawn inside the brand's SVG, in the brand's strokes */
.typed { transition: opacity .3s ease; }
.typed [data-glyph] { opacity: 0; transform-box: fill-box; transform-origin: 50% 80%; }
.typed [data-glyph].on { opacity: 1; }
.typed [data-glyph].pop { animation: glyph-pop .42s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes glyph-pop { from { transform: translateY(10px) scale(.55); } }
.typed .t-ink { stroke: var(--brand-ink); }
.typed .t-o { stroke: var(--accent); }
.typed .t-mark { fill: var(--mark); stroke: none; }
.typed .t-mark-q path { stroke: var(--mark); }
.typed .t-mark-q circle { fill: var(--mark); stroke: none; }
.typed .caret {
  stroke: var(--accent);
  stroke-width: 7;
  transition: transform .08s linear;
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.typed.is-gone { opacity: 0; }
html:not([data-hero="intro"]) .typed { display: none; }

.hero-tagline {
  margin: clamp(22px, 4vh, 40px) 0 0;
  font-size: clamp(22px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .04em;
  color: var(--ink);
  text-align: center;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(22px, 3.6vh, 32px);
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s ease, background-color .2s ease, border-color .2s ease, opacity .6s ease;
}
.hero-btn:hover { transform: translateY(-2px); }
.hero-btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.hero-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 3px; }
.btn-icon { width: 17px; height: 17px; flex: none; }
.hero-btn.ghost {
  color: var(--brand-ink);
  background: rgb(var(--surface-rgb) / .78);
  border-color: rgb(var(--ink-rgb) / .12);
  box-shadow: 0 1px 2px rgb(var(--ink-rgb) / .04);
  backdrop-filter: blur(6px);
}
.hero-btn.ghost:hover { border-color: rgb(var(--ink-rgb) / .22); box-shadow: 0 8px 20px rgb(var(--ink-rgb) / .08); }
.hero-btn.ghost:hover .btn-icon { animation: wiggle .5s ease; }
@keyframes wiggle { 30% { transform: rotate(-12deg); } 65% { transform: rotate(8deg); } }
.hero-btn.primary {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 6px 18px rgb(var(--accent-rgb) / .26), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.hero-btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); box-shadow: 0 10px 24px rgb(var(--accent-rgb) / .32), inset 0 1px 0 rgba(255, 255, 255, .18); }
.hero-btn.primary:hover .arrow { animation: drop .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes drop { 40% { transform: translateY(3px); } }

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: max(16px, 2.4vh);
  width: 40px;
  height: 40px;
  margin-left: -20px;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  border-radius: 50%;
  transition: opacity .8s ease, color .2s ease;
}
.hero-scroll:hover { color: var(--accent); }
.hero-scroll svg { width: 24px; height: 24px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(5px); } }

/* ---------- hidden until the timeline gets there ---------- */
/* hidden as well as undrawn: an empty dash still paints its round caps */
html[data-hero="intro"] .hero:not(.is-brand) :is(.brand-c, .brand-o),
html[data-hero="intro"] .hero:not(.is-tail) .brand-tail path { stroke-dashoffset: 1; visibility: hidden; }
html[data-hero="intro"] .hero:not(.is-tail) .brand-dot { transform: scale(0); }
html[data-hero="intro"] .hero-rings:not(.on) { opacity: 0; }
html[data-hero="intro"] .hero:not(.is-tagline) .hero-tagline { opacity: 0; transform: translateY(10px); }
/* the buttons pop up one after the other */
html[data-hero="intro"] .hero:not(.is-actions) .hero-actions .hero-btn { opacity: 0; transform: translateY(14px) scale(.92); pointer-events: none; }
html[data-hero="intro"] .hero-actions .hero-btn + .hero-btn { transition-delay: .09s; }
html[data-hero="intro"] .hero:not(.is-scroll) .hero-scroll { opacity: 0; pointer-events: none; }

/* ---------- Coo's stage: wider than the window, so it can walk in from off screen ---------- */
.hero-stage {
  position: fixed;
  top: 0;
  left: -220px;
  width: calc(100% + 440px);
  height: 100vh;
  height: 100svh;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
}
.hero-stage .shadow { fill: rgba(27, 22, 38, .1); }
:root[data-theme="dark"] .hero-stage .shadow { fill: rgba(0, 0, 0, .4); }
.hero-stage .p-heart { stroke: #f0567a; }
.hero-stage .p-dust { stroke: #a39db0; }
.hero-stage.is-grab { cursor: grab; }

/* ---------- the floating bar: follows you down once you leave the opening ---------- */
.float-header {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  padding: 7px;
  border-radius: 999px;
  background: rgb(var(--surface-rgb) / .6);
  border: 1px solid rgb(var(--ink-rgb) / .07);
  box-shadow: 0 10px 30px rgb(var(--ink-rgb) / .07);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  opacity: 0;
  transform: translate(-50%, -120%);
  pointer-events: none;
  transition: transform .55s cubic-bezier(.3, 1.25, .5, 1), opacity .35s ease;
}
.float-header.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.float-actions { display: flex; align-items: center; gap: 8px; }
.float-actions button.hero-btn { cursor: pointer; font-family: var(--sans); }
.lang-toggle { font: 600 13px/1 var(--sans); letter-spacing: .02em; }
.bar-links { display: flex; align-items: center; gap: 4px; margin: 0 4px; }
.bar-link { padding: 8px 10px; border: 0; border-radius: 999px; background: none; font: 500 14px/1 var(--sans); color: var(--ink-soft); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.bar-link:hover { color: var(--ink); background: rgb(var(--ink-rgb) / .05); }
.bar-link:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }
.hero-btn.small { height: 40px; padding: 0 18px; font-size: 14px; }
.hero-btn.icon-only { width: 40px; padding: 0; justify-content: center; }
.theme-icon { display: grid; place-items: center; }
.theme-icon svg { width: 18px; height: 18px; stroke-width: 1.8px; }

/* ---------- the features screen ---------- */
.features {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

/* the numbered list: across the top while the demos play, then down the right side */
.steps {
  position: absolute;
  top: clamp(96px, 13vh, 120px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(14px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}
.steps li { opacity: 0; transform: translateY(-10px); transition: opacity .5s ease, transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.steps li.on { opacity: 1; transform: none; }
.steps button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: 400 clamp(15px, 1.3vw, 18px)/1 var(--sans);
  letter-spacing: .04em;
  color: var(--ink-dim);
  cursor: default;
  transition: color .3s ease, background-color .2s ease;
}
.steps .num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font: 600 14px/1 var(--sans);
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.steps li.past button { color: var(--ink-soft); }
.steps li.past .num { color: var(--accent); }
.steps li.now button { color: var(--ink); }
.steps li.now .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.12); }
/* once the four have played, the numbers play their demos again */
.steps.ready button { cursor: pointer; }
.steps.ready button:hover { background: rgb(var(--surface-rgb) / .75); color: var(--ink); }
.steps.ready button:hover .num { transform: scale(1.08); }
.steps button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }

/* what the current demo is */
.feat-caption {
  position: absolute;
  top: clamp(170px, 25vh, 230px);
  left: clamp(20px, 8vw, 128px);
  width: min(420px, 40vw);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.feat-caption.on { opacity: 1; transform: none; }
.feat-caption p, .feat-caption h3 { margin: 0; }
.feat-kicker { font: 600 13px/1 var(--sans); letter-spacing: .2em; color: var(--accent); }
.feat-title { margin-top: 14px !important; font: 500 clamp(34px, 4vw, 54px)/1.15 var(--sans); letter-spacing: .04em; color: var(--ink); }
.feat-desc { margin-top: 16px !important; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.75; color: var(--ink-soft); }

/* the demo's own window on the right */
.feat-panel {
  position: absolute;
  top: 50%;
  left: 52%;
  width: min(400px, 34vw);
  transform: translateY(-46%);
}
.card {
  position: relative;
  padding: 26px 28px;
  border-radius: 22px;
  background: rgb(var(--surface-rgb) / .86);
  border: 1px solid rgb(var(--ink-rgb) / .08);
  box-shadow: 0 18px 50px rgb(var(--ink-rgb) / .08);
  animation: card-in .6s cubic-bezier(.3, 1.3, .5, 1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.card-label { margin: 0 0 18px; font-size: 13px; letter-spacing: .16em; color: var(--ink-dim); }
.card-note { margin: 18px 0 0; font-size: 14px; line-height: 1.7; color: var(--ink-soft); }

/* 1: the talk key */
.keys { display: flex; align-items: center; gap: 12px; }
.key {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 54px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid rgb(var(--ink-rgb) / .16);
  border-bottom-width: 5px;
  background: rgb(var(--surface-rgb));
  font: 600 16px/1 var(--sans);
  color: var(--ink);
}
.key.tap { animation: key-tap 2.4s ease-in-out infinite; }
.key.hold { animation: key-hold 2.4s ease-in-out infinite; }
@keyframes key-tap { 8%, 16% { transform: translateY(3px); border-bottom-width: 2px; border-color: var(--accent); color: var(--accent); } 0%, 24%, 100% { transform: none; } }
@keyframes key-hold { 0%, 28% { transform: none; } 34%, 82% { transform: translateY(3px); border-bottom-width: 2px; border-color: var(--accent); color: var(--accent); } 90%, 100% { transform: none; } }
.key-then { font-size: 13px; color: var(--ink-dim); }

/* 3: the alarm */
.alarm-card { display: grid; place-items: center; padding: 34px 28px 30px; }
.alarm-ring { width: 210px; height: 210px; transform: rotate(-90deg); }
.alarm-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.alarm-ring .track { stroke: rgb(var(--ink-rgb) / .07); }
.alarm-ring .prog { stroke: var(--accent); stroke-dasharray: 100 100; stroke-dashoffset: 0; }
.alarm-face { position: absolute; top: 34px; left: 0; right: 0; height: 210px; display: grid; place-content: center; text-align: center; }
.alarm-time { font: 600 46px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink); }
.alarm-what { margin-top: 8px; font-size: 14px; letter-spacing: .1em; color: var(--ink-dim); }
.ff { margin-top: 18px; padding: 5px 12px; border-radius: 999px; background: rgb(var(--accent-rgb) / .1); font: 600 12px/1 var(--sans); letter-spacing: .12em; color: var(--accent); opacity: 0; transition: opacity .3s ease; }
.alarm-card.waiting .alarm-ring, .alarm-card.waiting .alarm-face { opacity: .35; }
.alarm-card.running .ff { opacity: 1; }
.alarm-card.ringing { animation: card-in .6s both, ring-shake .5s ease-in-out 3; }
.alarm-card.ringing .alarm-time { color: var(--accent); }
/* when it rings the ring fills back up (an empty one would leave its round cap as a dot) */
.alarm-card.ringing .prog { stroke-dashoffset: 0 !important; transition: stroke-dashoffset .5s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes ring-shake { 20%, 60% { transform: rotate(-3deg); } 40%, 80% { transform: rotate(3deg); } }

/* 4: a window Coo works in */
.app-window { padding: 0; overflow: hidden; }
.win-bar { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-bottom: 1px solid rgb(var(--ink-rgb) / .07); background: rgb(var(--ink-rgb) / .03); }
.win-bar i { width: 11px; height: 11px; border-radius: 50%; background: rgb(var(--ink-rgb) / .12); }
.win-bar i:first-child { background: #ff6b6b; } .win-bar i:nth-child(2) { background: #ffc145; } .win-bar i:nth-child(3) { background: #3ccf75; }
.win-bar span { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.win-body { padding: 22px 24px 20px; display: grid; gap: 14px; }
.win-row { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-dim); }
.win-field { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; border: 1.5px solid rgb(var(--ink-rgb) / .12); background: rgb(var(--surface-rgb)); font-size: 15px; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease; }
.win-field.focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .12); }
.win-field.focus .v::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -3px; background: var(--accent); animation: caret-blink 1s steps(1) infinite; }
.win-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.win-save { padding: 9px 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600; transition: transform .12s ease, filter .12s ease; }
.win-save.pressed, .win-field.pressed { transform: scale(.96); }
.win-saved { font-size: 13px; color: var(--accent); opacity: 0; transform: translateX(6px); transition: opacity .3s ease, transform .3s ease; }
.app-window.saved .win-saved { opacity: 1; transform: none; }

/* after the four: what Coopanion does, filling the screen */
/* laid out in the band between the numbers and Coo's floor, so the cards never ride up into the numbers */
.feat-summary {
  position: absolute;
  /* the bottom keeps clear of Coo (its height, --coo-h, set by stage.js) and its floor */
  inset: clamp(150px, 20vh, 190px) clamp(20px, 7vw, 120px) max(150px, calc(var(--coo-h, 152px) + 60px));
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  align-content: safe center;
  gap: clamp(28px, 5vw, 80px);
  pointer-events: none;
}
.feat-summary > * { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.feat-summary.on > * { opacity: 1; transform: none; pointer-events: auto; }
.feat-summary.on .sum-grid { transition-delay: .12s; }
.sum-lead p, .sum-title { margin: 0; }
.sum-title { margin-top: 14px; font: 500 clamp(30px, 3.6vw, 52px)/1.2 var(--sans); letter-spacing: .03em; color: var(--ink); }
.sum-desc { margin-top: 18px !important; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.75; color: var(--ink-soft); }
.sum-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sum-grid li {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgb(var(--surface-rgb) / .72);
  border: 1px solid rgb(var(--ink-rgb) / .07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* the ring sits on the title's first line, however the title wraps */
.sum-grid b { display: block; position: relative; padding-left: 18px; font-size: 17px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.sum-grid b::before { content: ""; position: absolute; left: 0; top: .42em; width: 8px; height: 8px; border-radius: 50%; border: 2.5px solid var(--accent); }
.sum-grid span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

/* skip, bottom right, while a demo plays */
.feat-skip {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(18px, 4vh, 36px);
  z-index: 9;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgb(var(--ink-rgb) / .12);
  background: rgb(var(--surface-rgb) / .78);
  font: 500 14px/1 var(--sans);
  letter-spacing: .06em;
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, color .2s ease, border-color .2s ease;
}
.feat-skip.on { opacity: 1; transform: none; pointer-events: auto; }
.feat-skip:hover { color: var(--ink); border-color: rgb(var(--ink-rgb) / .24); }
.feat-skip span { margin-left: 2px; font-size: 16px; }

/* the way on down, once the tour is over */
.feat-scroll { opacity: 0; pointer-events: none; transition: opacity .8s ease .4s; }
:is(.features, .dress-screen).done .feat-scroll { opacity: 1; pointer-events: auto; }

/* 5: the persona editor */
.prompt-editor .prompt-body { padding: 18px 22px 6px; font: 13.5px/1.75 var(--mono); color: var(--ink-soft); }
.prompt-editor .pl { margin: 0; }
.prompt-editor .pl.h { color: var(--ink); font-weight: 600; margin-top: 6px; }
.prompt-editor .pl.h:first-child { margin-top: 0; }
.prompt-editor .tic { color: var(--ink); }
.tic-word { padding: 1px 2px; border-radius: 4px; transition: background-color .2s ease, color .2s ease; }
.tic-word.selected { background: rgb(var(--accent-rgb) / .25); }
.tic-word.editing::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -3px; background: var(--accent); animation: caret-blink 1s steps(1) infinite; }
.tic-word.edited { color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.prompt-editor .win-foot { padding: 6px 18px 18px; margin: 0; gap: 8px; flex-wrap: nowrap; }
.prompt-editor .win-foot > * { white-space: nowrap; flex: none; }
.prompt-editor .win-saved { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prompt-editor .win-btn { padding: 8px 11px; font-size: 13px; }
.prompt-editor .win-save { padding: 8px 15px; font-size: 13.5px; }
.win-btn { padding: 9px 14px; border-radius: 10px; border: 1.5px solid rgb(var(--ink-rgb) / .14); font-size: 13.5px; color: var(--ink-soft); transition: transform .12s ease; }
.win-btn.pressed { transform: scale(.96); }

/* ---------- the dressing screen ---------- */
.dress-screen { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.dress-caption { position: absolute; top: clamp(120px, 18vh, 170px); left: clamp(20px, 8vw, 128px); width: min(440px, 38vw); }
.dress-caption .feat-kicker, .dress-caption .feat-title, .dress-caption .feat-desc { margin: 0; }
.dress-pack {
  margin-top: 26px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px dashed rgb(var(--accent-rgb) / .45);
  background: rgb(var(--accent-rgb) / .06);
}
.dress-pack b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.dress-pack span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.dress-window {
  position: absolute;
  top: clamp(120px, 18vh, 170px);
  left: 50%;
  width: min(520px, 42vw);
  height: min(540px, calc(100svh - clamp(120px, 18vh, 170px) - 110px));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 22px;
  background: rgb(var(--surface-rgb) / .9);
  border: 1px solid rgb(var(--ink-rgb) / .08);
  box-shadow: 0 22px 60px rgb(var(--ink-rgb) / .1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  --swatch-bg: #e8e6ee;
  --accent: var(--skin-eye);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transform-origin: 50% 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .55s cubic-bezier(.3, 1.3, .5, 1);
}
.dress-window.on { opacity: 1; transform: none; pointer-events: auto; }
.wardrobe > * { animation: wardrobe-in .4s ease both; }
@keyframes wardrobe-in { from { opacity: 0; } }
:root[data-theme="dark"] .dress-window { --swatch-bg: #10151c; }
.dress-window .win-bar { position: sticky; top: 0; z-index: 1; background: rgb(var(--surface-rgb) / .95); }
.wardrobe { display: grid; gap: 14px; padding: 18px 20px 20px; }
.wardrobe .opt { background: var(--surface); }
.wardrobe .pressed { transform: scale(.96); }

/* ---------- the download screen ---------- */
.download-screen { position: relative; height: 100vh; height: 100svh; min-height: 560px; display: grid; place-items: center; padding: 96px 16px 40px; }
.download-card { width: min(440px, 100%); text-align: center; }
.dl-title { margin: 0 0 30px; white-space: nowrap; font: 500 clamp(34px, 4.2vw, 56px)/1.15 var(--sans); letter-spacing: .04em; color: var(--ink); }
.download-card .platform-options { display: flex; margin: 0 0 14px; }
.download-card .platform-options .seg { flex: 1; font-size: 14px; padding: 8px 12px; }
.download-card .segwrap { background: rgb(var(--ink-rgb) / .05); }
.download-card .seg.active { background: rgb(var(--surface-rgb)); color: var(--ink); box-shadow: 0 1px 3px rgb(var(--ink-rgb) / .08); }
.dl-button { width: 100%; justify-content: space-between; height: 50px; padding: 0 22px; font-size: 16px; text-decoration: none; }
.download-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-dim); }
.download-note { margin: 26px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.download-links { display: flex; justify-content: center; gap: 22px; margin-top: 12px; font-size: 13.5px; }
.download-links a { color: var(--accent); text-decoration: none; }
.download-links a:hover { text-decoration: underline; }
/* the package picker, from the homepage's style.css */
.variant-label {
  display: flex;
  align-items: center;
  position: relative;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 15px;
  gap: 12px;
  text-align: left;
}

.variant-label .field { flex: 1; min-width: 0; }

.variant-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: 13px/1.4 var(--sans);
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}

.variant-trigger:hover { border-color: var(--border-strong); }
.variant-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}
.variant-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variant-chevron { width: 14px; height: 14px; flex: none; color: var(--ink-dim); transition: transform .18s; }
.variant-trigger[aria-expanded="true"] .variant-chevron { transform: rotate(180deg); }

.variant-options {
  position: fixed;
  z-index: 70;
  display: grid;
  gap: 3px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 12px 32px var(--shadow-soft), 0 2px 6px var(--shadow-soft);
  animation: variant-open .16s ease-out both;
  transform-origin: top center;
}
.variant-options[data-side="above"] { transform-origin: bottom center; }
.variant-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.variant-option[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.variant-option.is-active { background: var(--surface-hover); }
.variant-option.is-active[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.variant-option-copy { display: grid; gap: 3px; }
.variant-option-title { font: 500 13px/1.4 var(--sans); }
.variant-option-detail { color: var(--ink-soft); font: 11px/1.4 var(--sans); }
.variant-check { flex: none; width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.variant-option[aria-selected="true"] .variant-check { visibility: visible; }
@keyframes variant-open {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}


.download-card .variant-label { margin-bottom: 16px; font-size: 14px; }
.download-card .variant-trigger { min-height: 44px; font-size: 14px; background: rgb(var(--surface-rgb)); border-color: rgb(var(--ink-rgb) / .12); }
.variant-options { background: rgb(var(--surface-rgb)); border-color: rgb(var(--ink-rgb) / .1); }
.variant-option { border: 0; font: inherit; cursor: pointer; }

/* ---------- about ---------- */
.about-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 26px 28px 22px;
  border: 1px solid rgb(var(--ink-rgb) / .08);
  border-radius: 22px;
  background: rgb(var(--surface-rgb));
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(var(--ink-rgb) / .16);
}
.about-dialog::backdrop { background: rgb(var(--ink-rgb) / .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
:root[data-theme="dark"] .about-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.about-dialog h2 { margin: 0 0 12px; font-size: 19px; font-weight: 600; }
.about-dialog .lead { margin: 0 0 10px; font-size: 14.5px; line-height: 1.75; color: var(--ink-soft); }
.about-dialog .meta { margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-dim); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 13.5px; }
.about-links a { color: var(--accent); text-decoration: none; }
.about-links a:hover { text-decoration: underline; }
.about-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.about-actions .hero-btn { border: 0; cursor: pointer; }

/* ---------- Coo's bubbles and the pointers, over everything ---------- */
.feat-layer { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.feat-layer.away > :not(.fake-cursor) { visibility: hidden; }
.feat-layer .tool { width: 40px; height: 40px; }
.feat-layer .tools { gap: 9px; }
.feat-layer .bubble { pointer-events: auto; font-size: 16px; padding: 12px 17px; max-width: min(340px, calc(100vw - 20px)); }
.feat-layer .bubble.status { pointer-events: none; font-size: 13.5px; padding: 7px 12px; }
.feat-layer .b-opt { font-size: 15px; padding: 8px 12px; }
.feat-layer .b-opt:not(:has(kbd)) { justify-content: center; }
.feat-layer .bubble.ask { min-width: 260px; }
/* a word Coo stresses, as the new catchphrase */
.feat-layer .b-em { font-style: normal; font-weight: 600; color: var(--skin-eye); }
.fake-cursor { position: fixed; left: 0; top: 0; z-index: 9; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.fake-cursor.on { opacity: 1; }
.fake-cursor svg { display: block; width: 26px; height: 26px; margin: -3px 0 0 -4px; filter: drop-shadow(0 2px 3px rgb(var(--ink-rgb) / .25)); }
.fake-cursor path { fill: #1b1626; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.fake-cursor.coo path { fill: var(--accent); }
.fake-cursor span { position: absolute; left: 18px; top: 18px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 11px/1.4 var(--sans); }
.fake-cursor::after { content: ""; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; color: var(--ink); }
.fake-cursor.coo::after { color: var(--accent); }
.fake-cursor.clicking::after { animation: click-ripple .45s ease-out; }
@keyframes click-ripple { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.4); } }

/* where the card has no room beside Coo, it sits above it */
@media (max-width: 1000px) {
  .download-screen { padding-bottom: calc(var(--coo-h, 152px) + 50px); }
}
/* narrow desktops and tablets: the five numbers keep only the current label, the summary stacks */
@media (max-width: 1000px) and (min-width: 761px) {
  .steps { gap: 10px; }
  .steps li:not(.now) .label, .steps.ready li .label { display: none; }
  .steps li.now .label { display: inline; }
  .feat-caption { width: 42vw; }
  .feat-panel { left: 52%; width: 42vw; }
  /* stacked under the numbers with room to breathe, growing down rather than up */
  .feat-summary { top: calc(clamp(96px, 13vh, 120px) + 80px); grid-template-columns: 1fr; align-content: start; gap: 22px; }
  .sum-lead { max-width: 560px; }
  .sum-title br { display: none; }
  .sum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .sum-grid li { padding: 14px 16px; }
  .sum-grid b { font-size: 15.5px; }
  .sum-grid span { font-size: 13px; }
  .dress-caption { width: 40vw; }
  .dress-window { width: 46vw; }
}
/* short desktop windows: tighter cards so the summary stays inside its band, and the dressing screen sits higher */
@media (max-height: 800px) and (min-width: 761px) {
  .dress-caption { top: 100px; }
  .dress-caption .feat-title { font-size: clamp(30px, 3.4vw, 46px); }
  .dress-caption .feat-desc { font-size: 15px; }
  .dress-pack { margin-top: 18px; padding: 12px 16px; }
  .dress-window { top: 100px; height: min(540px, calc(100svh - 210px)); }
}
/* narrow and short: the stacked summary keeps its cards to their titles */
@media (max-height: 760px) and (max-width: 1000px) and (min-width: 761px) {
  .sum-grid span { display: none; }
  .sum-grid li { padding: 12px 14px; }
  .sum-title { font-size: 30px; }
}
@media (max-height: 700px) and (max-width: 1000px) and (min-width: 761px) {
  .sum-desc { display: none; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .sum-grid { gap: 10px; }
  .sum-grid li { padding: 12px 16px; }
  .sum-grid span { font-size: 13px; line-height: 1.5; }
  .sum-desc { margin-top: 12px !important; }
}

@media (max-width: 760px) {
  .float-header { max-width: calc(100vw - 16px); padding: 5px; }
  .float-actions { gap: 4px; }
  .bar-links { margin: 0; gap: 0; }
  .bar-link { padding: 7px 7px; font-size: 13px; }
  .float-actions .hero-btn.small { height: 36px; }
  .float-actions .hero-btn.icon-only { width: 36px; }
  .float-actions [data-new-tab].hero-btn { width: 36px; padding: 0; justify-content: center; }
  .float-actions [data-new-tab].hero-btn span { display: none; }
  .float-actions .hero-btn.primary { padding: 0 12px; }
  .steps { top: 92px; gap: 4px; }
  .steps li:not(.now) .label { display: none; }
  .steps.ready li .label { display: none; }
  .steps button { gap: 6px; padding: 4px; font-size: 13px; }
  .steps .num { width: 22px; height: 22px; font-size: 11.5px; }
  .feat-caption { top: 146px; left: 20px; right: 20px; width: auto; text-align: center; }
  .feat-title { font-size: 30px; margin-top: 10px !important; }
  .feat-desc { font-size: 14px; margin-top: 10px !important; }
  .feat-summary { inset: 146px 16px calc(var(--coo-h, 118px) + 40px); grid-template-columns: 1fr; align-content: start; gap: 18px; }
  .sum-lead { text-align: center; }
  .sum-title { font-size: 26px; }
  .sum-title br { display: none; }
  .sum-desc { font-size: 14px; margin-top: 10px !important; }
  .sum-grid { gap: 8px; }
  .sum-grid li { padding: 10px 12px; border-radius: 14px; }
  .sum-grid b { font-size: 15px; padding-left: 15px; }
  .sum-grid b::before { width: 6px; height: 6px; border-width: 2px; }
  .sum-grid span { font-size: 12.5px; margin-top: 3px; }
  .dress-caption { top: 92px; left: 20px; right: 20px; width: auto; text-align: center; }
  .dress-caption .feat-title { font-size: 28px; }
  .dress-caption .feat-title br { display: none; }
  .dress-caption .feat-desc { font-size: 13.5px; }
  .dress-pack { display: none; }
  .dress-window { top: 280px; left: 12px; right: 12px; width: auto; height: calc(100svh - 470px); min-height: 220px; }
  .feat-panel { transform-origin: 50% 0; }
  .feat-panel { top: 330px; left: 50%; width: min(330px, 88vw); transform: translateX(-50%); }
  .card { padding: 18px 20px; }
  .alarm-ring { width: 150px; height: 150px; }
  .alarm-face { top: 18px; height: 150px; }
  .alarm-time { font-size: 34px; }
}

/* ---------- the screens after this one (placeholders for now) ---------- */
.placeholder {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0 16px;
  color: var(--ink-soft);
}
.placeholder h2 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 40px); color: var(--ink); }
.placeholder p { margin: 0; }
.placeholder-label { font-size: 12px; letter-spacing: .2em; color: var(--ink-dim); margin-bottom: 10px !important; }
.placeholder a { color: var(--accent); }

/* short phones: the demo panel moves up under a caption without its description, the summary cards keep their titles */
@media (max-width: 760px) and (max-height: 760px) {
  .feat-caption .feat-desc { display: none; }
  .feat-panel { top: 222px; }
  .prompt-editor .pl:not(.tic):not(:first-child) { display: none; }
  .sum-grid span { display: none; }
  .sum-desc { display: none; }
}
/* phones: the demo panels a little smaller, so they clear Coo */
@media (max-width: 760px) {
  .feat-panel { transform: translateX(-50%) scale(.88); }
}

/* ---------- big screens: the things on show (demo windows, the wardrobe, Coo) grow with the screen;
   text, buttons and bubbles only a little, so the page stays fine-grained ---------- */
:root { --s: 1; --t: 1; }
@media (min-width: 1600px) and (min-height: 860px) { :root { --s: 1.1; --t: 1.03; } }
@media (min-width: 1900px) and (min-height: 1000px) { :root { --s: 1.2; --t: 1.06; } }
@media (min-width: 2400px) and (min-height: 1300px) { :root { --s: 1.35; --t: 1.1; } }
@media (min-width: 1600px) and (min-height: 860px) {
  /* the demo windows and the wardrobe are zoomed whole, so their insides keep their proportions */
  .feat-panel { width: min(calc(400px * var(--s)), 36vw); }
  .feat-panel > .card { zoom: var(--s); }
  .dress-window { width: min(calc(520px * var(--s)), 44vw); height: min(calc(540px * var(--s)), calc(100svh - 280px)); }
  .dress-window > * { zoom: var(--s); }
  /* the rest: text and controls */
  .download-card { zoom: var(--t); }
  .steps .num { width: calc(30px * var(--t)); height: calc(30px * var(--t)); font-size: calc(14px * var(--t)); }
  .sum-grid b { font-size: calc(17px * var(--t)); }
  .sum-grid span { font-size: calc(14px * var(--t)); }
  .feat-layer .bubble { font-size: calc(16px * var(--t)); max-width: min(calc(340px * var(--t)), calc(100vw - 20px)); }
  .feat-layer .bubble.status { font-size: calc(13.5px * var(--t)); }
  .feat-layer .b-opt { font-size: calc(15px * var(--t)); }
  .feat-layer .tool { width: calc(40px * var(--t)); height: calc(40px * var(--t)); }
  .fake-cursor svg { width: calc(26px * var(--t)); height: calc(26px * var(--t)); }
}

/* a window shorter than a screen's minimum height: no snapping, so the rest of each screen can be scrolled to */
@media (max-height: 560px) {
  html { scroll-snap-type: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ring, .hero-scroll svg { animation: none; }
}

.hero-tagline .coo { color: var(--accent); }
