/* Landing page sections. Shared shell (header, buttons, footer) lives in base.css. */

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

.hero {
  padding: clamp(2rem, 5vh, 4rem) var(--gutter) 0;
  text-align: center;
}

.hero__copy {
  max-width: 46rem;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: var(--display-1);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.hero__sub {
  margin: 1.2rem auto 0;
  max-width: 40rem;
  font-size: var(--body-lg);
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.hero__meta {
  margin: 1rem 0 0;
  font-size: var(--micro);
  color: var(--faint);
}

/* ------------------------------------------------------------ app mock */

.stage {
  max-width: 62rem;
  margin: clamp(1.75rem, 4vh, 3rem) auto 0;
}

.app {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.app__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  font-size: var(--micro);
  color: var(--muted);
}

.app__dots {
  display: inline-flex;
  gap: 0.35rem;
}

.app__dots i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line);
  border: 1px solid var(--line-strong);
}

.app__title {
  font-weight: 600;
  color: var(--ink);
}

.app__chips {
  margin-left: auto;
  display: inline-flex;
  gap: 0.35rem;
}

.chip {
  padding: 0.15rem 0.5rem;
  border-radius: 980px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--micro);
  font-weight: 550;
}

.chip--quiet {
  background: var(--canvas);
  color: var(--muted);
  border: 1px solid var(--line);
}

.app__body {
  padding: 1rem 1.1rem 1rem;
  background: linear-gradient(180deg, var(--surface), var(--canvas));
}

.app__stream {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  /* Reserved so the composer never jumps while the demo cycles. */
  min-height: 13.5rem;
}

.bubble {
  align-self: flex-end;
  max-width: 78%;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent);
  color: #fff;
  font-size: var(--small);
  transition: opacity var(--motion-base) var(--ease-standard);
}

[data-theme="dark"] .bubble {
  color: var(--green-900);
}

.bubble:empty {
  opacity: 0;
}

.reply {
  max-width: 88%;
  font-size: var(--small);
  color: var(--ink-soft);
}

.reply__line {
  margin: 0;
  min-height: 1.4em;
}

.reply__line:empty {
  display: none;
}

.thinking {
  display: none;
  gap: 0.28rem;
  padding: 0.15rem 0;
}

.reply.is-thinking .thinking {
  display: inline-flex;
}

.thinking i {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: var(--accent-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .reply.is-thinking i {
    animation: pulse 1.1s var(--ease-standard) infinite;
  }
  .reply.is-thinking i:nth-child(2) {
    animation-delay: 140ms;
  }
  .reply.is-thinking i:nth-child(3) {
    animation-delay: 280ms;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.card {
  margin-top: 0.35rem;
  padding: 0.85rem 0.95rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 35, 29, 0.04);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.card.is-shown {
  opacity: 1;
  transform: none;
}

.card header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: var(--micro);
}

.card__type {
  color: var(--accent-text);
  font-weight: 600;
}

.card__status {
  color: var(--faint);
}

.card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0;
  font-size: var(--small);
  color: var(--muted);
}

.card footer {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.tag {
  padding: 0.1rem 0.45rem;
  border-radius: 980px;
  background: var(--accent-faint);
  color: var(--accent-text);
  font-size: var(--micro);
}

.composer {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 35, 29, 0.03);
  transition: border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard);
}

.composer.is-focused {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

.composer__input {
  padding: 0.75rem 0.9rem 0.35rem;
  font-size: var(--small);
  min-height: 2.5rem;
}

.composer__text {
  color: var(--ink);
}

.composer__text:empty::before {
  content: "Message Zett Agent…";
  color: var(--faint);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.16em;
  background: var(--accent);
  opacity: 0;
}

.caret.is-on {
  opacity: 1;
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.composer__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.6rem 0.9rem;
}

.composer__send {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

[data-theme="dark"] .composer__send {
  color: var(--green-900);
}

.composer__send svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* ------------------------------------------------- product tour (story) */

.story {
  padding: var(--band) var(--gutter);
}

.section-title {
  max-width: 26ch;
  margin: 0 auto clamp(2rem, 6vh, 4rem);
  font-size: var(--display-2);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-align: center;
}

.story__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 84rem;
  margin: 0 auto;
  align-items: start;
}

.story__stage {
  position: sticky;
  /* Centres the window in the viewport, level with the active step's copy. */
  top: 17vh;
}

/* --- the window itself ------------------------------------------------- */

.app--full {
  min-height: 23rem;
}

.app__layout {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr) 12.5rem;
  min-height: 23rem;
  background: linear-gradient(180deg, var(--surface), var(--canvas));
}

.pane {
  min-width: 0;
  padding: 0.9rem 0.85rem;
}

.pane + .pane {
  border-left: 1px solid var(--line);
}

