html:has(#story) {
  scroll-behavior: auto;
  overflow-x: hidden;
}

.page-story {
  max-width: none;
  padding: 0;
}

@font-face {
  font-family: "Story Name";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
}

#story {
  --stage-pad: max(var(--space-4), env(safe-area-inset-left));
  --stage-pad-r: max(var(--space-4), env(safe-area-inset-right));
  --stick-top: calc(var(--topbar-height) + env(safe-area-inset-top));
  --stick-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  --stick-height: calc(100dvh - var(--stick-top) - var(--stick-bottom));
  --story-control-border: rgba(0, 0, 0, 0.22);
  --story-control-bg: transparent;
  --story-control-bg-hover: rgba(0, 0, 0, 0.04);
  --p: 0;
}

:root[data-theme="dark"] #story {
  --story-control-border: rgba(255, 255, 255, 0.28);
  --story-control-bg-hover: rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #story {
    --story-control-border: rgba(255, 255, 255, 0.28);
    --story-control-bg-hover: rgba(255, 255, 255, 0.06);
  }
}

html:has(#story) .topbar,
html:has(#story) .tabbar {
  background: var(--surface-canvas);
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.story-stage {
  height: var(--stage-length, 300vh);
  position: relative;
}

.story-stick {
  position: sticky;
  top: var(--stick-top);
  height: var(--stick-height);
  max-height: var(--stick-height);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 max(var(--stage-pad-r), env(safe-area-inset-right))
    var(--stick-bottom)
    max(var(--stage-pad), env(safe-area-inset-left));
}

.story-scene {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(var(--space-3), 2.5vh, var(--space-5));
}

.story-kicker {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-mark {
  width: 44px;
  height: 44px;
  margin: 0;
}

.story-name.story-who-title {
  margin: 0;
  font-family: "Story Name", var(--font-display);
  font-size: clamp(2.6rem, 15vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-wrap: balance;
  hyphens: none;
  word-break: keep-all;
  width: 100%;
  max-width: 100%;
}

.story-who-title .story-who-line {
  display: block;
  width: fit-content;
  max-width: 100%;
}

.story-who-title [data-name-line]:first-child {
  font-size: var(--name-first-size, inherit);
  width: var(--name-line-width, fit-content);
  max-width: 100%;
}

.story-who-title [data-name-line]:last-child {
  width: var(--name-line-width, fit-content);
  max-width: 100%;
}

.story-role {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0.06em;
}

.story-stage-title {
  margin: 0;
  font-family: "Story Name", var(--font-display);
  font-size: clamp(2.25rem, 11vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  word-spacing: normal;
  line-height: 1.02;
  text-wrap: balance;
}

.story-stage-lede,
.story-tagline,
.story-scene-foot {
  margin: 0;
  max-width: 36em;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
}

.story-scene-foot {
  margin-top: var(--space-2);
}

.story-scene-foot a {
  color: inherit;
}

/* ------------------------------------------------------------------ who */

#story {
  /* The coldfinch bird, in the colours of coldfinch.eu. */
  --cf-body: #213448;
  --cf-belly: #547792;
  --cf-wing: #547792;
}

:root[data-theme="dark"] #story {
  --cf-body: #94b4c1;
  --cf-belly: #eae0cf;
  --cf-wing: #eae0cf;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #story {
    --cf-body: #94b4c1;
    --cf-belly: #eae0cf;
    --cf-wing: #eae0cf;
  }
}

.story-scene--who {
  position: relative;
}

.story-scene--who .story-who-body {
  flex: 0 1 auto;
  margin-top: var(--space-3);
  width: 100%;
  max-width: 36em;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-5);
}

.story-who-stack {
  position: relative;
  width: 100%;
  min-height: 7.5rem;
  overflow: visible;
}

.story-who-stack [data-who-layer] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--text-body);
  font-size: clamp(var(--fs-md), 4vw, var(--fs-lg));
  line-height: var(--lh-relaxed);
  opacity: var(--layer-o, 1);
  filter: blur(var(--layer-blur, 0px));
  transform: translate3d(0, var(--layer-y, 0px), 0);
}

