/* 홈 전용. 칸을 늘어놓지 않고 큰 글자·까치·앱 화면만으로. 움직임은 CSS + 앱의 로티 */

.wrap.home { max-width: 1040px; }

.nb { display: inline-block; }
:lang(ko) { word-break: keep-all; }

/* 스크롤하면 아래에서 살짝 지나쳤다 돌아오며 나타남 (스크립트가 있을 때만 숨김) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.5s, transform 0.7s cubic-bezier(0.2, 1.35, 0.4, 1);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ── 첫 화면 ── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 56px;
  padding: 48px 0 72px;
}
.hero h1 {
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.08;
  margin: 0 0 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero .lead {
  font-size: 20px;
  color: var(--ink-soft);
  margin: 0 0 30px;
  max-width: 25em;
}
.hero .where {
  margin: 18px 0 0;
  font-size: 15px;
  color: #9AA0B2;
  font-weight: 700;
}
.hero-copy > * { animation: rise 0.7s cubic-bezier(0.2, 1.35, 0.4, 1) backwards; }
.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.hero-copy > :nth-child(4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

.demo { text-align: center; animation: rise 0.8s 0.2s cubic-bezier(0.2, 1.35, 0.4, 1) backwards; }
.demo .try { margin: 14px 0 0; font-size: 14px; color: #9AA0B2; font-weight: 700; }

/* ── 폰 ── 얇은 테두리, 옆 버튼이 살짝 보이는 아이폰 모양, 위에 검은 섬(뺐다가 있는 쪽이 낫다고 해서 되돌림) */
.phone {
  position: relative;
  width: 300px;
  padding: 5px;
  background: var(--ink);
  border-radius: 46px;
  margin: 0 auto;
}
.phone::before, .phone::after {
  content: "";
  position: absolute;
  width: 3px;
  background: #3D435A;
}
/* 왼쪽: 동작 버튼 + 음량 둘 */
.phone::before {
  left: -3px; top: 16%; height: 25%;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(#3D435A 0 17%, transparent 17% 33%, #3D435A 33% 63%, transparent 63% 70%, #3D435A 70%);
}
/* 오른쪽: 전원 */
.phone::after { right: -3px; top: 27%; height: 13%; border-radius: 0 2px 2px 0; }
.screen {
  position: relative;
  aspect-ratio: 9 / 20;
  border-radius: 41px;
  background: #fff;
  overflow: hidden;
}
.screen::after {
  content: "";
  position: absolute; z-index: 5;
  top: 10px; left: 50%;
  width: 28%; height: 7.2%; max-height: 22px;
  transform: translateX(-50%);
  background: #15151C;
  border-radius: 12px;
}
.screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* 살아 있는 데모: 앱의 학습 화면을 그대로 흉내 냄 */
.live {
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  text-align: center;
}
.live:focus-visible { box-shadow: inset 0 0 0 3px var(--mirror); }
.live.auto { pointer-events: none; cursor: default; }
.live .slide.drag { transition: transform 0.5s cubic-bezier(0.3, 0, 0.3, 1); }
.live .tint {
  position: absolute; inset: 0;
  background: var(--blue);
  opacity: 0;
  pointer-events: none;
}
.live .bar {
  position: absolute; left: 0; right: 0; top: 44px;
  font-weight: 800; font-size: 15px;
}
.live .streak {
  position: absolute; left: 18px; top: 0;
  display: flex; align-items: center; gap: 6px;
}
.live .streak svg { width: 19px; height: 21px; }
.live .dots {
  position: absolute; left: 0; right: 0; top: 78px;
  display: flex; justify-content: center; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: #9AA0B2;
}
.live .dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #DCE0EA;
  transition: background 0.25s, transform 0.35s cubic-bezier(0.3, 2, 0.5, 1);
}
.live .dots i.known { background: var(--blue); transform: scale(1.15); }
.live .dots i.miss { background: var(--coral); }
.live .dots span { margin-left: 6px; }

