/**
 * Electric Motion — front page modules.
 *
 * Three blocks that only exist on the home page:
 *   1. the lime marquee band under the hero,
 *   2. the scroll story (sticky photo + chapters),
 *   3. the inquiry band that closes the page.
 *
 * Everything here reads its colours from the tokens in main.css, so the palette
 * stays in one place. Motion is opt-out: the marquee stops and the chapters are
 * all fully visible under prefers-reduced-motion, and the story works without
 * JavaScript (first photo + readable copy).
 */

/* ------------------------------------------------------------- marquee -- */
.okg-marquee {
  display: flex;
  align-items: center;
  height: 44px;
  overflow: hidden;
  background: var(--grad-accent);
  color: var(--deep);
  border-block: 0;
}
.okg-marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  width: max-content;
  padding-inline-start: clamp(18px, 2.4vw, 34px);
  animation: okg-marquee 34s linear infinite;
  will-change: transform;
}
.okg-marquee__track span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.okg-marquee__track b {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: var(--deep);
  opacity: .55;
}
@keyframes okg-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.okg-marquee:hover .okg-marquee__track { animation-play-state: paused; }

/* ------------------------------------------------------ scroll story --- */
.okg-story {
  position: relative;
  padding: clamp(56px, 7vw, 104px) 0;
  color: var(--ink);
  background:
    radial-gradient(56% 70% at 96% 0%, rgba(184, 243, 74, .20), transparent 68%),
    radial-gradient(50% 60% at 0% 100%, rgba(33, 199, 183, .14), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f1faf7 46%, #f7fbe9 100%);
  /* clip on X only: `overflow: clip` on both axes would kill the sticky stage. */
  overflow-x: clip;
  overflow-y: visible;
}
/* One soft light source, top-right, so the dark band never reads as flat black. */
.okg-story::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(33, 199, 183, .18), transparent 70%);
  pointer-events: none;
}
.okg-story__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(28px, 4.4vw, 80px);
  align-items: start;
}
.okg-story__stage {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  height: min(76vh, 680px);
  border-radius: 20px;
  overflow: hidden;
  background: var(--media-bg);
  box-shadow: 0 30px 64px rgba(16, 24, 32, .16);
}
.okg-story__frames { position: absolute; inset: 0; }
.okg-story__frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity .75s ease, transform 1.4s cubic-bezier(.22, .61, .36, 1);
}
.okg-story__frames img:first-child { opacity: 1; transform: none; }
.okg-story__frames img.is-active { opacity: 1; transform: none; }
/* Bottom scrim so the counter stays legible on any photo. */
.okg-story__stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(16, 27, 32, 0), rgba(16, 27, 32, .82));
  pointer-events: none;
}
.okg-story__meta {
  position: absolute;
  z-index: 2;
  left: 22px;
  bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 800;
}
.okg-story__meta b { font-size: 15px; color: var(--lime); }
.okg-story__meta span { color: rgba(255, 255, 255, .6); }
.okg-story__bar {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 24px;
  left: 78px;
  height: 1px;
  background: rgba(255, 255, 255, .22);
}
.okg-story__bar i {
  display: block;
  height: 100%;
  width: 33%;
  background: var(--lime);
  transform-origin: left center;
  transition: width .5s cubic-bezier(.22, .61, .36, 1);
}

.okg-story__chapters { display: grid; }
.okg-story__chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 72vh;
  padding-inline-end: clamp(0px, 2vw, 28px);
  transition: opacity .45s ease;
}
html.okg-fx .okg-story__chapter { opacity: .42; }
html.okg-fx .okg-story__chapter.is-active { opacity: 1; }
.okg-story__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--aqua-deep);
}
.okg-story__eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}
.okg-story__chapter h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4.6vw, 66px);
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.okg-story__text {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.okg-story__specs {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(16, 24, 32, .12);
  max-width: 46ch;
}
.okg-story__specs li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(16, 24, 32, .12);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.okg-story__specs li span {
  color: var(--aqua-deep);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
}

/* --------------------------------------------------------- inquiry ----- */
.okg-inquiry {
  padding: clamp(56px, 7vw, 96px) 0;
  position: relative;
  color: var(--ink);
  /* Slightly deeper than raw aqua→lime: at full brightness the band read as
     fluorescent and clashed with the calm page above it. These stops keep the
     ink text at 5.6:1 or better while still feeling electric. */
  background: linear-gradient(112deg, #0f8d84 0%, #2fae82 46%, #8cc44f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30);
}
.okg-inquiry__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
}
.okg-inquiry__kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--aqua-ink);
}
.okg-inquiry__kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}
.okg-inquiry h2 {
  margin: 0 0 20px;
  max-width: 15ch;
  color: var(--deep);
  font-size: clamp(36px, 5.4vw, 82px);
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.05em;
  text-transform: uppercase;
}
/* On the one fully saturated band, the accent word becomes a lime marker block
   with ink type — the loudest moment on the page, and still 12:1. */
