/* Xelf 홈페이지. 앱과 같은 색(브랜드 녹색)과 글꼴(Pretendard). 회색 글자 없이 진한 글자만 쓴다. */
:root {
  --brand: #1f6b52;
  --brand-dark: #174d3d;
  --brand-deep: #0f3328;
  --brand-soft: #e6f2ec;
  --brand-mint: #cdeadc;
  --gold: #f2c94c;
  --ink: #121a16;
  --bg: #f6f8f5;
  --line: #d9e0da;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(15, 51, 40, 0.18);
  --wrap: 1180px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.25; }
p { margin: 0; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ───── 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 999px; padding: 14px 24px; transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: 15px; }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-gold { background: var(--gold); color: var(--brand-deep); box-shadow: 0 10px 24px rgba(242, 201, 76, .35); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: var(--white); border: 1px solid rgba(255, 255, 255, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.btn-block { width: 100%; }

/* ───── 상단 메뉴 */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  transition: background .25s ease, box-shadow .25s ease;
}
.nav.scrolled, .nav.open { background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; text-decoration: none; color: var(--white); }
.nav.scrolled .logo, .nav.open .logo { color: var(--ink); }
.logo-mark { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--white); }
.nav.scrolled .nav-links a { color: var(--ink); }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 6px; }
.menu-btn { display: none; }