.story-w {
  display: inline-block;
}

/* Typing: the untyped rest keeps its place, so the lines never move. */
.story-type-rest {
  color: transparent !important;
}

.story-caret {
  position: relative;
}

.story-caret::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.06em;
  width: 2px;
  height: 1.08em;
  border-radius: 1px;
  background: var(--text-primary);
  animation: story-caret 1s steps(1) infinite;
}

.story-caret[hidden] {
  display: none;
}

/* A hint on the first screen: the page goes on below. */
.story-cue {
  position: absolute;
  left: 50%;
  bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  transform: translateX(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.story-cue-track {
  position: relative;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text-primary) 14%, transparent);
}

.story-cue-track span {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 16px;
  background: var(--text-primary);
  animation: story-cue 1.8s var(--ease-in-out) infinite;
}

.story-cue-label {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@keyframes story-cue {
  0% {
    transform: translateY(-16px);
  }

  100% {
    transform: translateY(44px);
  }
}

/* Until story.js takes over, only one paragraph and one opinion show. */
.js #story:not(.story--live):not(.story--calm) .story-who-stack [data-who-layer],
.js #story:not(.story--live):not(.story--calm) .story-care-opinion:not(:first-child) {
  visibility: hidden;
}

/* The word stays one link: the bird and coldfinch. */
.story-cf {
  position: relative;
  display: inline-block;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  --cf-hover: 0;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: calc(max(var(--cf-line, 0), var(--cf-hover)) * 100%) 1.5px;
  transition: background-size 0.35s var(--ease-out);
}

.story-cf:hover {
  --cf-hover: 1;
}

.story-cf:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}

.story-cf-perch {
  display: inline-block;
  width: 1.42em;
  height: 1.42em;
  margin: 0 0.1em 0 0.02em;
  vertical-align: -0.38em;
}

.story-cf-perch svg,
.story-fly-bird {
  display: block;
  overflow: visible;
}

.story-cf-perch svg {
  width: 100%;
  height: 100%;
  transform-origin: 50% 90%;
}

.story-cf-body {
  fill: var(--cf-body);
}

.story-cf-belly {
  fill: var(--cf-belly);
}

.story-cf-wing {
  fill: var(--cf-wing);
}