.pane--conversations,
.pane--artifacts {
  background: color-mix(in srgb, var(--canvas) 60%, transparent);
}

.pane__title {
  margin: 0 0 0.6rem;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.convos,
.collections {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: var(--micro);
  color: var(--muted);
}

.convos li,
.collections li {
  padding: 0.32rem 0.45rem;
  border-radius: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collections li {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.collections li span {
  color: var(--faint);
}

.collections .is-nested {
  padding-left: 1.1rem;
}

.convos .is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.pane--chat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 12rem;
}

/* The app's own empty state, so the first step is not a blank pane. */
.chat__empty {
  margin: auto;
  max-width: 22rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--small);
  transition: opacity var(--motion-base) var(--ease-standard);
}

.chat__empty span {
  display: block;
  margin-top: 0.25rem;
  color: var(--faint);
  font-size: var(--micro);
}

.story__stage:not([data-phase="1"]) .chat__empty {
  opacity: 0;
  pointer-events: none;
}

.chat .bubble--user {
  max-width: 92%;
}

.chat__tools,
.chat__reply {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--small);
}

.chat__tools {
  display: flex;
  gap: 0.3rem;
}

.card--inline {
  margin: 0;
}

.card--inline h3 {
  font-size: 1rem;
}

/* The tour's composer: a real input box, sized for a window this big. */
.composer--inline {
  margin-top: 0;
  padding: 0.6rem 0.8rem 0.65rem;
  font-size: var(--small);
}

.composer--inline .composer__text:empty::before {
  color: var(--faint);
}

/* --- the animated states ---------------------------------------------- */

/*
 * Scoped to the tour: the hero has its own bubble and must keep its own timing.
 * The sent message starts down by the composer and rises into the thread, the
 * way it would if you had just pressed Enter.
 */
.story__stage .bubble--user {
  opacity: 0;
  transform: translate3d(0, 2.8rem, 0) scale(0.98);
  transition: opacity 400ms var(--ease-out-soft), transform 540ms var(--ease-out-soft);
}

.story__stage .chat__tools,
.story__stage .chat__reply {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.story__stage .card--inline {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.99);
  transition: opacity 460ms var(--ease-out-soft), transform 560ms var(--ease-out-soft);
}

/* The artifact panel fills in as the card is produced. */
.pane--artifacts .mini-card {
  opacity: 0;
  transform: translate3d(12px, 0, 0);
  transition: opacity 420ms var(--ease-out-soft), transform 460ms var(--ease-out-soft);
}

.story__stage[data-phase="2"] .pane--artifacts .mini-card,
.story__stage[data-phase="3"] .pane--artifacts .mini-card {
  opacity: 1;
  transform: none;
}

.story__stage[data-phase="2"] .pane--artifacts .mini-card:nth-child(3),
.story__stage[data-phase="3"] .pane--artifacts .mini-card:nth-child(3) {
  transition-delay: 140ms;
}

.story__stage[data-phase="2"] .pane--artifacts .mini-card:nth-child(4),
.story__stage[data-phase="3"] .pane--artifacts .mini-card:nth-child(4) {
  transition-delay: 280ms;
}

/* The library the saved card lands in: each card settles into place. */
.app__view--library .lib-grid > .mini-card {
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.985);
  transition: opacity 420ms var(--ease-out-soft), transform 480ms var(--ease-out-soft);
}

.story__stage[data-view="library"] .app__view--library .lib-grid > .mini-card {
  opacity: 1;
  transform: none;
}

.story__stage[data-view="library"] .app__view--library .lib-grid > .mini-card:nth-child(2) {
  transition-delay: 90ms;
}

.story__stage[data-view="library"] .app__view--library .lib-grid > .mini-card:nth-child(3) {
  transition-delay: 180ms;
}

.story__stage[data-view="library"] .app__view--library .lib-grid > .mini-card:nth-child(4) {
  transition-delay: 270ms;
}

.story__stage[data-phase="2"] .bubble--user,
.story__stage[data-phase="2"] .chat__tools,
.story__stage[data-phase="2"] .chat__reply,
.story__stage[data-phase="2"] .card--inline,
.story__stage[data-phase="3"] .bubble--user,
.story__stage[data-phase="3"] .chat__tools,
.story__stage[data-phase="3"] .chat__reply,
.story__stage[data-phase="3"] .card--inline {
  opacity: 1;
  transform: none;
}

.story__stage[data-phase="2"] .chat__tools {
  transition-delay: 90ms;
}
.story__stage[data-phase="2"] .chat__reply {
  transition-delay: 200ms;
}
.story__stage[data-phase="2"] .card--inline {
  transition-delay: 320ms;
}

.mini-card {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  font-size: var(--micro);
}

.mini-card span {
  color: var(--accent-text);
  font-weight: 600;
}

.mini-card strong {
  font-size: var(--small);
  font-weight: 550;
  line-height: 1.35;
}