/* ───── 첫 화면 */
.hero { position: relative; min-height: 100svh; color: var(--white); overflow: hidden; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 80px; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, #1f6b52 0%, #174d3d 50%, #0f3328 100%);
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { font-weight: 700; font-size: 15px; color: var(--brand); margin-bottom: 14px; letter-spacing: 0; }
.eyebrow-light { color: var(--gold); }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 800; line-height: 1.12; }
.lead { font-size: clamp(17px, 1.6vw, 20px); margin-top: 22px; max-width: 34em; color: #f3f8f5; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.hero-meta li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
.hero-visual { position: relative; display: flex; justify-content: center; }
.phone { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .28)); }
.phone-hero { width: min(340px, 78vw); border-radius: 52px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); animation: floatY 7s ease-in-out infinite; }
.float-card {
  position: absolute; background: var(--white); color: var(--ink); border-radius: 18px; padding: 14px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; max-width: 240px;
  animation: floatY 7s ease-in-out infinite;
}
.float-card strong { font-size: 18px; line-height: 1.35; }
.fc-label { font-size: 13px; font-weight: 700; color: var(--brand); }
.fc-chip { margin-top: 6px; align-self: flex-start; font-size: 13px; font-weight: 700; background: #fff1dc; color: #7a4600; padding: 3px 10px; border-radius: 999px; }
.fc-1 { left: -14%; top: 22%; animation-delay: -2s; }
.fc-2 { right: -4%; bottom: 14%; animation-delay: -4.5s; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 28px; height: 44px; border: 2px solid rgba(255, 255, 255, .6); border-radius: 16px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--white); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ───── 공통 섹션 */
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section-soft { background: var(--brand-soft); }
.section-dark { background: linear-gradient(170deg, #174d3d, #0f3328); color: var(--white); }
.section h2 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; }
.section-lead { font-size: 19px; margin-top: 18px; max-width: 40em; }
.section-dark .section-lead { color: #eef6f2; }

/* 문제 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 52px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; }
.stat-num { font-size: clamp(44px, 5vw, 60px); font-weight: 800; color: var(--brand); letter-spacing: -0.04em; line-height: 1.1; }
.stat-text { margin-top: 14px; font-size: 17px; }
.stat-src { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--brand-dark); }

/* 학습 순환 */
.loop { list-style: none; padding: 0; margin: 52px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; counter-reset: s; }
.loop-step { position: relative; background: var(--white); border-radius: var(--radius); padding: 26px 20px; border: 1px solid var(--line); }
.loop-step.accent { background: #f2fbf6; border-color: var(--brand-mint); }
.loop-step h3 { font-size: 24px; margin-top: 12px; }
.loop-step p { margin-top: 8px; font-size: 15.5px; }
.loop-no { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--white); font-weight: 800; font-size: 15px; }
.loop-step:not(:last-child)::after {
  content: ""; position: absolute; right: -11px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-top: 2px solid var(--brand); border-right: 2px solid var(--brand); transform: rotate(45deg); z-index: 1;
}
.loop-note { margin-top: 22px; font-weight: 700; color: var(--brand-dark); text-align: center; }

/* 기능 둘러보기: 넓은 화면에서는 왼쪽 휴대폰이 고정되고 화면이 바뀐다 */
.tour { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 40px; }
.tour-phone { position: relative; }
.tour-stage { position: sticky; top: calc(var(--nav-h) + 40px); height: min(680px, calc(100vh - var(--nav-h) - 80px)); display: grid; place-items: center; }
.tour-img { position: absolute; height: 100%; width: auto; border-radius: 48px; opacity: 0; transform: translateY(24px) scale(.97); transition: opacity .55s ease, transform .55s ease; }
.tour-img.is-active { opacity: 1; transform: none; }
.tour-steps { display: flex; flex-direction: column; }
.tour-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; opacity: .35; transition: opacity .4s ease; }
.tour-step.is-active { opacity: 1; }
.tour-inline { display: none; }
.tour-tag { display: inline-block; align-self: flex-start; font-size: 14px; font-weight: 800; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; padding: 5px 12px; }
.tour-step h3 { font-size: clamp(26px, 3vw, 36px); margin-top: 16px; }
.tour-step > p { margin-top: 16px; font-size: 18px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; font-size: 16px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 3px solid var(--brand); border-bottom: 3px solid var(--brand); transform: rotate(-45deg); }
.section-dark .ticks li::before { border-color: var(--gold); }

/* 차별점 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 52px; }
.card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--radius); padding: 30px 26px; transition: transform .3s ease, background .3s ease; }
.card:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .11); }
.card-no { font-size: 15px; font-weight: 800; color: var(--gold); }
.card h3 { font-size: 22px; margin-top: 14px; }
.card p:last-child { margin-top: 12px; font-size: 16px; color: #eef6f2; }

/* 데이터 원칙 */
.data-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.principles li { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 24px 26px; }
.principles li::before { content: ""; position: absolute; left: 24px; top: 0; width: 40px; height: 4px; border-radius: 0 0 4px 4px; background: var(--brand); }
.principles h3 { font-size: 20px; }
.principles p { margin-top: 10px; font-size: 16px; }

/* 요금제 */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 52px; align-items: stretch; }
.plan { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px; }
.plan h3 { font-size: 26px; }
.price { font-size: 22px; font-weight: 800; color: var(--brand); margin-top: 8px; }
.plan-pick { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -14px; left: 28px; background: var(--brand); color: var(--white); font-size: 13px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.fine { margin-top: 20px; font-size: 15px; font-weight: 600; color: var(--brand-dark); }

/* 일정 */
.timeline { list-style: none; padding: 0; margin: 52px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--brand-mint); }
.timeline li { position: relative; padding: 40px 20px 0 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand); }
.timeline li.is-now::before { background: var(--gold); border-color: var(--brand-dark); box-shadow: 0 0 0 6px rgba(242, 201, 76, .35); }
.tl-when { font-size: 15px; font-weight: 800; color: var(--brand); }
.timeline h3 { font-size: 22px; margin-top: 6px; }
.timeline p:last-child { margin-top: 10px; font-size: 16px; }

