/* ==========================================================================
   /story — page layer (owner: story+join agent). Board: design/project/V3Story.dc.html
   Loads after brand.css + motion-v3.css + foldbike.css. Page-specific layout only; prefix st-.
   Motion: hero .sb-ken + .sb-wipe/.sb-wipe2 (eager), chapter wipes (scroll), manifesto .sb-rise word reveal,
   ch.01 data-parallax, five-things .sb-carousel + staggered .sb-rise, CTA .sb-pulse (paper ring on red, below).
   ========================================================================== */

.st-flare { color: var(--sb-flare); }

/* ---------- Hero ---------- */
.st-hero {
  position: relative; overflow: hidden; isolation: isolate;
  height: clamp(460px, calc(80svh - var(--sb-nav-h)), 620px);
  background: var(--sb-sand);
}
.st-hero__media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.st-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 35% 45%; }
.st-hero__tag { position: absolute; left: var(--sb-gutter); top: 44px; min-height: 26px; }
.st-hero__slabs { position: absolute; left: 0; right: 0; bottom: 28px; }
@media (min-width: 1024px) {
  .st-hero { height: clamp(520px, calc(80svh - var(--sb-nav-h)), 700px); }
  .st-hero__media img { object-position: 50% 38%; }
  .st-hero__slabs { bottom: 56px; }
}

/* ---------- Intro ---------- */
.st-intro { padding-block: 28px 40px; }
.st-intro .sb-copy { max-width: 44rem; }
@media (min-width: 1024px) { .st-intro { padding-block: 64px 80px; } }

/* ---------- Origin ---------- */
.st-origin { padding-block: 48px; }
.st-origin__grid { display: grid; gap: 20px; }
.st-origin__text { margin-top: 14px; max-width: 36rem; }
.st-source { margin-top: 12px; font-size: .8125rem; font-weight: 700; }
.st-source a { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 44px; color: var(--sb-ink); text-underline-offset: 3px; }
.st-origin__fig { aspect-ratio: 350 / 300; background: var(--sb-sand); }
.st-origin__fig img { object-position: 50% 40%; }
@media (min-width: 1024px) {
  .st-origin { padding-block: var(--sb-section-y); }
  .st-origin__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
  .st-origin__fig { aspect-ratio: 5 / 4; }
}

/* ---------- Manifesto ---------- */
.st-manifesto { padding-block: 48px; }
.st-manifesto__grid { display: grid; gap: 20px; }
.st-manifesto__zh {
  font-family: var(--sb-font-zh); font-weight: 500; font-size: clamp(2.5rem, 1.6rem + 3.8vw, 5rem);
  line-height: 1.2; letter-spacing: -.01em;
}
.st-manifesto__zh .sb-rise { display: inline-block; }
.st-manifesto__en { font-style: normal; font-weight: 600; font-size: clamp(1.125rem, 1rem + .6vw, 1.625rem); }
.st-pills { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.st-pills .sb-chip { min-height: 30px; font-style: normal; font-weight: 700; text-transform: none; font-size: .8125rem; }
.st-pills .sb-chip [lang|="zh"] { font-size: .8125rem; font-weight: 700; }
@media (min-width: 1024px) {
  .st-manifesto { padding-block: var(--sb-section-y); }
  .st-manifesto__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 64px; align-items: end; }
  .st-manifesto__eyebrow { grid-column: 1 / -1; }
}

