/* The home page. Loaded after site.css. */

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px 0 112px;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 42%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 75% at 50% 42%, #000 30%, transparent 78%);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.hero-mark {
  position: relative;
  width: 184px;
  height: 184px;
  margin: 0 auto 40px;
}
.hero-mark::before {
  content: "";
  position: absolute;
  inset: -70px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(8px);
  animation: breathe 7s ease-in-out infinite;
}
.hero-mark img {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 30px rgba(0, 20, 30, 0.35));
}
.orbit {
  position: absolute;
  inset: -22px;
  width: calc(100% + 44px);
  height: calc(100% + 44px);
  color: var(--accent-text);
  animation: spin 90s linear infinite;
  pointer-events: none;
}
.orbit.inner {
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  animation-duration: 140s;
  animation-direction: reverse;
  opacity: 0.6;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes breathe {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}
.release-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-raised) 70%, transparent);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.release-pill:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
}
.release-pill .tag {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.release-pill svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}
.release-pill:hover svg {
  transform: translateX(2px);
}
.hero h1 {
  font-size: clamp(60px, 9.5vw, 108px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 62%, var(--accent-text)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}
.hero .lede {
  max-width: 34ch;
  margin: 22px auto 0;
  font-size: clamp(19px, 2.3vw, 23px);
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

/* Why */
.why {
  overflow: hidden;
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.why::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 45%, var(--accent-glow), transparent 70%);
  opacity: 0.45;
  pointer-events: none;
}
.why-body {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.why-body p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  margin-top: 20px;
}
.why-body .why-line {
  margin: 44px 0;
  color: var(--text);
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-wrap: balance;
}
.why-body .why-line span {
  color: var(--accent-text);
}
.why-body .why-line br {
  display: none;
}
@media (min-width: 761px) {
  .why-body .why-line br {
    display: inline;
  }
}

/* Code section */
.code-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: center;
}
.code-grid .section-head {
  margin-bottom: 0;
}
.window {
  position: relative;
  border-radius: var(--radius);
  background: var(--code-bg);
  border: 1px solid rgba(200, 225, 245, 0.1);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.window::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(420px 120px at 80% 0%, hsla(192, 90%, 45%, 0.07), transparent 70%);
  pointer-events: none;
}
.window-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px 0 18px;
  height: 50px;
  border-bottom: 1px solid rgba(200, 225, 245, 0.08);
}
.dots {
  display: flex;
  gap: 7px;
}
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(200, 225, 245, 0.14);
}
.tabs {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}
.tab {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: #8796a8;
  background: transparent;
  border: 0;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.tab:hover {
  color: #d8e2ec;
}
.tab[aria-selected="true"] {
  color: #e9f6fb;
  background: rgba(200, 225, 245, 0.08);
}
.copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #8796a8;
  background: transparent;
  border: 1px solid rgba(200, 225, 245, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy:hover {
  color: #e9f6fb;
  border-color: rgba(200, 225, 245, 0.25);
}
.copy svg {
  width: 14px;
  height: 14px;
}
.window pre {
  position: relative;
  margin: 0;
  padding: 22px 24px 26px;
  overflow-x: auto;
  color: var(--code-text);
  font-size: 13.5px;
  line-height: 1.75;
  tab-size: 4;
}
.window pre[hidden] {
  display: none;
}
.tok-c {
  color: #6c7d90;
}
.tok-k {
  color: #c49cff;
}
.tok-s {
  color: #8fd6a8;
}
.tok-f {
  color: #6fd3ef;
}
.tok-t {
  color: #f2c879;
}
.tok-m {
  color: #ff9f80;
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
.card-media > picture img,
.card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .card-media > picture img,
.card:hover .card-media > img {
  transform: scale(1.025);
}
.card-media .shot-dark {
  display: none;
}
:root[data-theme="dark"] .card-media .shot-dark,
:root[data-theme="solarized"] .card-media .shot-dark {
  display: block;
}
:root[data-theme="dark"] .card-media .shot-light,
:root[data-theme="solarized"] .card-media .shot-light {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-media .shot-dark {
    display: block;
  }
  :root:not([data-theme="light"]) .card-media .shot-light {
    display: none;
  }
}
.card-media.art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 55%, var(--accent-soft), transparent 60%),
    radial-gradient(var(--dot) 1px, transparent 1.5px) 0 0 / 18px 18px,
    var(--bg-sunken);
}
.card-media.art img {
  width: auto;
  height: 62%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 20, 30, 0.25));
}
.card-media.relay img {
  height: 58%;
}
.media-wrap {
  position: relative;
}
.card-media.framed {
  padding: 26px 30px 0;
  background:
    radial-gradient(circle at 50% 120%, var(--accent-soft), transparent 70%),
    radial-gradient(var(--dot) 1px, transparent 1.5px) 0 0 / 18px 18px,
    var(--bg-sunken);
}
.card-media.framed picture {
  display: block;
  height: 100%;
}
.card-media.framed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  box-shadow: var(--shadow-lg);
  transform-origin: 50% 100%;
}
.card-media.framed .media-caption {
  top: 38px;
  right: 42px;
}
.gateway-art {
  width: 82%;
  max-width: 420px;
  height: auto;
  color: var(--accent-text);
}
.gateway-art .box {
  fill: var(--bg-raised);
  stroke: var(--line-strong);
}
.gateway-art .lbl {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}
.gateway-art .lbl.hi {
  fill: var(--accent-text);
}
.gateway-art .wire {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 4 6;
  animation: flow 1.6s linear infinite;
}
@keyframes flow {
  to {
    stroke-dashoffset: -20;
  }
}
.badge-mark {
  position: absolute;
  left: 24px;
  bottom: -28px;
  z-index: 2;
  width: 62px;
  height: 62px;
  padding: 6px;
  border-radius: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.badge-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 26px 26px 24px;
}
.card.has-badge .card-body {
  padding-top: 42px;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card h3 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.card h3 a {
  color: var(--text);
}
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card h3 a:hover {
  text-decoration: none;
}
.card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15.5px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 550;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status.ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.status.idea {
  color: var(--idea);
  background: var(--idea-soft);
}
.card-links {
  display: flex;
  gap: 18px;
  margin-top: auto;
  padding-top: 20px;
  font-size: 14.5px;
  font-weight: 550;
}
.card-links {
  flex-wrap: wrap;
}
.quick-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  font-weight: 400;
}
.quick-dialog[open] {
  animation: quick-in 0.18s ease-out;
}
.quick-dialog::backdrop {
  background: rgba(8, 14, 20, 0.5);
  backdrop-filter: blur(6px);
}
.quick-dialog[open]::backdrop {
  animation: quick-fade 0.18s ease-out;
}
@keyframes quick-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}
@keyframes quick-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .quick-dialog[open],
  .quick-dialog[open]::backdrop {
    animation: none;
  }
}
.quick-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quick-head picture {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
}
.quick-head img {
  max-width: 100%;
  height: auto;
  max-height: 48px;
}
.quick-head h4 {
  flex: 1;
  margin: 0;
  font-size: 17px;
}
.quick-cmd {
  position: relative;
  margin-top: 16px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
}
.quick-cmd pre {
  margin: 0;
  padding: 12px 52px 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.quick-cmd .icon-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--bg-sunken);
}
.quick-dialog p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.quick-dialog p a {
  color: var(--accent-text);
}
.card-links a {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-links svg {
  width: 15px;
  height: 15px;
}

/* Get started */
.install {
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.install-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  transition: background-color 0.2s ease;
}
.install-row:first-child {
  border-top: 0;
}
.install-row:hover {
  background: color-mix(in srgb, var(--accent-soft) 50%, transparent);
}
.install-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15.5px;
}
.install-name small {
  display: block;
  color: var(--faint);
  font-weight: 500;
  font-size: 13px;
}
.install-name .ficon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
}
.install-name .ficon svg {
  width: 18px;
  height: 18px;
}
.cmd {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 0 6px 0 14px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13.5px;
}
.cmd code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  color: var(--text);
  background: none;
  padding: 0;
  font-size: inherit;
}
.cmd code::-webkit-scrollbar {
  display: none;
}
.cmd code::before {
  content: "$ ";
  color: var(--faint);
}
.cmd .icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
}
.cmd .icon-btn svg {
  width: 15px;
  height: 15px;
}
.icon-btn.copied {
  color: var(--ok);
}
.install-row > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.install-row > a svg {
  width: 15px;
  height: 15px;
}

