/* CHALLY 웹사이트 공용 스타일
   - 앱 theme.ts 와 같은 색: 화이트 기반, 브랜드 검정은 히어로/헤더, 오렌지는 가장 강한 행동 하나에만
   - 외부 폰트 없음(시스템 폰트) → 방문자 정보가 제3자에게 전송되지 않음 */
:root {
  --ink: #07090a;
  --ink-2: #14171a;
  --ink-line: #2a2e33;
  --on-ink: #ffffff;
  --on-ink-secondary: #b4b4be;
  --primary: #ff5a1f;
  --primary-pressed: #e04a12;
  --text: #111114;
  --text-secondary: #6b6b76;
  --surface: #f6f6f8;
  --border: #e6e6ea;
  --bg: #ffffff;
  --focus: #ff5a1f;
  --radius: 20px;
  --radius-sm: 16px;
  --max: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR',
    'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 키보드 사용자를 위한 본문 바로가기 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 10;
  background: var(--on-ink);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ───────── 헤더 ───────── */
.site-header {
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 1px solid var(--ink-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-block: 12px;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
}
.logo-link img {
  width: auto;
  height: 36px;
}
.site-nav {
  order: 3;
  width: 100%;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -10px;
}
.site-nav::-webkit-scrollbar {
  display: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 10px;
  color: var(--on-ink-secondary);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 10px;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--on-ink);
}
.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch a,
.lang-switch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--on-ink-secondary);
}
.lang-switch a:hover {
  color: var(--on-ink);
}
.lang-switch [aria-current='true'] {
  background: var(--on-ink);
  color: var(--ink);
}

@media (min-width: 760px) {
  .site-header .wrap {
    flex-wrap: nowrap;
    padding-block: 14px;
  }
  .logo-link img {
    height: 40px;
  }
  .site-nav {
    order: 0;
    width: auto;
    margin-inline: 0;
  }
}

/* ───────── 공통 요소 ───────── */
.eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.on-ink .eyebrow {
  color: var(--primary);
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--ink-line);
  background: var(--ink-2);
  color: var(--on-ink);
  font-size: 16px;
  font-weight: 600;
}
.coming-soon .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--on-ink-secondary);
  flex: none;
}
.coming-soon small {
  color: var(--on-ink-secondary);
  font-size: 14px;
  font-weight: 500;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding-inline: 24px;
  border-radius: 16px;
  /* 흰 글자 + 오렌지(#FF5A1F) 대비 3.1:1 → 큰 글자(19px 굵게) 기준으로 WCAG AA 충족 */
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease-out,
    background-color 160ms ease-out;
}
.button:active {
  transform: scale(0.97);
}
.primary {
  background: var(--primary);
  color: #fff;
}
.primary:hover,
.primary:active {
  background: var(--primary-pressed);
}

/* ───────── 랜딩: 히어로 ───────── */
.hero {
  background: var(--ink);
  color: var(--on-ink);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  gap: 40px;
  padding-block: 56px 0;
}
.hero h1 {
  font-size: clamp(38px, 9vw, 72px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-top: 14px;
}
.hero .lead {
  margin-top: 20px;
  max-width: 34em;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
  color: var(--on-ink-secondary);
}
.hero .cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.hero .cta p {
  font-size: 14px;
  color: var(--on-ink-secondary);
}
.hero-shot {
  justify-self: center;
  width: min(100%, 360px);
  margin-bottom: -2px;
}
.hero-shot img {
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--ink-line);
  border-bottom: 0;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
    padding-top: 88px;
  }
  .hero-copy {
    padding-bottom: 96px;
  }
  .hero-shot {
    justify-self: end;
    width: 380px;
  }
}