.live .slide {
  position: absolute; left: 0; right: 0; top: 24%;
  padding: 0 18px;
  will-change: transform;
}
.live .slide.back { transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.live .slide.out { transition: transform 0.2s cubic-bezier(0.5, 0, 0.9, 0.5), opacity 0.2s; opacity: 0; }
.live .slide.enter { animation: enter 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes enter { from { opacity: 0; transform: scale(0.9); } }
.live .slide.nudge { animation: nudge 1.5s cubic-bezier(0.4, 0, 0.3, 1); }
@keyframes nudge {
  0%, 100% { transform: none; }
  22% { transform: translateX(-30px); }
  44% { transform: none; }
  66% { transform: translateX(30px); }
}
.live .word {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 44px; font-weight: 800; line-height: 1.15;
  margin-left: -26px;
}
.live .spk {
  border: 0; background: none; padding: 4px; cursor: pointer;
  width: 30px; height: 30px; flex: none;
  transition: transform 0.15s;
}
.live .spk:active { transform: scale(0.82); }
.live .spk svg { width: 100%; height: 100%; display: block; }
.live .roman { color: #8A90A2; font-size: 16px; margin-top: 2px; }
.live .rule { width: 26px; height: 3px; border-radius: 2px; background: var(--mist); margin: 16px auto; }
.live .example { font-size: 15px; line-height: 1.45; }
.live .example b { color: var(--blue); font-weight: 700; }
.live .more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.3s;
}
.live .more > div { overflow: hidden; }
.live .more strong { display: block; font-size: 18px; margin-top: 10px; }
.live .more span { display: block; color: var(--ink-soft); font-size: 14px; }
.live .slide.open .more { grid-template-rows: 1fr; opacity: 1; }
.live .hint { margin-top: 10px; font-size: 13px; color: #B4B9C8; }
.live .slide.open .hint { visibility: hidden; }

.live .sides {
  position: absolute; left: 16px; right: 16px; bottom: 37%;
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 700; color: #B4B9C8;
  pointer-events: none;
}
.live .sides span { transition: color 0.15s, transform 0.2s; }
.live.left .sides span:first-child { color: var(--blue); transform: scale(1.12); }
.live.right .sides span:last-child { color: var(--coral); transform: scale(1.12); }

.live .burst {
  position: absolute; left: 50%; bottom: 20%;
  width: 240px; height: 240px; margin-left: -120px;
  pointer-events: none;
}

.live .finish {
  position: absolute; left: 0; right: 0; top: 24%;
  padding: 0 16px;
  display: none;
}
.live.done .finish { display: block; animation: enter 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.live.done .slide, .live.done .sides { display: none; }
.live .finish b { display: block; font-size: 30px; font-weight: 900; line-height: 1.2; }
.live .finish span { display: block; color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.live .finish button {
  margin-top: 18px;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 16px; color: var(--blue);
  padding: 8px 14px;
}

/* 빼꼼 까치 */
.peek {
  position: absolute; left: 0; bottom: 0; width: 100%;
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: breathe 3.6s ease-in-out infinite;
  --px: 0px; --py: 0px;
}
.peek svg { display: block; width: 100%; overflow: visible; }
@keyframes breathe { 50% { transform: scale(1.01, 1.025); } }
.peek .body { transform-origin: 50% 100%; transition: transform 0.5s cubic-bezier(0.3, 1.7, 0.5, 1); transform: translateX(var(--lean, 0px)); }
.pupil { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform 0.18s; }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5.3s infinite; }
@keyframes blink { 0%, 95.5%, 100% { transform: none; } 97.5% { transform: scaleY(0.08); } }
.peek .cheek { opacity: 0; transition: opacity 0.2s; }
.peek .lid { opacity: 0; transition: opacity 0.15s; }
.peek .beads { transform-box: fill-box; transform-origin: 20% 0; }
.peek.happy .cheek { opacity: 1; }
.peek.happy .pupil { transform: translate(0, -5px); }
.peek.happy svg { animation: hop 0.62s cubic-bezier(0.3, 0, 0.4, 1); transform-origin: 50% 100%; }
.peek.happy .beads { animation: dangle 0.9s cubic-bezier(0.3, 1.4, 0.5, 1); }
.peek.sad .lid { opacity: 1; }
.peek.sad .pupil { transform: translate(0, 4px); }
.peek.sad svg { animation: slump 0.6s cubic-bezier(0.3, 1.3, 0.5, 1); transform-origin: 50% 100%; }
/* 웅크림 → 홀쭉하게 뛰기 → 납작 착지 → 지나쳐 돌아옴 */
@keyframes hop {
  0% { transform: none; }
  16% { transform: scale(1.05, 0.93); }
  46% { transform: translateY(-20px) scale(0.96, 1.06); }
  74% { transform: scale(1.06, 0.92); }
  88% { transform: scale(0.985, 1.02); }
  100% { transform: none; }
}
@keyframes dangle {
  0%, 100% { transform: none; }
  35% { transform: rotate(-16deg); }
  62% { transform: rotate(10deg); }
  82% { transform: rotate(-4deg); }
}
@keyframes slump {
  0%, 100% { transform: none; }
  35% { transform: translateY(7px) scale(1.02, 0.97); }
}

/* ── 큰 한 줄 ── */
.line {
  text-align: center;
  padding: 56px 0 72px;
}
.line h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.line h2 em { font-style: normal; color: var(--blue); font-variant-numeric: tabular-nums; }
.line p { margin: 14px auto 0; color: var(--ink-soft); font-size: 19px; max-width: 30em; }

/* ── 화면 하나, 글 하나 ── */
.show {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 56px 0;
}
.show .copy { max-width: 440px; justify-self: center; }
.show:nth-of-type(even) .copy { order: 2; }
.show h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--blue);
  text-wrap: balance;
}
.show p { margin: 0; font-size: 19px; color: var(--ink-soft); }
.show .shot { position: relative; justify-self: center; }
.show .shot .phone { width: 262px; animation: float 6s ease-in-out infinite; }
/* 혼자 도는 데모는 첫 화면과 같은 크기로 그리고 통째로 줄임(글자 크기가 px라서) */
.show .shot .phone:has(.live) { width: 300px; zoom: 0.873; }
.show:nth-of-type(even) .shot .phone { animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-9px) rotate(0.6deg); } }
.show .fx {
  position: absolute; left: 50%; top: 50%;
  width: 520px; height: 520px; margin: -260px 0 0 -260px;
  pointer-events: none;
  z-index: 2; /* 목업 위에서 터지게 */
}

