/* ==========================================================================
   ClickLess home page scenes
   1. Mini website cards (shared by story, marquee, deploy)
   2. Story: pinned 3D stage
   3. CMS bento
   4. Cloud console demo
   5. Versions: pinned time travel
   6. CLI
   7. Deploy
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Mini website cards
   Every dimension is in em so one card can render crisply at any size:
   set --k and the whole thing scales (font-size = 10px * k).
   -------------------------------------------------------------------------- */
.site {
  --k: 1;
  --bg: #f5f0e6;
  --fg: #171512;
  --ac: #e4572e;
  --img: linear-gradient(135deg, #f2b880, #e4572e);
  position: relative;
  width: calc(360px * var(--k));
  height: calc(232px * var(--k));
  font-size: calc(10px * var(--k));
  border-radius: 1.1em;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 2.4em 5em -1.6em rgba(0, 0, 0, 0.85);
  line-height: 1.3;
  letter-spacing: -0.01em;
  user-select: none;
}

/* Depth fog, set per frame by the story scene */
.site::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #04060c;
  opacity: var(--fog, 0);
  pointer-events: none;
}

.site-bar {
  height: 2.5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0 1.1em;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}

.site-bar i {
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
}

.site-url {
  margin-left: 0.9em;
  padding: 0.3em 1em;
  border-radius: 1em;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  font-family: var(--mono);
  font-size: 0.82em;
  opacity: 0.65;
  white-space: nowrap;
}

.site-body {
  height: calc(100% - 2.5em);
  display: flex;
  flex-direction: column;
  gap: 1.3em;
  padding: 1.5em 1.9em 1.6em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5em;
  font-size: 0.95em;
}

.site-nav b {
  margin-right: auto;
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.site-nav span {
  font-weight: 500;
  opacity: 0.6;
}

/* Skeleton links on the small cards */
.site-nav span:empty {
  width: 2.6em;
  height: 0.5em;
  border-radius: 0.3em;
  background: currentColor;
  opacity: 0.22;
}

.site-nav em {
  padding: 0.5em 1em;
  border-radius: 0.6em;
  background: var(--ac);
  color: var(--bg);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav em:empty {
  width: 5em;
  height: 1.9em;
  padding: 0;
}

.site-hero {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 1.6em;
  align-items: center;
}

.site-copy small {
  display: block;
  margin-bottom: 0.9em;
  font-family: var(--mono);
  font-size: 0.78em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}

.site-copy h6 {
  margin-bottom: 0.42em;
  font-size: 2.35em;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.site.is-serif .site-copy h6 {
  font-family: var(--serif);
  font-size: 3em;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

/* The large hero / deploy card shows real copy, so the headline is sized to
   hold two lines beside the image. */
.site.is-rich .site-copy h6 {
  font-size: 2.6em;
  margin-bottom: 0.36em;
}

.site-copy p {
  max-width: 24em;
  font-size: 1em;
  opacity: 0.66;
}

.site-copy p:empty {
  height: 0.5em;
  margin-bottom: 0.5em;
  border-radius: 0.3em;
  background: currentColor;
  opacity: 0.16;
}

.site-copy p:empty + p:empty {
  width: 62%;
}

.site-copy u {
  display: inline-block;
  margin-top: 1.1em;
  padding: 0.62em 1.2em;
  border-radius: 0.6em;
  background: var(--ac);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.site-copy u:empty {
  display: block;
  width: 6.4em;
  height: 2.1em;
  padding: 0;
}

.site-img {
  position: relative;
  height: 100%;
  min-height: 8em;
  border-radius: 0.9em;
  background: var(--img);
  overflow: hidden;
}

/* A little abstract composition so the "photo" is not a flat gradient */
.site-img::before,
.site-img::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.site-img::before {
  width: 62%;
  aspect-ratio: 1;
  right: -14%;
  top: -18%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
}

.site-img::after {
  width: 90%;
  aspect-ratio: 1;
  left: -30%;
  bottom: -60%;
  background: color-mix(in srgb, var(--fg) 26%, transparent);
}

.site-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9em;
}

.site-row i {
  display: block;
  padding: 0.8em 1em;
  border-radius: 0.7em;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  font-style: normal;
  font-size: 0.9em;
  font-weight: 600;
}

.site-row i:empty {
  height: 2.6em;
}

.site-row i span {
  display: block;
  margin-top: 0.2em;
  font-weight: 400;
  opacity: 0.55;
}

/* Layout variants */
.site.is-center .site-hero {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 1em;
  text-align: center;
}

.site.is-center .site-copy p:empty,
.site.is-center .site-copy u:empty {
  margin-left: auto;
  margin-right: auto;
}

.site.is-center .site-copy p:empty + p:empty {
  display: none;
}

.site.is-center .site-img {
  min-height: 4em;
}

.site.is-cover .site-hero {
  position: relative;
  grid-template-columns: 1fr;
  padding: 1.4em;
  border-radius: 0.9em;
  overflow: hidden;
  color: #fff;
}

.site.is-cover .site-img {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.site.is-cover .site-copy {
  position: relative;
  z-index: 1;
  max-width: 62%;
}

.site.is-cover .site-copy u:empty {
  background: #fff;
}

/* "Generating" intro on the hero card: blocks cascade in after a scan line */
.site .bld {
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--b, 0) * 95ms + 250ms);
}

.site.is-building .bld {
  opacity: 0;
  transform: translate3d(0, 1.2em, 0);
}

.site.is-scanning::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: 38%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ac) 28%, transparent) 70%, color-mix(in srgb, var(--ac) 70%, transparent));
  border-bottom: 1px solid var(--ac);
  animation: site-scan 1.5s var(--ease-in-out) 0.1s both;
  pointer-events: none;
}

@keyframes site-scan {
  from { transform: translateY(-100%); opacity: 1; }
  80% { opacity: 1; }
  to { transform: translateY(270%); opacity: 0; }
}

/* --------------------------------------------------------------------------
   2. Story
   -------------------------------------------------------------------------- */
.story {
  position: relative;
  height: 540vh;
}

.story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ink-0);
}

.story-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 108%, rgba(124, 58, 237, 0.34), transparent 65%),
    radial-gradient(ellipse 45% 40% at 12% 8%, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(ellipse 40% 36% at 92% 22%, rgba(139, 92, 246, 0.14), transparent 70%);
}

.story-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 40%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 40%, #000, transparent 78%);
}

.story-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-scene {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.story-world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Darkens the centre behind the question text */
.story-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 52% 40% at 50% 50%, rgba(4, 6, 12, 0.82), rgba(4, 6, 12, 0.35) 55%, transparent 78%);
  opacity: var(--v, 0);
  pointer-events: none;
}

/* World-positioned wrapper around a .site */
.sc {
  --k: 1;
  position: absolute;
  left: 0;
  top: 0;
  width: calc(360px * var(--k));
  height: calc(232px * var(--k));
  margin: calc(-116px * var(--k)) 0 0 calc(-180px * var(--k));
  will-change: transform, opacity;
}

