/* story.css — 소개(story.html) 전용 스타일.
 * 스토리 프로즈 · 믿는 것 · 바다 장면 히어로 · 떠다니는 장식 · 전환 문장 · 물결 경계.
 * 공통 뼈대는 base.css 참고.
 */

/* ── 소개 · 스토리 프로즈 ─────────────────────── */
.story { padding-block: var(--space-3xl) var(--space-2xl); }

.story__body {
  max-width: 40rem;
  margin-inline: auto;        /* 화면 가운데로 */
  display: grid;
  gap: var(--space-lg);
  line-height: 1.8;
  color: var(--color-ink-2);
  text-align: center;
}

.story__body strong { color: var(--color-ink); }

.story__turn {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--color-ink);
  padding-block-start: calc(var(--space-md) + 3px);  /* 위 코럴 바 자리 */
  margin-block: var(--space-md);
}

/* 전환 문장 위의 코럴 바 — 가운데 정렬형 (기본: 항상 보임) */
.story__turn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.75rem;
  height: 3px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: translateX(-50%);
}

/* ── 소개 · 만드는 사람 ───────────────────────── */
.maker { padding-block: var(--space-xl); }

.maker__card {
  background: var(--color-paper-2);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-xl), 5vw, var(--space-2xl));
  max-width: 44rem;
  display: grid;
  gap: var(--space-sm);
}

.maker__card h2 { font-size: var(--text-lg); }
.maker__card p { color: var(--color-ink-2); max-width: 36rem; }

/* ── 소개 · 믿는 것 3가지 (가운데 정렬 — 상단 스토리와 통일) ── */
.beliefs { padding-block: var(--space-2xl) var(--space-3xl); text-align: center; }

.beliefs__list {
  list-style: none;
  counter-reset: belief;
  margin: var(--space-xl) auto 0;   /* 가운데 */
  padding: 0;
  display: grid;
  gap: var(--space-2xl);
  max-width: 40rem;
}

.beliefs__list li {
  counter-increment: belief;
  position: relative;
  padding-block-start: 3.25rem;     /* 위 번호 자리 */
}

.beliefs__list li::before {
  content: counter(belief);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);       /* 텍스트 위 가운데 */
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1;
  color: var(--color-accent);
}

.beliefs__list h3 { font-size: var(--text-md); font-weight: 800; }
.beliefs__list p { margin: var(--space-2xs) auto 0; color: var(--color-muted); max-width: 32rem; }

/* ═══════════════════════════════════════════════
   About — 바다 장면 (2026-07-23)
   poporpop 참고: 큰 네이비 돔 + 물결 가장자리 + 떠다니는 요소
   요소는 세계관 3종만: 물결 · 원(진주/기포) · 빛줄기 (+ 심볼 스파클)
   ═══════════════════════════════════════════════ */

/* ── 히어로: 네이비 돔 속 "바다속 진주" ── */
.sea-hero {
  padding-block-start: clamp(5.5rem, 9vh, 7rem);
  padding-block-end: var(--space-xl);   /* 스크롤 아래로 숨 쉬는 공간 */
  padding-inline: clamp(0.75rem, 2vw, 2rem);
}

.sea-hero__dome {
  position: relative;
  overflow: hidden;
  min-height: clamp(26rem, 74vh, 44rem);
  display: grid;
  place-items: center;
  border-radius: clamp(3.5rem, 16vw, 13rem) clamp(3.5rem, 16vw, 13rem) var(--radius-md) var(--radius-md);
  /* 빛은 위에서 — 수면 가까운 청록 → 깊은 네이비 */
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--color-teal) 38%, var(--color-deep)) 0%,
    color-mix(in oklch, var(--color-teal) 14%, var(--color-deep)) 46%,
    var(--color-deep) 100%
  );
}

.sea-hero__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sea-hero__copy {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  padding-block-end: clamp(2rem, 6vh, 3.5rem); /* 아래 진주와 살짝 간격만 */
}

.sea-hero__copy h1 {
  font-family: var(--font-display);
  font-size: var(--text-display-s);
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--color-on-deep);
  text-wrap: balance;
}

/* 돔 하단 물결 가장자리 — 아이보리가 물결로 파고듦 */
.sea-hero__wave {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(26px, 4.5vw, 52px);
  display: block;
}

/* 장면 애니메이션 — 전부 CSS, 느리고 잔잔하게 */
.sea-ray { animation: sea-shine 9s var(--ease-in-out, ease-in-out) infinite alternate; }
.sea-ray--2 { animation-delay: -3s; }
.sea-ray--3 { animation-delay: -6s; }
@keyframes sea-shine {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.sea-bubble { opacity: 0; animation: sea-rise 12s linear infinite; }
.sb1 { animation-delay: 0s; }
.sb2 { animation-delay: -4.5s; animation-duration: 14s; }
.sb3 { animation-delay: -8s; }
.sb4 { animation-delay: -2s; animation-duration: 16s; }
.sb5 { animation-delay: -10s; animation-duration: 13s; }
.sb6 { animation-delay: -6s; animation-duration: 10s; }
@keyframes sea-rise {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 0.55; }
  85% { opacity: 0.45; }
  100% { transform: translateY(-660px); opacity: 0; }
}