.story-cf-word,
.story-fly--sans {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.story-cf-word > span {
  display: inline-block;
}

@media (hover: hover) {
  .story-cf:hover .story-cf-perch svg {
    animation: story-cf-hop 0.7s var(--ease-out);
  }
}

@keyframes story-cf-hop {
  0% {
    transform: none;
  }

  28% {
    transform: translateY(-32%) rotate(-10deg);
  }

  56% {
    transform: translateY(0) scale(1.06, 0.9);
  }

  78% {
    transform: translateY(-6%) rotate(3deg);
  }

  100% {
    transform: none;
  }
}

/* The flock: clones of the letters and the bird, flown by story.js over the scene. */
.story-flight {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
  display: none;
}

.story--live .story-flight {
  display: block;
}

.story-fly,
.story-fly-bird {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}

.story-fly {
  line-height: 1;
  white-space: pre;
  color: var(--text-primary);
}

.story-fly-g {
  display: inline;
}

.story-fly--serif {
  font-family: "Story Name", var(--font-display);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.story-fly-bird {
  transform-origin: 50% 50%;
}

/* ship → measure → improve */
.story-loop-words [data-loop-word],
.story-loop-arrow {
  transition: color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.story-loop-words [data-loop-word] {
  position: relative;
}

.story-loop-words [data-loop-word]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease-out);
}

.story-loop-words [data-loop-word].is-on {
  color: var(--text-primary);
}

.story-loop-words [data-loop-word].is-on::after {
  transform: scaleX(1);
}

.story-loop-words [data-loop-word].is-off {
  opacity: 0.42;
}

.story-loop-arrow {
  display: inline-block;
  opacity: 0.42;
}

.story-loop-arrow.is-on {
  opacity: 1;
  color: var(--text-primary);
}

.story-loop {
  position: relative;
  width: 100%;
  opacity: var(--loop-o, 0);
  transform: translate3d(0, calc((1 - var(--loop-o, 0)) * 14px), 0);
}

.story-loop-chart {
  display: block;
  width: 100%;
  height: clamp(7.25rem, 17vh, 9.5rem);
  overflow: visible;
  color: var(--text-primary);
}

.story-loop-grid line {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.08;
}

.story-loop-grid .story-loop-axis {
  opacity: 0.22;
}

.story-loop-area {
  fill: url(#story-loop-fade);
}

.story-loop-line,
.story-loop-ghost {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.story-loop-ghost {
  stroke-width: 1;
  stroke-dasharray: 1 5;
  opacity: 0.22;
}

.story-loop-band {
  fill: currentColor;
  opacity: 1;
  fill-opacity: 0.06;
  transition: opacity 0.4s var(--ease-out);
}

.story-loop-rule {
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.55;
}

.story-loop-pill rect {
  fill: currentColor;
}

.story-loop-pill text,
.story-loop-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.story-loop-pill text {
  fill: var(--surface-canvas);
}

.story-loop-label {
  fill: currentColor;
  transition: opacity 0.2s ease;
}

.story-loop-dot {
  fill: currentColor;
}

.story-loop-halo {
  fill: currentColor;
  opacity: 0.12;
  transform-box: fill-box;
  transform-origin: center;
}

.story-loop-halo.is-live {
  animation: story-ping 1.4s var(--ease-out) infinite;
}

@keyframes story-ping {
  0% {
    transform: scale(0.4);
    opacity: 0.35;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ masks */

.story-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.04em 0 0.12em;
  margin: -0.04em 0 -0.12em;
}

.story-mask-in {
  display: inline-block;
  will-change: transform;
}

/* ------------------------------------------------------------------ build */

.story-build-window {
  overflow: hidden;
  touch-action: pan-y;
  flex: 0 0 auto;
  height: min(64dvh, 34rem);
  display: flex;
  align-items: stretch;
  perspective: 1300px;
  perspective-origin: 40% 50%;
  /* The cards leave at the edge of the screen, and their shadows have room. */
  box-sizing: content-box;
  width: auto;
  align-self: stretch;
  padding: var(--space-6) var(--stage-pad-r) 88px var(--stage-pad);
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--stage-pad-r)) -88px
    calc(-1 * var(--stage-pad));
}

.story-build-rail {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
  transform: translate3d(calc(-1px * var(--build-x, 0)), 0, 0);
  transform-style: preserve-3d;
  will-change: transform;
}

.story-build-slide {
  --d: 0;
  --ad: 0;
  --focus: 1;
  --in: 1;
  flex: 0 0 92%;
  width: 92%;
  max-width: 92%;
  min-width: 0;
  padding-right: var(--space-3);
  box-sizing: border-box;
  height: 100%;
  transform-style: preserve-3d;
}

/* The whole card is the link. */
.story-build-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  border: 1px solid var(--story-control-border);
  border-radius: var(--radius-card);
  background: var(--surface-canvas);
  box-shadow: 0 calc(8px + var(--focus) * 16px) calc(22px + var(--focus) * 26px) -18px
    color-mix(in srgb, var(--text-primary) calc(6% + var(--focus) * 14%), transparent);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  transform-origin: 50% 50%;
  transform: translate3d(0, calc((1 - var(--in)) * 56px), calc(var(--ad) * -110px))
    rotateY(calc(var(--d) * -18deg)) rotateX(calc((1 - var(--in)) * 14deg));
  opacity: calc(var(--in) * (1 - min(var(--ad), 1) * 0.5));
  transition: border-color 0.2s ease;
}

/* A lit edge that turns with the card. */
.story-build-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 3;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from calc(200deg + var(--d) * 160deg),
    transparent 0deg,
    var(--text-primary) 40deg,
    transparent 110deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: calc(var(--focus) * 0.55);
  pointer-events: none;
}