/* ── 질문 ── */
.faq { max-width: 680px; margin: 0 auto; padding: 56px 0 80px; }
.faq h2 { font-size: clamp(28px, 3.8vw, 40px); font-weight: 900; margin: 0 0 14px; letter-spacing: -0.015em; }
.faq details { border-bottom: 2px solid var(--mist); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0;
  font-weight: 800; font-size: 19px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(var(--blue), var(--blue)) center / 100% 3px no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 3px 100% no-repeat;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details p { margin: 0 0 20px; color: var(--ink-soft); max-width: 34em; }

/* ── 마지막: 로딩 화면처럼 검정 바탕에 눈과 부리만 ── */
.night {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 84px 20px 92px;
}
.night .face { width: 190px; margin: 0 auto 30px; --px: 0px; --py: 0px; }
.night .face svg { display: block; width: 100%; overflow: visible; }
.night .face.idle .pupil { animation: look 6s infinite cubic-bezier(0.5, 0, 0.2, 1); }
@keyframes look {
  0%, 12%, 88%, 100% { transform: none; }
  22%, 44% { transform: translateX(-9px); }
  56%, 78% { transform: translateX(9px); }
}
.night h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 900; line-height: 1.15; letter-spacing: -0.02em;
}
.night p { margin: 0 auto 30px; color: #B9BFD0; font-size: 19px; max-width: 26em; }

.button.big { font-size: 20px; padding: 16px 34px; border-radius: 20px; }

/* ── 다운로드 버튼 ── */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.night .stores { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 20px 9px 16px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--mist-lip);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--mist-lip);
  text-decoration: none;
  font-weight: 800; font-size: 18px; line-height: 1.15;
  text-align: left;
  transition: transform 0.08s, box-shadow 0.08s;
}
.store:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--mist-lip); }
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.night .store { border-color: #fff; box-shadow: 0 4px 0 #A9B0C4; }
.night .store:active { box-shadow: 0 1px 0 #A9B0C4; }

/* 글자 위에서 입력 커서(I 모양)가 나오지 않게 */
body { cursor: default; caret-color: transparent; }
a, button, summary, .store { cursor: pointer; }

/* ── 목업 속 움직임 ── */
.tap {
  position: absolute; z-index: 3;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(58, 111, 240, 0.28);
  opacity: 0;
  pointer-events: none;
}
/* 뜻 펼치기: 앞면과 펼친 면이 번갈아 */
.flip img + img { position: absolute; inset: 0; animation: flip 6s infinite; }
.flip .tap { left: 50%; top: 31%; animation: tapA 6s infinite; }
@keyframes flip { 0%, 30% { opacity: 0; } 36%, 86% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes tapA {
  0%, 22% { opacity: 0; transform: scale(0.4); }
  27% { opacity: 1; transform: scale(1); }
  36% { opacity: 0; transform: scale(1.7); }
  78% { opacity: 0; transform: scale(0.4); }
  83% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(1.7); }
}
/* 퀴즈: 첫 보기를 눌러 맞히는 모습 */
.pick {
  position: absolute; z-index: 2;
  left: 5.6%; width: 88.8%; top: 66.1%; height: 6.3%;
  border: 3px solid var(--blue);
  border-radius: 12px;
  background: rgba(58, 111, 240, 0.12);
  opacity: 0;
}
.pickit .tap { left: 50%; top: 69.2%; }
.go .pick { animation: pick 4.2s both; }
.go .pickit .tap { animation: tapB 4.2s both; }
@keyframes pick {
  0%, 27% { opacity: 0; transform: scale(0.96); }
  31% { opacity: 1; transform: scale(1.03); }
  36%, 80% { opacity: 1; transform: none; }
  90%, 100% { opacity: 0; }
}
@keyframes tapB {
  0%, 16% { opacity: 0; transform: scale(0.4); }
  23% { opacity: 1; transform: scale(1); }
  33%, 100% { opacity: 0; transform: scale(1.7); }
}

/* ── 스크롤 따라 움직임 (--p: 화면 가운데서 벗어난 정도, --sy: 내린 거리) ── */
.demo .phone { transform: translateY(calc(var(--sy, 0) * 0.05px)) rotate(calc(var(--sy, 0) * 0.007deg)); }
.show .shot { transform: translateY(calc(var(--p, 0) * -56px)) rotate(calc(var(--p, 0) * 7deg)); }
.show:nth-of-type(even) .shot { transform: translateY(calc(var(--p, 0) * -56px)) rotate(calc(var(--p, 0) * -7deg)); }
.show .copy { transform: translateY(calc(var(--p, 0) * 34px)); }
.night .face { transform: translateY(calc(var(--p, 0) * 60px)) scale(calc(1 - var(--p, 0) * 0.35)); }

/* 숫자 둘레에 떠 있는 그림 단어들: 저마다 다른 빠르기로 흘러감 */
.line { position: relative; padding: 170px 0 180px; }
.line h2, .line p { position: relative; z-index: 1; }
.drift { position: absolute; inset: 0; pointer-events: none; }
.drift span {
  position: absolute;
  width: var(--w);
  transform: translateY(calc(var(--p, 0) * var(--s) * 0.6px)) rotate(calc(var(--r) + var(--p, 0) * var(--t)));
}
.drift img { display: block; width: 100%; animation: float 5s ease-in-out infinite; }
.drift span:nth-child(even) img { animation-duration: 6.4s; animation-delay: -2s; }
.drift span:nth-child(1) { left: 1%; top: 10%; --w: 118px; --s: -150; --r: -12deg; --t: 24deg; }
.drift span:nth-child(2) { left: 15%; top: 70%; --w: 84px; --s: 110; --r: 10deg; --t: -30deg; }
.drift span:nth-child(3) { left: -3%; top: 50%; --w: 96px; --s: -60; --r: 8deg; --t: 18deg; }
.drift span:nth-child(4) { right: 2%; top: 6%; --w: 128px; --s: 130; --r: 12deg; --t: -22deg; }
.drift span:nth-child(5) { right: 13%; top: 72%; --w: 100px; --s: -120; --r: -8deg; --t: 26deg; }
.drift span:nth-child(6) { right: -3%; top: 46%; --w: 90px; --s: 70; --r: -14deg; --t: -16deg; }
.drift span:nth-child(7) { left: 25%; top: 3%; --w: 70px; --s: 190; --r: 16deg; --t: 34deg; }
.drift span:nth-child(8) { right: 29%; top: 84%; --w: 74px; --s: -190; --r: 12deg; --t: -30deg; }
.drift span:nth-child(9) { left: 36%; top: 86%; --w: 64px; --s: 150; --r: -10deg; --t: 28deg; }
.drift span:nth-child(10) { right: 31%; top: 0%; --w: 78px; --s: -100; --r: -6deg; --t: -20deg; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; text-align: center; padding: 24px 0 48px; }
  .hero .lead { margin-left: auto; margin-right: auto; font-size: 18px; }
  .show { grid-template-columns: 1fr; gap: 28px; text-align: center; padding: 40px 0; }
  .show .copy, .show:nth-of-type(even) .copy { order: 0; }
  .show p, .line p, .night p { font-size: 17px; }
  .show .shot .phone { width: 236px; }
  .show .shot .phone:has(.live) { width: 300px; zoom: 0.787; }
  .show .fx { width: 400px; height: 400px; margin: -200px 0 0 -200px; }
  .line { padding: 150px 0 160px; }
  .hero .stores { justify-content: center; }
  .demo .phone { transform: none; }
  .show .copy { transform: none; }
  .show .shot, .show:nth-of-type(even) .shot { transform: translateY(calc(var(--p, 0) * -24px)) rotate(calc(var(--p, 0) * 5deg)); }
  .drift span { width: calc(var(--w) * 0.62); }
  .drift span:nth-child(1) { left: 2%; top: 4%; }
  .drift span:nth-child(2) { left: 6%; top: 82%; }
  .drift span:nth-child(3) { left: 40%; top: 9%; }
  .drift span:nth-child(4) { right: 3%; top: 3%; }
  .drift span:nth-child(5) { right: 6%; top: 84%; }
  .drift span:nth-child(6) { right: 38%; top: 88%; }
  .drift span:nth-child(n+7) { display: none; }
  .faq summary { font-size: 17px; }
  .night { padding: 64px 20px 72px; }
}
@media (max-width: 360px) {
  .hero .phone { width: 270px; }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-copy > *, .demo, .peek, .eye, .show .shot .phone, .night .face.idle .pupil,
  .peek.happy svg, .peek.sad svg, .peek.happy .beads, .live .slide.nudge, .live .slide.enter,
  .drift img, .flip img + img, .flip .tap { animation: none; }
}

/* 떠다니는 그림·기울어진 폰이 옆으로 넘쳐도 가로 스크롤이 생기지 않게 */
html, body { overflow-x: clip; }
