/* Khipu hero lab v6 — split layout, keyed video plates, no rope sim */

html {
  /* ScrollTrigger pins against document coordinates. Native smooth hash/history
     restoration can still be in flight after its temporary refresh override. */
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body.khipu-hero-page {
  --khipu-paper: var(--background);
  --font-display: var(--font-sans);
  --ochre: #8b5d1c;
  --accent-fill: linear-gradient(180deg, #b64d32 0%, #ad4a30 100%);
  --accent-fill-hover: linear-gradient(180deg, #bc5235 0%, #ad4a30 100%);
  margin: 0;
  overflow-x: clip;
  background: var(--background);
}

/* Anchor-button specificity must beat the shared kit's inherited link color. */
.ds.khipu-hero-page a.ds-btn-primary,
.ds.khipu-hero-page a.khipu-skip {
  color: var(--primary-foreground);
}

.khipu-hero-page a:focus-visible {
  outline: 2px solid #365d60;
  outline-offset: 3px;
}

.khipu-skip {
  position: fixed;
  z-index: 200;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: var(--radius-md);
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.khipu-skip:focus {
  transform: translateY(0);
}

.khipu-hero-ctas .ds-btn,
.khipu-get-actions .ds-btn {
  min-height: 44px;
}

.khipu-site-nav {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 5%;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 78%, transparent);
  background: color-mix(in oklab, var(--background) 74%, transparent);
  backdrop-filter: blur(12px);
}

.khipu-site-brand,
.khipu-site-links a {
  color: var(--foreground);
  text-decoration: none;
}

.khipu-site-brand {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.khipu-site-brand span {
  color: var(--primary);
  font-weight: 600;
}

.khipu-site-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.khipu-site-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

@media (hover: hover) and (pointer: fine) {
  .khipu-site-links a:hover { color: var(--primary); }
  .khipu-site-links .khipu-site-download:hover {
    color: var(--primary-foreground);
    background: var(--accent-fill-hover);
  }
}

.khipu-site-links .khipu-site-download {
  min-height: 44px;
  padding: 0 0.9rem;
  color: var(--primary-foreground);
  background: var(--accent-fill);
  border-radius: var(--radius-md);
}


.khipu-hero-page .lab-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 62%, transparent);
  backdrop-filter: blur(10px);
  font-size: 0.8125rem;
}

.khipu-hero-page .lab-bar a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-weight: 500;
}

.khipu-hero-page .lab-bar a[aria-current="page"] {
  color: var(--foreground);
  font-weight: 600;
}

.khipu-hero-page .lab-bar .pair {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.khipu-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-rows: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(80% 60% at 18% 12%, color-mix(in oklab, var(--card) 55%, transparent), transparent 55%),
    radial-gradient(70% 50% at 88% 78%, color-mix(in oklab, var(--teal) 5%, transparent), transparent 50%),
    var(--background);
}

.khipu-parchment {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.khipu-sheet {
  position: absolute;
  pointer-events: none;
}

.khipu-sheet--deckled {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 520'%3E%3Cpath fill='%23000' d='M8 14c42-8 88 4 132-6 54-12 98 2 152-4 52-6 88 8 108 18v470c-28 12-62 4-98 10-44 8-88-2-132 6-48 8-98-4-132-10V14z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 520'%3E%3Cpath fill='%23000' d='M8 14c42-8 88 4 132-6 54-12 98 2 152-4 52-6 88 8 108 18v470c-28 12-62 4-98 10-44 8-88-2-132 6-48 8-98-4-132-10V14z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.khipu-sheet--a {
  inset: 8% 3% 6% 5%;
  background: linear-gradient(155deg, var(--muted) 0%, var(--cream) 100%);
  opacity: 0.18;
}

.khipu-sheet--b {
  inset: 4% 7% 8% 3%;
  background: linear-gradient(160deg, var(--card) 0%, var(--secondary) 100%);
  opacity: 0.22;
}

.khipu-sheet--c {
  inset: 2% 4% 4% 6%;
  background: linear-gradient(168deg, color-mix(in oklab, var(--card) 55%, transparent), color-mix(in oklab, var(--background) 15%, transparent) 50%, transparent 78%);
  opacity: 0.28;
}

.khipu-hero-copy {
  position: relative;
  z-index: 6;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5.75rem 5% 3.25rem 7.5%;
  max-width: 42rem;
  pointer-events: auto;
}

.khipu-hero-copy .eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-caps: all-small-caps;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.85rem;
}

.khipu-hero-copy .eyebrow .brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-caps: normal;
  text-transform: none;
  color: var(--foreground);
}

.khipu-hero-copy .eyebrow .sep {
  opacity: 0.35;
}

.khipu-hero-page h1.khipu-hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 5.6vw, 5.8rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 0 0 1.35rem;
  max-width: 14ch;
  color: var(--foreground);
  text-wrap: balance;
}

