/* 뒤척임 연구소 랜딩. 밤 남색 한 가지 바탕, 폰 폭 한 줄 흐름.
   위는 스크롤에 맞춰 영상 프레임을 넘기는 무대, 아래는 펜 선 그림으로 연구소 이야기. */
@font-face {
  font-family: "Jaram";
  src: url("font/iceJaram-Rg.woff2") format("woff2");
  font-display: swap;
}
:root {
  --night: #121a2e;
  --night-2: #18223a;
  --line: #2a3552;
  --paper: #ece6d6;
  --ink: #1d2233;
  --moon: #f2d88a;
  --dawn: #8d95ad;
  --text: #d9dbe6;
  --display: "Gowun Batang", "AppleMyungjo", serif;
  --body: "IBM Plex Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --hand: "Jaram", "Gowun Batang", cursive;
  --col: 480px;
  color-scheme: dark;
}
/* 일본어 쪽: 자람체·고운바탕에는 가나가 없어서 같은 결의 일본어 글꼴로 바꾼다 */
html[lang="ja"] {
  --display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --hand: "Klee One", "Hiragino Maru Gothic ProN", cursive;
}
* { box-sizing: border-box; }
/* Lenis 기본 스타일 (lenis.css 1.1.13) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }
html, body { margin: 0; background: var(--night); }
body {
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
a { color: inherit; }

/* 위 막대: 영상 위에선 투명, 영상이 끝나면 밤색 막 */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--col);
  margin-inline: auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  transition: background-color .4s, backdrop-filter .4s;
}
.nav.solid { background: rgba(18, 26, 46, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.logo { font-family: var(--hand); font-size: 24px; line-height: 1; color: var(--paper); text-decoration: none; transition: opacity .4s; }
.nav.bare .logo { opacity: 0; pointer-events: none; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.lang { font-size: 13px; color: var(--dawn); text-decoration: none; padding: 6px 8px; }
.lang:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid rgba(236, 230, 214, .45);
  border-radius: 999px;
  padding: 6px 14px;
}

/* 스크롤 무대: 500vh 길이 동안 화면에 붙어 있는 캔버스 */
.hero { position: relative; height: 500vh; max-width: var(--col); margin-inline: auto; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--night); }
/* 글자가 그림 위에서 읽히도록 위아래만 살짝 어둡게 */
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 14, 28, .62) 0%, rgba(10, 14, 28, 0) 34%, rgba(10, 14, 28, 0) 70%, rgba(10, 14, 28, .55) 100%);
}

.beat {
  position: absolute;
  left: 0;
  right: 0;
  padding-inline: 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.beat.on { pointer-events: auto; }
.beat-top { top: calc(64px + env(safe-area-inset-top, 0px)); display: grid; gap: 6px; justify-items: center; }
.beat-end { inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding-top: calc(72px + env(safe-area-inset-top, 0px)); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.end-title { display: grid; gap: 4px; justify-items: center; }
.end-cta { grid-row: 3; display: grid; gap: 10px; justify-items: center; }

.hand { font-family: var(--hand); font-size: 26px; line-height: 1.2; color: var(--moon); }
.wordmark { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 12vw, 56px); line-height: 1.15; letter-spacing: .02em; color: var(--paper); text-shadow: 0 2px 18px rgba(8, 12, 26, .55); }
.en { font-family: var(--display); font-size: 15px; letter-spacing: .08em; color: var(--dawn); }
.line { font-family: var(--display); font-size: 24px; line-height: 1.5; color: var(--paper); text-wrap: balance; text-shadow: 0 2px 14px rgba(8, 12, 26, .7); }
.line.big { font-size: clamp(36px, 10vw, 46px); font-weight: 700; }

.cta {
  display: inline-block;
  font-family: var(--body);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: var(--moon);
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 30px;
  box-shadow: 0 6px 24px rgba(242, 216, 138, .18);
}
.cta:focus-visible, .nav-cta:focus-visible, .logo:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.cta-note { font-size: 13px; color: var(--dawn); }

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--paper);
  opacity: .75;
  transition: opacity .5s;
}
.hint::after { content: ""; display: block; width: 1px; height: 28px; margin: 8px auto 0; background: linear-gradient(var(--paper), transparent); }
.hint.gone { opacity: 0; }

/* 아래 이야기 */
.sec {
  max-width: var(--col);
  margin-inline: auto;
  padding: 72px 20px 0;
  display: grid;
  gap: 16px;
}
.label { font-size: 12px; letter-spacing: .1em; color: var(--dawn); }
.sec h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.35; color: var(--paper); text-wrap: balance; }
.art { margin: 4px 0 0; border-radius: 14px; overflow: hidden; background: var(--night-2); }
.art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.note { font-size: 14px; color: var(--dawn); }

.cast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cast li { display: grid; gap: 4px; align-content: start; min-width: 0; background: var(--night-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 14px; }
.cast img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: var(--paper); margin-bottom: 6px; }
.cast b { font-family: var(--hand); font-weight: 400; font-size: 26px; line-height: 1.1; color: var(--paper); }
.cast span { font-size: 13px; line-height: 1.6; }

.rules { margin: 0; padding-left: 26px; display: grid; gap: 8px; font-family: var(--hand); font-size: 26px; line-height: 1.35; color: var(--paper); }
.rules li::marker { color: var(--moon); font-family: var(--display); font-size: 16px; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.facts b { font-family: var(--display); font-size: 18px; color: var(--paper); }
.facts span { font-size: 14px; }


.final { justify-items: center; text-align: center; padding-block: 96px 24px; gap: 14px; }
.final .hand { font-size: 30px; }

.foot { max-width: var(--col); margin: 72px auto 0; padding: 24px 20px calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--dawn); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 아래 이야기는 화면에 들어올 때 살짝 떠오른다 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .nav, .hint { transition: none; }
}
