/* 문득 랜딩 — 팔레트는 style.css(앱 Color.kt 동기화)와 동일 토큰 + 키비주얼 포인트 색 */
:root {
  --cream: #f2e8d6;
  --cream-dark: #ede3cf;
  --darker-cream: #f7efdf;
  --paper: #fdf8ee;
  --camel: #c0894a;
  --camel-dark: #9a6a30;
  --camel-deep: #825722;          /* eyebrow 텍스트 — cream-dark 배경 대비 4.94:1 (WCAG AA) */
  --text-primary: #2f2616;
  --text-secondary: #8a7c64;
  --text-secondary-strong: #796c54; /* 푸터 텍스트 — paper 배경 대비 4.86:1 (WCAG AA) */
  --divider: #efe7d6;
  --accent-pink: #e88f8f;
  --nav-h: 60px;

  /* 기능 섹션 색상 코딩 — 히어로 플로팅 카드와 1:1 대응 */
  --sage: #8fa06a;          /* STEP 1 노트 가져오기 */
  --sage-soft: #eef0df;
  --apricot: #d09048;       /* STEP 2 AI 퀴즈 (브랜드 카멜 계열) */
  --apricot-soft: #f8ead3;
  --dusk: #7e93ad;          /* STEP 3 잠금화면 복습 */
  --dusk-soft: #e7edf3;
  --curve-decay: #6b5c44;   /* 다크 섹션 위 '복습 없음' 곡선 */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* 가로 스크롤 방지 — 모바일에서 화면이 좌우로 밀리지 않도록 뷰포트 밖 요소를 잘라냄
   (clip은 스크롤 컨테이너를 만들지 않아 히어로 sticky에 영향 없음) */
html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

iframe {
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-primary);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.7;
  font-size: 17px;
  word-break: keep-all;
  padding-top: var(--nav-h);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

section {
  padding: 88px 24px;
}

.section-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cream-dark);
  color: var(--camel-deep);
  font-size: 14px;
  font-weight: 700;
}

h2 {
  font-size: clamp(26px, 5vw, 38px);
}

/* 스크롤 등장 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* 첫 화면(히어로) 등장 — JS reveal 로 게이트하면 스크립트 실행 전까지 LCP 텍스트가
   opacity 0 으로 잡혀 렌더가 수 초 지연된다(느린 4G 실측 2.8s). CSS 만으로 즉시 재생 */
.reveal-now {
  animation: reveal-in 0.6s ease both;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-now { animation: none; }
}

/* 스티키 헤더 */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(253, 248, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
  z-index: 20;
}

.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 19px;
}

.nav-brand img {
  border-radius: 8px;
}

.btn-nav {
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
}

/* Hero — 좌 카피 · 우 폰 (climbx 레이아웃) */
.hero {
  padding: 72px 24px 88px;
  background: linear-gradient(var(--cream) 0%, var(--paper) 90%);
}

.hero-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
}

.hero-copy {
  flex: 1 1 440px;
  max-width: 580px;
  text-align: left;
}

.hero-copy .cta-group {
  justify-content: flex-start;
}

.hero-shot {
  flex: 0 1 340px;
  position: relative;
}

/* 히어로 h1 문구 로테이터 — 같은 그리드 셀에 겹쳐 높이 점프 없음 */
.rotator {
  display: inline-grid;
  text-align: inherit;
}

.rotator .phrase {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(0.6em);
  transition: opacity 0.5s ease, transform 0.5s ease;
  white-space: nowrap;
}

.rotator .phrase.is-on {
  opacity: 1;
  transform: none;
}

/* 지나간 문구는 위로 빠져나감 (스크롤 구동 시 방향감) */
.rotator .phrase.is-past {
  opacity: 0;
  transform: translateY(-0.6em);
}

/* 스크롤 유도 화살표 — 핀 상태에서만 의미 있으므로 데스크톱 전용 */
.scroll-cue {
  display: none;
}

/* 플로팅 기능 카드 — 데스크톱에선 폰 주위를 떠다니고, 모바일에선 칩 행 */
.float-cards {
  list-style: none;
  padding: 0;
  margin: 0;
}

.float-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--fx-soft, #fff);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--fx, var(--camel));
  border-radius: 14px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 6px 16px rgba(47, 38, 22, 0.1);
  white-space: nowrap;
}