.mini-card em {
  color: var(--faint);
  font-style: normal;
}

.mini-card.is-active {
  border-color: var(--accent-soft);
}

/* --- the second view: the library the saved card lands in -------------- */

.app--full {
  position: relative;
  overflow: hidden;
}

.app__view--library {
  position: absolute;
  inset: 2.35rem 0 0 0;
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  background: linear-gradient(180deg, var(--surface), var(--canvas));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-reveal) var(--ease-standard);
}

.story__stage[data-view="library"] .app__view--library {
  opacity: 1;
  pointer-events: auto;
}

.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.lib-grid .mini-card {
  margin: 0;
}

.mini-card.is-new {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

/* --- steps ------------------------------------------------------------- */

.story__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.story__steps li {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  opacity: 0.4;
  transition: opacity var(--motion-reveal) var(--ease-standard);
}

.story__steps li.is-active {
  opacity: 1;
}

.story__steps h3 {
  margin: 0;
  font-size: var(--title-3);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.story__steps p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
}

.library {
  padding: var(--band) var(--gutter);
}

.library__intro {
  max-width: 46rem;
  margin: 0 auto clamp(2rem, 6vh, 3.5rem);
}

/* All four artifact kinds side by side: no card ever hides behind a scrub. */
.library__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  max-width: 78rem;
  margin: 0 auto;
  align-items: stretch;
}

.artifact {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 35, 29, 0.04);
  transition: border-color var(--motion-base) var(--ease-standard);
}

.artifact:hover {
  border-color: var(--accent-soft);
}

.artifact header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: var(--micro);
}

.artifact__type {
  color: var(--accent-text);
  font-weight: 600;
}

.artifact__status {
  color: var(--faint);
}

.artifact__status.is-draft {
  color: #a8721f;
}

[data-theme="dark"] .artifact__status.is-draft {
  color: #e0b463;
}