.story-build-card:hover {
  border-color: var(--text-primary);
}

.story-build-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* The live site, floating: a browser window with a phone in front of it. */
.story-build-visual {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 0%, color-mix(in srgb, var(--text-primary) 7%, transparent), transparent 60%),
    color-mix(in srgb, var(--text-primary) 3%, var(--surface-canvas));
  perspective: 900px;
}

.story-shot {
  position: absolute;
  overflow: hidden;
  background: var(--surface-canvas);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--text-primary) 10%, transparent),
    0 22px 44px -18px rgba(0, 0, 0, 0.38);
  transition: transform 0.6s var(--ease-out);
}

.story-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.story-shot--browser {
  left: 8%;
  top: 13%;
  width: 82%;
  border-radius: 10px;
  transform: translate3d(calc(var(--d) * 46px), calc((1 - var(--focus)) * 22px), 0)
    rotateY(calc(-14deg + var(--d) * 10deg)) rotateX(6deg)
    scale(calc(0.9 + var(--focus) * 0.1));
  transform-origin: 30% 50%;
  animation: story-float 7s ease-in-out infinite;
}

.story-shot-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--text-primary) 6%, var(--surface-canvas));
}

.story-shot-dots {
  display: flex;
  gap: 3px;
}

.story-shot-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-primary) 28%, transparent);
}

.story-shot-url {
  flex: 0 1 auto;
  margin: 0 auto;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.4;
  white-space: nowrap;
}

.story-shot--phone {
  right: 7%;
  top: 26%;
  width: 25%;
  aspect-ratio: 300 / 577;
  border-radius: 14px;
  border: 3px solid #111;
  transform: translate3d(calc(var(--d) * 96px), calc((1 - var(--focus)) * 40px), 40px)
    rotateY(calc(-8deg + var(--d) * 14deg)) rotateZ(calc(3deg + var(--d) * 4deg));
  box-shadow: 0 26px 46px -16px rgba(0, 0, 0, 0.45);
  animation: story-float 6s ease-in-out -2.5s infinite;
}

.story-shot--phone img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}

@keyframes story-float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -6px;
  }
}

@media (hover: hover) {
  .story-build-card:hover .story-shot--browser {
    transform: translate3d(0, -6px, 0) rotateY(-6deg) rotateX(3deg) scale(1.02);
  }

  .story-build-card:hover .story-shot--phone {
    transform: translate3d(-6px, -14px, 40px) rotateY(-4deg) rotateZ(1deg);
  }
}

.story-build-info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.story-build-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  transform: translate3d(calc(var(--d) * 26px), 0, 0);
}

.story-build-logo {
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
}

.story-build-card-top h3 {
  margin: 0;
  font-family: "Story Name", var(--font-display);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  min-width: 0;
}

.story-build-info > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: 1.45;
  opacity: calc(0.3 + 0.7 * var(--focus));
  transform: translate3d(calc(var(--d) * 14px), 0, 0);
}

.story-build-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.story-chip {
  padding: 0.22em 0.6em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--story-control-border);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  opacity: var(--chip-o, 1);
  transform: translate3d(0, calc((1 - var(--chip-o, 1)) * 10px), 0) scale(var(--chip-s, 1));
}

.story-build-dots {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 6px;
  margin-top: var(--space-4);
}

.story-build-dots span {
  display: block;
  width: calc(6px + var(--dot, 0) * 20px);
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  opacity: calc(0.16 + var(--dot, 0) * 0.84);
}