.sc .site {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
}

.sc.is-hero .site {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 5em 12em -3em rgba(124, 58, 237, 0.7),
    0 2.4em 5em -1.6em rgba(0, 0, 0, 0.85);
}

/* Status tags pinned to a few cards. Inverse-scaled so they read at a constant
   size on screen regardless of how far away the card is. */
.sc-tag {
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.94);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.8);
  color: var(--amber-300);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  transform-origin: 100% 0;
  transform: translate(12%, -55%) scale(var(--inv, 1));
  opacity: var(--tag, 0);
  transition: border-color 0.4s ease, color 0.4s ease;
}

.sc.tag-l .sc-tag {
  right: auto;
  left: 0;
  transform-origin: 0 0;
  transform: translate(-5%, -55%) scale(var(--inv, 1));
}

.sc-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.sc-tag .ts {
  display: none;
}

.sc.is-solved .sc-tag {
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--green-300);
  animation: tag-flip 0.6s var(--ease-out);
}

.sc.is-solved .sc-tag .tp {
  display: none;
}

.sc.is-solved .sc-tag .ts {
  display: inline;
}

@keyframes tag-flip {
  0% { filter: brightness(2.4); }
  100% { filter: none; }
}

.sc-label {
  position: absolute;
  left: 0;
  top: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transform-origin: 0 0;
  transform: scale(var(--inv, 1));
  opacity: var(--label, 0);
}

.sc-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.sc-label small {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
}

/* Console frame the cards land in */
.story-frame {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 20, 36, 0.92), rgba(8, 11, 21, 0.92));
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.9), 0 0 120px -30px rgba(124, 58, 237, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  will-change: transform, opacity;
}

.story-frame-bar {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.story-frame-bar img {
  height: 19px;
  width: auto;
}

.story-frame-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.story-frame-bar .icon {
  width: 12px;
  height: 12px;
}

.story-frame-bar .sf-count {
  margin-left: auto;
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--green-300);
  font-family: var(--mono);
  font-size: 11px;
}

/* ----- Beats (copy laid over the stage) ----- */
.beat {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--page-pad);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}

.beat.is-on {
  visibility: visible;
}

.beat-hero {
  justify-content: flex-start;
  padding-top: calc(var(--nav-h) + clamp(14px, 5.5vh, 64px));
  opacity: 1;
  visibility: visible;
}

.beat-hero.is-live > * {
  pointer-events: auto;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 12px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.09);
  color: var(--violet-200);
  font-size: 0.83rem;
  font-weight: 500;
  animation: rise-in 0.9s var(--ease-out) 0.05s both;
}

.hero-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(14px, 2.6vh, 30px);
  font-weight: 500;
}

.hero-line1 {
  font-size: clamp(1.3rem, 2.9vw, 2.6rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: #e7ebf3;
  text-wrap: balance;
}

.hero-line1 .swi {
  transition-duration: 1.1s;
  transition-delay: calc(var(--i) * 60ms + 0.15s);
}

.hero-line2 {
  margin-top: 0.02em;
  padding: 0 0.12em 0.2em;
  font-size: clamp(4.4rem, min(15.5vw, 25vh), 13.5rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  background: linear-gradient(175deg, #ffffff 30%, #c4b5fd 85%, #8b5cf6 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: now-what 1.3s var(--ease-out) 0.95s both;
}

@keyframes now-what {
  from { opacity: 0; transform: translate3d(0, 0.18em, 0) scale(0.92); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: none; }
}

.hero-sub {
  max-width: 580px;
  margin-top: clamp(8px, 1.6vh, 20px);
  font-size: clamp(0.98rem, 1.25vw, 1.15rem);
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
  animation: rise-in 1s var(--ease-out) 1.5s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(16px, 2.8vh, 30px);
  animation: rise-in 1s var(--ease-out) 1.65s both;
}

.hero-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-3);
  animation: rise-in 1s var(--ease-out) 1.8s both;
}

/* Question beats */
.beat-num {
  margin-bottom: clamp(14px, 2.4vh, 26px);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--violet-300);
}

