:root {
  --screen-hero-height: 230vh;
  --screen-day-height: 280vh;
  --gap-hero: 20px;
  --gap-day: 40px;
  --pad-hero-bottom: 60px;
  --pad-day-y: 104px;
  --copy-max-width: 720px;
  --eyebrow-gap: 40px;
  --end-panel-gap: 40px;
}
:root {
  color-scheme: light;
  /* Looki design language v1.6.2 semantic colors. */
  --looki-color-background: #ffffff;
  --looki-color-surface: #f7f7f7;
  --looki-color-text-primary: #333333;
  --looki-color-text-primary-rgb: 51, 51, 51;
  --looki-color-text-secondary: rgba(23, 23, 23, 0.5);
  --looki-color-text-tertiary: rgba(23, 23, 23, 0.24);
  --looki-color-brand: #ff8737;
  --looki-color-brand-rgb: 255, 135, 55;
  --looki-color-button-primary: #171717;
  --looki-color-button-primary-foreground: #f7f7f7;
  --looki-color-current-status: rgba(255, 135, 55, 0.08);
  --looki-color-line: rgba(10, 10, 10, 0.12);
  --looki-color-decorative-neutral-rgb: 115, 115, 115;

  /* Template component aliases. */
  --bg: var(--looki-color-background);
  --ink: var(--looki-color-text-primary);
  --subtle: var(--looki-color-text-secondary);
  --faint: var(--looki-color-text-tertiary);
  --soft-ink: var(--looki-color-text-secondary);
  --warm: var(--looki-color-brand);
  --grid-color: rgba(10, 10, 10, 0.06);
  --topbar-border: var(--looki-color-line);
  --topbar-start: rgba(255, 255, 255, 0.92);
  --topbar-end: rgba(247, 247, 247, 0.76);
  --surface-border: var(--looki-color-line);
  --media-border: var(--looki-color-line);
  --glass-start: rgba(255, 255, 255, 0.92);
  --glass-end: rgba(247, 247, 247, 0.72);
  --photo-card-start: rgba(255, 255, 255, 0.96);
  --photo-card-end: rgba(247, 247, 247, 0.82);
  --glass-shadow: 0 18px 45px rgba(10, 10, 10, 0.08);
  --active-surface: var(--looki-color-current-status);
  --media-surface: rgba(247, 247, 247, 0.92);
  --stack-surface: rgba(23, 23, 23, 0.88);
  --stack-overlay: rgba(0, 0, 0, 0.2);
  --dot: var(--looki-color-text-tertiary);
  --dot-active: var(--looki-color-text-secondary);
  --meter-track: var(--looki-color-line);
  --comic-start: rgba(255, 255, 255, 0.96);
  --comic-end: rgba(247, 247, 247, 0.88);
  --comic-frame: var(--looki-color-surface);
  --photo-surface: var(--looki-color-surface);
  --shadow: 0 24px 72px rgba(10, 10, 10, 0.12);
  --skeleton: rgba(23, 23, 23, 0.1);
  --skeleton-highlight: rgba(255, 255, 255, 0.72);
  /* MiSans everywhere. Both the display ("serif") and UI ("sans") roles now use
  MiSans; the old aliases are kept so existing rules keep resolving. Body copy
  uses weight 400, headings 600 (set on the elements below). */
  --serif: "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --sans: "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  /* Driven by the JS scroll proxy (smoothed scroll progress). Defaults keep the
  page looking right when JS is off or before the first frame. */
  --field-shift: 0px;
  --field-glow: 0.025;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --looki-color-background: #0a0a0a;
  --looki-color-surface: #171717;
  --looki-color-text-primary: #f7f7f7;
  --looki-color-text-primary-rgb: 247, 247, 247;
  --looki-color-text-secondary: rgba(247, 247, 247, 0.5);
  --looki-color-text-tertiary: rgba(247, 247, 247, 0.24);
  --looki-color-brand: #ff944d;
  --looki-color-brand-rgb: 255, 148, 77;
  --looki-color-button-primary: #ffffff;
  --looki-color-button-primary-foreground: #171717;
  --looki-color-current-status: rgba(255, 148, 77, 0.08);
  --looki-color-line: rgba(247, 247, 247, 0.12);
  --grid-color: rgba(247, 247, 247, 0.05);
  --topbar-start: rgba(30, 30, 31, 0.8);
  --topbar-end: rgba(23, 23, 23, 0.72);
  --glass-start: rgba(30, 30, 31, 0.8);
  --glass-end: rgba(23, 23, 23, 0.72);
  --photo-card-start: rgba(30, 30, 31, 0.86);
  --photo-card-end: rgba(23, 23, 23, 0.76);
  --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --media-surface: rgba(23, 23, 23, 0.88);
  --stack-surface: rgba(23, 23, 23, 0.94);
  --stack-overlay: rgba(0, 0, 0, 0.5);
  --comic-start: rgba(30, 30, 31, 0.86);
  --comic-end: rgba(23, 23, 23, 0.78);
  --comic-frame: rgba(247, 247, 247, 0.08);
  --photo-surface: rgba(247, 247, 247, 0.08);
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
  --skeleton: rgba(247, 247, 247, 0.12);
  --skeleton-highlight: rgba(247, 247, 247, 0.22);
}