/* ------------------------------------------------------------------ care */

.story-care-head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  width: 100%;
}

.story-care-num {
  display: inline-flex;
  font-family: "Story Name", var(--font-display);
  font-size: clamp(3.2rem, 15vw, 5rem);
  font-style: italic;
  line-height: 1.25;
  height: 1.25em;
  padding: 0 0.14em 0 0.02em;
  overflow: hidden;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.story-care-roll {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, calc(var(--roll, 0) * -1.25em), 0);
}

.story-care-roll span {
  display: block;
  height: 1.25em;
}

.story-care-segs {
  flex: 1;
  display: flex;
  gap: 6px;
  padding-bottom: 0.7rem;
}

.story-care-seg {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 14%, transparent);
  overflow: hidden;
}

.story-care-seg span {
  position: absolute;
  inset: 0;
  background: var(--text-primary);
  transform-origin: left center;
  transform: scaleX(var(--seg, 0));
}

.story-care-opinions {
  position: relative;
  width: 100%;
  min-height: 19rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-care-opinion {
  position: absolute;
  inset: 0 0 auto;
  margin: 0;
  opacity: var(--care-o, 1);
  filter: blur(var(--care-blur, 0px));
}

.story-care-opinion h3 {
  margin: 0 0 var(--space-3);
  font-family: "Story Name", var(--font-display);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  word-spacing: normal;
  line-height: 1.05;
}

.story-care-opinion p {
  margin: 0;
  max-width: 34em;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
}

.story-care-illo {
  display: block;
  margin-top: var(--space-6);
  width: 100%;
  max-width: 26rem;
  height: auto;
  aspect-ratio: 320 / 120;
  overflow: visible;
  color: var(--text-primary);
  opacity: var(--illo-o, 1);
  transform: translate3d(0, calc((1 - var(--illo-o, 1)) * 12px), 0);
}

.story-care-illo .dg-thread {
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.story-care-illo .dg-thread--solid {
  stroke-dasharray: none;
}

.story-care-illo .dg-ink {
  fill: currentColor;
}

.story-care-illo .dg-ring {
  fill: var(--surface-canvas);
  stroke: currentColor;
  stroke-width: 1.5;
}

.story-care-illo .dg-ring--small {
  stroke-width: 1.25;
}

.story-care-illo .dg-box {
  fill: color-mix(in srgb, currentColor 6%, transparent);
  stroke: currentColor;
  stroke-width: 1.5;
}

.story-care-illo .dg-draw {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
}

.story-care-illo .dg-led {
  fill: var(--surface-canvas);
  opacity: 0.25;
  transition: opacity 0.25s ease;
}

.story-care-illo .dg-led.is-on {
  opacity: 1;
  animation: story-blink 2.4s steps(1) infinite;
}

.story-care-illo g:nth-of-type(3) .dg-led.is-on {
  animation-delay: 0.7s;
}

@keyframes story-blink {
  0%,
  86% {
    opacity: 1;
  }

  90%,
  100% {
    opacity: 0.3;
  }
}

.story-care-illo .dg-pill rect {
  fill: currentColor;
}

.story-care-illo .dg-pill text {
  fill: var(--surface-canvas);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.story-care-illo .dg-label {
  fill: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.story-care-illo .dg-label--ink {
  fill: currentColor;
}

.story-care-illo .dg-axis {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.25;
}

.story-care-illo .dg-curve {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
}

.story-care-illo .dg-curve--cloud {
  stroke-dasharray: 4 4;
  opacity: 0.6;
}

.story-care-illo .dg-hatch {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.3;
}

.story-care-illo .dg-term {
  fill: color-mix(in srgb, currentColor 4%, transparent);
  stroke: color-mix(in srgb, currentColor 22%, transparent);
  stroke-width: 1;
}

.story-care-illo .dg-term-dot {
  fill: currentColor;
  opacity: 0.18;
}

.story-care-illo .dg-grid rect {
  fill: currentColor;
  opacity: 0.06;
}

.story-care-illo .dg-soft {
  fill: currentColor;
  opacity: 0.32;
}

.story-care-illo .dg-pic {
  fill: color-mix(in srgb, currentColor 12%, transparent);
}

.story-care-illo .dg-guide {
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.story-care-illo .dg-check {
  fill: none;
  stroke: var(--surface-canvas);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.story-care-illo .dg-ripple {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.story-care-illo .dg-pointer {
  fill: currentColor;
  stroke: var(--surface-canvas);
  stroke-width: 1.2;
  stroke-linejoin: round;
}


@keyframes story-caret {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0.12;
  }
}

/* ------------------------------------------------------------------ say hello: the chat */

/* The last chapter does not stick: the chat needs the page to stay put while typing. */
.story-stage--hello {
  height: auto;
}

.story-stage--hello .story-stick {
  position: relative;
  top: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-top: var(--space-10);
  padding-bottom: 0;
}

.story-scene--contact {
  height: auto;
  justify-content: flex-start;
}

#content.page-story,
body:has(#story) {
  padding-bottom: 0;
}

.story-contact-tease {
  margin: 0;
  max-width: 36em;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
}

.story-chat {
  --in: 1;
  --bot-bg: color-mix(in srgb, var(--text-primary) 6%, var(--surface-canvas));
  position: relative;
  display: flex;
  flex-direction: column;
  /* Full screen once the page is scrolled to the end, like an app: the header under the
     top bar, the input at the bottom of the screen. */
  width: auto;
  height: calc(100dvh - var(--stick-top));
  margin: var(--space-4) calc(-1 * var(--stage-pad-r)) 0 calc(-1 * var(--stage-pad));
  background: var(--surface-canvas);
  overflow: hidden;
  opacity: var(--in);
  transform: translate3d(0, calc((1 - var(--in)) * 60px), 0);
}

.story-chat-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 3rem;
  padding: var(--space-2) var(--space-4);
}

.story-chat-name {
  font-family: "Story Name", var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.story-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fluid-sage);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fluid-sage) 30%, transparent);
  animation: story-breathe 2.2s ease-in-out infinite;
}

.story-chat.is-busy .story-chat-dot {
  animation-duration: 0.7s;
}

@keyframes story-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.7);
  }
}

