/* ==========================================================================
   pelican.css — /pelican/ 板块页
   Layer 3 of 3 (tokens.css → frame.css → 本文件). 只换舞台不换 artwork：
   SMIL SVG 与 3D 转台的内容原样迁自 home-v4，本文件只管舞台——排版、
   画框、面板；全部色值走 tokens 变量，绝不触碰 SVG 内部结构与颜色。
   ========================================================================== */

/* ---- 阅读列：v4 内容列 760px，在 1140px 容器内居中 ---------------------- */
.pelican-col {
  max-width: 760px;
  margin-inline: auto;
}

/* ---- 返回链接（框架契约：子页以 ← 返回首页 开头） ------------------------ */
.pelican-back {
  display: inline-block;
  margin-block-end: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.pelican-back:hover {
  color: var(--accent-dim); /* sitewide hover voice: warm dim, body-size safe */
}

/* ---- H1：人声标题；版本号 small 是机器声 → mono --------------------------- */
.pelican-col h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  margin-block-end: var(--space-2);
}

.pelican-col h1 small {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-dim); /* --text-faint is large-size-only on paper */
  margin-left: var(--space-2);
}

/* ---- 导语 ---------------------------------------------------------------- */
.lead {
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--text-dim);
}

.lead b {
  color: var(--text);
}

/* ---- 2D artwork frame (stage only; v4 radius + shadow zeroed via tokens:
        the Obys sharp edge, no elevation) ------------------------------------ */
