:root {
  --navy: #0f2a43;
  --navy-deep: #0a1d30;
  --amber: #f5a524;
  --amber-dark: #d98c0f;
  --ink: #1c2733;
  --muted: #46586a; /* 40-50대 가독성 — 저대비 회색 금지 (스펙 2차) */
  --line: #e3e9ef;
  --bg: #f7f9fb;
  --card: #ffffff;
  --radius: 10px;
  --header-h: 60px;
  font-size: 17px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo",
    "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.3; margin: 0 0 0.5rem; }
a { color: inherit; }

.btn-primary {
  display: inline-block;
  background: var(--amber);
  color: var(--navy-deep);
  font-weight: 700;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.6rem;
  cursor: pointer;
  font-size: 1.05rem;
}
.btn-primary:hover { background: var(--amber-dark); }
.btn-lg { padding: 1rem 2.4rem; font-size: 1.2rem; }
.btn-block { display: block; width: 100%; padding: 0.95rem; font-size: 1.1rem; }
.cta-note { color: #c6d3e0; font-size: 0.95rem; margin-top: 0.7rem; }
.bottom-cta .cta-note { color: var(--muted); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  padding: 0.35rem 0.9rem;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ---- 랜딩 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 1.5rem;
  background: var(--navy-deep);
  color: #fff;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; }

/* 헤더 탭 — hover·활성(scrollspy) 시 amber 밑줄 */
.header-tabs { display: flex; gap: 1.6rem; margin-left: auto; margin-right: 1.2rem; }
.header-tabs a {
  position: relative;
  color: #c6d3e0;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 4px 2px;
}
.header-tabs a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.header-tabs a:hover { color: #fff; }
.header-tabs a[aria-current="true"] { color: #fff; }
.header-tabs a[aria-current="true"]::after { transform: scaleX(1); }
/* sticky 헤더에 가리지 않게 앵커 착지 보정 */
#how, #features { scroll-margin-top: calc(var(--header-h) + 1rem); }

.hero {
  /* 수직 그라데이션 — 상단 전폭이 헤더(--navy-deep)와 같아 경계선이 안 보인다 */
  background: linear-gradient(180deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: 2rem 1.5rem 2.5rem;
  overflow: hidden;
  /* 첫 화면을 항상 뷰포트에 꽉 채운다 (sticky 헤더 제외분) —
     내용이 더 길면 min-height 라 자연스럽게 늘어난다 */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  align-items: center;
}
.hero-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.hero-sub {
  color: #d4dee8;
  max-width: 32rem;
  margin: 1.1rem 0 2rem;
  font-size: 1.08rem;
}

/* 한 번의 등장 애니메이션 — 과한 모션은 피한다 */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero-copy > * { animation: rise 0.55s ease both; }
.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.16s; }
.hero-visual { animation: rise 0.65s 0.2s ease both; }

/* 폰 목업 — 느린 부유 + 메일 내용 순차 등장 (등장 후 잔잔한 모션만 유지) */
@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-9px); }
}
.phone { animation: float 5s 1.4s ease-in-out infinite alternate; }
.mail-card > * { animation: rise 0.45s ease both; }
.mail-card > *:nth-child(1) { animation-delay: 0.5s; }
.mail-card > *:nth-child(2) { animation-delay: 0.58s; }
.mail-card > *:nth-child(3) { animation-delay: 0.66s; }
.mail-card > *:nth-child(4) { animation-delay: 0.74s; }
.mail-card > *:nth-child(5) { animation-delay: 0.82s; }
.mail-card > *:nth-child(6) { animation-delay: 0.9s; }
.mail-card > *:nth-child(7) { animation-delay: 0.98s; }
.mail-card > *:nth-child(8) { animation-delay: 1.06s; }

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-visual, .phone, .mail-card > * { animation: none; }
}

/* 폰 목업 — 실제 폰에서 열어 본 실제 메일 화면을 그대로 재현한다.
   내부 치수는 px 고정(루트 rem 확대와 무관하게 목업 비율 유지). */
.hero-visual { justify-self: center; }
.phone {
  position: relative;
  width: 320px;
  background: linear-gradient(145deg, #2a3542, #0b1622 30%);
  border-radius: 44px;
  padding: 11px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 30px 70px rgba(4, 12, 22, 0.55),
    0 6px 18px rgba(4, 12, 22, 0.45);
}
/* 측면 버튼 (전원·볼륨) */
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  right: -2.5px;
  width: 2.5px;
  border-radius: 2px;
  background: #1c2836;
}
.phone::before { top: 130px; height: 62px; }
.phone::after { top: 96px; height: 26px; left: -2.5px; right: auto; }
.phone-screen {
  position: relative;
  background: #fff;
  border-radius: 34px;
  overflow: hidden;
  color: var(--ink);
  text-align: left; /* 모바일 히어로의 center 정렬을 상속받지 않는다 */
}
.phone-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: 12px;
  background: #0b1622;
  z-index: 2;
}
.phone-homebar {
  width: 110px;
  height: 4.5px;
  border-radius: 3px;
  background: #111;
  opacity: 0.85;
  margin: 6px auto 7px;
}
.mail-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 26px 4px;
  background: #fff;
}
.sb-time { font-size: 12.5px; font-weight: 700; color: #111; letter-spacing: 0.02em; }
.sb-icons { display: flex; align-items: center; gap: 4px; }

/* Gmail 풍 메일 앱 크롬 */
.mail-appbar {
  display: flex;
  align-items: center;
  padding: 8px 14px 6px;
  background: #fff;
}
.appbar-back { display: inline-flex; }
.appbar-spacer { flex: 1; }
.appbar-dots { color: #3c4043; font-size: 15px; font-weight: 700; }
.mail-subjectline {
  padding: 2px 16px 8px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #202124;
}
.mail-inbox-tag {
  display: inline-block;
  background: #eceff3;
  color: #5f6368;
  font-size: 9.5px;
  font-weight: 500;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}
.mail-sender-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 16px 10px;
}
.mail-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--navy-deep);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mail-sender-meta { line-height: 1.3; min-width: 0; }
.mail-sender-name { display: block; font-size: 12.5px; font-weight: 700; color: #202124; }
.mail-time { color: #5f6368; font-weight: 400; font-size: 10.5px; margin-left: 4px; }
.mail-sender-to { display: block; font-size: 10.5px; color: #5f6368; }

/* 메일 본문 — 실제 다이제스트 템플릿(회색 캔버스 + 흰 카드 + 표) 축소 재현.
   색·강조는 collector pipeline/digest.py 와 동일. */
.mail-canvas { background: #f4f5f7; padding: 10px 10px 12px; }
.mail-brand { font-size: 13px; font-weight: 700; color: #20232a; padding: 0 4px; }
.mail-brand-sub { font-size: 9.5px; color: #8a919c; padding: 0 4px 8px; }
.mail-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 10px 6px;
}
.mail-profile { font-weight: 700; font-size: 12px; color: #20232a; }
.mail-profile span { color: #8a919c; font-weight: 400; font-size: 9.5px; }
.mail-region { font-size: 10px; font-weight: 700; color: #374151; margin: 10px 0 3px; }
/* 컬럼 헤더 — 카드 상단에 한 번만 */
.mail-cols {
  display: grid;
  grid-template-columns: 1fr 52px 58px;
  gap: 6px;
  font-size: 8px;
  color: #8a919c;
  font-weight: 600;
  margin-top: 7px;
  padding: 0 2px 3px;
  border-bottom: 1px solid #e5e7eb;
}
.mail-cols .col-r { text-align: right; }
.mail-row {
  display: grid;
  grid-template-columns: 1fr 52px 58px;
  gap: 6px;
  padding: 4px 2px 5px;
  font-size: 10px;
  line-height: 1.4;
}
.mail-row + .mail-region { border-top: 1px solid #eef0f3; padding-top: 7px; }
.mail-cell-title { min-width: 0; }
.mail-title { display: block; font-weight: 600; color: #1a56db; }
.mail-bidno { display: block; color: #9aa1ab; font-size: 8px; margin-top: 1px; }
.mail-cell-price { text-align: right; white-space: nowrap; color: #20232a; }
.mail-cell-close { white-space: nowrap; color: #20232a; }
.mail-cell-close.urgent { color: #c0392b; font-weight: 700; } /* 메일 URGENT_COLOR */
.mail-footnote {
  text-align: center;
  font-size: 8.5px;
  color: #8a919c;
  padding: 8px 4px 0;
}
.sample-caption {
  text-align: center;
  color: #6d8199;
  font-size: 0.78rem;
  margin-top: 0.9rem;
}

.steps { max-width: 60rem; margin: 3.5rem auto 0; padding: 0 1.5rem; text-align: center; }
.section-title { font-size: 1.5rem; margin-bottom: 1.4rem; }
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  text-align: left;
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
}
.step-num {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--amber);
  color: var(--navy-deep);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: 0.98rem; margin: 0; }

.value-props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: 60rem;
  margin: 3rem auto 3.5rem;
  padding: 0 1.5rem;
}
.prop {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.prop h2 { font-size: 1.1rem; }
.prop p { color: var(--muted); font-size: 0.98rem; margin: 0; }

.bottom-cta { text-align: center; margin: 0 0 4rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--navy-deep);
  color: #8fa3b8;
  font-size: 0.85rem;
}

/* ---- 설정 ---- */
.settings { max-width: 40rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.account { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.9rem; min-width: 0; }
.account > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account form { flex-shrink: 0; } /* 긴 이메일에 밀려도 로그아웃 버튼은 줄바꿈되지 않는다 */
.site-header .account { color: #c6d3e0; }

.notice {
  background: #e8f6ec;
  border: 1px solid #bfe4c8;
  color: #22633a;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.field-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.field-group h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin: -0.4rem 0 0.9rem; }

.check {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.5rem 0;
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--navy);
  flex-shrink: 0;
  transform: translateY(0.2rem);
}
.check small { display: block; color: var(--muted); font-size: 0.92rem; }

.region-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1rem;
}

/* ---- 카드형 단일 페이지 (수신거부 등) ---- */
.card-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  max-width: 26rem;
  box-shadow: 0 8px 24px rgba(10, 29, 48, 0.08);
}

/* 낮은 뷰포트 — 폰 목업을 단계 축소해 히어로가 항상 한 화면에 들어온다
   (zoom 은 레이아웃에 반영되는 배율 — 미지원 브라우저는 스크롤로 폴백) */
@media (min-width: 48rem) and (max-height: 800px) {
  .phone { zoom: 0.9; }
}
@media (min-width: 48rem) and (max-height: 720px) {
  .phone { zoom: 0.8; }
}
@media (min-width: 48rem) and (max-height: 640px) {
  .phone { zoom: 0.7; }
}
@media (min-width: 48rem) and (max-height: 570px) {
  .phone { zoom: 0.6; }
}

@media (max-width: 48rem) {
  .hero { padding: 2.5rem 1.5rem; text-align: center; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-sub { margin: 1.1rem auto 1.8rem; }
  .phone { width: 272px; }
}

@media (max-width: 40rem) {
  .header-tabs { display: none; } /* 좁은 화면 — 로고·로그인만 남긴다 */
  .value-props, .step-grid { grid-template-columns: 1fr; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 공용 footer 확장 (사업자정보 + 법정 링크 — 컴플라이언스 스펙 C2) ---- */
.site-footer { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.footer-top { display: flex; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: #b7c6d6; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-biz { margin: 0; font-size: 0.78rem; line-height: 1.6; color: #7c92a8; }
.cta-consent { font-size: 0.82rem; color: var(--muted, #667); margin-top: 0.6rem; }
.cta-consent a { color: inherit; text-decoration: underline; }

/* ---- 법정 고지 페이지 (이용약관·개인정보처리방침·환불정책) ---- */
.legal { max-width: 44rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; line-height: 1.75; }
.legal h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.legal h2 { font-size: 1.05rem; margin: 1.8rem 0 0.5rem; }
.legal p, .legal li { font-size: 0.95rem; }
.legal ul { padding-left: 1.2rem; }
.legal table { border-collapse: collapse; width: 100%; margin: 0.6rem 0; font-size: 0.9rem; }
.legal th, .legal td { border: 1px solid var(--line, #d8dee5); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
.legal-meta { color: #778; font-size: 0.85rem; }