@keyframes plog-skeleton-shimmer {
  to {
    background-position-x: -200%;
  }
}

.hero .comic-single {
  transition: opacity 260ms ease;
}

.comic-frame::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 220ms ease;
  background: linear-gradient(
    100deg,
    var(--skeleton) 15%,
    var(--skeleton-highlight) 38%,
    var(--skeleton) 62%
  );
  background-size: 220% 100%;
}

html.is-media-loading .hero .comic-single {
  opacity: 0;
}

html.is-media-loading .hero .comic-frame::after {
  opacity: 1;
  animation: plog-skeleton-shimmer 1.25s linear infinite;
}

/* English mode: Latin text uses Lab Grotesque, with MiSans kept as the CJK
fallback for any stray Chinese glyphs. */
html:lang(en) {
  --serif: "Lab Grotesque", "MiSans", "PingFang SC", system-ui, sans-serif;
  --sans: "Lab Grotesque", "MiSans", "PingFang SC", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image:
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    linear-gradient(var(--grid-color) 1px, transparent 1px);
  background-size: 72px 72px;
  /* The grid drifts a touch as the smoothed scroll proxy advances. */
  background-position: var(--field-shift) calc(var(--field-shift) * 0.6);
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 78%);
}

/* Soft ambient glow that brightens with scroll — driven by the JS proxy so it
arrives a beat behind the scroll wheel, reinforcing the smooth feel. */
body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(
      circle at 78% 18%,
      rgba(var(--looki-color-brand-rgb), var(--field-glow)),
      transparent 40%
    ),
    radial-gradient(
      circle at 18% 72%,
      rgba(var(--looki-color-decorative-neutral-rgb), var(--field-glow)),
      transparent 44%
    );
}

.page-shell {
  min-height: 100vh;
}

/* The guide line is absolutely positioned over the WHOLE document (its height
is set in JS to the full scroll height), so it scrolls with the content and
threads the page top to bottom — behind the content, above the ambient
background. The path geometry and draw-on-scroll are set from JS. */
.guide-line {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.guide-line path {
  stroke: var(--warm);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.5;
  filter: drop-shadow(0 4px 14px rgba(var(--looki-color-brand-rgb), 0.24));
}

/* Keep the main content flow above the guide line. The topbar, prompt bar and
scroll meter are already position:fixed with higher z-index, so they're fine. */
.page-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: max(14px, calc(env(safe-area-inset-top) + 10px));
  padding-right: max(14px, calc(env(safe-area-inset-right) + 14px));
  padding-bottom: 14px;
  padding-left: max(14px, calc(env(safe-area-inset-left) + 14px));
  pointer-events: none;
}

html.is-android .topbar {
  padding-top: 14px;
}

.brand {
  pointer-events: auto;
  display: flex;
  align-items: center;
}

.chapter-nav,
.bgm-toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  border: 1px solid var(--topbar-border);
  background: linear-gradient(135deg, var(--topbar-start), var(--topbar-end));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--glass-shadow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.bgm-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.bgm-icon {
  display: block;
  position: relative;
  width: 14px;
  height: 14px;
}

.bgm-icon::before {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
  content: "";
}

.bgm-toggle.is-playing .bgm-icon::before {
  top: 1px;
  left: 2px;
  width: 3px;
  height: 12px;
  border: 0;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
}