.beat-text {
  max-width: 15ch;
  font-size: clamp(2.5rem, 7.2vw, 6.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.beat-text em {
  font-size: 1.1em;
  letter-spacing: -0.02em;
  color: var(--violet-300);
  padding: 0 0.04em 0.08em 0;
  margin-bottom: -0.08em;
}

.beat-sub {
  max-width: 34ch;
  margin-top: clamp(16px, 2.6vh, 28px);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  color: var(--text-2);
  text-wrap: balance;
}

/* The scroll scrub never opens the mask. A little clip margin lets descenders
   paint without growing the line, and stays inside the 112% rise. */
.beat-text .sw {
  overflow: clip;
  overflow-clip-margin: 0.12em;
}

/* Words are scrubbed in by scroll: --t runs 0..1 across the beat's entrance */
.beat:not(.beat-hero) .sw > .swi {
  transition: none;
  transform: translate3d(0, calc((1 - clamp(0, var(--t, 0) * (var(--n, 6) + 3) - var(--i, 0), 1)) * 112%), 0)
    rotate(calc((1 - clamp(0, var(--t, 0) * (var(--n, 6) + 3) - var(--i, 0), 1)) * 5deg));
}

/* The supporting line waits for the headline to finish landing */
html.js .beat:not(.beat-hero) .beat-sub {
  opacity: clamp(0, var(--t, 0) * 4 - 2.8, 1);
  transform: translate3d(0, calc((1 - clamp(0, var(--t, 0) * 4 - 2.8, 1)) * 14px), 0);
}

html.js .story.is-static .beat .beat-sub {
  opacity: 1;
  transform: none;
}

.beat-arrive {
  justify-content: flex-start;
  padding-top: calc(var(--nav-h) + clamp(10px, 4vh, 48px));
}

.beat-arrive .beat-text {
  max-width: 18ch;
  font-size: clamp(2.1rem, 5.4vw, 4.6rem);
}

.beat-arrive .beat-text em .swi {
  background: linear-gradient(100deg, #bfdbfe, #c4b5fd 55%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.beat-arrive .beat-sub {
  max-width: 46ch;
  margin-top: clamp(10px, 1.6vh, 18px);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
}

.scroll-cue {
  position: absolute;
  left: var(--page-pad);
  bottom: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rise-in 1s var(--ease-out) 2.2s both;
}

.scroll-cue.is-off {
  animation: cue-out 0.4s ease both;
}

@keyframes cue-out {
  to { opacity: 0; }
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.scroll-cue i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--violet-300);
  animation: cue 2s var(--ease-in-out) infinite;
}

@keyframes cue {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

/* ----- Static story: no JS, or reduced motion. Plain stacked content. ----- */
html:not(.js) .story,
.story.is-static {
  height: auto;
}

html:not(.js) .story-stage,
.story.is-static .story-stage {
  position: relative;
  height: auto;
  padding-bottom: 72px;
  /* Column flex so the site grid can be ordered after the copy */
  display: flex;
  flex-direction: column;
}

html:not(.js) .beat,
.story.is-static .beat {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  padding-top: 72px;
}

html:not(.js) .beat-hero,
.story.is-static .beat-hero {
  padding-top: calc(var(--nav-h) + 48px);
}

html:not(.js) .beat .sw > .swi,
.story.is-static .beat .sw > .swi {
  transform: none;
}

html:not(.js) .story-scene,
html:not(.js) .story-dust,
html:not(.js) .scroll-cue,
.story.is-static .story-dust,
.story.is-static .scroll-cue {
  display: none;
}

.story.is-static .story-scene {
  order: 10;
  position: relative;
  inset: auto;
  perspective: none;
  width: 100%;
  margin: 56px auto 0;
  padding: 0 var(--page-pad);
  max-width: 1100px;
}

.story.is-static .story-world {
  position: static;
  width: auto;
  height: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.story.is-static .sc {
  --k: 1 !important;
  position: relative;
  width: auto;
  height: auto;
  margin: 0;
  aspect-ratio: 360 / 232;
  container-type: inline-size;
}

.story.is-static .sc .site {
  font-size: 2.78cqw;
}

.story.is-static .sc-tag,
.story.is-static .sc-label,
.story.is-static .story-frame {
  display: none;
}

/* --------------------------------------------------------------------------
   3. CMS bento
   -------------------------------------------------------------------------- */
.section-tight {
  padding: clamp(40px, 6vw, 88px) 0;
}

.cms {
  background:
    radial-gradient(ellipse 50% 30% at 85% 0%, rgba(59, 130, 246, 0.1), transparent 70%),
    linear-gradient(180deg, var(--ink-0), var(--ink-1) 30%, var(--ink-0));
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 400px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  isolation: isolate;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

html.js .bento-card[data-reveal] {
  transition: opacity 0.9s var(--ease-out) var(--d, 0s), translate 1.1s var(--ease-out) var(--d, 0s),
    transform 0.6s var(--ease-out), border-color 0.4s ease;
}

.bento-card.is-tilting {
  border-color: var(--line-3);
  transition-duration: 0.9s, 1.1s, 0.12s, 0.4s !important;
}

/* Pointer-following glow */
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 0%), rgba(139, 92, 246, 0.16), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bento-card.is-tilting::before {
  opacity: 1;
}

.b-anatomy { grid-column: span 7; flex-direction: row; align-items: stretch; }
.b-edit { grid-column: span 5; }
.b-own,
.b-scale,
.b-html { grid-column: span 4; }

.bento-copy {
  position: relative;
  z-index: 2;
}

.b-anatomy .bento-copy {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
}

.bento-q {
  display: block;
  margin-bottom: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-300);
}

.bento-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.bento-card p {
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.type-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.type-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.type-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}

/* ----- Anatomy: exploded isometric layers ----- */
.anatomy {
  position: relative;
  flex: 1;
  min-height: 320px;
  display: grid;
  place-items: center;
  perspective: 1600px;
}

.anatomy-stack {
  --gap: 6px;
  position: relative;
  width: 200px;
  height: 136px;
  /* Leaves room on the right for the billboard labels */
  margin-right: 150px;
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-40deg) translateZ(calc(var(--gap) * -1.5));
  transition: transform 1.6s var(--ease-out);
}

.anatomy.is-open .anatomy-stack {
  --gap: 56px;
}

.b-anatomy:hover .anatomy.is-open .anatomy-stack {
  --gap: 70px;
}

.layer {
  --c: var(--type-partial);
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 13%, rgba(8, 12, 22, 0.9));
  box-shadow: 0 0 44px -10px color-mix(in srgb, var(--c) 70%, transparent);
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--n) * var(--gap)));
  transition: transform 1.6s var(--ease-out);
  transition-delay: calc(var(--n) * 70ms);
}

.l-page { --c: var(--type-page); }
.l-collection { --c: var(--type-collection); }

.layer-face {
  position: absolute;
  inset: 0;
  padding: 14px;
}

.layer-face > * {
  display: block;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 55%, transparent);
}

.lf-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lf-header b { width: 44px; height: 10px; margin-right: auto; opacity: 0.95; }
.lf-header i { width: 20px; height: 6px; margin-top: 2px; opacity: 0.5; }
.lf-header u { width: 34px; height: 12px; margin-top: -1px; border-radius: 5px; }

.lf-page b { width: 62%; height: 16px; margin-bottom: 10px; }
.lf-page i { height: 6px; margin-bottom: 7px; opacity: 0.45; }
.lf-page i + i { width: 74%; }
.lf-page u { width: 54px; height: 16px; margin-top: 12px; border-radius: 6px; }

.lf-coll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: center;
}

.lf-coll i { aspect-ratio: 1 / 1.15; border-radius: 7px; opacity: 0.55; }

.lf-footer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.lf-footer i { flex: 1; height: 22px; opacity: 0.4; }

/* Billboard: undo the stack rotation so labels face the viewer */
.layer-tag {
  position: absolute;
  left: 100%;
  top: 100%;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.92);
  color: color-mix(in srgb, var(--c) 70%, #fff);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  transform-origin: 0 0;
  transform: rotateZ(40deg) rotateX(-58deg) translate(16px, -50%);
  opacity: 0;
  transition: opacity 0.8s ease;
  transition-delay: calc(var(--n) * 70ms + 0.5s);
}

.layer-tag::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: color-mix(in srgb, var(--c) 60%, transparent);
}

.anatomy.is-open .layer-tag {
  opacity: 1;
}

/* ----- Entry editor ----- */
.entry {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(6, 9, 18, 0.72);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
}

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--text-2);
}

.entry-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.entry-crumb i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--type-collection);
}

.entry-crumb b {
  color: var(--text-3);
  font-weight: 400;
}

.entry-saved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-300);
  font-size: 0.74rem;
  font-weight: 500;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.5s var(--ease-spring);
}

.entry-saved .icon {
  width: 11px;
  height: 11px;
}

.entry.is-saved .entry-saved {
  opacity: 1;
  transform: none;
}

.entry-field {
  margin-bottom: 10px;
}

.entry-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 500;
}

.entry-input {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.entry-input.is-focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.entry-input.is-focus span::after,
.ai-composer.is-typing::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 1.05em;
  /* Zero advance width, so the caret can never wrap onto a line of its own */
  margin-right: -1.5px;
  border-left: 1.5px solid #fff;
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}

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

.entry-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.entry-toggle {
  width: 36px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.entry-toggle i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.4s var(--ease-spring);
}

.entry-toggle.is-on {
  background: var(--violet);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5);
}

.entry-toggle.is-on i {
  transform: translateX(16px);
}

.entry-toggle-label {
  color: var(--text-2);
  font-size: 0.8rem;
}

