/* Thaw 웹 (랜딩·법적 고지) 공용 스타일
 * 토큰은 BRAND.md 팔레트를 3층으로 옮긴 것 — L1 palette(raw hex) → L2 semantic → L3 형태.
 * raw hex 는 L1 에서만 쓴다. 색온도가 정보라는 원칙(콜드 베이스 + 웜 정점)을 웹에서도 지킨다. */

:root {
  /* L1 — palette */
  --p-bg: #eff6fa;
  --p-bg-warm: #fbe3c2;
  --p-ice: #45bee4;
  --p-ice-light: #9fdcf2;
  --p-ice-pale: #d9e9f5;
  --p-ice-mid: #2fa8d5;
  --p-ice-deep: #17708f;
  --p-ice-cta: #1a7fa6;
  --p-warm: #f79b3d;
  --p-warm-grad-from: #dd6e12;
  --p-warm-grad-to: #bc5506;
  --p-warm-ink: #3a1b02;
  --p-warm-deep: #a85808;
  --p-cream: #fbdca8;
  --p-ink: #2b3a44;
  --p-muted: #5e7280;
  --p-white: #ffffff;

  /* L2 — semantic */
  --bg: var(--p-bg);
  --surface: rgba(255, 255, 255, 0.8);
  --surface-solid: var(--p-white);
  --text: var(--p-ink);
  --text-muted: var(--p-muted);
  --accent-text: var(--p-ice-deep); /* 아이스 텍스트 — 흰 배경 5.6:1 */
  --warm-text: var(--p-warm-deep); /* 웜 텍스트 — 흰 배경 5.2:1 */
  --cta-cold: var(--p-ice-cta); /* 콜드 CTA 면 + 흰 라벨 4.54:1 */
  --border: rgba(43, 58, 68, 0.08);

  /* L3 — 형태·간격 (4px 그리드, 타입 스케일 8단) */
  --r-outer: 44px;
  --r-card: 32px;
  --r-button: 20px;
  --shadow-clay:
    0 18px 40px rgba(43, 58, 68, 0.1), 0 4px 12px rgba(43, 58, 68, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --shadow-soft: 0 8px 24px rgba(43, 58, 68, 0.08);

  --font-heading: "Jua", "Fredoka", system-ui, sans-serif;
  --font-wordmark: "Fredoka", system-ui, sans-serif;
  --font-body:
    "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont,
    system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600; /* 본문 Pretendard SemiBold */
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--p-ice-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 400; /* Jua 는 400 단일 웨이트 */
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ── 레이아웃 ─────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-wordmark);
  font-size: 22px;
  text-decoration: none;
  color: var(--text);
}

.wordmark img {
  width: 84px;
  height: auto;
  display: block;
}

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

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-button);
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--accent-text);
}

/* ── 히어로 — 중앙 정렬 한 컬럼, 장면 이미지가 주인공 ──── */

.hero {
  text-align: center;
  padding: 24px 0 16px;
}

@media (min-width: 720px) {
  .hero {
    padding: 40px 0 24px;
  }
}

.hero h1 {
  font-size: 36px;
  margin: 0 0 12px;
  text-wrap: balance;
}