.float-card svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--fx, var(--camel));
}

/* epop식 스크롤 핀 — 트랙을 스크롤하는 동안 히어로가 고정되고 문구가 전환됨.
   모바일은 히어로가 화면보다 길어 트랙 높이를 JS가 지정(히어로 높이 + 전환 거리) */
.hero-track .hero {
  position: sticky;
  top: var(--nav-h);
}

@media (min-width: 641px) {
  /* 데스크톱: 문구와 폰 장면을 처음부터 함께 표시, 트랙은 vh 기준 */
  .hero-track {
    height: 260vh;
  }

  .hero-track .hero {
    min-height: calc(100vh - var(--nav-h));
    max-height: calc(100vh - var(--nav-h));
    padding-top: 24px;
    padding-bottom: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* .hero-pin은 JS가 스크롤 모드일 때만 부여 — JS 미동작 시 기본 2단 레이아웃 유지 */
  .hero-pin .hero-inner {
    display: grid;
    grid-template-columns: minmax(320px, 580px) 340px;
    gap: 56px;
    justify-content: center;
    align-items: center;
  }

  .hero-pin h1 {
    font-size: clamp(32px, 6.5vw, 52px);
  }

  .hero-pin .hero-shot {
    width: 340px;
    min-width: 0;
    justify-self: center;
  }

  .scroll-cue {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 30px;
    width: 14px;
    height: 14px;
    border-right: 3px solid var(--camel-dark);
    border-bottom: 3px solid var(--camel-dark);
    border-radius: 1px;
    opacity: 0.5;
    transform: translateX(-50%) rotate(45deg);
    animation: cue-bounce 1.6s ease-in-out infinite;
  }

  .float-card {
    position: absolute;
    z-index: 5;
    animation: bob 5s ease-in-out infinite;
  }

  .float-card:nth-child(1) {
    left: -96px;
    top: 11%;
    animation-delay: 0s;
  }

  .float-card:nth-child(2) {
    right: -78px;
    top: 42%;
    animation-duration: 5.8s;
    animation-delay: -1.7s;
  }

  .float-card:nth-child(3) {
    left: -78px;
    bottom: 13%;
    animation-duration: 6.4s;
    animation-delay: -3.4s;
  }
}

@keyframes bob {
  50% {
    transform: translateY(-10px);
  }
}

@keyframes cue-bounce {
  50% {
    transform: translate(-50%, 8px) rotate(45deg);
  }
}

/* 정적 화면 iframe — 폰 프레임(iphone-frame.png)·그림자는 화면 내부에서 그림 */
.screen-demo {
  width: 340px;
  max-width: 340px;
  aspect-ratio: 1 / 2; /* 프레임(449×910 좌표) × 폭 기준 스케일 + 상하 여유 */
  border: 0;
  display: block;
  margin: 0 auto;
}

h1 {
  font-size: clamp(32px, 6.5vw, 52px);
}

h1 em {
  font-style: normal;
  color: var(--camel-dark);
}

.sub {
  margin: 18px 0 28px;
  font-size: clamp(16px, 2.5vw, 19px);
  color: var(--text-secondary);
}

/* CTA */
.cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  font-family: inherit;
  padding: 15px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 6px 18px rgba(47, 38, 22, 0.22);
}

.btn-store:hover {
  transform: translateY(-1px);
}

.btn-store:active {
  transform: scale(0.97);
}

/* 공감 — 말풍선 */
.empathy {
  background: var(--paper);
}

.bubbles {
  max-width: 560px;
  margin: 36px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  margin: 0;
  max-width: 88%;
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 20px;
  text-align: left;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(47, 38, 22, 0.05);
}

.bubble.right {
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px;
  background: var(--cream);
}

.empathy-close {
  margin: 36px 0 0;
  font-size: clamp(18px, 3vw, 22px);
}

.empathy-close strong {
  color: var(--camel-dark);
}

/* 기능 섹션 — epop 스타일 색상 코딩 카드 템플릿 (섹션마다 --fx/--fx-soft 지정) */
.feature {
  padding: 44px 24px;
  background: var(--paper);
}

.feature:first-of-type {
  padding-top: 88px;
}

.feature-head {
  max-width: 880px;
  margin: 0 auto 44px;
  text-align: center;
}