.entry-save {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.entry-save.is-press {
  transform: scale(0.94);
  filter: brightness(1.2);
}

/* ----- Handoff ----- */
.handoff {
  position: relative;
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding-top: 26px;
}

.handoff-org {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.handoff-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  letter-spacing: 0;
}

.handoff-org.is-target .handoff-avatar {
  animation: handoff-target 6s var(--ease-out) infinite;
}

.handoff-name {
  color: var(--text-3);
  font-size: 0.76rem;
}

.handoff-track {
  position: relative;
  height: 54px;
  margin-bottom: 26px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px) 0 50% / 100% 1px no-repeat;
}

.handoff-site {
  position: absolute;
  left: 0;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 9px;
  background: #121829;
  box-shadow: 0 8px 24px -6px rgba(124, 58, 237, 0.6);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  animation: handoff-move 6s var(--ease-in-out) infinite;
}

.handoff-site .icon {
  width: 11px;
  height: 11px;
  color: var(--violet-300);
}

.handoff-ok {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #04130d;
  animation: handoff-ok 6s var(--ease-spring) infinite;
}

.handoff-ok .icon {
  width: 11px;
  height: 11px;
}

@keyframes handoff-move {
  0%, 12% { left: 0; transform: translate(0, -50%); opacity: 1; }
  34% { transform: translate(-50%, -110%); }
  56%, 86% { left: 100%; transform: translate(-100%, -50%); opacity: 1; }
  94%, 100% { left: 100%; transform: translate(-100%, -50%); opacity: 0; }
}

@keyframes handoff-ok {
  0%, 56% { transform: scale(0); }
  64%, 90% { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes handoff-target {
  0%, 56% { border-color: var(--line-2); box-shadow: none; }
  64%, 88% { border-color: rgba(16, 185, 129, 0.7); box-shadow: 0 0 28px -4px rgba(16, 185, 129, 0.6); }
  100% { border-color: var(--line-2); box-shadow: none; }
}

html.js .b-own:not(.is-in) * {
  animation-play-state: paused;
}

/* ----- Scale marquee ----- */
.marquee {
  margin: auto calc(clamp(22px, 2.4vw, 34px) * -1) 0;
  display: grid;
  gap: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.marquee-row {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: marquee 46s linear infinite;
}

.marquee-row.is-reverse {
  animation-direction: reverse;
  animation-duration: 58s;
}

.marquee .site {
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@keyframes marquee {
  to { transform: translate3d(-50%, 0, 0); }
}

/* ----- Code card ----- */
.codecard {
  margin-top: auto;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(6, 9, 18, 0.72);
  overflow: hidden;
}

.codecard-status {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.codecard-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.codecard-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.codecard-status .is-amber { background: var(--amber); }
.codecard-status .is-green { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.2s ease-in-out infinite; }

.codecard pre {
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.75;
  color: var(--text);
  overflow: hidden;
  white-space: pre;
}

.c-tag { color: var(--violet-300); }
.c-loop { color: #fdba74; }
.c-var { color: var(--blue-300); }
.c-dim { color: var(--text-3); }

.cms-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 34px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.95rem;
}

.cms-strip li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.cms-strip .icon {
  width: 14px;
  height: 14px;
  color: var(--violet-300);
}

/* --------------------------------------------------------------------------
   4. Cloud console demo
   -------------------------------------------------------------------------- */
.console-sec {
  overflow: hidden;
}

.demo-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: -20px 0 36px;
}

.demo-steps li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.demo-steps li span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.7rem;
  transition: background 0.4s ease, color 0.4s ease;
}

.demo-steps li.is-on {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.12);
  color: var(--text);
}

.demo-steps li.is-on span {
  background: var(--violet);
  color: #fff;
}

.demo-steps li.is-done {
  color: var(--text-2);
}

.demo-steps li.is-done span {
  background: rgba(16, 185, 129, 0.18);
  color: var(--green-300);
}

.console-wrap {
  position: relative;
  perspective: 2200px;
}

.console-glow {
  position: absolute;
  inset: 8% -6% -10%;
  background: radial-gradient(ellipse 60% 55% at 50% 40%, rgba(124, 58, 237, 0.34), transparent 70%);
  filter: blur(40px);
}

.console {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: #090d19;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform-origin: 50% 0%;
  transform: rotateX(var(--tilt, 0deg)) scale(var(--zoom, 1));
  will-change: transform;
}

.cs-top {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 6, 12, 0.55);
}

.cs-logo {
  height: 20px;
  width: auto;
  margin-right: 4px;
}

.cs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 0.78rem;
  white-space: nowrap;
}

.cs-pill .icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.cs-selectors {
  display: flex;
  gap: 8px;
  margin: 0 auto;
  min-width: 0;
}

.cs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-deploy {
  border: none;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.cs-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad);
  font-size: 0.68rem;
  font-weight: 600;
}

.cs-body {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  height: clamp(540px, 66vh, 660px);
}

.cs-side {
  border-right: 1px solid var(--line);
  background: rgba(4, 6, 12, 0.35);
}

.cs-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.cs-tabs span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  border-radius: 7px;
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 500;
}

.cs-tabs .icon {
  width: 12px;
  height: 12px;
}

.cs-tabs .on {
  background: rgba(139, 92, 246, 0.14);
  color: var(--violet-300);
}

.cs-list {
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.cs-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.cs-list li .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--text-3);
}

.cs-list li.on {
  border-color: rgba(139, 92, 246, 0.32);
  background: rgba(139, 92, 246, 0.1);
}

.cs-list li.on .icon {
  color: var(--violet-300);
}

.cs-list li.is-flash {
  animation: row-flash 1.6s ease;
}

@keyframes row-flash {
  0%, 60% { background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.5); }
}

.cs-list b {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
}

.cs-list small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.68rem;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.dot.is-draft {
  background: var(--amber);
  box-shadow: none;
}

.cs-main {
  --panel-w: 376px;
  position: relative;
  /* The page preview stops where the floating AI panel begins */
  padding: 18px calc(var(--panel-w) + 32px) 18px 18px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(59, 130, 246, 0.08), transparent 60%);
  overflow: hidden;
}

.cs-browser {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.cs-browser-bar,
.launch-bar,
.terminal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: #0d1322;
  border-bottom: 1px solid var(--line);
}

.cs-browser-bar {
  position: relative;
  z-index: 1;
  flex: none;
  height: 36px;
}

.lights {
  display: inline-flex;
  gap: 6px;
}

.lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.cs-url,
.launch-url {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.cs-url .icon,
.launch-url .icon {
  width: 11px;
  height: 11px;
  color: var(--green);
}

/* ----- Mock page (Riverside Studio). em-based so snapshots can reuse it. ----- */
.pg {
  flex: 1;
  min-height: 0;
  background: #f5f0e6;
  color: #171512;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  overflow: hidden;
  transition: transform 1s var(--ease-out);
}

.pg-nav {
  display: flex;
  align-items: center;
  gap: 1.6em;
  padding: 1.1em 2em;
  border-bottom: 1px solid rgba(23, 21, 18, 0.08);
  font-size: 0.95em;
}

.pg-nav b {
  margin-right: auto;
  font-size: 1.15em;
  letter-spacing: -0.03em;
}

.pg-nav span {
  opacity: 0.55;
}

.pg-nav span.on {
  opacity: 1;
  font-weight: 600;
}

.pg-hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2em;
  align-items: center;
  padding: 2em 2em 1.8em;
}