.sea-pearl-g {
  transform-box: fill-box;
  transform-origin: center;
  animation: sea-bob 6.5s ease-in-out infinite alternate;
}
@keyframes sea-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.sea-pearl-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: sea-glow 5s ease-in-out infinite alternate;
}
@keyframes sea-glow {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.07); }
}

.sea-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: sea-twinkle 3.6s ease-in-out infinite alternate;
}
.sk2 { animation-delay: -1.4s; }
.sk3 { animation-delay: -2.6s; }
@keyframes sea-twinkle {
  from { opacity: 0.55; scale: 0.85; }
  to { opacity: 1; scale: 1.1; }
}

/* Scroll 인디케이터 */
.sea-hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-block-start: var(--space-2xl);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.sea-hero__scroll-line {
  position: relative;
  width: 1px;
  height: 2.75rem;
  background: var(--color-rule);
  overflow: hidden;
}

.sea-hero__scroll-line::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 45%;
  background: var(--color-accent);
  animation: sea-scroll-hint 2s var(--ease-in-out, ease-in-out) infinite;
}
@keyframes sea-scroll-hint {
  from { transform: translateY(-110%); }
  to { transform: translateY(260%); }
}

/* ── 본문 여백의 떠다니는 장식 ── */
.story { position: relative; }

.sea-drift { position: absolute; inset: 0; pointer-events: none; }

.sea-drift__bubble {
  position: absolute;
  border: 1.5px solid color-mix(in oklch, var(--color-teal) 55%, var(--color-paper));
  border-radius: 50%;
  animation: sea-drift-bob 8s ease-in-out infinite;
}
/* 본문(story__body)은 왼쪽 정렬이라, 장식은 오른쪽 빈 공간에만 배치해요 */
.sea-drift__bubble--1 { width: 22px; height: 22px; top: 8%; right: 14%; }
.sea-drift__bubble--2 { width: 12px; height: 12px; top: 50%; right: 7%; animation-duration: 9.5s; animation-delay: -2.5s; }
.sea-drift__bubble--3 { width: 16px; height: 16px; top: 74%; right: 17%; animation-duration: 7s; animation-delay: -5s; }
/* 왼쪽 여백에도 대칭으로 배치 — story__body가 가운데 정렬이라 양쪽에 빈 공간이 있어요 */
.sea-drift__bubble--4 { width: 18px; height: 18px; top: 16%; left: 10%; animation-duration: 8.5s; animation-delay: -1s; }
.sea-drift__bubble--5 { width: 14px; height: 14px; top: 46%; left: 6%; animation-duration: 7.5s; animation-delay: -4s; }
.sea-drift__bubble--6 { width: 20px; height: 20px; top: 70%; left: 15%; animation-duration: 9s; animation-delay: -6.5s; }

.sea-drift__spark {
  position: absolute;
  top: 28%;
  right: 5%;
  width: 26px;
  height: 26px;
  color: var(--color-accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: sea-drift-twinkle 5s ease-in-out infinite;
}
.sea-drift__spark--2 { top: 60%; right: auto; left: 8%; width: 22px; height: 22px; animation-duration: 6s; animation-delay: -2s; }

@keyframes sea-drift-bob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-11px, -24px); }
}

@keyframes sea-drift-twinkle {
  0%, 100% { transform: rotate(0deg) scale(0.9); opacity: 0.6; }
  50% { transform: rotate(15deg) scale(1.15); opacity: 1; }
}

/* ── 전환 문장 — 가운데 코럴 바가 양옆으로 자라나는 연출 ── */
.js-reveal .story__turn.reveal-on-scroll::before {
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 700ms var(--ease-out) 250ms;
}

.js-reveal .story__turn.reveal-on-scroll.is-visible::before {
  transform: translateX(-50%) scaleX(1);
}

/* ── 믿는 것 — 항목 스태거 ── */
.js-reveal .beliefs__list li.reveal-on-scroll:nth-child(2) { transition-delay: 110ms; }
.js-reveal .beliefs__list li.reveal-on-scroll:nth-child(3) { transition-delay: 220ms; }


/* ── 모바일 조정 ── */
@media (max-width: 40rem) {
  .sea-hero { padding-block-start: 7.5rem; }
  .sea-hero__dome { min-height: clamp(22rem, 64vh, 30rem); }
  .sea-hero__copy { padding-block-end: clamp(5rem, 14vh, 7rem); }
  .sea-ray--3, .sb5, .sb6 { display: none; }
}

/* 본문 폭이 화면을 다 쓰는 구간부터는 장식을 숨겨요 (가독성 우선) */
@media (max-width: 48rem) {
  .sea-drift { display: none; }
}

/* ── 모션 축소 — 떠다님 전부 정지 ── */
@media (prefers-reduced-motion: reduce) {
  .sea-ray, .sea-bubble, .sea-pearl-g, .sea-pearl-glow, .sea-spark,
  .sea-drift__bubble, .sea-drift__spark, .sea-hero__scroll-line::after {
    animation: none !important;
  }
  .sea-bubble { opacity: 0.4; }
}