.artifact h3 {
  margin: 0.6rem 0 0.4rem;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.artifact p {
  margin: 0;
  color: var(--muted);
  font-size: var(--small);
}

/* Keeps the tags of a short card level with the tags of a long one. */
.artifact footer {
  display: flex;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

@media (max-width: 1180px) {
  .library__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 46rem;
  }
}

@media (max-width: 640px) {
  .library__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------- privacy */

.privacy {
  padding: var(--band) var(--gutter);
  background: var(--canvas);
}

.privacy__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.6rem;
  max-width: 62rem;
  margin: 0 auto 2.6rem;
  padding: 0;
  list-style: none;
}

.privacy__facts li {
  margin: 0;
}

.privacy__facts strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.privacy__facts span {
  color: var(--muted);
  font-size: var(--small);
}

.folder {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 30rem;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.folder svg {
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  color: var(--accent-text);
}

.folder strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.folder span {
  color: var(--muted);
  font-size: var(--small);
}

/* ---------------------------------------------------------------- extras */

/* The one-line intro under a section heading. */
.section-sub {
  max-width: 44rem;
  margin: 0 auto clamp(2rem, 6vh, 3.5rem);
  text-align: center;
  color: var(--muted);
}

.extras {
  padding: var(--band) var(--gutter) 0;
}

.extras .section-title {
  margin-bottom: 1rem;
}

.extras__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 76rem;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .extras__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.extras__item h3 {
  margin: 0 0 0.6rem;
  font-size: var(--title-3);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.extras__item > p {
  margin: 0 0 1.4rem;
  max-width: 42ch;
  color: var(--muted);
}

/* --- you → phone → link → Zett --------------------------------------- */

.bridge {
  display: grid;
  grid-template-columns: auto minmax(4rem, 1fr) minmax(0, 1.05fr);
  gap: 0.8rem;
  align-items: center;
  padding: 1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--canvas);
}

.bridge__side {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.bridge__label {
  font-size: var(--micro);
  font-weight: 600;
  color: var(--muted);
}

.avatar {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.avatar svg {
  width: 1.3rem;
  height: 1.3rem;
}

.avatar--agent {
  border-color: var(--accent-soft);
  background: var(--accent-faint);
}

.avatar--agent img {
  border-radius: 6px;
}

/* --- the handset ------------------------------------------------------ */

.mini-phone {
  position: relative;
  width: 9.6rem;
  padding: 0.5rem 0.35rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(23, 35, 29, 0.08);
}

.mini-phone__notch {
  position: absolute;
  top: 0.18rem;
  left: 50%;
  width: 2.2rem;
  height: 0.25rem;
  border-radius: 980px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.mini-phone__screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* A fixed window: new exchanges push the older ones up and out. */
  height: 13rem;
  gap: 0.3rem;
  padding: 0.5rem 0.15rem 0.1rem;
  overflow: hidden;
}

.mini-phone__thread {
  display: grid;
  gap: 0.5rem;
  align-content: end;
  transition: opacity var(--motion-base) var(--ease-standard);
}

.mini-phone__thread.is-clearing {
  opacity: 0;
}

.thread-round {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 760ms var(--ease-out-soft), opacity 760ms var(--ease-out-soft);
}

.thread-round.is-on {
  grid-template-rows: 1fr;
  opacity: 1;
}

.thread-round__inner {
  display: grid;
  gap: 0.3rem;
  justify-items: end;
  min-height: 0;
  overflow: hidden;
}

.mini-phone__sent {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  max-width: 8.2rem;
  padding: 0.35rem 0.45rem;
  border-radius: 12px 12px 3px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.66rem;
  line-height: 1.35;
  text-align: left;
}

.mini-phone__voice,
.mini-phone__file {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0.2rem 0.3rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.62rem;
}

.mini-phone__voice i {
  width: 3.2rem;
  height: 0.5rem;
  border-radius: 980px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85) 40%, transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0 2px, transparent 2px 5px);
  background-size: 200% 100%, auto;
}

@media (prefers-reduced-motion: no-preference) {
  .thread-round.is-on .mini-phone__voice i {
    animation: voice-scan 1.8s linear infinite;
  }
}

@keyframes voice-scan {
  to {
    background-position: -200% 0, 0 0;
  }
}

.mini-phone__reply {
  padding: 0.35rem 0.45rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 3px;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.35;
}

.mini-phone__status {
  color: var(--faint);
  font-size: 0.62rem;
  text-align: center;
}

/* --- the link --------------------------------------------------------- */

.bridge__link {
  position: relative;
  height: 3.6rem;
  min-width: 4.5rem;
}

.bridge__link svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* A soft beam: a wide translucent halo under a hairline, both fading out at
   the ends, so the pair reads as a signal between the two devices. */
.bridge__halo {
  fill: none;
  stroke: url("#bridge-line");
  stroke-width: 8;
  stroke-linecap: round;
  filter: blur(3px);
  opacity: 0.55;
  transition: opacity var(--motion-base) var(--ease-standard);
}

.bridge__curve {
  fill: none;
  stroke: url("#bridge-line");
  stroke-width: 1.3;
  stroke-linecap: round;
  transition: stroke-width var(--motion-base) var(--ease-standard);
}

.bridge__link.is-live .bridge__curve {
  stroke-width: 1.9;
}

.bridge__link.is-live .bridge__halo {
  opacity: 0.85;
}

/* AirDrop-style rings: one leaves the sender, one lands at the receiver. */
.bridge__ring {
  position: absolute;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  /* Visible at rest so the two devices read as connected, then it pings. */
  opacity: 0.35;
  transform: scale(0.7);
}

.bridge__ring--from {
  left: 0;
}

.bridge__ring--to {
  right: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .bridge__link.is-out .bridge__ring--from,
  .bridge__link.is-in .bridge__ring--to {
    animation: bridge-ping 700ms var(--ease-out-soft);
  }
  .bridge__link.is-out .bridge__ring--to,
  .bridge__link.is-in .bridge__ring--from {
    animation: bridge-ping 700ms var(--ease-out-soft) 620ms;
  }
}

@keyframes bridge-ping {
  0% {
    opacity: 0.55;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

/* The travelling dot: a soft glow with a short tail behind it. */
.bridge__comet {
  position: absolute;
  top: 0;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-faint), 0 0 14px var(--accent);
  opacity: 0;
  pointer-events: none;
}

.bridge__comet i {
  position: absolute;
  right: 0.32rem;
  top: 50%;
  width: 1.1rem;
  height: 0.34rem;
  border-radius: 980px;
  background: linear-gradient(90deg, transparent, var(--accent-faint));
  transform: translateY(-50%);
}

.bridge__tag {
  position: absolute;
  font-size: 0.6rem;
  color: var(--faint);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--motion-base) var(--ease-standard);
}

.bridge__tag--out {
  top: 0;
  left: 0.2rem;
}

.bridge__tag--in {
  right: 0.2rem;
  bottom: 0;
}

.bridge__link.is-out .bridge__tag--out,
.bridge__link.is-in .bridge__tag--in {
  opacity: 1;
}

/* --- the agent side --------------------------------------------------- */

.mini-agent {
  width: 100%;
  padding: 0.5rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: var(--micro);
  transition: border-color var(--motion-base) var(--ease-standard);
}

.mini-agent.is-working {
  border-color: var(--accent-soft);
}

.mini-agent__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.mini-agent__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.mini-agent__working {
  display: flex;
  gap: 0.25rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 380ms var(--ease-out-soft), opacity 380ms var(--ease-out-soft);
}

.mini-agent__working.is-on {
  max-height: 2.4rem;
  padding: 0.4rem 0 0.1rem;
  opacity: 1;
}

.mini-agent__working i {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
}

@media (prefers-reduced-motion: no-preference) {
  .mini-agent__working.is-on i {
    animation: pulse 1.1s var(--ease-standard) infinite;
  }
  .mini-agent__working.is-on i:nth-child(2) {
    animation-delay: 140ms;
  }
  .mini-agent__working.is-on i:nth-child(3) {
    animation-delay: 280ms;
  }
}

.mini-agent__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: 0;
  overflow: hidden;
  opacity: 1;
  transition: max-height 420ms var(--ease-out-soft);
}

.mini-agent__tools.is-on {
  max-height: 6rem;
  margin-top: 0.45rem;
}

.mini-agent__tools .chip {
  font-size: 0.62rem;
  opacity: 0;
  transform: translate3d(0, 5px, 0);
  transition: opacity 320ms var(--ease-out-soft), transform 320ms var(--ease-out-soft);
}

.mini-agent__tools.is-on .chip {
  opacity: 1;
  transform: none;
}

.mini-agent__tools.is-on .chip:nth-child(2) {
  transition-delay: 150ms;
}

.mini-agent__tools.is-on .chip:nth-child(3) {
  transition-delay: 300ms;
}

.mini-agent__saved {
  display: grid;
  gap: 0.1rem;
  max-height: 0;
  overflow: hidden;
  padding: 0 0.5rem;
  margin-top: 0;
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  background: var(--canvas);
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.mini-agent__saved.is-on {
  max-height: 5rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.5rem;
  opacity: 1;
  transform: none;
}

.mini-agent__saved strong {
  font-weight: 600;
}

.mini-agent__saved span {
  color: var(--muted);
  font-size: 0.62rem;
}

/* Elements the timeline reveals. */
.mini-phone__reply,
.mini-phone__status {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: max-height 420ms var(--ease-out-soft),
    opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.mini-phone__reply.is-on,
.mini-phone__status.is-on {
  max-height: 8rem;
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .mini-agent__working,
  .mini-agent__tools,
  .mini-agent__saved,
  .mini-phone__reply,
  .mini-phone__status {
    max-height: none;
    opacity: 1;
    transform: none;
  }
  .mini-agent__tools .chip {
    opacity: 1;
    transform: none;
  }
}

/* --- scriptable: agents write into Zett -------------------------------- */

.tools {
  padding: var(--band) var(--gutter) 0;
}

.relay {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(4.5rem, 1fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: center;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--canvas);
}

.relay__agents,
.relay__links {
  display: grid;
  gap: 1rem;
}

.relay__agents {
  justify-items: start;
}

/* --- one agent -------------------------------------------------------- */

.agent {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  transition: border-color 700ms var(--ease-standard), box-shadow 700ms var(--ease-standard),
    transform 700ms var(--ease-out-soft);
}

.agent.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-faint);
  transform: translateY(-1px);
}

.agent__logo {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.5rem;
  background: var(--accent-faint);
  color: var(--accent-text);
}

.agent__logo svg {
  width: 1.15rem;
  height: 1.15rem;
}

.agent__text {
  display: grid;
  gap: 0.05rem;
}

.agent__text strong {
  font-size: var(--small);
  font-weight: 600;
}

.agent__text span {
  color: var(--faint);
  font-size: var(--micro);
  transition: color 700ms var(--ease-standard);
}

.agent.is-active .agent__text span {
  color: var(--accent-text);
  font-weight: 550;
}

/* --- the two beams ---------------------------------------------------- */

/* The relay reuses the bridge's beam component: soft halo, hairline, end rings,
   and a glowing packet that rides the curve. */
.relay__link {
  height: 3.2rem;
}

/* --- Zett's side ------------------------------------------------------ */

.relay__zett {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.relay__log {
  display: block;
  margin: 0.4rem 0 0;
  /* No reserved height: the card grows as results arrive, which is the point. */
  min-height: 0;
  padding: 0;
  list-style: none;
  font-size: var(--micro);
}

/*
 * A new result unfolds: its own height animates, so the card grows smoothly
 * instead of jumping, and the request sits in the loop long enough to read.
 */
.relay__log li {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  transition: grid-template-rows 1200ms var(--ease-out-soft), margin-top 1200ms var(--ease-out-soft),
    opacity 1200ms var(--ease-out-soft);
}

.relay__log li.is-on {
  grid-template-rows: 1fr;
  margin-top: 0.6rem;
  opacity: 1;
}

/* The row is clipped by its own box while the row above it grows. */
.relay__log-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 0;
  overflow: hidden;
}

/* The actor line cross-fades when it changes hands. */
.relay__actor {
  transition: opacity 440ms var(--ease-standard);
}

.relay__actor.is-swapping {
  opacity: 0;
}

.relay__log-dot {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.relay__log-text {
  display: grid;
  gap: 0.05rem;
}

.relay__log strong {
  font-weight: 600;
}

.relay__log span {
  color: var(--muted);
}

.relay__foot {
  max-width: 44rem;
  margin: 1.6rem auto 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--small);
}

@media (max-width: 760px) {
  .relay {
    grid-template-columns: minmax(0, 1fr);
  }
  .relay__links {
    display: none;
  }
  .relay__agents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .relay__log li {
    opacity: 1;
    transform: none;
  }
}

/* --- the scheduled task ---------------------------------------------- */

.task {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  min-height: 15rem;
}

.task header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.task header strong {
  font-size: 1rem;
  font-weight: 600;
}

.task__schedule,
.task__log-time {
  color: var(--faint);
  font-size: var(--micro);
}

.task__prompt {
  margin: 0.8rem 0 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--accent-faint);
  color: var(--ink-soft);
  font-size: var(--small);
}