.pg-hero small {
  display: block;
  margin-bottom: 0.8em;
  font-family: var(--mono);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e4572e;
}

.pg-hero h4 {
  margin-bottom: 0.4em;
  font-family: var(--serif);
  font-size: 2.5em;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.pg-hero p {
  max-width: 32em;
  opacity: 0.68;
}

.pg-art {
  aspect-ratio: 1.25;
  border-radius: 1em;
  background:
    radial-gradient(circle at 70% 28%, #fbe3c4 0 18%, transparent 19%),
    radial-gradient(circle at 30% 110%, #171512 0 46%, transparent 47%),
    linear-gradient(140deg, #f2b880, #e4572e);
}

.pg-team {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 1.1s var(--ease-out);
}

.pg-team.is-open {
  grid-template-rows: 1fr;
}

.pg-team-in {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 0 2em;
}

.pg-team.is-open .pg-team-in {
  padding-bottom: 1.8em;
}

.pg-team h5 {
  margin-bottom: 0.7em;
  font-family: var(--serif);
  font-size: 1.7em;
  font-weight: 400;
}

.pg-new {
  position: absolute;
  right: 2em;
  top: 0.3em;
  padding: 0.25em 0.8em;
  border-radius: 99em;
  background: #7c3aed;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.75em;
  opacity: 0;
  transition: opacity 0.6s ease 0.6s;
}

.pg-team.is-open .pg-new {
  opacity: 1;
}

.pg-team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
}

.pg-m {
  padding: 0.9em;
  border-radius: 0.9em;
  background: rgba(23, 21, 18, 0.05);
  opacity: 0;
  transform: translateY(1em);
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
}

.pg-team.is-open .pg-m {
  opacity: 1;
  transform: none;
}

.pg-team.is-open .pg-m:nth-child(1) { transition-delay: 0.35s; }
.pg-team.is-open .pg-m:nth-child(2) { transition-delay: 0.45s; }
.pg-team.is-open .pg-m:nth-child(3) { transition-delay: 0.55s; }
.pg-team.is-open .pg-m:nth-child(4) { transition-delay: 0.65s; }

.pg-m i {
  display: block;
  width: 2.6em;
  height: 2.6em;
  margin-bottom: 0.7em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a), var(--b));
}

.pg-m b {
  display: block;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-m span {
  display: block;
  font-size: 0.82em;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-foot {
  display: flex;
  justify-content: space-between;
  margin: 0 2em;
  padding: 1.2em 0;
  border-top: 1px solid rgba(23, 21, 18, 0.1);
  font-size: 0.85em;
  opacity: 0.6;
}

/* Highlight ring on the freshly edited region */
.pg-team::after {
  content: '';
  grid-area: 1 / 1;
  margin: -0.4em 1em 0.6em;
  border: 2px solid #7c3aed;
  border-radius: 1em;
  opacity: 0;
  pointer-events: none;
}

.pg-team.is-open::after {
  animation: ring 2.6s ease 0.3s;
}

.pg-team-in {
  grid-area: 1 / 1;
}

@keyframes ring {
  0%, 100% { opacity: 0; }
  20%, 70% { opacity: 0.85; }
}

/* ----- AI Editor panel (mirrors the real floating panel) ----- */
.ai-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  width: var(--panel-w);
  height: calc(100% - 36px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(17, 17, 27, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 40px 90px -20px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

.ai-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.ai-spark {
  width: 18px;
  height: 18px;
  color: var(--violet-400);
}

.ai-head-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  color: #9ca3af;
}

.ai-head-actions .icon {
  width: 14px;
  height: 14px;
}

.ai-msgs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  overflow-y: auto;
  scrollbar-width: none;
  transition: opacity 0.5s ease;
}

.ai-msgs::-webkit-scrollbar {
  display: none;
}

.ai-msgs > * {
  flex: none;
  animation: msg-in 0.5s var(--ease-out) both;
}

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

.ai-empty {
  margin: auto;
  max-width: 260px;
  text-align: center;
  color: #9ca3af;
}

.ai-empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet-400);
}

.ai-empty b {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 14px;
}

.m-user {
  align-self: flex-end;
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 16px 16px 5px 16px;
  background: #7c3aed;
  color: #fff;
}

.m-mentions {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(196, 181, 253, 0.3);
  color: #ddd6fe;
  font-size: 11.5px;
}

.m-mentions span,
.m-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-mentions .icon,
.m-label .icon {
  width: 12px;
  height: 12px;
}

.m-label {
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 11.5px;
}

.m-bubble {
  align-self: flex-start;
  max-width: 92%;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
}

.m-proc {
  min-width: 240px;
}

.m-proc-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #9ca3af;
}

.m-dots {
  display: inline-flex;
  gap: 4px;
}

.m-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-400);
  animation: bounce 1s infinite;
}

.m-dots i:nth-child(2) { animation-delay: 0.15s; }
.m-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.m-proc small {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 10.5px;
}

.m-proc small b {
  color: #c4b5fd;
  font-weight: 400;
}

.m-ops-wrap {
  align-self: stretch;
}

.m-ops {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.op-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
}

.op-ic {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.op-ic .icon {
  width: 14px;
  height: 14px;
}

.op-title {
  font-weight: 500;
  color: #fff;
}

.op-title span {
  color: #d1d5db;
  font-weight: 400;
}

.op-title i {
  margin: 0 5px;
  color: #4b5563;
  font-style: normal;
}

.op-sub {
  color: #6b7280;
  font-family: var(--mono);
  font-size: 11px;
}

.op-row > .icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: #6b7280;
  transform: rotate(180deg);
}

.op-diff {
  margin: 0 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.op-diff-head {
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  color: #6b7280;
  font-size: 10px;
  font-weight: 500;
}

.op-diff-body {
  padding: 9px 10px;
}

.op-diff-body b {
  display: block;
  margin-bottom: 4px;
  color: rgba(52, 211, 153, 0.7);
  font-size: 10px;
  font-weight: 500;
}

.op-diff-body pre {
  color: rgba(110, 231, 183, 0.85);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  white-space: pre;
  overflow: hidden;
}

.m-approve {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.m-approve span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  font-weight: 500;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.m-approve .icon {
  width: 15px;
  height: 15px;
}

.m-approve .ok {
  flex: 1;
  background: #7c3aed;
  color: #fff;
}

.m-approve .ok.is-press {
  transform: scale(0.96);
  filter: brightness(1.25);
}

.m-success {
  align-self: flex-start;
  max-width: 92%;
  padding: 10px 13px;
  border: 1px solid rgba(6, 95, 70, 0.6);
  border-radius: 16px 16px 16px 5px;
  background: rgba(6, 78, 59, 0.32);
  color: #6ee7b7;
}

.m-success-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-weight: 500;
}

.m-success-head .icon {
  width: 15px;
  height: 15px;
}

.m-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  font-size: 10px;
}