.brand {
  height: 24px;
  padding: 20px 12px;
}

.brand-logo {
  display: block;
  width: 66px;
  height: 16px;
  background: var(--ink);
  -webkit-mask: var(--plog-logo) center / contain no-repeat;
  mask: var(--plog-logo) center / contain no-repeat;
}

.chapter-nav {
  gap: 2px;
  min-height: 42px;
  border-radius: 99px;
  padding: 5px;
  font-size: 14px;
}

.chapter-nav a {
  border-radius: 99px;
  padding: 8px 12px;
  color: var(--soft-ink);
}

.chapter-nav a.is-active {
  background: var(--active-surface);
  color: var(--ink);
}

/* Copy and artwork stay together as one centered composition. */
.hero {
  position: relative;
  /* 首屏滚动长度 — 改 --screen-hero-height（在 index.html 顶部）*/
  min-height: var(--screen-hero-height, 230vh);
}

.hero-stage {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-hero, clamp(18px, 3vw, 32px));
  overflow: clip;
  padding: clamp(72px, 10vh, 104px) clamp(22px, 7vw, 110px);
  isolation: isolate;
  text-align: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(100%, var(--copy-max-width, 720px));
  max-width: var(--copy-max-width, 720px);
  margin: 0 auto;
}

/* Centered variants of the shared heading/sub styles for the stacked hero. */
.hero-copy h1 {
  margin: 0 auto;
}

.hero-copy .hero-sub {
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  /* 小标签(eyebrow)↔标题 间距 — 改 --eyebrow-gap */
  margin: 0 0 var(--eyebrow-gap, 14px);
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.plog-title-char {
  display: inline-block;
  will-change: transform, opacity;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 600;
  /* Allow clean wrapping so a long heading never overflows on narrow screens. */
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* Medium, editorial heading scale — restrained rather than oversized, leaving
room for the visual reference element beside it. */
h1 {
  max-width: 16ch;
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.02;
}

/* English titles use a lighter weight. The hero h1 also gets a wider measure so
the longer Latin headline breaks onto two lines. */
html:lang(en) h1,
html:lang(en) h2 {
  font-weight: 500;
}

html:lang(en) h1 {
  max-width: 22ch;
}

h2 {
  max-width: 20ch;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08;
}

.hero-sub,
.scene-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--subtle);
  font-family: var(--sans);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.72;
}

.scene-art {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(92vw, 400px);
  justify-content: center;
}

.hero-visual {
  position: relative;
  z-index: 3;
  width: min(92vw, 520px);
  overflow: clip;
  border-radius: 26px;
  perspective: 900px;
}

/* ---- Pointer parallax tilt (reactbits.dev/components/profile-card) ---------
Any [data-tilt] element rotates in 3D toward the pointer. JS writes --rx/--ry
(degrees) live while the pointer is over it; on leave they ease back to 0 via
the transition below. No colour/holographic layers — just the tilt parallax.
Its own perspective container is the element's parent (.hero-visual or
.art-photo), set above. */
[data-tilt] {
  --rx: 0deg;
  --ry: 0deg;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 320ms ease-out;
  will-change: transform;
}

/* While actively tracking the pointer, drop the transition so the tilt follows
the JS-smoothed values 1:1 (JS does its own easing). */
[data-tilt].is-tilting {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-tilt] {
    transform: none !important;
    transition: none;
  }
}

.glass-card,
.art-card {
  position: absolute;
  border: 1px solid var(--surface-border);
  background: linear-gradient(135deg, var(--glass-start), var(--glass-end));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow);
}

/* A small progress HUD chip in the corner — a label for the canvas core, not a
competing block. */
.main-card {
  top: 6%;
  left: 0;
  display: grid;
  width: min(50vw, 190px);
  gap: 6px;
  align-content: start;
  border-radius: 18px;
  padding: 16px 18px;
}

.main-card strong {
  font-size: 40px;
  font-weight: 300;
  line-height: 0.9;
}

.main-card i {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--warm), transparent);
}