.task__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.task__run {
  margin-left: auto;
  padding: 0.42rem 0.9rem;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: var(--small);
  font-weight: 550;
  transition: transform var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard);
}

[data-theme="dark"] .task__run {
  color: var(--green-900);
}

.task__run.is-pressed {
  transform: scale(0.96);
  box-shadow: 0 0 0 6px var(--accent-faint);
}

.task__log {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--small);
  color: var(--ink-soft);
}

.task__log li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.task__log li.is-on {
  opacity: 1;
  transform: none;
}

.task__log-dot {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.task__log-time {
  margin-left: auto;
}

.task__result {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  background: var(--canvas);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft);
}

.task__result.is-on {
  opacity: 1;
  transform: none;
}

.task__result strong {
  font-size: var(--small);
  font-weight: 600;
}

.task__result span {
  color: var(--muted);
  font-size: var(--micro);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: var(--micro);
}

.switch i {
  position: relative;
  width: 2.1rem;
  height: 1.15rem;
  border-radius: 980px;
  background: var(--accent);
}

.switch i::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 1.08rem;
  width: 0.87rem;
  height: 0.87rem;
  border-radius: 50%;
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .phone__meta,
  .phone__typing,
  .phone__tools,
  .phone__tools .chip,
  .phone__reply,
  .phone__saved,
  .task__log li,
  .task__result {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------- install */

.install {
  padding: var(--band) var(--gutter);
  background: var(--canvas);
  text-align: center;
}

.install__inner {
  max-width: 56rem;
  margin: 0 auto;
}

.install .section-title {
  margin-bottom: 1.2rem;
}

.install__sub {
  max-width: 44rem;
  margin: 0 auto 2rem;
  color: var(--muted);
}

.install__code {
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: left;
  overflow-x: auto;
}

.install__code .line {
  display: block;
}

.install__code code {
  /* The block itself is not inline code: reset the pill the rule below adds. */
  padding: 0;
  background: none;
  font-size: 0.9rem;
}

.dim {
  color: var(--faint);
}

.install__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.install :not(pre) > code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--accent-faint);
}