.m-success p {
  color: rgba(52, 211, 153, 0.85);
  font-size: 12px;
}

.m-success-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(6, 95, 70, 0.45);
  color: rgba(52, 211, 153, 0.7);
  font-size: 11.5px;
}

.m-undo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 4px 10px;
  border: 1px solid rgba(5, 150, 105, 0.45);
  border-radius: 6px;
  background: rgba(4, 120, 87, 0.3);
  color: #a7f3d0;
  font-size: 11px;
}

.m-undo .icon {
  width: 12px;
  height: 12px;
}

.ai-input {
  position: relative;
  flex: none;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-mention {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 2px);
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(20, 20, 32, 0.98);
  box-shadow: 0 -12px 40px -8px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.25s var(--ease-out), visibility 0.18s;
}

.ai-mention.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.ai-mention-head {
  padding: 8px 12px 6px;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 500;
}

.ai-mention-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
}

.ai-mention-row .icon {
  width: 15px;
  height: 15px;
}

.ai-mention-row.t-page .icon { color: var(--type-page); }
.ai-mention-row.t-partial .icon { color: var(--type-partial); }
.ai-mention-row.t-collection .icon { color: var(--type-collection); }

.ai-mention-row b {
  font-weight: 500;
  color: #e5e7eb;
}

.ai-mention-row small {
  margin-left: auto;
  color: #6b7280;
  font-size: 11px;
}

.ai-mention-row.is-active {
  background: rgba(139, 92, 246, 0.18);
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chips:not(:empty) {
  margin-bottom: 8px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: color-mix(in srgb, var(--c) 60%, #fff);
  font-size: 11.5px;
  animation: chip-in 0.45s var(--ease-spring) both;
}

.ai-chip .icon {
  width: 11px;
  height: 11px;
}

.ai-chip.t-page { --c: var(--type-page); }
.ai-chip.t-partial { --c: var(--type-partial); }
.ai-chip.t-collection { --c: var(--type-collection); }

@keyframes chip-in {
  from { opacity: 0; transform: scale(0.7); }
}

.ai-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ai-attach,
.ai-send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.ai-attach {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
}

.ai-send {
  background: #7c3aed;
  color: #fff;
  opacity: 0.5;
  transition: opacity 0.25s ease, transform 0.15s ease;
}

.ai-send.is-ready {
  opacity: 1;
}

.ai-send.is-press {
  transform: scale(0.88);
}

.ai-attach .icon,
.ai-send .icon {
  width: 16px;
  height: 16px;
}

.ai-composer {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  overflow-wrap: anywhere;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ai-composer.is-typing {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.ai-composer.is-empty::before {
  content: attr(data-placeholder);
  color: #6b7280;
}

.mention-token {
  font-weight: 700;
  color: #c4b5fd;
}

/* Scripted pointer used by the demos */
.fake-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: 24px;
  height: 24px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0);
  transition: transform 0.9s var(--ease-in-out), opacity 0.35s ease, scale 0.12s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

.fake-cursor.is-on {
  opacity: 1;
}

.fake-cursor.is-click {
  scale: 0.8;
}

/* --------------------------------------------------------------------------
   5. Versions
   -------------------------------------------------------------------------- */
.versions {
  position: relative;
  height: 280vh;
  background:
    radial-gradient(ellipse 50% 40% at 78% 50%, rgba(124, 58, 237, 0.16), transparent 70%),
    var(--ink-0);
}

.versions-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.versions-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 84px);
  align-items: center;
}

.versions-copy .h-display {
  margin: 18px 0;
  font-size: clamp(1.9rem, 3.5vw, 3.2rem);
}

.v-list {
  list-style: none;
  display: grid;
  gap: 4px;
  margin-top: clamp(16px, 3vh, 30px);
}

.v-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-3);
  font-size: 0.9rem;
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease, transform 0.6s var(--ease-out);
}

.v-list li.is-on {
  border-color: rgba(139, 92, 246, 0.34);
  background: rgba(139, 92, 246, 0.1);
  color: var(--text);
  transform: translateX(6px);
}

.v-list .v-num {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.v-list .v-what {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v-list .v-what small {
  margin-left: 8px;
  color: var(--text-3);
  font-size: 0.78rem;
}

.v-list .v-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.v-list .v-src i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, var(--violet));
}

.versions-visual {
  position: relative;
  min-width: 0;
}

.v-tabs {
  display: flex;
  gap: 6px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent);
  mask-image: linear-gradient(90deg, #000 80%, transparent);
}

.v-tabs span {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.v-tabs span.on {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.v-tabs i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c);
}

.v-tabs b {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  font-size: 0.64rem;
  font-weight: 500;
}

.v-scene {
  position: relative;
  height: clamp(300px, 52vh, 480px);
  perspective: 1300px;
  perspective-origin: 50% 20%;
}

.v-world {
  position: absolute;
  left: 50%;
  top: 60%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.snap {
  position: absolute;
  left: 0;
  top: 0;
  width: 460px;
  height: 300px;
  margin: -150px 0 0 -230px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  will-change: transform, opacity;
}

.snap .pg {
  font-size: 9.6px;
}

.snap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #04060c;
  opacity: var(--fog, 0);
  pointer-events: none;
}

.snap-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.92);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.6);
}

.snap-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, var(--violet));
}

.snap-banner {
  padding: 0.5em 2em;
  background: #171512;
  color: #f5f0e6;
  font-size: 0.85em;
  text-align: center;
}

.snap .pg-team {
  grid-template-rows: 1fr;
}

.snap .pg-team::after {
  display: none;
}

.snap .pg-team .pg-team-in {
  padding-bottom: 1.4em;
}

.snap .pg-m {
  opacity: 1;
  transform: none;
}

.snap.alt-art .pg-art {
  background:
    radial-gradient(circle at 30% 30%, #dbeafe 0 20%, transparent 21%),
    linear-gradient(140deg, #6366f1, #0ea5e9);
}

.snap.alt-art2 .pg-art {
  background: linear-gradient(140deg, #d6d3d1, #a8a29e);
}

.v-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 6px;
}

.v-now {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 0.76rem;
}

.v-restore,
.v-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}

.v-restore {
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
}

.v-restore .icon,
.v-toast .icon {
  width: 14px;
  height: 14px;
}

.v-bar.is-hot .v-restore {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(139, 92, 246, 0.16);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.v-bar.is-press .v-restore {
  transform: scale(0.95);
}

.v-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(6, 40, 30, 0.96);
  color: var(--green-300);
  opacity: 0;
  transform: translate(-50%, -20%) scale(0.92);
  transition: opacity 0.35s ease, transform 0.6s var(--ease-spring);
  pointer-events: none;
}

.v-bar.is-restored .v-toast {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.v-bar.is-restored .v-restore,
.v-bar.is-restored .v-now {
  opacity: 0;
}

/* Static fallback */
html:not(.js) .versions,
.versions.is-static {
  height: auto;
}

html:not(.js) .versions-stage,
.versions.is-static .versions-stage {
  position: relative;
  height: auto;
  padding: clamp(88px, 12vw, 168px) 0;
}

/* --------------------------------------------------------------------------
   6. CLI
   -------------------------------------------------------------------------- */
.cli {
  background: linear-gradient(180deg, var(--ink-0), var(--ink-1) 40%, var(--ink-0));
}

.cli-title {
  max-width: none;
}

.roller {
  display: block;
  height: 1.2em;
  margin-top: 0.04em;
  perspective: 900px;
  overflow: hidden;
}

.roller-drum {
  --theta: 51.4286deg;
  --r: 1.246em;
  --step: 0;
  position: relative;
  display: block;
  height: 100%;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -1)) rotateX(calc(var(--step) * var(--theta) * -1));
  transition: transform 1s var(--ease-spring);
}