.khipu-hero-headline em {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
}

.khipu-hero-copy .ds-supporting {
  max-width: 42ch;
  margin: 0 0 1.25rem;
  font-size: clamp(0.9375rem, 1.3vw, 1.0625rem);
  line-height: 1.55;
}

.khipu-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.khipu-hero-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.khipu-stage {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  min-height: 100%;
  overflow: hidden;
  pointer-events: none;
}

/* Cord tips in the clip are cut flat; fade the bottom of the stage so they
   dissolve into the parchment instead of ending on a line. */
.khipu-stage {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 82%, transparent 100%);
}

.khipu-plane-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.khipu-hero-loop,
.khipu-hero-canvas,
.khipu-hero-mark,
.khipu-hero-shadow {
  position: absolute;
  top: 5.5%;
  left: 50%;
  width: min(100%, 118vh);
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: top center;
  pointer-events: none;
  background: transparent;
}

/* The shadow is a static blurred copy of the still, rasterised once, instead of
   a drop-shadow filter re-run on every video frame. */
.khipu-hero-shadow {
  z-index: 0;
  transform: translate(-50%, 22px) scale(0.985);
  filter: blur(14px) brightness(0);
  opacity: 0.16;
}

.khipu-hero-loop,
.khipu-hero-canvas {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.khipu-hero-loop.is-playing,
.khipu-hero-canvas.is-playing {
  opacity: 1;
}

/* Stacked-source mode: the video is only a decoder feeding the canvas. */
.khipu-stage.is-stacked .khipu-hero-loop {
  opacity: 0;
  width: 2px;
  height: 2px;
  filter: none;
  transition: none;
}

.khipu-stage:not(.is-stacked) .khipu-hero-canvas {
  display: none;
}

.khipu-hero-mark {
  z-index: 1;
}

.khipu-hero-mark[hidden] {
  display: none;
}

body.is-static-khipu .khipu-hero-loop {
  display: none;
}

body.is-static-khipu .khipu-hero-mark {
  display: block;
}

.khipu-knot-frames,
.khipu-story-bundle {
  background: transparent;
}

.khipu-story {
  position: relative;
  z-index: 2;
  background: var(--background);
}

.khipu-story-scroll {
  height: 340vh;
}

.khipu-story-pin {
  --enter: 1;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Same split as the hero: copy left, object right, so the page reads as one
   composition rather than a hero followed by a different page. */
.khipu-story-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  width: 100%;
  height: 100%;
}

.khipu-story-copy {
  position: relative;
  z-index: 5;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5.5rem 5% 3rem 7.5%;
  max-width: 42rem;
  pointer-events: none;
  opacity: var(--enter);
  transform: translateY(calc((1 - var(--enter)) * 18px));
}

.khipu-story-rail {
  display: flex;
  gap: 1.4rem;
  margin: 0 0 2.2rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.khipu-story-rail li {
  position: relative;
  padding-top: 0.75rem;
  opacity: 0.45;
  transition: opacity 0.35s ease, color 0.35s ease;
}

.khipu-story-rail li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.2rem;
  height: 2px;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 0.35s ease, width 0.35s ease;
}

.khipu-story-rail li.is-active {
  opacity: 1;
  color: var(--ochre);
}

.khipu-story-rail li.is-active::before {
  opacity: 1;
  width: 3.4rem;
}

.khipu-story-beats {
  position: relative;
  min-height: 15rem;
}

.khipu-story-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.khipu-story-beat.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.45s ease 0.1s, transform 0.45s ease 0.1s, visibility 0s;
}