.feature-card {
  max-width: 1060px;
  margin: 0 auto;
  border-radius: 36px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  text-align: left;
  background: linear-gradient(160deg, var(--fx-soft, var(--cream)), #fff 115%);
}

.feature-copy {
  flex: 1 1 320px;
  max-width: 420px;
}

.feature-label {
  display: inline-block;
  background: var(--fx, var(--camel));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.feature-copy h2 {
  font-size: clamp(23px, 3.6vw, 30px);
  margin-bottom: 10px;
}

.feature-copy p {
  color: var(--text-secondary);
  margin: 0;
}

/* 인터랙티브 데모 안내 배지 (STEP 1·3 전용) */
.feature .demo-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #e4d5b8;
  border-radius: 999px;
  color: var(--camel-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.demo-hint .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx, var(--camel));
  flex-shrink: 0;
  animation: hint-pulse 1.8s ease-out infinite;
}

@keyframes hint-pulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 137, 74, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(192, 137, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 137, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .demo-hint .dot { animation: none; }
  .float-card { animation: none; }
  .rotator .phrase { transition: none; }
}

.feature .screen-demo {
  flex: 0 1 340px;
}

/* 인터랙티브 데모 iframe — 폰 프레임(iphone-frame.png)/그림자는 데모 내부에서 그림 */
.step-demo {
  flex: 0 1 340px;
  width: 340px;
  max-width: 340px;
  aspect-ratio: 4 / 9; /* 340×765: 프레임(910×0.72) + 점·재시작 크롬 + 그림자 여유 */
  border: 0;
  display: block;
}

/* 망각곡선 — 다크 브라운 데이터 섹션 (epop 그래프 섹션 대응) */
.curve {
  background: var(--text-primary);
  color: var(--cream);
}

.curve .eyebrow {
  background: rgba(242, 232, 214, 0.12);
  color: var(--cream);
}

.curve h2 {
  color: #fff;
}

.curve h2 .counter-wrap {
  color: var(--accent-pink);
  font-variant-numeric: tabular-nums;
}

.curve-chart {
  max-width: 640px;
  margin: 40px auto 0;
}

.curve-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.curve-chart .c-decay {
  fill: none;
  stroke: var(--curve-decay);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.curve-chart .c-keep {
  fill: none;
  stroke: var(--accent-pink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 그리기 애니메이션 — JS가 dasharray/dashoffset을 실측 세팅, .drawn에서 0으로 */
.curve-chart .c-decay,
.curve-chart .c-keep {
  transition: stroke-dashoffset 1.2s ease-out;
}

.curve-chart .c-keep {
  transition: stroke-dashoffset 1.8s ease-out 0.3s;
}

.curve-chart .rev-pt {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.curve-chart .rev-pt circle {
  fill: var(--accent-pink);
  stroke: var(--text-primary);
  stroke-width: 2.5;
}

.curve-chart .rev-pt text,
.curve-chart .axis {
  fill: rgba(242, 232, 214, 0.7);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
}

.curve-chart .axis {
  font-weight: 600;
  fill: rgba(242, 232, 214, 0.45);
}

.curve-chart.drawn .rev-pt {
  opacity: 1;
}

.curve-chart.drawn .rev-pt:nth-of-type(1) { transition-delay: 1.2s; }
.curve-chart.drawn .rev-pt:nth-of-type(2) { transition-delay: 1.5s; }
.curve-chart.drawn .rev-pt:nth-of-type(3) { transition-delay: 1.8s; }

.curve-legend {
  display: flex;
  gap: 22px;
  justify-content: center;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(242, 232, 214, 0.8);
}

.curve-legend .lg::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

.curve-legend .lg.decay::before {
  background: var(--curve-decay);
  height: 2.5px;
}

.curve-legend .lg.keep::before {
  background: var(--accent-pink);
}

.curve-body {
  max-width: 560px;
  margin: 32px auto 0;
  font-size: 18px;
  color: rgba(242, 232, 214, 0.75);
}

.curve-body strong {
  color: var(--accent-pink);
}

.curve-footnote {
  margin: 20px auto 0;
  font-size: 13px;
  color: rgba(242, 232, 214, 0.4);
}

/* USP 아코디언 */
.usp {
  background: var(--darker-cream);
}

.usp-list {
  max-width: 640px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.usp-item,
.faq-item {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 18px;
  padding: 0;
}

.usp-item summary,
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 48px 18px 22px;
  font-weight: 800;
  font-size: 17px;
  position: relative;
}

.usp-item summary::-webkit-details-marker,
.faq-item summary::-webkit-details-marker {
  display: none;
}

.usp-item summary::after,
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--camel-dark);
  border-bottom: 2.5px solid var(--camel-dark);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}

.usp-item[open] summary::after,
.faq-item[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.usp-item p,
.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--text-secondary);
  overflow: hidden; /* 펼침/접힘 높이 애니메이션용 클리핑 */
}

/* 접힘 애니메이션 동안(open 유지 상태) 화살표는 먼저 닫힘 방향으로 */
.usp-item.closing summary::after,
.faq-item.closing summary::after {
  transform: translateY(-70%) rotate(45deg);
}

/* 아웃트로 CTA */
.outro {
  background: var(--cream);
}

.final-demo {
  width: 300px;
  max-width: 300px;
  margin: 0 auto 20px;
}

.outro .sub {
  margin: 12px 0 26px;
}

/* FAQ */
.faq {
  background: var(--paper);
}

.faq-list {
  max-width: 640px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

/* Footer */
footer.site {
  padding: 36px 24px calc(48px + 74px);
  border-top: 1px solid var(--divider);
  font-size: 13px;
  color: var(--text-secondary-strong);
  background: var(--paper);
}

.foot-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.foot-brand {
  margin: 0 0 8px;
}

footer.site nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

footer.site a {
  color: var(--text-secondary-strong);
}

/* 모바일 하단 고정 CTA */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(253, 248, 238, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--divider);
  z-index: 20;
  display: none;
}

.cta-bar .btn-store {
  width: 100%;
  justify-content: center;
}

@media (max-width: 640px) {
  .cta-bar {
    display: block;
  }

  .pc-br {
    display: none;
  }

  section {
    padding: 64px 20px;
  }

  .hero {
    padding: 40px 20px 64px;
  }

  /* 1단계: 문구 블록만 첫 화면을 꽉 채움 → 핀 구간에서 문구 전환 → 2단계: 폰 장면이 아래에서 올라옴 */
  .hero-copy {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - var(--nav-h) - 40px);
    min-height: calc(100svh - var(--nav-h) - 40px);
    padding-bottom: 96px; /* 하단 고정 CTA 바(약 82px) 위로 화살표 자리 확보 */
  }

  .hero-copy .cta-group {
    justify-content: center;
  }

  /* 스크롤 유도 화살표 — 문구 블록 하단 */
  .hero-copy::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100px;
    width: 14px;
    height: 14px;
    border-right: 3px solid var(--camel-dark);
    border-bottom: 3px solid var(--camel-dark);
    border-radius: 1px;
    opacity: 0.5;
    transform: translateX(-50%) rotate(45deg);
    animation: cue-bounce 1.6s ease-in-out infinite;
  }

  .hero-shot {
    flex-basis: auto;
  }

  .hero-shot .screen-demo {
    width: min(300px, 72vw);
    max-width: min(300px, 72vw);
  }

  /* 플로팅 카드 → 폰 아래 칩 행 */
  .float-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 22px;
  }

  .float-card {
    font-size: 13px;
    padding: 7px 12px;
    box-shadow: none;
  }

  .feature {
    padding: 28px 20px;
  }

  .feature:first-of-type {
    padding-top: 64px;
  }

  .feature-card {
    padding: 36px 22px;
    border-radius: 26px;
  }

  .step-demo,
  .feature .screen-demo {
    flex-basis: auto;
    width: min(320px, 82vw);
    max-width: min(320px, 82vw);
  }
}

@media (min-width: 641px) {
  footer.site {
    padding-bottom: 48px;
  }
}

/* 모션 최소화 — 곡선 즉시 완성, 히어로 핀 해제 (기본 규칙보다 뒤에 두어 소스 순서로 이김) */
@media (prefers-reduced-motion: reduce) {
  .curve-chart .c-decay,
  .curve-chart .c-keep,
  .curve-chart .rev-pt {
    transition: none;
    opacity: 1;
  }

  .hero-track {
    height: auto;
  }

  .hero-track .hero {
    position: static;
    min-height: 0;
  }

  .scroll-cue {
    display: none;
  }

  .hero-copy::after {
    animation: none;
  }
}