.roller-drum > span {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  padding-right: 0.2em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--violet-300);
  white-space: nowrap;
  backface-visibility: hidden;
  transform: rotateX(calc(var(--i) * var(--theta))) translateZ(var(--r));
}

.cli-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.tree {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 12, 22, 0.7);
  font-family: var(--mono);
  font-size: 0.8rem;
  overflow: hidden;
}

.tree-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.tree-head .icon {
  width: 14px;
  height: 14px;
  color: var(--violet-300);
}

.tree ul {
  list-style: none;
  padding: 10px 8px;
}

.tree li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: 7px;
  color: var(--text-2);
  transition: opacity 0.5s ease, transform 0.7s var(--ease-out), background 0.4s ease;
}

html.js .tree li {
  opacity: 0.16;
  transform: translateX(-8px);
}

html.js .tree.is-pulled li {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 50ms), calc(var(--i, 0) * 50ms), 0s;
}

.tree .t-in {
  padding-left: 30px;
}

.tree .t-dir .t-name {
  color: var(--text);
}

.tree .t-dim {
  color: var(--text-3);
}

.t-note {
  margin-left: auto;
  color: var(--violet-300);
  font-size: 0.66rem;
  opacity: 0.85;
}

.t-flag {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
}

.tree li.is-mod {
  background: rgba(245, 158, 11, 0.1);
}

.tree li.is-mod .t-name {
  color: var(--amber-300);
}

.tree li.is-mod .t-flag::after {
  content: 'M';
  color: var(--amber-300);
}

.tree li.is-ok {
  background: rgba(16, 185, 129, 0.1);
}

.tree li.is-ok .t-name {
  color: var(--green-300);
}

.tree li.is-ok .t-flag::after {
  content: 'deployed';
  color: var(--green-300);
  font-weight: 500;
}

.cli-points {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.cli-points li {
  display: flex;
  gap: 12px;
  color: var(--text-2);
  font-size: 0.98rem;
}

.cli-points .icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--violet-300);
}

.cli-points strong {
  color: var(--text);
  font-weight: 600;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--violet-300);
  font-weight: 500;
  text-decoration: none;
}

.link-arrow .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-out);
}

.link-arrow:hover .icon {
  transform: translateX(4px);
}

.terminal {
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #070a13;
  box-shadow: var(--shadow-xl), 0 0 120px -40px rgba(124, 58, 237, 0.5);
  overflow: hidden;
}

.terminal-head {
  height: 42px;
}

.terminal-title {
  color: var(--text-3);
  font-size: 0.74rem;
}

.terminal-body {
  height: 468px;
  padding: 18px 20px;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow: hidden;
  transition: opacity 0.45s ease;
}

.terminal-body.is-reset {
  opacity: 0;
}

.terminal-body .line {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-body .line.blank {
  height: 0.9em;
}

.terminal-body .prompt { color: var(--violet-400); }
.terminal-body .cmd { color: #fff; }
.terminal-body .flag { color: var(--blue-300); }
.terminal-body .comment { color: var(--text-3); }
.terminal-body .out { color: var(--text-2); }
.terminal-body .muted { color: var(--text-3); }
.terminal-body .ok { color: var(--green-300); }
.terminal-body .info { color: var(--blue-300); }
.terminal-body .ai { color: var(--violet-300); font-style: italic; }
.terminal-body .mod { color: var(--amber-300); }

.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--violet-300);
  vertical-align: -0.2em;
  animation: blink 1s steps(1) infinite;
}

/* --------------------------------------------------------------------------
   7. Deploy
   -------------------------------------------------------------------------- */
.deploy {
  overflow: hidden;
  padding-bottom: clamp(64px, 8vw, 112px);
}

.deploy-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 78%, rgba(124, 58, 237, 0.26), transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(16, 185, 129, 0), transparent 70%);
  /* Fade out before the section edge so the glow never ends in a hard line */
  -webkit-mask-image: linear-gradient(180deg, transparent 8%, #000 38%, #000 68%, transparent 96%);
  mask-image: linear-gradient(180deg, transparent 8%, #000 38%, #000 68%, transparent 96%);
  transition: opacity 1s ease;
}

.deploy-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 78%, rgba(16, 185, 129, 0.24), transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
}

.deploy.is-live .deploy-bg::after {
  opacity: 1;
}

.deploy .container {
  position: relative;
}

.deploy-title {
  display: grid;
  justify-items: center;
}

.deploy-title .dt {
  grid-area: 1 / 1;
  transition: opacity 0.6s ease, transform 0.9s var(--ease-out), filter 0.6s ease;
}

.deploy-title .dt-b {
  opacity: 0;
  transform: translateY(45%) scale(0.94);
  filter: blur(10px);
}

.deploy.is-live .deploy-title .dt-a {
  opacity: 0;
  transform: translateY(-45%) scale(0.94);
  filter: blur(10px);
}

.deploy.is-live .deploy-title .dt-b {
  opacity: 1;
  transform: none;
  filter: none;
}

.launch {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  perspective: 1700px;
  perspective-origin: 50% 20%;
}

.launch-rings {
  position: absolute;
  left: 50%;
  bottom: -70px;
  width: 120%;
  aspect-ratio: 3.4;
  transform: translateX(-50%);
  pointer-events: none;
}

.launch-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 50%;
  opacity: 0.6;
  transition: border-color 0.8s ease;
}

.launch-rings i:nth-child(2) { inset: 14% 12%; opacity: 0.45; }
.launch-rings i:nth-child(3) { inset: 28% 24%; opacity: 0.3; }

.deploy.is-live .launch-rings i {
  border-color: rgba(16, 185, 129, 0.6);
  animation: ring-out 1.8s var(--ease-out) both;
}

.deploy.is-live .launch-rings i:nth-child(2) { animation-delay: 0.12s; }
.deploy.is-live .launch-rings i:nth-child(3) { animation-delay: 0.24s; }

@keyframes ring-out {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}