.khipu-hero-page .khipu-story-copy .kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 0.6rem;
}

.khipu-hero-page h2.khipu-story-line {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 0.9rem;
  max-width: 14ch;
  text-wrap: balance;
}

.khipu-story-support {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
  line-height: 1.55;
  color: var(--muted-foreground);
}

.khipu-story-media {
  position: relative;
  grid-column: 2;
  z-index: 1;
  overflow: hidden;
}

/* The knot frame is a square the height of the pin, centred in the right
   column. The filmed cord enters at the top edge and leaves at the bottom. */
.khipu-knot-frame {
  --gather: 0;
  --drop: 0;
  --slot: 0;
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  aspect-ratio: 1;
  transform: translateX(-50%);
}

/* --gather (0..1) is set by hero.js during Store. The whole khipu settles
   bar-first; the old cord then shrinks to the photographed teal knot before
   their surrounding-hanging crossfade begins. Recall runs this reversibly. */
.khipu-story-khipu {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: calc(var(--enter) * clamp(0, (var(--gather) - 0.42) / 0.36, 1));
  transform: translateY(calc((1 - var(--drop)) * -26%));
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 86%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 0, #000 86%, transparent 99%);
}

.khipu-story-loop,
.khipu-story-canvas,
.khipu-story-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

.khipu-story-loop,
.khipu-story-canvas {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.khipu-story-loop.is-playing,
.khipu-story-canvas.is-playing {
  opacity: 1;
}

.khipu-story-khipu.is-stacked .khipu-story-loop {
  opacity: 0;
  width: 2px;
  height: 2px;
  transition: none;
}

.khipu-story-khipu:not(.is-stacked) .khipu-story-canvas {
  display: none;
}

.khipu-story-mark {
  z-index: 1;
}

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

body.is-static-khipu .khipu-story-loop,
body.is-static-khipu .khipu-story-canvas {
  display: none;
}

body.is-static-khipu .khipu-story-mark {
  display: block;
}

/* The photograph sits above the filmed cord so the cord's top slides in
   behind the bar as the bar solidifies, rather than lying on top of it. */

.khipu-knot-frames {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  transform-origin: 50% 40%;
  /* Measured and normalized to this 960px CSS square: old knot is 166px at
     (480,410); teal-pair knot is 59px at (500,357). Scale to 35.6% about
     the 50%/40% anchor, then nudge into that target before blending. */
  transform: translate(calc(var(--slot) * 2.1%), calc(var(--slot) * -3.8% + (1 - var(--enter)) * -7%)) scale(calc(1 - var(--slot) * 0.6437));
  opacity: calc(var(--enter) * clamp(0, (0.78 - var(--gather)) / 0.36, 1));
}

.khipu-below {
  position: relative;
  z-index: 2;
  background: var(--background);
}

.khipu-details {
  position: relative;
  z-index: 2;
  padding: clamp(4.5rem, 10vw, 9rem) 7.5% 5rem;
  background:
    radial-gradient(58% 80% at 100% 0%, color-mix(in oklab, var(--teal) 9%, transparent), transparent 72%),
    var(--background);
}

.khipu-details-intro {
  max-width: 38rem;
}

.khipu-details .kicker {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ochre);
  text-transform: uppercase;
}