/* ----------------------------------------------------------- motion */

/* ----------------------------------------------------------- first run */

.setup {
  padding: var(--band) var(--gutter) 0;
}

.setup__intro {
  max-width: 46rem;
  margin: 0 auto clamp(2rem, 6vh, 3.5rem);
}

.setup__stage {
  max-width: 62rem;
  margin: 0 auto;
}

.app--setup {
  min-height: 24rem;
}

.app__layout--setup {
  grid-template-columns: 11rem minmax(0, 1fr);
  min-height: 24rem;
  background: linear-gradient(180deg, var(--surface), var(--canvas));
}

.settings-nav {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--small);
  color: var(--muted);
}

.settings-nav li {
  padding: 0.4rem 0.5rem;
  border-radius: 0.3rem;
}

.settings-nav .is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.pane--providers {
  display: grid;
  padding: 1.1rem 1.2rem;
}

/* Empty state, form, and saved list share one cell so a phase change is a
   cross-fade rather than an instant swap. */
.pane--providers > * {
  grid-area: 1 / 1;
  align-self: start;
}

.provider-empty {
  margin: 3rem 0 0;
  color: var(--muted);
  font-size: var(--small);
}

.provider-empty span {
  display: block;
  color: var(--faint);
  font-size: var(--micro);
}

/* --- the provider form, matching the application ---------------------- */

.provider-form {
  display: grid;
  gap: 0.85rem;
  font-size: var(--small);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.2rem;
}

.field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
}

.field__badge,
.field__number {
  color: var(--muted);
  font-size: var(--micro);
  font-style: normal;
  font-weight: 550;
}

.field__value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 35, 29, 0.03);
}

/* The hint stands in until the typing animation reaches this field. */
.field__value:empty::before {
  content: attr(data-setup-hint);
  color: var(--faint);
}