/* 1회성 진입 연출 — 장식 무한 애니는 브랜드 금지, transform/opacity 만 사용 */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1,
.hero-lead,
.hero .actions,
.hero .scene,
.hero .story {
  animation: rise-in 560ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero-lead {
  animation-delay: 90ms;
}

.hero .actions {
  animation-delay: 180ms;
}

.hero .scene {
  animation-delay: 270ms;
}

.hero .story {
  animation-delay: 300ms;
}

@media (min-width: 720px) {
  .hero h1 {
    font-size: 48px;
  }
}

.hero-lead {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 28px;
  word-break: keep-all; /* 한국어 어절 중간 줄바꿈 방지 — 공백(어절)에서만 줄바꿈 */
}

/* 좁은 화면에선 강제 줄바꿈을 풀어 고아 어절("열어요.")을 없앤다 */
@media (max-width: 560px) {
  .hero-lead {
    max-width: 21em;
    margin-inline: auto;
  }

  .hero-lead br {
    display: none;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* 장면 이미지 — 배경색이 페이지 bg 와 같아 프레임·카드 없이 그대로 잇는다.
   가장자리만 살짝 페더링해 톤 미세 차이를 지운다 */
.scene {
  position: relative;
  margin: 4px auto 0;
  max-width: 768px; /* 원본 1536px 의 정확히 1/2 — 레티나 2x */
}

/* 경계 처리는 CSS가 아니라 색 정렬로 한다: 히어로 WebP 배경은 완전 평탄화돼
   #F0F6FB로 디코딩되고, 랜딩 페이지 배경(index.html의 --p-bg 오버라이드)이
   같은 값이라 이미지↔페이지 경계가 존재하지 않는다. 페이드·페더는 띠를 만들어 금지 */

.scene img {
  display: block;
  width: 100%;
  height: auto;
  /* 마스크 페이드 없음 — 이미지 배경을 페이지 bg(#EFF6FA)와 픽셀 단위로 일치시켜
     (전 픽셀 시프트 + sharp_yuv) 경계 자체가 존재하지 않는다. 페이드는 오히려 띠로 읽힌다 */
}

/* 좁은 화면: .wrap 패딩을 뚫고 화면 끝까지 풀블리드로 크롭 — 좌우 경계선이 생길 수 없다.
   마스크는 상하 페이드만 남긴다 (좌우 페이드가 크롭에 잘리면 반투명 경계선이 드러난다) */
@media (max-width: 560px) {
  .scene {
    /* .wrap 의 좌우 패딩(20px)을 정확히 상쇄해 화면 끝까지 — 100vw 와 달리
       스크롤바 폭이 끼어들 여지가 없어 가로 오버플로가 원천 차단된다 */
    width: calc(100% + 40px);
    max-width: none;
    margin-inline: -20px;
    overflow: hidden;
  }

  .scene img {
    width: 136%;
    margin-left: -18%;
  }
}

.story {
  margin: 4px 0 0;
  font-size: 16px; /* 문장 — D-086 역할 매핑상 14(꼬리표) 아님 */
  color: var(--text); /* muted는 흐리게 읽힘 — 브랜드 오브젝티브라 본문 잉크로 */
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-button);
  /* 색면 버튼 라벨은 헤딩(D-077 경계 ②), 주 CTA 라벨은 18px(D-086) */
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400; /* Jua 단일 웨이트 */
  text-decoration: none;
  border: 0;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease;
}

.btn-cold {
  background: var(--cta-cold);
  color: var(--p-white);
}

.btn-ghost {
  background: var(--surface);
  color: var(--accent-text);
}

.btn:active {
  transform: scale(0.96); /* press 스프링 스퀴시 */
}

.store-ic {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
}

/* ── 법적 고지 문서 ───────────────────────────────────── */

.doc {
  background: var(--surface-solid);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: 32px 24px;
  margin-bottom: 48px;
}

@media (min-width: 720px) {
  .doc {
    padding: 48px;
  }
}

.doc h1 {
  font-size: 36px;
  margin: 0 0 8px;
}

.doc h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.doc h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 32px;
}

.doc p,
.doc li {
  font-size: 16px;
}

.doc ul {
  padding-left: 20px;
}

.doc li {
  margin-bottom: 8px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.doc th,
.doc td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.doc th {
  background: var(--p-ice-pale);
  font-weight: 700;
}

/* 구분 열은 줄바꿈시키지 않는다 ("공부 기록"이 두 줄로 쪼개지는 것 방지) */
.doc td:first-child {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .doc td:first-child {
    white-space: normal;
  }
}

.doc .meta {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* 사람이 확정해야 하는 값 — 배포 전에 반드시 채운다. 눈에 띄게 남긴다 */
.todo {
  background: var(--p-cream);
  color: var(--p-warm-ink);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
  white-space: normal;
}

.notice {
  background: var(--p-ice-pale);
  border-radius: var(--r-button);
  padding: 16px 20px;
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--text);
}

/* ── 푸터 ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px; /* 좌우는 .wrap 이 담당 — 여기서 겹치면 푸터만 본문보다 넓어진다 */
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 20px;
  top: 20px;
  z-index: 10;
  background: var(--surface-solid);
  padding: 12px 16px;
  border-radius: var(--r-button);
  box-shadow: var(--shadow-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