.khipu-details h2,
.khipu-details h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  color: var(--foreground);
}

.khipu-details h2 {
  max-width: 14ch;
  margin: 0 0 0.85rem;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  font-weight: 600;
  line-height: 1.03;
}

.khipu-details-intro > p:last-child {
  max-width: 48ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1.05rem;
  line-height: 1.6;
}

.khipu-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(2.5rem, 6vw, 5rem);
  border: 1px solid var(--border);
  background: var(--border);
}

.khipu-detail-grid article {
  min-width: 0;
  padding: 1.5rem;
  background: color-mix(in oklab, var(--card) 82%, var(--background));
}

.khipu-detail-grid h3 {
  margin: 0 0 0.7rem;
  font-size: 1.45rem;
  font-weight: 600;
}

.khipu-detail-grid p,
.khipu-get p {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.khipu-get {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(3rem, 8vw, 7rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 74%, var(--background));
  box-shadow: var(--shadow-sm);
}

.khipu-get h2 {
  max-width: none;
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
}

.khipu-get > div:first-child {
  max-width: 37rem;
}

.khipu-get-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.khipu-updates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-top: clamp(3rem, 8vw, 7rem);
  padding-top: clamp(2.5rem, 6vw, 5rem);
  border-top: 1px solid var(--border);
}

.khipu-updates h2 {
  max-width: 18ch;
  margin-bottom: 0.5rem;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
}