.field__value--key {
  letter-spacing: 0.14em;
}

.field__value--key svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: var(--faint);
  letter-spacing: normal;
}

.field__value--select svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

.field__help {
  color: var(--muted);
  font-size: var(--micro);
}

.slider {
  position: relative;
  display: block;
  height: 1.1rem;
  margin-top: 0.5rem;
}

.slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  transform: translateY(-50%);
}

.slider i {
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  width: var(--temp, 0%);
  border-radius: 3px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: width 900ms var(--ease-out-soft);
}

.slider i::after {
  content: "";
  position: absolute;
  right: -0.42rem;
  top: 50%;
  width: 0.84rem;
  height: 0.84rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--canvas);
  font-size: var(--micro);
  text-align: center;
}

.segmented span {
  padding: 0.4rem 0.5rem;
  border-radius: 0.35rem;
  color: var(--muted);
}

.segmented .is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(23, 35, 29, 0.06);
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.form-foot__note {
  color: var(--muted);
  font-size: var(--micro);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  color: var(--muted);
  font-size: var(--micro);
}

.switch i {
  position: relative;
  width: 2.1rem;
  height: 1.15rem;
  border-radius: 980px;
  background: var(--accent);
}

.switch i::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 1.08rem;
  width: 0.87rem;
  height: 0.87rem;
  border-radius: 50%;
  background: #fff;
}

.form-foot__submit {
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 550;
  transition: transform 160ms var(--ease-standard), box-shadow 220ms var(--ease-standard),
    background-color 220ms var(--ease-standard);
}

/* Pressed: it sinks a little and takes the glow of the click. */
.form-foot__submit.is-pressed {
  transform: scale(0.96);
  background: var(--accent-strong);
  box-shadow: 0 0 0 8px var(--accent-faint), 0 0 18px rgba(71, 105, 87, 0.25);
}

/* The saved entry pops in, so the click has a visible result. */
.provider-row__dot {
  animation: provider-pop 460ms var(--ease-out-soft) 120ms both;
}

@keyframes provider-pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  60% {
    transform: scale(1.25);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

[data-theme="dark"] .form-foot__submit {
  color: var(--green-900);
}

/* --- saved state ------------------------------------------------------ */

.provider-list {
  display: grid;
  gap: 0.5rem;
}

.provider-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--accent-soft);
  border-radius: 0.5rem;
  background: var(--surface);
}

.provider-row__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.provider-row strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.provider-row span {
  color: var(--muted);
  font-size: var(--micro);
}

.provider-add {
  justify-self: start;
  color: var(--accent-text);
  font-size: var(--small);
  font-weight: 550;
}

/* --- phases ----------------------------------------------------------- */

.provider-empty,
.provider-form,
.provider-list {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 10px, 0);
  transition: opacity var(--motion-reveal) var(--ease-out-soft),
    transform var(--motion-reveal) var(--ease-out-soft), visibility 0s linear var(--motion-reveal);
}

.setup__stage[data-phase="1"] .provider-empty,
.setup__stage[data-phase="2"] .provider-form,
.setup__stage[data-phase="3"] .provider-list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* --- the pointer that saves the provider ------------------------------- */

.app--setup {
  position: relative;
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  opacity: 0;
  transform: translate(var(--cursor-x, 50%), var(--cursor-y, 50%));
  transition: transform 620ms var(--ease-out-soft), opacity 220ms var(--ease-standard);
  pointer-events: none;
}

.cursor.is-visible {
  opacity: 1;
}

/* The burst: two rings expanding out of the click point, plus a few sparks. */
.cursor__burst {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  width: 0;
  height: 0;
}

.cursor__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  opacity: 0;
  transform: scale(0.3);
}

.cursor__ring--outer {
  border-width: 2px;
  border-color: var(--green-500);
}

/* The flash right at the click point. */
.cursor__burst::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0.7rem;
  height: 0.7rem;
  margin: -0.35rem 0 0 -0.35rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px var(--accent);
  opacity: 0;
  transform: scale(0.2);
}

.cursor.is-clicking .cursor__burst::before {
  animation: cursor-flash 340ms var(--ease-out-soft) forwards;
}