.media-caption {
  position: absolute;
  right: 14px;
  top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: #e6f2f7;
  background: rgba(5, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: 7px;
}
.card-media.art picture {
  display: contents;
}
@media (max-width: 760px) {
  .cmd {
    font-size: 12.5px;
    padding-left: 12px;
  }
  .cmd code {
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
}

/* Full logo in the hero. The badge is black on white in both themes, so it
   sits on a teal glow rather than being inverted. */
.hero {
  padding-top: 64px;
}
.hero .release-pill {
  margin-bottom: 30px;
}
.hero .hero-mark {
  width: 196px;
  height: 188px;
  margin: 0 auto 6px;
}
.hero-mark::before {
  inset: -60px;
}
.hero-mark .orbit {
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
}
.hero-mark .orbit.inner {
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
}
.hero-mark img {
  filter: drop-shadow(0 0 1px hsla(192, 90%, 45%, 0.5)) drop-shadow(0 0 28px var(--accent-glow)) drop-shadow(0 20px 36px rgba(0, 20, 30, 0.28));
}
.hero h1.hero-title {
  max-width: 21ch;
  margin: 40px auto 0;
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-wrap: balance;
  padding-bottom: 0.08em;
}
.hero-title .accent {
  background: linear-gradient(100deg, var(--accent-text), color-mix(in srgb, var(--accent-text) 55%, var(--text)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  max-width: 54ch;
  margin-top: 20px;
  font-size: clamp(17px, 1.9vw, 20px);
  text-wrap: balance;
}
@media (max-width: 760px) {
  .hero {
    padding-top: 48px;
  }
  .hero .release-pill {
    margin-bottom: 26px;
  }
  .hero .hero-mark {
    width: 156px;
    height: 149px;
  }
  .hero-mark::before {
    inset: -46px;
  }
  .hero-mark .orbit {
    inset: -16px;
    width: calc(100% + 32px);
    height: calc(100% + 32px);
  }
  .hero-mark .orbit.inner {
    inset: -7px;
    width: calc(100% + 14px);
    height: calc(100% + 14px);
  }
  .hero h1.hero-title {
    margin-top: 30px;
  }
  .hero .lede {
    margin-top: 16px;
  }
}

/* How Felix is different. Without JS, or with reduced motion, every element
   sits in its static state, which tells the whole story; home.js adds the
   classes that run the animations. */
.differ-fig {
  margin: 0;
}
.differ-fig + .differ-fig {
  margin-top: 64px;
}
.differ-fig figcaption {
  margin-top: 18px;
  max-width: 68ch;
  color: var(--muted);
  font-size: 15.5px;
}

/* Stack collapse */
.collapse {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
}
.collapse-arrow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 30px;
  border-radius: 50%;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.collapse-arrow svg {
  width: 18px;
  height: 18px;
}
.sc text {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
}
.sc .app rect {
  fill: var(--bg-sunken);
  stroke: var(--line-strong);
}
.sc .w0, .sc .b0 { --wc: hsl(32, 50%, 52%); }
.sc .w1, .sc .b1 { --wc: hsl(268, 32%, 62%); }
.sc .w2, .sc .b2 { --wc: hsl(152, 32%, 45%); }
.sc .w3, .sc .b3 { --wc: hsl(346, 42%, 58%); }
.sc .wire path {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke: var(--wc);
  stroke-width: 1.25;
}
.sc .wire circle,
.sc .bar {
  fill: var(--wc);
}
.sc .bx {
  fill: var(--bg-sunken);
  stroke: var(--line-strong);
}
.sc text.bs,
.sc text.fs {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  fill: var(--faint);
}
.sc .lock {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.sc .lock.acc {
  stroke: var(--accent-text);
}
.sc .halo {
  fill: var(--accent);
  opacity: 0.28;
}
.sc .fx {
  fill: color-mix(in srgb, var(--accent) 7%, var(--bg-raised));
  stroke: color-mix(in srgb, var(--accent) 70%, transparent);
}
.sc text.ft {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sc text.fa {
  font-size: 12px;
}
.sc .lc {
  fill: var(--accent);
  fill-opacity: calc(0.08 + var(--i) * 0.035);
  stroke: color-mix(in srgb, var(--accent) 45%, transparent);
}
.sc .chp rect {
  fill: var(--bg-raised);
  stroke: color-mix(in srgb, var(--accent) 45%, transparent);
}
.sc .chp text {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  fill: var(--accent-text);
}
.sc .sep {
  stroke: var(--line-strong);
}
.sc .link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-dasharray: 1;
}
.sc .link-end {
  fill: var(--accent);
}
.sc .from {
  visibility: hidden;
}
.sc .wire {
  transform-box: view-box;
  transform-origin: 0 150px;
}
.sc .box,
.sc .to {
  transform-box: fill-box;
  transform-origin: center;
}
/* Armed: the after panel starts as a copy of the usual stack. */
.collapse.armed .after .from {
  visibility: visible;
}
.collapse.armed .after .to {
  opacity: 0;
  transform: scale(0.94);
}
.collapse.armed .after .lc,
.collapse.armed .after .link-end {
  opacity: 0;
}
.collapse.armed .after .chp {
  opacity: 0;
  transform: translateY(5px);
}
.collapse.armed .after .link {
  stroke-dashoffset: 1;
}
/* Go: the wires fold into one line and the four boxes merge into the log. */
.collapse.go .after .wire {
  opacity: 0;
  transform: scaleY(0);
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1) calc(0.2s + var(--i) * 0.08s), opacity 0.4s ease calc(0.8s + var(--i) * 0.08s);
}
.collapse.go .after .box {
  opacity: 0;
  transform: translate(-20px, var(--dy)) scale(0.45);
  transition: transform 1s cubic-bezier(0.7, 0, 0.25, 1) calc(0.4s + var(--i) * 0.09s), opacity 0.35s ease calc(1s + var(--i) * 0.09s);
}
.collapse.go .after .to {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease 1.15s, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 1.15s;
}
.collapse.go .after .halo {
  animation: sc-pulse 2.2s ease 1.2s both;
}
.collapse.go .after .lc {
  opacity: 1;
  transition: opacity 0.3s ease calc(1.35s + var(--i) * 0.045s);
}
.collapse.go .after .chp {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease calc(1.6s + var(--i) * 0.09s), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) calc(1.6s + var(--i) * 0.09s);
}
.collapse.go .after .link {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.35, 1) 1s;
}
.collapse.go .after .link-end {
  opacity: 1;
  transition: opacity 0.3s ease 1.7s;
}
@keyframes sc-pulse {
  0% { opacity: 0; }
  40% { opacity: 0.6; }
  100% { opacity: 0.28; }
}

/* Slow-subscriber isolation */
.iso-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 18px;
}
.stage.mini {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
}
.mini-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.mini-cap svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--warn);
}
.iso-svg .lane {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.25;
}
.iso-svg .jam-tint,
.iso-svg .cut-tint {
  stroke: var(--warn);
  stroke-width: 2;
}
.iso-svg .cap {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--faint);
}
.iso-svg .s0 {
  stop-color: var(--accent);
  stop-opacity: 0;
}
.iso-svg .s1 {
  stop-color: var(--accent);
  stop-opacity: 0.6;
}
.iso-svg .dt {
  fill: url(#iso-tail);
}
.iso-svg .dh {
  fill: var(--accent);
  opacity: 0.16;
}
.iso-svg .dc {
  fill: var(--accent);
}
.iso-svg .dw {
  fill: var(--warn);
  opacity: 0;
}
.iso-svg .bk {
  fill: var(--bg-sunken);
  stroke: var(--line-strong);
}
.iso-svg .meter {
  fill: color-mix(in srgb, var(--accent) 55%, transparent);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.iso-svg .m-ab {
  transform: scaleY(0.25);
}
.iso-svg .m-c {
  fill: color-mix(in srgb, var(--warn) 65%, transparent);
}
.iso-svg .tick {
  stroke: var(--bg-raised);
  stroke-width: 1.5;
}
.iso-svg .bk-full {
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.5;
}
.iso-svg .flash {
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.iso-svg .cdot {
  opacity: var(--o, 0);
  transform: translateX(var(--x, 0px));
  transform-box: fill-box;
  transform-origin: 75% 50%;
}
.iso-svg .pc {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.25;
}
.iso-svg .ph {
  fill: var(--accent);
  opacity: 0.08;
}
.iso-svg .pi {
  fill: var(--accent-text);
}
.iso-svg .sub circle {
  fill: var(--bg-sunken);
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
}
.iso-svg .sub text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  fill: var(--text);
}
.iso-svg .slow circle,
.iso-svg .slow-ring {
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
}
.iso-svg .slow text {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--warn);
}
.iso-svg .pub-warn {
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.5;
}
.iso-svg .backlog {
  fill: var(--warn);
}
.iso-svg .snap {
  transform-box: view-box;
  transform-origin: 356px 92px;
  transform: rotate(-9deg);
}
.iso-svg .cut-x {
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.75;
  stroke-linecap: round;
}
.iso-svg .sub-cut {
  opacity: 0.35;
}
.iso-svg .jam .dc {
  fill: var(--warn);
}
.iso-svg .jam .dh {
  fill: var(--warn);
  opacity: 0.18;
}
.iso-svg .cap.warn {
  fill: var(--warn);
}
.iso-svg .starved {
  opacity: 0.45;
}
.iso-svg .sub-cut circle {
  stroke-dasharray: 2 3;
}
.iso-gap {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.iso-gap .gap-viz span {
  min-width: 32px;
  height: 28px;
  font-size: 12.5px;
}
.iso-gap .gap-viz .miss {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 60%, transparent);
  text-decoration: line-through;
  opacity: 1;
}
.iso-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.iso-note {
  display: grid;
}
.iso-note > span {
  grid-area: 1 / 1;
}
.iso-note .s0,
.iso-note .s1 {
  opacity: 0;
}
.iso-note .s1,
.iso-note b {
  color: var(--warn);
  font-weight: 500;
}

/* Live isolation loop. One 16 s cycle; a record leaves every 0.8 s and takes
   2.4 s to reach its subscriber's queue. */
.iso.live .flow {
  animation: iso-flow 0.8s linear infinite;
}
.iso.live .cdot {
  animation: iso-c 16s linear var(--d) infinite;
}
.iso.live .cdot.drop {
  animation-name: iso-drop;
}
.iso.live .cdot .dw {
  animation: iso-warm 16s linear var(--d) infinite;
}
.iso.live .flash {
  animation: iso-flash 16s ease-out var(--d) infinite;
}
.iso.live .m-c {
  animation: iso-fill 16s linear infinite;
}
.iso.live .bk-full {
  animation: iso-full 16s linear infinite;
}
.iso.live .slow {
  animation: iso-slow 16s linear infinite;
}
/* Elsewhere: the bad state holds in every frame; only these move. */
.iso.live .jam {
  animation: else-creep 1.6s linear infinite;
}
.iso.live .pub-warn,
.iso.live .backlog {
  animation: else-pulse 1.6s ease-in-out infinite;
}
.iso.live .backlog.k1 { animation-delay: -0.4s; }
.iso.live .backlog.k2 { animation-delay: -0.8s; }
.iso.live .cflow {
  animation: iso-flow 0.8s linear infinite;
}
.iso.live .gd,
.iso.live .s2 {
  animation: iso-s2 16s linear infinite;
}
.iso.live .s0 {
  animation: iso-s0 16s linear infinite;
}
.iso.live .s1 {
  animation: iso-s1 16s linear infinite;
}
/* Off screen, nothing runs. */
.iso.live:not(.play) * {
  animation-play-state: paused !important;
}

@keyframes iso-flow {
  to { transform: translateX(84px); }
}
@keyframes iso-c {
  0% { transform: translateX(0); opacity: 0; }
  1.5% { opacity: 1; }
  15% { transform: translateX(252px); opacity: 1; }
  16.5%,
  100% { transform: translateX(256px); opacity: 0; }
}
@keyframes iso-drop {
  0% { transform: translateX(0) scale(1); opacity: 0; }
  1.5% { opacity: 1; }
  15% { transform: translateX(252px) scale(1); opacity: 1; }
  17% { transform: translateX(253px) scale(1.7); opacity: 0.75; }
  19.5%,
  100% { transform: translateX(253px) scale(2.1); opacity: 0; }
}
@keyframes iso-warm {
  0%,
  12% { opacity: 0; }
  15%,
  100% { opacity: 1; }
}
@keyframes iso-flash {
  0% { opacity: 0.95; transform: scale(0.6); }
  9%,
  100% { opacity: 0; transform: scale(2.6); }
}
@keyframes iso-fill {
  0%,
  34.5% { transform: scaleY(0); }
  35.5%,
  39.5% { transform: scaleY(0.25); }
  40.5%,
  44.5% { transform: scaleY(0.5); }
  45.5%,
  49.5% { transform: scaleY(0.75); }
  50.5%,
  72.5% { transform: scaleY(1); }
  77.5%,
  100% { transform: scaleY(0); }
}
@keyframes iso-full {
  0%,
  49.5% { opacity: 0; }
  50.5%,
  72.5% { opacity: 1; }
  74%,
  100% { opacity: 0; }
}
@keyframes iso-slow {
  0%,
  26% { opacity: 0; }
  28.5%,
  72% { opacity: 1; }
  75%,
  100% { opacity: 0; }
}
/* One sentence at a time, in step with the chips: C keeps up, C slows,
   then 41-44 dropped and the resume point, all at the first drop. */
@keyframes iso-s0 {
  0%,
  26.5% { opacity: 1; }
  28%,
  97% { opacity: 0; }
  98.5%,
  100% { opacity: 1; }
}
@keyframes iso-s1 {
  0%,
  27% { opacity: 0; }
  28.5%,
  53.5% { opacity: 1; }
  55%,
  100% { opacity: 0; }
}
@keyframes iso-s2 {
  0%,
  54.5% { opacity: 0; }
  56%,
  96% { opacity: 1; }
  98.5%,
  100% { opacity: 0; }
}
@keyframes else-creep {
  to { transform: translateX(14px); }
}
@keyframes else-pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 760px) {
  .collapse {
    grid-template-columns: minmax(0, 1fr);
  }
  .collapse-arrow {
    justify-self: center;
    margin: 0;
    transform: rotate(90deg);
  }
  .iso-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    padding: 12px;
  }
  .differ-fig + .differ-fig {
    margin-top: 48px;
  }
  /* SVG text scales with the panel, so it starts larger on a phone. */
  .sc text {
    font-size: 15px;
  }
  .sc text.bs,
  .sc text.fs {
    font-size: 12px;
  }
  .sc .chp text {
    font-size: 13px;
  }
  .iso-svg .cap,
  .iso-svg .slow text {
    font-size: 13px;
  }
  .iso-svg .sub text {
    font-size: 14px;
  }
}