/* ---------- Chapters ---------- */
.st-chapter { padding-bottom: 40px; }
.st-chapter__media {
  position: relative; overflow: hidden; isolation: isolate;
  height: 470px; background: var(--sb-sand);
}
.st-chapter__media > .st-chapter__img,
.st-chapter__para { position: absolute; inset: 0; z-index: -1; }
.st-chapter__para { inset: -10% 0; }
.st-chapter__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* ch.01: the board crops white.webp to the seat-tube decal (≈2× zoom) */
.st-chapter__img--decal { object-position: 50% 52%; transform: scale(2); transform-origin: 54% 88%; }
.st-chapter__num {
  position: absolute; right: 16px; top: 16px;
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 14px;
  background: var(--sb-paper); color: var(--sb-ink);
  border-radius: 999px;
  font-style: normal; font-weight: 600; font-size: .8125rem; text-transform: uppercase;
}
.st-chapter__slabs { position: absolute; left: 0; right: 0; bottom: 22px; }
.st-chapter__body { padding-top: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.st-chapter__body .sb-copy { max-width: 40rem; }
.st-chapter__chip { min-height: 30px; font-style: normal; font-weight: 700; text-transform: none; }
.st-chapter__chip [lang|="zh"] { font-size: .8125rem; font-weight: 700; }
@media (min-width: 1024px) {
  .st-chapter { padding-bottom: 72px; }
  .st-chapter__media { height: clamp(480px, 46vw, 660px); }
  .st-chapter__img--decal { object-position: 50% 60%; transform: scale(1.35); transform-origin: 49% 70%; }
  .st-chapter__slabs { bottom: 48px; }
  .st-chapter__body { padding-top: 32px; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 48px; }
}

/* ---------- Five things (M9 carousel + M5 rise) ---------- */
.st-five { padding-block: 48px; }
.st-five__intro { margin-top: 12px; max-width: 36rem; }
.st-five__wrap { margin-top: 20px; max-width: calc(var(--sb-max) + 2 * var(--sb-gutter)); margin-inline: auto; }
.st-five__track {
  --sb-carousel-gap: 10px;
  padding-inline: var(--sb-gutter); scroll-padding-inline: var(--sb-gutter);
  padding-bottom: 4px;
}
.st-five__track:focus-visible { outline: 3px solid var(--sb-ink); outline-offset: -3px; }
.st-card { width: 240px; background: var(--sb-paper); padding-bottom: 14px; }
.st-card__img { position: relative; height: 230px; overflow: hidden; background: var(--sb-sand); }
.st-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-card__zoom { transform: scale(var(--zs, 1.5)); transform-origin: var(--zx, 50%) var(--zy, 50%); object-position: var(--zx, 50%) var(--zy, 50%); }
.st-card__tag {
  position: absolute; left: 0; top: 10px; padding: 4px 14px 4px 10px;
  background: var(--sb-ink); color: var(--sb-white);
  border-radius: 0 6px 6px 0;
  font-style: normal; font-weight: 600; font-size: .8125rem; text-transform: uppercase;
}
.st-card__tag--brick { background: var(--sb-brick); }
.st-card__title { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 4px; }
.st-card__title [lang="en"] { font-style: normal; font-weight: 600; font-size: 1.0625rem; line-height: 1.15; }
.st-card__title [lang|="zh"] { font-weight: 700; font-size: .875rem; color: var(--sb-ink-2); }
[data-lang="zh"] .st-card__title [lang|="zh"] { order: -1; font-size: 1.0625rem; color: var(--sb-ink); }
[data-lang="zh"] .st-card__title [lang="en"] { font-size: .875rem; font-weight: 700; color: var(--sb-ink-2); }
.st-five__controls { display: flex; justify-content: flex-end; gap: 8px; padding: 14px var(--sb-gutter) 0; }
.st-five__controls .sb-carousel-prev,
.st-five__controls .sb-carousel-next { position: static; transform: none; background: var(--sb-ink); color: var(--sb-paper); }
.st-five__controls .sb-carousel-prev:focus-visible,
.st-five__controls .sb-carousel-next:focus-visible { outline: 3px solid var(--sb-ink); outline-offset: 3px; }
html:not(.js) .st-five__controls { display: none; }
@media (min-width: 1024px) {
  .st-five { padding-block: var(--sb-section-y); }
  .st-five__wrap { margin-top: 40px; }
  .st-card { width: calc((min(100vw, var(--sb-max) + 2 * var(--sb-gutter)) - 2 * var(--sb-gutter) - 40px) / 5); min-width: 220px; }
  .st-card__img { height: auto; aspect-ratio: 240 / 260; }
}

/* ---------- Field notes (I2, static) ---------- */
.st-notes__intro { margin-top: 12px; }
.st-notes__grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.st-note { position: relative; display: block; aspect-ratio: 1; overflow: hidden; color: var(--sb-white); text-decoration: none; background: var(--sb-sand); }
.st-note img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.st-note:hover img { transform: scale(1.04); }
.st-note:focus-visible { outline: 3px solid var(--sb-white); outline-offset: -3px; box-shadow: 0 0 0 3px var(--sb-ink); z-index: 1; } /* two-tone: readable over any photo */
.st-note__label {
  position: absolute; left: 0; bottom: 8px; max-width: calc(100% - 8px);
  padding: 3px 12px 3px 8px; background: var(--sb-ink);
  border-radius: 0 6px 6px 0;
  font-weight: 700; font-size: .8125rem; line-height: 1.4;
}
.st-notes__profile { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-notes__name { font-weight: 900; font-size: .9375rem; }
.st-notes__id { font-size: .8125rem; color: var(--sb-ink-2); }
.st-notes__follow { min-width: 0; }
@media (min-width: 900px) {
  .st-notes__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .st-note img { transition: none; } .st-note:hover img { transform: none; } }

/* ---------- CTA (M6 pulse: paper ring so it shows on the red ground) ---------- */
@keyframes stPulsePaper {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 241, 232, .7); }
  60% { box-shadow: 0 0 0 12px rgba(244, 241, 232, 0); }
}
.st-cta { padding-block: 32px; }
.st-cta__inner { display: flex; flex-direction: column; gap: 18px; }
.st-cta__title { font-size: clamp(1.875rem, 1.2rem + 3vw, 4rem); }
.st-cta__zh { font-size: 1rem; }
.st-cta__btn { --sb-btn-cut: 0px; }
.st-cta__btn.sb-pulse { animation-name: stPulsePaper; }
@media (min-width: 1024px) {
  .st-cta { padding-block: 72px; }
  .st-cta__inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .st-cta__zh { font-size: var(--sb-fs-h2-zh); }
}