@keyframes cursor-flash {
  0% {
    opacity: 0.95;
    transform: scale(0.25);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

.cursor__spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.3rem;
  height: 0.3rem;
  margin: -0.15rem 0 0 -0.15rem;
  border-radius: 50%;
  background: var(--accent-strong);
  opacity: 0;
}

/* Six sparks, each with its own direction. */
.cursor__spark:nth-child(3) { --spark-x: 0.95rem; --spark-y: -0.55rem; }
.cursor__spark:nth-child(4) { --spark-x: 1.05rem; --spark-y: 0.25rem; }
.cursor__spark:nth-child(5) { --spark-x: 0.45rem; --spark-y: 1rem; }
.cursor__spark:nth-child(6) { --spark-x: -0.55rem; --spark-y: 0.95rem; }
.cursor__spark:nth-child(7) { --spark-x: -1.05rem; --spark-y: 0.2rem; }
.cursor__spark:nth-child(8) { --spark-x: -0.9rem; --spark-y: -0.6rem; }

.cursor.is-clicking .cursor__ring--inner {
  animation: cursor-ring 620ms var(--ease-out-soft) forwards;
}

.cursor.is-clicking .cursor__ring--outer {
  animation: cursor-ring 760ms var(--ease-out-soft) 110ms forwards;
}

.cursor.is-clicking .cursor__spark {
  animation: cursor-spark 560ms var(--ease-out-soft) forwards;
}

/* The pointer dips on press, the way a real one does. */
.cursor.is-pressed svg {
  transform: scale(0.88);
  transform-origin: 6px 6px;
}

@keyframes cursor-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(4.6);
  }
}

@keyframes cursor-spark {
  0% {
    opacity: 0.9;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-x, 0.9rem), var(--spark-y, 0.6rem)) scale(0.4);
  }
}

.cursor svg {
  display: block;
  filter: drop-shadow(0 2px 3px rgba(23, 35, 29, 0.25));
}

.setup__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  justify-content: center;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--small);
  color: var(--faint);
}

.setup__steps li {
  max-width: 16rem;
  transition: color var(--motion-base) var(--ease-standard);
}

.setup__steps li.is-active {
  color: var(--ink);
}

.setup__steps strong {
  display: block;
  font-weight: 600;
}

.setup__steps span {
  color: inherit;
}

.setup__steps code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.1em 0.32em;
  border-radius: 4px;
  background: var(--accent-faint);
}

/* The hero's message arrives the same way: up from the composer. */
@media (prefers-reduced-motion: no-preference) {
  .bubble--user.is-entering {
    animation: bubble-rise 520ms var(--ease-out-soft);
  }
}

@keyframes bubble-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 2.4rem, 0) scale(0.98);
  }
}

/* The page is complete before the motion runs: entrances only add polish. */
[data-enter] {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  [data-enter] {
    animation: enter var(--motion-hero) var(--ease-out-soft) both;
  }
  [data-enter="nav"] {
    animation-delay: 0ms;
  }
  [data-enter="claim"] {
    animation-delay: 140ms;
  }
  [data-enter="product"] {
    animation-delay: 260ms;
  }
  [data-enter="action"] {
    animation-delay: 400ms;
  }

  [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity var(--motion-reveal) var(--ease-out-soft),
      transform var(--motion-reveal) var(--ease-out-soft);
  }

  [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  /*
   * A staggered group (the artifact grid) arrives card by card: each one rises
   * into place once and stays there. Nothing fades back out, and the sequence
   * is slow on purpose — a gentle arrival, not a snap.
   */
  [data-reveal-stagger] > * {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    transition: opacity 700ms var(--ease-out-soft), transform 700ms var(--ease-out-soft);
    transition-delay: calc(var(--reveal-index, 0) * 110ms);
  }

  [data-reveal-stagger].is-visible > * {
    opacity: 1;
    transform: none;
  }

  /* The two commands arrive one after the other, like a terminal printing them. */
  .install__code .line {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition: opacity 500ms var(--ease-out-soft), transform 500ms var(--ease-out-soft);
  }

  .install__inner.is-visible .install__code .line {
    opacity: 1;
    transform: none;
  }

  .install__inner.is-visible .install__code .line:nth-child(2) {
    transition-delay: 200ms;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
  .card,
  .story__stage .bubble--user,
  .story__stage .chat__tools,
  .story__stage .chat__reply,
  .story__stage .card--inline,
  .pane--artifacts .mini-card,
  .app__view--library .lib-grid > .mini-card,
  .story__steps li,
  [data-reveal-stagger] > * {
    transition: none;
  }
  [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }
  .install__code .line {
    opacity: 1;
    transform: none;
  }
  .provider-empty,
  .provider-form,
  .provider-list {
    transition: none;
  }
  /* Every step is readable; the highlight is decoration, not information. */
  .story__steps li {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .story__grid {
    grid-template-columns: 1fr;
  }
  .story__stage {
    position: static;
  }
  .story__steps li {
    min-height: 0;
    margin: 2.4rem 0;
    opacity: 1;
  }
  .app__stream {
    min-height: 0;
  }
}

/* The window drops its outer columns before the text column gets cramped. */
@media (max-width: 1200px) {
  .app__layout,
  .app__view--library {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
  .pane--artifacts {
    display: none;
  }
}

@media (max-width: 720px) {
  .app__layout,
  .app__view--library {
    grid-template-columns: minmax(0, 1fr);
  }
  .pane--conversations {
    display: none;
  }
}