/* 문의 */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.contact-points li { font-weight: 700; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.form { background: var(--white); color: var(--ink); border-radius: 26px; padding: clamp(24px, 3vw, 36px); box-shadow: var(--shadow); display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-weight: 700; font-size: 15px; }
.opt { font-weight: 600; color: var(--brand-dark); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fbfcfb; transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31, 107, 82, .15); }
.field.invalid input, .field.invalid textarea { border-color: #b42318; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { background: var(--brand-soft); border-radius: 14px; padding: 16px 18px; font-size: 14.5px; display: grid; gap: 8px; }
.consent-title { font-weight: 800; font-size: 15px; }
.consent a { font-weight: 700; color: var(--brand-dark); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.form-msg { font-weight: 700; padding: 12px 14px; border-radius: 12px; }
.form-msg.ok { background: var(--brand-soft); color: var(--brand-dark); }
.form-msg.err { background: #fde8e6; color: #8f1d14; }

/* 바닥글 */
.footer { background: #0b261e; color: #e8f1ec; padding: 56px 0 40px; font-size: 15px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.logo-light { color: var(--white); }
.footer-inner > div > p { margin-top: 10px; }
.footer-info { display: grid; gap: 6px; text-align: right; }
.footer-info a { color: var(--white); font-weight: 700; }
.footer-note { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .15); display: grid; gap: 6px; font-size: 14px; }

/* 스크롤하면 나타나기 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.stats .reveal:nth-child(2), .loop .reveal:nth-child(2), .cards .reveal:nth-child(2), .plans .reveal:nth-child(2), .principles .reveal:nth-child(2), .timeline .reveal:nth-child(2) { transition-delay: .08s; }
.stats .reveal:nth-child(3), .loop .reveal:nth-child(3), .cards .reveal:nth-child(3), .plans .reveal:nth-child(3), .principles .reveal:nth-child(3), .timeline .reveal:nth-child(3) { transition-delay: .16s; }
.loop .reveal:nth-child(4), .cards .reveal:nth-child(4), .principles .reveal:nth-child(4), .timeline .reveal:nth-child(4) { transition-delay: .24s; }
.loop .reveal:nth-child(5) { transition-delay: .32s; }
.loop .reveal:nth-child(6) { transition-delay: .4s; }

/* ───── 태블릿 */
@media (max-width: 1080px) {
  .loop { grid-template-columns: repeat(3, 1fr); }
  .loop-step:nth-child(3)::after { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .data-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ───── 휴대폰·좁은 화면 */
@media (max-width: 860px) {
  :root { --nav-h: 60px; }
  br.d { display: none; }
  body { font-size: 16px; }
  .menu-btn { display: inline-grid; place-content: center; gap: 6px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; margin-left: 4px; }
  .menu-btn span { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 2px; transition: transform .25s ease, background .25s ease; }
  .nav.scrolled .menu-btn span, .nav.open .menu-btn span { background: var(--ink); }
  .nav.open .menu-btn span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .menu-btn span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav-inner { gap: 10px; }
  .nav-inner .btn-sm { margin-left: auto; }
  .nav-links {
    position: absolute; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px; display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { color: var(--ink); padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }

  .hero { padding-top: calc(var(--nav-h) + 32px); min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .phone-hero { width: min(280px, 70vw); border-radius: 42px; }
  .fc-1 { left: 0; top: 6%; }
  .fc-2 { right: 0; bottom: 6%; }
  .float-card { max-width: 200px; padding: 12px 14px; }
  .float-card strong { font-size: 16px; }
  .scroll-hint { display: none; }

  .stats, .plans { grid-template-columns: 1fr; }
  .loop { grid-template-columns: 1fr 1fr; }
  .loop-step::after { display: none; }
  .cards, .principles { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { left: 9px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .timeline li { padding: 0 0 32px 44px; }
  .timeline li::before { top: 4px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-info { text-align: left; }

  /* 기능 둘러보기는 단계마다 휴대폰 화면을 함께 보여 준다 */
  .tour { grid-template-columns: 1fr; gap: 0; margin-top: 12px; }
  .tour-phone { display: none; }
  .tour-step { min-height: 0; opacity: 1; padding: 48px 0; border-bottom: 1px solid var(--line); }
  .tour-step:last-child { border-bottom: 0; }
  .tour-inline { display: block; width: min(260px, 66vw); margin: 0 auto 28px; border-radius: 40px; }
}

@media (max-width: 420px) {
  .loop { grid-template-columns: 1fr; }
  .float-card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