.story-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.story-chat-msg {
  display: flex;
  max-width: 88%;
  animation: story-msg-in 0.45s var(--ease-out) both;
}

.story-chat-msg--me {
  align-self: flex-end;
}

.story-chat-bubble {
  padding: 0.62em 0.9em;
  border-radius: 20px;
  font-size: var(--fs-md);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.story-chat-msg--bot .story-chat-bubble {
  background: var(--bot-bg);
  color: var(--text-body);
  border-bottom-left-radius: 6px;
}

.story-chat-msg--me .story-chat-bubble {
  background: var(--text-primary);
  color: var(--surface-canvas);
  border-bottom-right-radius: 6px;
}

.story-chat-bubble p {
  margin: 0;
}

.story-chat-bubble p + p,
.story-chat-bubble ul {
  margin-top: 0.5em;
}

.story-chat-bubble ul {
  margin-bottom: 0;
  padding-left: 1.2em;
}

.story-chat-bubble a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.story-chat-bubble code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.story-chat-msg.is-error .story-chat-bubble {
  color: var(--text-secondary);
}

.story-chat-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: currentColor;
  animation: story-caret 1s steps(1) infinite;
}

.story-chat-dots {
  display: inline-flex;
  gap: 4px;
  padding: 0.35em 0;
}

.story-chat-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: story-dot 1.1s ease-in-out infinite;
}

.story-chat-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.story-chat-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes story-dot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes story-msg-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.97);
  }
}

/* The other ways in, shared by the assistant as link cards. */
.story-chat-msg--links {
  flex-direction: column;
  max-width: none;
  margin: 0 calc(-1 * var(--space-4));
  animation: none;
}