.launch-card {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #090d19;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform-origin: 50% 100%;
  transform: rotateX(20deg) scale(0.93);
  transition: transform 1.3s var(--ease-spring), box-shadow 1s ease, border-color 0.8s ease;
}

.deploy.is-armed .launch-card {
  transform: rotateX(12deg) scale(0.96);
}

.deploy.is-live .launch-card {
  transform: rotateX(0deg) scale(1) translateY(-8px);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 50px 140px -30px rgba(16, 185, 129, 0.5), var(--shadow-xl);
}

.launch-bar {
  height: 54px;
}

.launch-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.76rem;
  white-space: nowrap;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.launch-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.launch-status.is-busy {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--amber-300);
}

.launch-status.is-busy i {
  background: var(--amber);
  animation: pulse 0.9s ease-in-out infinite;
}

.launch-status.is-live {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-300);
}

.launch-status.is-live i {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.launch-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 20px -4px rgba(124, 58, 237, 0.7);
  transition: transform 0.15s ease, filter 0.2s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.launch-btn .icon {
  width: 14px;
  height: 14px;
}

.launch-btn:hover {
  filter: brightness(1.12);
}

.launch-btn.is-press {
  transform: scale(0.93);
}

.launch-btn.is-busy {
  cursor: default;
  filter: saturate(0.6);
}

.launch-btn.is-busy .icon {
  animation: spin-rocket 0.9s linear infinite;
}

@keyframes spin-rocket {
  50% { transform: translate(2px, -2px); }
}

.launch-btn.is-live {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 24px -4px rgba(16, 185, 129, 0.8);
  cursor: default;
}

.launch-site {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 360 / 214;
  overflow: hidden;
  filter: saturate(0.35) brightness(0.72);
  transition: filter 1.2s ease;
}

.deploy.is-live .launch-site {
  filter: none;
}

.launch-site .site {
  width: 100%;
  height: 100%;
  font-size: 2.78cqw;
  border-radius: 0;
  box-shadow: none;
}

.launch-site .site-bar {
  display: none;
}

.launch-site .site-body {
  height: 100%;
  padding: 2.2em 3em;
}

/* Build progress sweeps across the site while deploying */
.launch-site::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none;
}

.deploy.is-deploying .launch-site::after {
  animation: sweep 1.1s var(--ease-in-out) infinite;
}

@keyframes sweep {
  to { transform: translateX(100%); }
}

.launch-steps {
  position: absolute;
  left: 50%;
  bottom: 18px;
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(8, 11, 21, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.deploy.is-deploying .launch-steps {
  opacity: 1;
  transform: translate(-50%, 0);
}

.launch-steps li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-3);
  font-size: 0.78rem;
  transition: color 0.3s ease, background 0.3s ease;
}

.launch-steps i {
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.launch-steps li.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.launch-steps li.is-on i {
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.launch-steps li.is-done {
  color: var(--green-300);
}

.launch-steps li.is-done i {
  border-color: var(--green);
  background: var(--green);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.deploy-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(40px, 6vw, 72px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .b-anatomy { grid-column: span 12; }
  .b-edit { grid-column: span 12; }
  .b-own,
  .b-scale { grid-column: span 6; }
  .b-html { grid-column: span 12; }
  .b-edit,
  .b-html { flex-direction: row; align-items: center; }
  .b-edit .bento-copy,
  .b-html .bento-copy { flex: 1; }
  .b-edit .entry,
  .b-html .codecard { flex: 1; margin-top: 0; }
  .bento-card { min-height: 0; }
  .cs-main { --panel-w: 340px; }
  .cs-body { grid-template-columns: 1fr; }
  .cs-side { display: none; }
}

@media (max-width: 900px) {
  .versions-grid { grid-template-columns: 1fr; gap: 18px; }
  .versions-copy .lede,
  .v-list { display: none; }
  .versions-copy .h-display { margin: 12px 0 0; font-size: clamp(1.5rem, 5.4vw, 2.2rem); }
  .v-scene { height: clamp(260px, 44vh, 400px); }
  .cli-grid { grid-template-columns: 1fr; }
  .cli-side { order: 2; }
}

@media (max-width: 760px) {
  .story { height: 500vh; }
  .story.is-static .story-world { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-line2 { font-size: clamp(4.2rem, min(23vw, 20vh), 8rem); }
  .hero-sub { font-size: 0.98rem; }
  .hero-actions .btn { padding: 13px 20px; font-size: 0.96rem; }
  .beat-text { font-size: clamp(2.3rem, 11.5vw, 3.6rem); }
  .beat-arrive .beat-text { font-size: clamp(1.9rem, 8.6vw, 2.8rem); }
  .scroll-cue { display: none; }
  .story-vignette {
    background: radial-gradient(ellipse 100% 26% at 50% 50%, rgba(4, 6, 12, 0.88), rgba(4, 6, 12, 0.4) 60%, transparent 85%);
  }

  .bento { gap: 12px; }
  .b-own,
  .b-scale { grid-column: span 12; }
  .b-anatomy,
  .b-edit,
  .b-html { flex-direction: column; align-items: stretch; }
  .b-anatomy .bento-copy { flex: none; }
  .anatomy { min-height: 290px; }
  .anatomy-stack { width: 160px; height: 110px; margin-right: 128px; }
  .anatomy.is-open .anatomy-stack { --gap: 46px; }
  .layer-tag { font-size: 10px; padding: 4px 8px; }
  .sc-tag { font-size: 10.5px; padding: 5px 9px 5px 8px; }
  .cms-strip { justify-content: flex-start; gap: 12px 22px; }

  .demo-steps { gap: 6px; margin-top: -12px; }
  .demo-steps li { padding: 6px 11px 6px 6px; font-size: 0.8rem; }
  .cs-top { gap: 8px; padding: 0 12px; }
  .cs-top > .cs-pill,
  .cs-selectors .cs-pill:first-child,
  .cs-ghost,
  .cs-avatar { display: none; }
  .cs-selectors { margin: 0 auto 0 0; }
  .cs-body { height: 620px; }
  .cs-main { padding: 10px; }
  .ai-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: 64%;
  }
  .pg { font-size: 10px; }
  .pg-nav span:not(.on) { display: none; }

  .snap { width: 340px; height: 222px; margin: -111px 0 0 -170px; }
  .snap .pg { font-size: 7.1px; }
  .v-tabs span:nth-child(n + 3) { display: none; }

  .terminal-body { height: 420px; padding: 14px; font-size: 0.7rem; }
  .launch-bar { gap: 8px; padding: 0 10px; }
  .launch-bar .lights,
  .launch-status { display: none; }
  .launch-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .launch-steps { bottom: 10px; gap: 2px; padding: 4px; }
  .launch-steps li { padding: 5px 8px; font-size: 0.66rem; gap: 5px; }
  .launch-steps i { width: 9px; height: 9px; }
  .deploy-actions .btn { width: 100%; }
}

@media (max-height: 640px) and (min-width: 761px) {
  .hero-sub { display: none; }
}