.okg-inquiry h2 .okg-em {
  /* Block, not inline-block: at 900 weight and .94 leading an inline block
     grew upwards into the line above and clipped it. */
  display: block;
  width: fit-content;
  background: var(--deep);
  color: var(--lime);
  -webkit-text-fill-color: var(--lime);
  padding: .06em .14em .1em;
  margin-top: .06em;
  border-radius: 8px;
  line-height: 1;
}
.okg-inquiry p {
  margin: 0;
  max-width: 52ch;
  color: rgba(16, 24, 32, .78);
  font-size: 15px;
  line-height: 1.75;
}
.okg-inquiry__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  padding-bottom: 6px;
}
.okg-btn--dark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 30px;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.okg-btn--dark svg { width: 16px; height: 16px; transition: transform .25s ease; }
.okg-btn--dark:hover {
  background: var(--graphite);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 27, 32, .22);
}
.okg-btn--dark:hover svg { transform: translate(2px, -2px); }
.okg-inquiry__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(16, 24, 32, .38);
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: gap .22s ease, color .22s ease, border-color .22s ease;
}
.okg-inquiry__link svg { width: 14px; height: 14px; }
.okg-inquiry__link:hover {
  gap: 16px;
  color: var(--deep);
  border-color: var(--deep);
}

/* ------------------------------------------------------------ mobile --- */
@media (max-width: 1024px) {
  .okg-inquiry__inner { grid-template-columns: minmax(0, 1fr); }
  .okg-inquiry__actions { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 26px; }
}

@media (max-width: 860px) {
  .okg-story { padding-bottom: clamp(28px, 6vw, 44px); }
  /* The pinned-photo pattern needs a tall scroll column, which squeezes the
     copy on a phone. So the phone layout drops the pin: one hero frame, then
     the three chapters as a readable stack. */
  .okg-story__grid { display: block; }
  .okg-story__stage {
    position: relative;
    top: auto;
    height: 46vh;
    min-height: 250px;
    max-height: 420px;
    margin-bottom: 10px;
    border-radius: 14px;
  }
  .okg-story__chapters { display: grid; gap: 0; }
  .okg-story__chapter {
    min-height: 0;
    padding: 30px 4px 26px;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .okg-story__chapter:first-child { border-top: 0; padding-top: 18px; }
  .okg-story__chapter h2 { font-size: clamp(30px, 8.4vw, 42px); }
  .okg-story__text { font-size: 14px; }
  .okg-story__specs li { font-size: 13px; }
  .okg-btn--dark { height: 52px; padding: 0 24px; }
  .okg-inquiry h2 { font-size: clamp(32px, 9.6vw, 48px); max-width: none; }
  .okg-inquiry p { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .okg-marquee__track { animation: none; }
  .okg-story__frames img { transition: none; transform: none; }
  html.okg-fx .okg-story__chapter { opacity: 1; }
}
/* ------------------------------------------------- STORY-PIN-PHONE (11-18) --
 * 手机端原本取消了 sticky（注释说会挤压文字），代价是图片随页面一起滚走，
 * 章节切换时看不见画面变化，整个滚动叙事失效。
 * 这里把图片重新钉住，但高度压到 40vh，章节保留 52vh 的滚动节奏，
 * 视觉上等同于桌面版的「图钉住 / 文滚动」，同时不挡住文字。
 */
@media (max-width: 860px) {
  .okg-story__grid {
    display: block;
  }
  .okg-story__stage {
    position: -webkit-sticky;
    position: sticky;
    /* 头部是 sticky 且高 68px，钉住位置必须让开它，否则图片顶部被盖住。
       8px 是图片与头部之间的呼吸间距。 */
    top: calc(var(--header-h, 68px) + 8px);
    height: 38vh;
    min-height: 220px;
    max-height: 320px;
    margin-bottom: 14px;
    border-radius: 16px;
    z-index: 2;
    box-shadow: 0 14px 34px rgba(16, 24, 32, .18);
  }
  .okg-story__chapter {
    min-height: 52vh;
    padding: 26px 2px 22px;
    justify-content: flex-start;
    gap: 12px;
  }
  .okg-story__chapter:first-child {
    padding-top: 20px;
  }
  /* 非激活章节压暗，激活时提亮 + 轻微上移，滚动时有明确反馈 */
  html.okg-fx .okg-story__chapter {
    opacity: .38;
    transform: translateY(8px);
    transition: opacity .5s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  }
  html.okg-fx .okg-story__chapter.is-active {
    opacity: 1;
    transform: none;
  }
  /* 图片切换时给一点缩放，强化「换画面」的感觉 */
  .okg-story__frames img {
    transition: opacity .6s ease, transform 1.1s cubic-bezier(.22, .61, .36, 1);
  }
  .okg-story__frames img.is-active {
    transform: scale(1.02);
  }
  /* 章节标题在手机上略小，给图片留空间 */
  .okg-story__chapter h2 {
    font-size: clamp(28px, 7.6vw, 38px);
    line-height: 1;
  }
}