.story-links {
  display: flex;
  gap: var(--space-2);
  padding: 2px var(--space-4) var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--space-4);
  scrollbar-width: none;
}

.story-links::-webkit-scrollbar {
  display: none;
}

.js .story-chat-msg--links.is-waiting {
  display: none;
}

.story-link {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  width: 9.5rem;
  min-height: 6rem;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--story-control-border);
  border-radius: 18px;
  background: var(--surface-canvas);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.3s var(--ease-out), border-color 0.2s ease;
}

.story-chat-msg--links.is-in .story-link {
  animation: story-link-in 0.55s var(--ease-out) both;
}

.story-chat-msg--links.is-in .story-link:nth-child(2) {
  animation-delay: 0.07s;
}

.story-chat-msg--links.is-in .story-link:nth-child(3) {
  animation-delay: 0.14s;
}

.story-chat-msg--links.is-in .story-link:nth-child(4) {
  animation-delay: 0.21s;
}

@keyframes story-link-in {
  from {
    opacity: 0;
    transform: translate3d(28px, 0, 0) rotate(2deg);
  }
}

.story-link:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.story-link:active {
  transform: scale(0.97);
}

.story-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.story-link--space {
  width: 13rem;
  background: color-mix(in srgb, var(--text-primary) 3%, var(--surface-canvas));
}

.story-link-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--text-primary);
}

.story-link-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--surface-canvas);
}

.story-link-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-top: auto;
}

.story-link-text b {
  font-family: "Story Name", var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.05;
}

.story-link-text small {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Replies to tap. */
.story-chat-replies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
}

.story-chat-replies:empty {
  display: none;
}

.story-chat-chip {
  padding: 0.5em 0.85em;
  border: 1px solid var(--story-control-border);
  border-radius: var(--radius-pill);
  background: var(--surface-canvas);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.2;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.94);
  transition:
    opacity 0.35s var(--ease-out) calc(var(--i, 0) * 70ms),
    transform 0.45s var(--ease-out) calc(var(--i, 0) * 70ms),
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.story-chat-replies.is-in .story-chat-chip {
  opacity: 1;
  transform: none;
}

.story-chat-chip:hover {
  border-color: var(--text-primary);
}

.story-chat-chip:active {
  transform: scale(0.96);
}

.story-chat-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  margin: 0 var(--space-3) max(var(--space-3), env(safe-area-inset-bottom));
  padding: 6px 6px 6px var(--space-4);
  border: 1px solid var(--story-control-border);
  border-radius: 24px;
  background: var(--surface-canvas);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.story-chat-form:focus-within {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.story-chat-form textarea {
  flex: 1;
  min-width: 0;
  min-height: 2.25rem;
  max-height: 8.25rem;
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  outline: none;
}

.story-chat-form textarea::placeholder {
  color: var(--text-tertiary);
}

.story-chat-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--surface-canvas);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), opacity 0.2s ease;
}

.story-chat-send:active {
  transform: scale(0.92);
}

.story-chat-send:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (min-width: 761px) {
  .story-chat {
    max-width: 44rem;
    margin-left: 0;
    margin-right: 0;
  }
}

/* skiver passing a request on to Fried. */
.story-chat-sent {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92%;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 4%, var(--surface-canvas));
  animation: story-msg-in 0.45s var(--ease-out) both;
}

.story-chat-sent-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--surface-canvas);
  overflow: hidden;
}

.story-chat-sent-mark svg {
  width: 15px;
  height: 15px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-chat-sent-plane {
  fill: currentColor;
  stroke-width: 1.4;
  animation: story-plane 1.1s var(--ease-in-out) infinite;
}

.story-chat-sent-check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.story-chat-sent.is-done .story-chat-sent-plane {
  animation: story-plane-off 0.5s var(--ease-in-out) forwards;
}

.story-chat-sent.is-done .story-chat-sent-check {
  transition: stroke-dashoffset 0.45s var(--ease-out) 0.3s;
  stroke-dashoffset: 0;
}

@keyframes story-plane {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(1.5px, -1.5px);
  }
}