/* ---------- Sticky WeChat bar (app.js [data-sticky-contact]; phones only) ---------- */
.cx-bar { display: none; }
.cx-bar .zh { font-family: var(--sb-font-zh); font-weight: 500; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 999px; flex: none; border: 1px solid rgba(255, 255, 255, .35); background: transparent; }
.swatch.black { background: var(--sb-bike-black); }
.swatch.white { background: var(--sb-bike-white); }
.swatch.blue  { background: var(--sb-bike-blue); }
.swatch.green { background: var(--sb-bike-green); }
.swatch.red   { background: var(--sb-bike-red); }
.swatch.earth { background: var(--sb-bike-earth); }
@media (max-width: 760px) {
  .cx-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--sb-ink); color: var(--sb-paper);
    transform: translateY(110%); visibility: hidden;
  }
  .cx-bar[hidden] { display: none; }
  .cx-bar.is-visible { transform: none; visibility: visible; }
  .cx-bar__info { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .9375rem; line-height: 1.3; }
  .cx-bar__text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cx-bar__text b { font-style: normal; font-weight: 600; }
  .cx-bar__text small { display: block; font-size: .8125rem; color: var(--sb-ink-muted); }
  .cx-bar__go {
    position: relative; isolation: isolate; flex: none;
    display: inline-flex; align-items: center; min-height: 44px; padding: 10px 22px;
    color: var(--sb-white); text-decoration: none; font-style: normal; font-weight: 600; font-size: .9375rem;
  }
  .cx-bar__go::before {
    content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sb-red);
    clip-path: polygon(11px 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
  }
  .cx-bar__go:focus-visible { outline: 3px solid var(--sb-paper); outline-offset: 2px; }
  /* the reserve for the bar goes inside the (dark) footer, not below it as a strip of paper */
  html.cx-bar-ready .sb-footer { padding-bottom: calc(28px + 60px + env(safe-area-inset-bottom, 0px)); }
  html.cx-bar-ready { scroll-padding-bottom: 76px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .cx-bar { transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .28s; }
  .cx-bar.is-visible { transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
}
@media print { .cx-bar { display: none !important; } }