.mini-label {
  color: var(--subtle);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The canvas core now carries the ring motif, so the standalone ring is hidden
to keep the centerpiece clean. */
.floating-ring {
  display: none;
}

.grain-plane {
  position: absolute;
  right: 22%;
  top: 17%;
  width: 180px;
  aspect-ratio: 3 / 4;
  border-radius: 50% 50% 44% 48%;
  background: radial-gradient(
    circle at 50% 30%,
    rgba(var(--looki-color-brand-rgb), 0.14),
    transparent 70%
  );
  filter: blur(1px);
}

.story-section {
  --story-topic-gap: 20px;
  position: relative;
  /* 每日屏滚动长度 — 改 --screen-day-height */
  min-height: var(--screen-day-height, 200vh);
}

/* Story copy and art share one centered vertical composition. */
.sticky-scene,
.sticky-scene.reverse {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--story-topic-gap);
  overflow: clip;
  padding: clamp(72px, 10vh, 104px) clamp(22px, 7vw, 110px);
  isolation: isolate;
  text-align: center;
}

.scene-copy {
  position: relative;
  z-index: 2;
  order: 0;
  width: min(100%, var(--copy-max-width, 720px));
  max-width: var(--copy-max-width, 720px);
  margin: 0 auto;
}

.sticky-scene .scene-art,
.sticky-scene.reverse .scene-art {
  order: 1;
  overflow: clip;
  border-radius: 24px;
  perspective: 900px;
}

/* Center the heading + paragraph within the centered column. */
.scene-copy h2,
.scene-copy p:not(.eyebrow) {
  margin-left: auto;
  margin-right: auto;
}

.scene-copy .eyebrow {
  margin: var(--story-topic-gap) 0 0;
}

.art-card {
  left: 50%;
  top: 50%;
  display: grid;
  width: min(80vw, 360px);
  min-height: 310px;
  gap: 16px;
  align-content: end;
  border-radius: 30px;
  padding: 26px;
  transform: translate(-50%, -50%);
}

.art-card.wide {
  width: min(82vw, 430px);
}

.art-card span {
  color: var(--faint);
  font-size: 13px;
}

.art-card strong {
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.art-card p {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

/* Per-day highlight image: centered under the copy and driven by the same
buildScrollScenes reveal timeline. The ChatGPT-generated illustration for each
each block receives backend-rendered image paths. The figure is just the perspective
container; the visual surface + pointer tilt live on the inner .tilt-card. */
.art-photo {
  position: relative;
  margin: 0;
  width: 100%;
  perspective: 700px;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-inline: none;
}

.art-photo .tilt-card {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(
    135deg,
    var(--photo-card-start),
    var(--photo-card-end)
  );
  box-shadow: var(--shadow);
}

.art-photo .photo-track {
  display: flex;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.art-photo .photo-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.art-photo .photo-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 50%);
  background: var(--media-surface);
  -webkit-user-drag: none;
  user-select: none;
}

/* Multi-image days keep their images in one centred stack. Vertical scroll
selects the active image; GSAP completes each crossfade independently. */
.art-photo.is-depth .tilt-card {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.art-photo.is-depth .photo-track {
  position: absolute;
  inset: 0;
  display: block;
}

.art-photo.is-depth .photo-slide {
  --slide-x: 0px;
  --slide-scale: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - clamp(42px, 14vw, 68px));
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--media-border);
  border-radius: 22px;
  background: var(--stack-surface);
  box-shadow: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateX(var(--slide-x))
    scale(var(--slide-scale));
  transform-origin: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.art-photo.is-depth .photo-slide:first-child {
  z-index: 1;
  opacity: 1;
}

.photo-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -28px;
  display: none;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}

.scene-art.has-dots .photo-dots {
  display: flex;
}

.photo-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.photo-dots i.is-active {
  background: var(--dot-active);
  transform: scale(1.25);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.8;
}

/* Ambient glows blooming outward from behind the centered image. Anchored to
.scene-art and offset past its edges so they read as soft background light. */
.orb-a {
  width: 260px;
  height: 260px;
  left: -140px;
  top: -90px;
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-brand-rgb), 0.16),
    transparent 68%
  );
}

.orb-b {
  width: 360px;
  height: 360px;
  right: -170px;
  bottom: -120px;
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-decorative-neutral-rgb), 0.1),
    transparent 70%
  );
}

[data-accent="cool"] .orb-a {
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-decorative-neutral-rgb), 0.14),
    transparent 68%
  );
}

[data-accent="cool"] .orb-b {
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-brand-rgb), 0.08),
    transparent 70%
  );
}

[data-accent="rose"] .orb-a {
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-brand-rgb), 0.12),
    transparent 68%
  );
}