@keyframes story-plane-off {
  to {
    transform: translate(18px, -18px) scale(0.6);
    opacity: 0;
  }
}

.story-chat-sent-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.story-chat-sent-text b {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.story-chat-sent-text small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-chat-sent-text small:empty {
  display: none;
}

.story-fineprint {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
}

.story-rail {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--stick-top);
  z-index: var(--z-progress, 30);
  height: 3px;
  background: var(--border-soft);
  pointer-events: none;
}

.story-rail-fill {
  display: block;
  height: 100%;
  width: calc(var(--story-progress, 0) * 100%);
  background: var(--text-primary);
  transform-origin: left center;
}

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

.story--calm .story-stage {
  height: auto;
  margin-bottom: var(--space-12);
}

.story--calm .story-stick {
  position: relative;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-bottom: var(--space-8);
}

.story--calm .story-build-window {
  height: auto;
  perspective: none;
}

.story--calm .story-build-rail {
  flex-direction: column;
  transform: none;
}

.story--calm .story-build-slide {
  flex: none;
  width: 100%;
  max-width: 100%;
  padding-right: 0;
  margin-bottom: var(--space-4);
  height: auto;
}

.story--calm .story-build-card,
.story--calm .story-build-card * {
  transform: none;
  opacity: 1;
}

.story--calm .story-build-card::after,
.story--calm .story-build-dots {
  display: none;
}

.story--calm .story-who-stack {
  display: grid;
  gap: var(--space-4);
  min-height: auto;
}

.story--calm .story-who-stack [data-who-layer] {
  position: relative;
  opacity: 1;
  filter: none;
  transform: none;
}

.story--calm .story-care-opinions {
  display: grid;
  gap: var(--space-10);
  min-height: auto;
}

.story--calm .story-care-opinion {
  position: relative;
  opacity: 1;
  filter: none;
}

.story--calm .story-care-head {
  display: none;
}

.story--calm .story-loop {
  opacity: 1;
  transform: none;
}

.story--calm .story-loop-halo,
.story--calm .story-chat-dot,
.story--calm .story-shot,
.story--calm .story-care-illo .dg-led.is-on {
  animation: none;
}

/* ------------------------------------------------------------------ sizes */

@media (max-width: 760px) {
  #story {
    --stage-pad: max(var(--space-5), env(safe-area-inset-left));
    --stage-pad-r: max(var(--space-5), env(safe-area-inset-right));
  }

  #story-who {
    --stage-length: 690vh;
  }

  .story-scene--who {
    gap: var(--space-2);
    justify-content: flex-start;
    padding-top: clamp(var(--space-2), 2vh, var(--space-5));
  }

  .story-scene--who .story-who-body {
    margin-top: var(--space-3);
    gap: var(--space-4);
  }

  .story-who-stack {
    min-height: 10.5rem;
  }

  .story-who-stack [data-who-layer] {
    font-size: clamp(0.94rem, 3.9vw, var(--fs-md));
    line-height: 1.5;
  }

  .story-care-opinions {
    min-height: 21rem;
  }

  .story-loop-chart {
    height: clamp(8rem, 22vh, 11rem);
  }
}

@media (min-width: 761px) {
  .story-stick {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }

  #story {
    --stick-bottom: var(--space-6);
    --stick-height: calc(100dvh - var(--stick-top) - var(--space-6));
  }

  .story-build-slide {
    flex-basis: min(80%, 44rem);
    width: min(80%, 44rem);
    max-width: min(80%, 44rem);
  }

  .story-build-window {
    height: min(66dvh, 36rem);
  }

  .story-scene--care {
    max-width: 44rem;
  }
}