/* Teasers for the other pages. Static pictures; the full figures are on those pages. */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.teaser {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.teaser-fig {
  flex: none;
  display: grid;
  align-content: center;
  min-height: 190px;
  padding: 14px 18px;
}
.teaser-fig .tz-svg {
  max-width: 340px;
  margin: 0 auto;
}
.teaser h3 {
  margin-top: 22px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.018em;
}
.teaser p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}
.teaser p code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent-text);
}
.teaser .text-link {
  margin-top: auto;
  padding-top: 18px;
}
@media (max-width: 960px) {
  .code-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .install-row {
    grid-template-columns: 1fr auto;
  }
  .install-row .cmd {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 760px) {
  .hero {
    padding: 56px 0 80px;
  }
  .hero-mark {
    width: 132px;
    height: 132px;
    margin-bottom: 30px;
  }
  .projects {
    grid-template-columns: 1fr;
  }
  .window pre {
    font-size: 12.5px;
    padding: 18px 18px 22px;
  }
  .window-bar .dots {
    display: none;
  }
  /* The tabs scroll rather than push the copy button out of the bar. */
  .window {
    min-width: 0;
  }
  .tabs {
    margin-left: 0;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .window-bar .copy {
    flex-shrink: 0;
  }
  .install-row {
    padding: 16px;
  }
  .card-media.framed {
    padding: 18px 20px 0;
  }
  .card-media.framed .media-caption {
    top: 28px;
    right: 30px;
  }
  .teaser-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .teaser {
    padding: 20px;
  }
}
@media (max-width: 420px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
  .tab {
    padding: 7px 8px;
  }
  .window-bar .copy-label {
    display: none;
  }
}

/* Phones get their own composition of the stack figure, and larger text in
   the others, so no label drops below 11px. */
.stage .sc-phone {
  display: none;
}
@media (max-width: 520px) {
  .collapse .sc:not(.sc-phone) {
    display: none;
  }
  .collapse .sc-phone {
    display: block;
  }
}
@media (max-width: 420px) {
  .iso-svg .sub text,
  .iso-svg .cap,
  .iso-svg .slow text {
    font-size: 16px;
  }
  .gateway-art .lbl {
    font-size: 16px !important;
  }
}
@media (max-width: 760px) {
  .cmd {
    height: 52px;
    padding-right: 4px;
  }
  .cmd .icon-btn {
    width: 44px;
    height: 44px;
  }
  .copy,
  .tab,
  .install-row > a,
  .card-links a,
  .release-pill {
    min-height: 44px;
  }
  .card-links a {
    display: inline-flex;
    align-items: center;
  }
}
@media (max-width: 420px) {
  .teaser {
    padding: 16px;
  }
  .teaser-fig {
    min-height: 0;
    padding: 12px 8px;
  }
}
@media (max-width: 380px) {
  .iso-svg .sub text,
  .iso-svg .cap,
  .iso-svg .slow text {
    font-size: 17px;
  }
  .gateway-art .lbl {
    font-size: 17.5px !important;
  }
}
@media (max-width: 760px) {
  .quick-cmd .icon-btn,
  .quick-close {
    width: 44px;
    height: 44px;
  }
  .card-title h3 a {
    display: inline-block;
    padding: 10px 0;
  }
}
.projects-more {
  margin-top: 28px;
  text-align: center;
}

/* Use cases: short links into the docs, one per scenario. */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.usecase {
  display: block;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.usecase:hover,
.usecase:focus-visible {
  text-decoration: none;
  border-color: var(--accent);
}
.usecase h3 {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--accent-text);
}
.usecase p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.usecase-all {
  display: inline-flex;
  margin-top: 22px;
}
@media (max-width: 900px) {
  .usecase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .usecase-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