.pelican-figure {
  margin-block: var(--space-8) 0;
  background: var(--border-color); /* 兜底底色，SVG 不透明铺满时不可见 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.pelican-figure svg {
  width: 100%;
  height: auto;
}

/* ---- badges → terminal metadata chips (machine voice → mono; v4 pill
        radius zeroed to the sharp corner; uppercase like frame mono labels) -- */
.badge {
  display: inline-block;
  margin: var(--space-4) var(--space-2) 0 0;
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- 说明文字 + 动画系统清单 ---------------------------------------------- */
.caption {
  margin-block-start: var(--space-6);
  color: var(--text-dim);
  line-height: var(--leading-body);
}

.pelican-col ul {
  margin-block-start: var(--space-4);
  padding-inline-start: var(--space-6);
  color: var(--text-dim);
  line-height: var(--leading-body);
}

.pelican-col li + li {
  margin-block-start: var(--space-2);
}

.pelican-col li b {
  color: var(--text);
}

/* ---- 对标 / 3D 面板（v4 .compare，深蓝配色整体迁到 tokens 表面层） -------- */
.compare {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-6);
}

.compare h2 {
  font-size: var(--text-md);
  line-height: var(--leading-tight);
  color: var(--text);
  margin-block-end: var(--space-4);
}

.compare p {
  color: var(--text-dim);
  line-height: var(--leading-body);
}

.compare p + p {
  margin-block-start: var(--space-3);
}

.compare p b {
  color: var(--text);
}

/* ---- 3D 转台视频（v4 内联样式迁移入册） ----------------------------------- */
.pelican-video {
  width: 100%;
  margin-block: var(--space-4);
  background: var(--surface-2); /* inset slot: deeper paper while poster loads */
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

/* ---- 页尾导流一行（终端风：$ ls + 注释，不搞卡片） ------------------------ */
.pelican-next {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.pelican-next .p-prompt {
  color: var(--accent);
  margin-right: var(--space-2);
}

.pelican-next .p-comment {
  color: var(--text-dim); /* --text-faint is large-size-only on paper */
}

/* ---- Project hero: pinned Obys split screen -------------------------------
   Left paper half: project name on the edge, credits column at ~x250.
   Right ink half: vertical media strip. While the hero is pinned (the
   page-end script adds one viewport of wrapper height), scroll progress
   translates the strip with lerp damping. No-JS / reduced motion: the
   wrapper keeps its natural height, the strip is a plain scrollable
   column — every shot stays fully readable, nothing is pinned. */

.phero-pin {
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
}

.phero {
  position: sticky;
  top: var(--header-height);
  display: flex;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.phero-half {
  position: relative;
  width: 50%;
}

/* Left: raised paper. Name hugs the left edge; the credits column sits at
   the obys ~x250 position. max-width keeps ragged lines clear of the
   brackets straddling the seam. */
.phero-left {
  display: flex;
  align-items: center;
  background: var(--surface);
}

.phero-name {
  position: absolute;
  top: 50%;
  left: var(--space-4);
  transform: translateY(-50%);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--text);
}

.phero-info {
  display: grid;
  gap: var(--space-1);
  max-width: min(20rem, 24vw);
  margin-left: clamp(9rem, 17vw, 16rem);
}

.phero-cat {
  color: var(--text);
}

.phero-credits {
  color: var(--text-dim);
}

.phero-cta {
  justify-self: start;
  margin-top: var(--space-2);
}

/* Right: the ink slab carrying the media strip. */
.phero-right {
  background: var(--text);
}

.phero-media {
  position: absolute;
  inset: 0;
  overflow-y: auto; /* static fallback: a plain scrollable column */
  scrollbar-width: none;
}

.phero-media::-webkit-scrollbar {
  display: none;
}

.phero-track {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: clamp(240px, 26vw, 420px);
  margin-inline: auto;
  padding-block: var(--space-8);
}

.phero-shot {
  display: block;
  transition: scale var(--dur-fast) var(--ease-out);
}

.phero-shot:active {
  scale: 0.96; /* press feedback, never smaller */
}

.phero-shot img {
  width: 100%;
  height: auto;
  outline: 1px solid rgba(255, 255, 255, 0.1); /* edge on the ink slab */
  transition: opacity var(--dur-base) var(--ease-out);
}

.phero-shot.is-tall img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 38% 50%;
}

/* Neighbor dimming only while the scroll driver runs (JS adds .is-pinned);
   the static fallback keeps every shot at full opacity. */
.phero-pin.is-pinned .phero-media {
  overflow: hidden;
}

.phero-pin.is-pinned .phero-track {
  will-change: transform;
}

.phero-pin.is-pinned .phero-shot img {
  opacity: 0.45;
}

.phero-pin.is-pinned .phero-shot.is-current img,
.phero-pin.is-pinned .phero-shot:hover img,
.phero-pin.is-pinned .phero-shot:focus-visible img {
  opacity: 1;
}

/* Giant brackets straddling the paper/ink seam: "(" inks on paper, ")"
   inverts to paper on ink — the site's ink/paper inversion motif. */
.phero-brackets {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: min(30vh, 16vw); /* ~30vh, capped so text columns stay clear */
  line-height: 0;
  pointer-events: none;
  user-select: none;
}

.phero-brackets span:first-child {
  color: var(--text);
}

.phero-brackets span:last-child {
  color: var(--bg);
}

.phero-back {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-decoration-color: currentColor;
}

.phero-back:hover {
  color: var(--accent-dim);
}

/* ---- Narrow viewports: hero stacks — copy on top, single image below ------ */
@media (max-width: 767px) {
  .phero {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
  }

  .phero-half {
    width: 100%;
  }

  .phero-left {
    display: block;
    padding: var(--space-8) var(--space-4) var(--space-6);
  }

  .phero-name {
    position: static;
    transform: none;
    margin-block-end: var(--space-3);
  }

  .phero-info {
    max-width: none;
    margin-left: 0;
  }

  .phero-right {
    flex: 1;
    min-height: 50vh;
    min-height: 50svh;
  }

  .phero-track {
    width: min(72vw, 300px);
    margin-block: auto;
  }

  .phero-shot:not(:first-child) {
    display: none; /* single-image fallback */
  }

  .phero-brackets {
    display: none;
  }

  .phero-back {
    color: rgba(242, 240, 234, 0.7); /* now sits on the ink half */
  }

  .phero-back:hover {
    color: var(--bg);
  }
}