/* ───────── 랜딩: 숫자 요약 ───────── */
.facts {
  border-bottom: 1px solid var(--border);
}
.facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.facts li {
  padding-block: 28px;
  border-top: 1px solid var(--border);
}
.facts li:first-child {
  border-top: 0;
}
.facts strong {
  display: block;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.facts span {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
}
@media (min-width: 760px) {
  .facts ul {
    grid-template-columns: repeat(3, 1fr);
  }
  .facts li {
    padding: 40px 28px 40px 0;
    border-top: 0;
  }
  .facts li + li {
    padding-left: 28px;
    border-left: 1px solid var(--border);
  }
}

/* ───────── 랜딩: 섹션 ───────── */
.section {
  padding-block: clamp(64px, 10vw, 112px);
}
.section-surface {
  background: var(--surface);
}
.section-head {
  max-width: 40em;
}
.section-head h2 {
  margin-top: 10px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
}
.section-head p {
  margin-top: 14px;
  font-size: 18px;
  color: var(--text-secondary);
}

.feature {
  display: grid;
  gap: 32px;
  align-items: center;
  margin-top: clamp(48px, 8vw, 88px);
}
.feature-copy h3 {
  margin-top: 10px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
}
.feature-copy > p {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-secondary);
}
.feature-copy ul:not(.chips) {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.feature-copy ul:not(.chips) li {
  position: relative;
  padding-left: 22px;
}
.feature-copy ul:not(.chips) li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--text);
}
.shot {
  justify-self: center;
  width: min(100%, 340px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--border);
}
@media (min-width: 860px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  .feature.reverse .shot {
    order: -1;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
}

.cards {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
@media (min-width: 1000px) {
  .cards.four {
    grid-template-columns: repeat(4, 1fr);
  }
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card .num {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.card h3 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
}
.card p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* 마무리 CTA */
.closing {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
}
.closing h2 {
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 800;
  margin-top: 10px;
}
.closing p.sub {
  margin: 16px auto 0;
  max-width: 30em;
  color: var(--on-ink-secondary);
  font-size: 18px;
}
.closing .coming-soon {
  margin-top: 32px;
}

/* ───────── 문서(개인정보·약관·지원) ───────── */
.doc-hero {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.doc-hero .wrap {
  max-width: 820px;
  padding-block: clamp(40px, 7vw, 72px);
}
.doc-hero h1 {
  margin-top: 8px;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
}
.doc-hero p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 17px;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
}
.doc-meta span {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.doc .wrap {
  max-width: 820px;
  padding-block: 40px 96px;
}
.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 48px;
}
.doc .toc h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0;
}
.toc ol {
  margin: 12px 0 0;
  padding-left: 1.4em;
  display: grid;
  gap: 4px;
}
@media (min-width: 700px) {
  .toc ol {
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }
}
.doc .toc li + li {
  margin-top: 0;
}
.doc .toc li {
  font-size: 15px;
  line-height: 1.6;
}
.toc a {
  text-decoration: none;
  font-size: 15px;
}
.toc a:hover {
  text-decoration: underline;
}

.doc section {
  padding-top: 8px;
  margin-bottom: 44px;
}
.doc h2 {
  font-size: clamp(22px, 3.4vw, 26px);
  font-weight: 800;
  margin-bottom: 14px;
}
.doc h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 8px;
}
.doc p,
.doc li {
  font-size: 16px;
  line-height: 1.75;
}
.doc p + p {
  margin-top: 10px;
}
.doc ul,
.doc ol {
  margin: 10px 0;
  padding-left: 1.3em;
}
.doc li + li {
  margin-top: 4px;
}
.doc .muted {
  color: var(--text-secondary);
}
.callout {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.callout strong {
  display: block;
  margin-bottom: 2px;
}

.table-scroll {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
thead th {
  background: var(--surface);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}
tbody th {
  font-weight: 700;
}

/* FAQ */
.faq {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 160ms ease-out;
}
.faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}
.faq .answer {
  padding: 0 20px 18px;
  color: var(--text);
}
.faq .answer p + p,
.faq .answer ol,
.faq .answer ul {
  margin-top: 8px;
}

.contact-card {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}
.contact-card .email {
  display: inline-block;
  margin-top: 6px;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
  word-break: break-all;
}
.contact-card p {
  margin-top: 8px;
  color: var(--text-secondary);
}

/* ───────── 푸터 ───────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-secondary);
}
.site-footer .wrap {
  display: grid;
  gap: 16px;
  padding-block: 32px 40px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}
.site-footer .operator {
  line-height: 1.6;
}

/* ───────── 공유 링크 안내(open.html) ───────── */
.open-page {
  background: var(--ink);
  color: var(--on-ink);
}
.open-main {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.open-main .logo {
  width: 150px;
  height: auto;
}
.open-main h1 {
  margin-top: 24px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
}
.open-main #message {
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-ink-secondary);
}
.open-main .actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.open-main .button {
  width: 100%;
}
.open-main .note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-ink-secondary);
  text-align: center;
}
.open-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 16px;
  padding: 8px 24px 24px;
  font-size: 13px;
}
.open-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-ink-secondary);
  text-decoration: none;
}
.open-footer a:hover {
  color: var(--on-ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .button:active {
    transform: none;
  }
}