[data-accent="rose"] .orb-b {
  background: radial-gradient(
    circle,
    rgba(var(--looki-color-decorative-neutral-rgb), 0.08),
    transparent 70%
  );
}

.end-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  align-content: center;
  /* Keep the recap copy and artwork centered independently from the bottom
  navigation control. */
  gap: var(--end-panel-gap);
  padding: 96px clamp(22px, 7vw, 110px) 80px;
  text-align: center;
}

.end-panel h2 {
  max-width: 920px;
}

.end-panel .portrait-copy,
.end-panel .weekly-recap-copy {
  width: min(100%, 920px);
  margin: 0;
  line-height: 1.75;
}

.end-panel .portrait-copy {
  margin-bottom: calc(12px - var(--end-panel-gap));
  font-size: 28px;
  font-weight: 700;
}

.end-panel .weekly-recap-copy {
  color: var(--subtle);
  font-size: 17px;
}

/* The eyebrow's own bottom margin would stack on top of the grid gap, making the
eyebrow→title gap larger than title→button. Zero it so the grid gap alone sets
all three spacings equal. */
.end-panel .eyebrow {
  margin: 0;
}

.round-button {
  position: absolute;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  z-index: 2;
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 0 0 -20px;
  border: 0;
  padding: 0;
  place-items: center;
  background: transparent;
  cursor: pointer;
}

.up-icon {
  display: block;
  width: 40px;
  height: 40px;
  background: var(--ink);
  -webkit-mask: var(--plog-up) center / contain no-repeat;
  mask: var(--plog-up) center / contain no-repeat;
}

/* ---- Bottom gradual blur (reactbits.dev/animations/gradual-blur) ----------
Five fixed, stacked full-width layers pinned to the viewport bottom. Each
layer's backdrop-filter blur ramps up (4→12px) and its mask gradient confines
it to a horizontal band, so the blur builds up gradually from clear at the top
edge to fully blurred at the bottom — no single hard blur line. */
.bottom-blur {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 29;
  height: 120px;
  pointer-events: none;
}

.bottom-blur .blur-layer {
  position: absolute;
  inset: 0;
}

/* Layer masks: transparent → black → black → transparent bands, each shifted
down 20% from the last (divCount = 5), so adjacent layers overlap and blend. */
.bottom-blur .blur-layer:nth-child(1) {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 20%,
    #000 40%,
    transparent 60%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 20%,
    #000 40%,
    transparent 60%
  );
}

.bottom-blur .blur-layer:nth-child(2) {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 20%,
    #000 40%,
    #000 60%,
    transparent 80%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 20%,
    #000 40%,
    #000 60%,
    transparent 80%
  );
}

.bottom-blur .blur-layer:nth-child(3) {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 40%,
    #000 60%,
    #000 80%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 40%,
    #000 60%,
    #000 80%,
    transparent 100%
  );
}

.bottom-blur .blur-layer:nth-child(4) {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 60%,
    #000 80%,
    #000 100%
  );
  mask-image: linear-gradient(to bottom, transparent 60%, #000 80%, #000 100%);
}

.bottom-blur .blur-layer:nth-child(5) {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 80%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 80%, #000 100%);
}

.scroll-meter {
  position: fixed;
  right: max(10px, calc(env(safe-area-inset-right) + 10px));
  top: 50%;
  z-index: 28;
  width: 3px;
  height: 170px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--meter-track);
  transform: translateY(-50%);
}

.scroll-meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: top;
}

/* ---- Weekly Comic (九宫格) ------------------------------------------------
Replaces the old canvas core as the hero's right-hand visual reference. A
3×3 grid of inked storybook panels distilled from last week's moments. */
.weekly-comic {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 22px;
  /* Clip the image's own corners to the card's rounded shape. */
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--media-border);
  background: linear-gradient(150deg, var(--comic-start), var(--comic-end));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow);
}

/* The illustration sits flush inside the card — no separate corners or shadow,
so the image + card read as a single surface. */
.comic-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

