/* 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;
}

/* 배경 블롭 — 슬로 드리프트. 콜드 베이스 위에 웜을 한 방울만 둔다 */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

body::before {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: var(--p-ice-light);
  opacity: 0.55;
  animation: drift 24s ease-in-out infinite alternate;
}

body::after {
  width: 320px;
  height: 320px;
  bottom: -140px;
  right: -80px;
  background: var(--p-cream);
  opacity: 0.5;
  animation: drift 30s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(20px, -20px, 0);
  }
}

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 {
  display: grid;
  gap: 32px;
  align-items: center;
  padding: 32px 0 48px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 48px 0 64px;
  }
}

.hero h1 {
  font-size: 36px;
  margin: 12px 0 16px;
}

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

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--accent-text);
  font-size: 14px;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-ice);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-button);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  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 스프링 스퀴시 */
}

/* ── 얼음 오브젝트 (히어로 비주얼) ────────────────────── */

.ice {
  position: relative;
  aspect-ratio: 1;
  max-width: 320px;
  margin-inline: auto;
  width: 100%;
  border-radius: var(--r-outer);
  background: linear-gradient(
    170deg,
    var(--p-white) 0%,
    var(--p-ice-light) 46%,
    var(--p-ice) 100%
  );
  box-shadow: var(--shadow-clay);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* 진행률에 비례해 웜이 아래에서 번진다 — 온도 = 정보 */
.ice::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(
    to top,
    var(--p-bg-warm) 0%,
    rgba(251, 227, 194, 0) 100%
  );
}

.ice span {
  position: relative;
  font-size: 96px;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(43, 58, 68, 0.18));
}

/* ── 카드 ─────────────────────────────────────────────── */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  padding-bottom: 48px;
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.card h2 {
  font-size: 22px;
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
}

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

.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;
  }
}