.khipu-updates > div > p:last-child,
.khipu-noscript {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.khipu-signup {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.khipu-signup label {
  font-size: 1rem;
  font-weight: 600;
}

.khipu-signup-row {
  display: flex;
  gap: 0.6rem;
}

.khipu-signup input[type="email"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  background: var(--card);
  font: inherit;
}

.khipu-signup input[type="email"]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.khipu-signup .ds-btn {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}

.khipu-signup .fine,
.khipu-signup .wait-status {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.khipu-signup .wait-status {
  color: var(--teal);
  font-weight: 600;
}

/* The production header is fixed at 64px. Keep the photographed bar below it
   during Store without changing the lab composition. */
@media (min-width: 1024px) {
  .khipu-site-page .khipu-knot-frame {
    top: 4rem;
    height: calc(100% - 4rem);
  }
}

.khipu-textile-band {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
}

.khipu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 1.25rem 3rem;
  max-width: 72rem;
  margin: 0 auto;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
}

.khipu-foot a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.khipu-foot a:hover {
  color: var(--foreground);
}

@media (max-width: 1023px) {
  .khipu-site-nav {
    padding: 0 1rem;
  }

  .khipu-hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-template-columns: none;
    grid-template-rows: none;
  }

  .khipu-parchment {
    position: absolute;
    inset: 0;
  }

  /* One-row lab bar on phones: the wrapped two-row bar was covering the
     woven bar, so the cords looked like they hung from the nav. */
  .khipu-hero-page .lab-bar {
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 0.6rem 1rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .khipu-hero-page .lab-bar::-webkit-scrollbar {
    display: none;
  }

  .khipu-hero-page .lab-bar .pair {
    flex-wrap: nowrap;
  }

  .khipu-stage {
    order: -1;
    width: 100%;
    height: calc(88vw + 3.6rem);
    max-height: 62vh;
    min-height: 260px;
    flex: 0 0 auto;
  }

  /* Clear the bar and pull in from the screen edges so both ends of the
     woven bar are visible instead of cut flat at the viewport. */
  .khipu-hero-loop,
  .khipu-hero-canvas,
  .khipu-hero-mark,
  .khipu-hero-shadow {
    top: 3.6rem;
    width: 88%;
  }

  .khipu-plane-wrap--back {
    display: none;
  }

  .khipu-hero-copy {
    padding: 1.5rem 1.25rem 2.4rem;
    max-width: none;
    justify-content: flex-start;
  }

  .khipu-hero-page h1.khipu-hero-headline {
    font-size: clamp(2.7rem, 11vw, 3.35rem);
    line-height: 0.98;
    max-width: none;
  }

  .khipu-story-scroll {
    height: 280vh;
  }

  .khipu-story-layout {
    display: flex;
    flex-direction: column;
  }

  .khipu-story-copy {
    order: 1;
    padding: 1.4rem 1.25rem 2rem;
    max-width: none;
    justify-content: flex-start;
    flex: 0 0 auto;
  }

  .khipu-story-rail {
    margin-bottom: 1.2rem;
  }

  .khipu-story-beats {
    min-height: 12.5rem;
  }

  .khipu-story-media {
    order: 0;
    flex: 0 0 auto;
    height: calc(88vw + 3.8rem);
    max-height: 62vh;
    min-height: 300px;
  }

  /* Same inset as the hero: clear the fixed bar, keep both ends of the woven
     bar inside the screen. */
  .khipu-knot-frame {
    top: 3.8rem;
    width: 88%;
    height: auto;
    max-height: calc(100% - 3.8rem);
  }

  .khipu-detail-grid {
    grid-template-columns: 1fr;
  }

  .khipu-get {
    align-items: flex-start;
    flex-direction: column;
  }

  .khipu-updates {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .khipu-site-nav {
    gap: 0.5rem;
  }

  .khipu-site-brand {
    font-size: 0.98rem;
  }

  .khipu-site-links {
    gap: 0.15rem;
    font-size: 0.75rem;
  }

  .khipu-site-links a:not(.khipu-site-download) {
    display: none;
  }

  .khipu-site-links .khipu-site-download {
    min-height: 44px;
    padding: 0 0.65rem;
  }

  .khipu-hero-ctas,
  .khipu-get-actions {
    width: 100%;
  }

  .khipu-hero-ctas .ds-btn,
  .khipu-get-actions .ds-btn {
    flex: 1 1 100%;
  }

  .khipu-details {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .khipu-signup-row {
    flex-direction: column;
  }

  .khipu-signup .ds-btn {
    width: 100%;
  }
}

/* All three story beats remain available if the motion script never loads. */
body:not(.has-khipu-motion) .khipu-story-scroll { height: auto; }
body:not(.has-khipu-motion) .khipu-story-pin { height: auto; min-height: 70vh; padding: 3rem 0; overflow: visible; }
body:not(.has-khipu-motion) .khipu-story-layout { display: flex; flex-direction: column; height: auto; }
body:not(.has-khipu-motion) .khipu-story-beat { position: relative; opacity: 1; visibility: visible; transform: none; margin-bottom: 2.25rem; pointer-events: auto; }
body:not(.has-khipu-motion) .khipu-story-beats { min-height: 0; }
body:not(.has-khipu-motion) .khipu-story-copy { position: relative; left: auto; bottom: auto; width: auto; padding: 0 1.25rem; min-height: 0; }
body:not(.has-khipu-motion) .khipu-story-media { position: relative; inset: auto; height: 60vh; }
body:not(.has-khipu-motion) .khipu-hero-loop,
body:not(.has-khipu-motion) .khipu-story-loop { display: none; }

@media (prefers-reduced-motion: reduce) {
  .khipu-sheet,
  .khipu-story-beat,
  .khipu-story-rail li {
    transition: none;
  }

  .khipu-story-scroll {
    height: auto;
  }

  .khipu-story-pin {
    height: auto;
    min-height: 70vh;
    padding: 3rem 0;
    overflow: visible;
  }

  .khipu-story-layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .khipu-story-beat {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-bottom: 2.25rem;
  }

  .khipu-story-beats {
    min-height: 0;
  }

  .khipu-story-copy {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    padding: 0 1.25rem;
    min-height: 0;
  }

  .khipu-story-media {
    position: relative;
    inset: auto;
    height: 60vh;
  }
}