/* Single weekly-comic illustration. The image already carries its own caption +
looki logo, so it sits edge-to-edge inside the card. */
.comic-single {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  :root {
    --screen-hero-height: 132svh;
    --screen-day-height: 142svh;
    --gap-hero: 20px;
    --gap-day: 40px;
    --eyebrow-gap: 20px;
    --end-panel-gap: 24px;
  }

  .topbar {
    align-items: center;
  }

  .chapter-nav {
    display: none;
  }

  .hero-stage {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-top: max(72px, calc(env(safe-area-inset-top) + 56px));
    padding-bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px));
  }

  .hero-copy > .eyebrow {
    display: none;
  }

  .hero.has-multiline-title .hero-copy {
    margin-top: 30px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 30px;
  }

  h1.is-long-title {
    font-size: 34px;
  }

  h2.is-long-title {
    font-size: 27px;
  }

  .hero-sub,
  .scene-copy p:not(.eyebrow) {
    font-size: 16px;
    line-height: 1.62;
  }

  .is-long-copy {
    font-size: 14px !important;
    line-height: 1.52 !important;
  }

  .hero-visual,
  .scene-art {
    width: min(88vw, 390px);
  }

  .story-section {
    min-height: 142svh;
  }

  .sticky-scene,
  .sticky-scene.reverse {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-top: max(72px, calc(env(safe-area-inset-top) + 56px));
    padding-bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px));
  }

  .weekly-comic {
    gap: 10px;
    border-radius: 22px;
    padding: 18px;
  }

  .art-photo .tilt-card {
    border-radius: 20px;
  }

  .photo-dots {
    bottom: 8px;
  }

  .scene-art.has-dots {
    padding-bottom: 24px;
  }

  .orb,
  .guide-line,
  .bottom-blur {
    display: none;
  }

  .scroll-meter {
    height: 112px;
    opacity: 0.55;
  }

  .end-panel {
    gap: var(--end-panel-gap);
    padding-top: max(84px, calc(env(safe-area-inset-top) + 72px));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: max(80px, env(safe-area-inset-bottom));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .end-panel .end-photo {
    width: min(84vw, 340px);
    margin-bottom: 0;
  }

  .end-panel .portrait-copy {
    font-size: 23px;
    line-height: 1.55;
  }

  .end-panel .weekly-recap-copy {
    font-size: 15px;
    line-height: 1.65;
    margin-top: 0;
  }

  .end-panel .portrait-copy.is-long-copy {
    font-size: 20px !important;
  }

  .end-panel .weekly-recap-copy.is-long-copy {
    font-size: 14px !important;
  }

  .round-button {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 360px), (max-width: 900px) and (max-height: 700px) {
  :root {
    --screen-hero-height: 126svh;
    --screen-day-height: 132svh;
    --gap-hero: 20px;
    --gap-day: 40px;
    --eyebrow-gap: 14px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 27px;
  }

  h1.is-long-title {
    font-size: 29px;
  }

  h2.is-long-title {
    font-size: 25px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .hero-sub,
  .scene-copy p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.55;
  }

  .is-long-copy {
    font-size: 13px !important;
    line-height: 1.48 !important;
  }

  .hero-stage {
    padding-top: max(52px, calc(env(safe-area-inset-top) + 40px));
    padding-bottom: max(52px, calc(env(safe-area-inset-bottom) + 40px));
  }

  .hero-visual {
    width: min(66vw, 230px);
  }

  .scene-art {
    width: min(72vw, 240px);
  }

  .sticky-scene,
  .sticky-scene.reverse {
    justify-content: safe center;
    padding-top: max(64px, calc(env(safe-area-inset-top) + 52px));
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  }

  .weekly-comic {
    gap: 8px;
    padding: 14px;
  }

  .end-panel .portrait-copy.is-long-copy {
    font-size: 18px !important;
  }

  .scroll-meter {
    height: 88px;
  }
}

@media (hover: none), (pointer: coarse) {
  [data-tilt] {
    --rx: 0deg;
    --ry: 0deg;
    transition: none;
  }
}

.no-motion .hero,
.no-motion .story-section {
  min-height: auto !important;
}

.no-motion .hero-stage,
.no-motion .sticky-scene,
.no-motion .sticky-scene.reverse {
  position: relative;
  display: flex;
  height: auto;
  min-height: 100svh;
  flex-direction: column;
  gap: 24px;
}

.no-motion .hero-copy,
.no-motion .hero-visual,
.no-motion .scene-copy,
.no-motion .scene-art {
  grid-area: auto;
}

.no-motion .hero-stage {
  gap: var(--gap-hero);
}

.no-motion .scene-copy {
  order: 0;
}

.no-motion .sticky-scene,
.no-motion .sticky-scene.reverse {
  gap: var(--story-topic-gap);
}

.no-motion .scene-copy .eyebrow {
  margin-top: var(--story-topic-gap);
}

.no-motion .scene-art {
  order: 1;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* PLOG dynamic template adjustments */
.chapter-nav a {
  min-width: 3.2em;
  max-width: 5em;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weekly-comic .comic-frame {
  aspect-ratio: 1;
  background: var(--comic-frame);
}
.weekly-comic .comic-single {
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}
.end-panel .end-photo {
  width: min(92vw, 520px);
  margin: 0 auto 28px;
  perspective: 900px;
}
.end-panel .end-photo .tilt-card {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 26px;
  border: 1px solid var(--surface-border);
  background: var(--photo-surface);
  box-shadow: var(--shadow);
}
.end-panel .end-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Final mobile typography spec. Keep the English editorial italic, while all
Chinese display copy uses an upright 30px title and 15px body scale. */
html:lang(zh) h1,
html:lang(zh) h2 {
  font-style: normal;
}

h1,
h2,
h1.is-long-title,
h2.is-long-title,
.end-panel .portrait-copy,
.end-panel .portrait-copy.is-long-copy {
  font-size: 24px !important;
}

.hero-sub,
.hero-sub.is-long-copy,
.scene-copy p:not(.eyebrow),
.scene-copy p:not(.eyebrow).is-long-copy,
.end-panel .weekly-recap-copy,
.end-panel .weekly-recap-copy.is-long-copy {
  font-size: 14px !important;
}

/* Wide screens get a fluid visual scale instead of the old 400px ceiling.
The viewport-height term keeps the copy and square image inside one screen. */
@media (min-width: 901px) {
  .hero-visual {
    width: min(52vw, 640px, calc(100svh - 330px));
  }

  .scene-art {
    width: min(58vw, 640px, calc(100svh - 380px));
  }

  .end-panel .end-photo {
    width: min(58vw, 620px);
  }
}

@media (max-width: 900px) {
  .chapter-nav {
    display: none;
  }
  .end-panel .end-photo {
    width: min(84vw, 340px);
    margin: 16px auto 0;
  }
}

/* Editorial image treatment inspired by Visual Business: the artwork reads as
the page itself, rather than as content placed inside a decorative UI card. */
.hero-visual {
  overflow: visible;
  border-radius: 0;
}

.weekly-comic {
  overflow: visible;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.weekly-comic .comic-frame,
.weekly-comic .comic-single,
.art-photo .tilt-card,
.art-photo.is-depth .photo-slide,
.end-panel .end-photo .tilt-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.art-photo.is-depth .photo-slide {
  border-radius: 16px;
}

.sticky-scene .scene-art,
.sticky-scene.reverse .scene-art {
  border-radius: 0;
}

.end-copy {
  display: flex;
  width: min(100%, 920px);
  flex-direction: column;
  align-items: center;
}

.end-copy .eyebrow {
  margin: 0 0 var(--end-panel-gap);
}

.end-copy .portrait-copy {
  margin: 0 0 12px;
}

.end-panel .end-photo {
  margin-bottom: 0;
}

@media (max-width: 360px), (max-width: 900px) and (max-height: 700px) {
  .end-panel {
    position: relative;
    min-height: 100svh;
    align-content: safe center;
    gap: 14px;
    padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 18px
      max(80px, env(safe-area-inset-bottom));
  }

  .end-copy .eyebrow {
    display: none;
  }

  .end-copy .portrait-copy {
    line-height: 1.1;
  }

  .end-copy .weekly-recap-copy {
    line-height: 1.3;
  }

  .end-panel .end-photo {
    width: min(58vw, 188px);
    margin: 0 auto;
  }
}

@media (max-width: 900px), (hover: none), (pointer: coarse) {
  html.has-motion.plog-step-scroll {
    scroll-snap-type: y mandatory;
  }

  .plog-scroll-step {
    position: absolute;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .hero-visual,
  .scene-art,
  .end-panel .end-photo {
    width: calc(100vw - 40px);
    max-width: none;
  }

  .art-photo.is-depth .photo-slide {
    width: 100%;
  }
}
