/* 토큰: 참고 디자인 시스템의 관찰값 — #222 전경, #e5e5e5 헤어라인, #ff6000 주목색(검색·강조 한정),
   #fcf4ee 웜 프로모 타일(16px 라운드·40px 패딩), 9999px 계정 필. 그림자 없음. */
:root {
  --fg: #222222;
  --muted: #737373;
  --faint: #a3a3a3;
  --line: #e5e5e5;
  --pill-line: #d4d4d4;
  --accent: #ff6000;
  --warm: #fcf4ee;
  --soft: #f5f5f5;
  --bg: #ffffff;
  --focus: #2563eb;
  --r-tile: 16px;
  --r-card: 12px;
  --wrap: 1200px;
  --gutter: 24px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/24px var(--font); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--fg); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* 헤더 */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 40px; height: 72px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.logo-dot { color: var(--accent); }
.gnb { display: flex; gap: 28px; flex: 1; }
.gnb a { position: relative; padding: 24px 0; font-weight: 600; }
.gnb a:hover { color: var(--accent); }
.gnb a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); }
.gnb .gnb-my { display: none; }
.header-side { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.link-my { color: var(--muted); }
.link-my:hover { color: var(--fg); }
.pill { display: inline-flex; align-items: center; padding: 10px 16px; border: 1px solid var(--pill-line); border-radius: 9999px; line-height: 21px; white-space: nowrap; }
.pill:hover { border-color: var(--fg); }
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.menu-btn span { width: 22px; height: 2px; background: var(--fg); transition: transform .2s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* 히어로 */
.hero { padding-top: 88px; padding-bottom: 72px; text-align: center; }
.eyebrow { color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.25; font-weight: 800; letter-spacing: -.03em; }
.search { display: flex; align-items: center; max-width: 731px; margin: 44px auto 0; border-bottom: 2px solid var(--fg); }
.search input[type="search"] { flex: 1; min-width: 0; height: auto; padding: 16px 4px; border: 0; border-radius: 0; background: none; font-size: 20px; line-height: 24px; font-weight: 600; color: var(--accent); outline: none; }
.search input::placeholder { color: var(--faint); font-weight: 600; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within { border-bottom-color: var(--accent); }
.search button { width: 48px; height: 48px; display: grid; place-items: center; }
.search svg { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; }
.keywords { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 20px; }
.keywords a { color: var(--muted); }
.keywords a::before { content: "#"; color: var(--faint); }
.keywords a:hover { color: var(--accent); }

/* 프로모 타일 */
.promos { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.promo { display: flex; flex-direction: column; justify-content: space-between; min-height: 310px; padding: 40px; border-radius: var(--r-tile); }
.promo-warm { background: var(--warm); }
.promo-line { border: 1px solid var(--line); }
.promo-kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin-bottom: 16px; }
.promo h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.4; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.promo p { color: var(--muted); }
.promo-link { font-weight: 600; }
.promo:hover .promo-link { color: var(--accent); }

/* 섹션 */
.section { padding-top: 96px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h3, .page-head h1 { font-size: 32px; line-height: 48px; font-weight: 700; letter-spacing: -.02em; }
.section-desc { color: var(--muted); margin-top: 4px; }
.more { color: var(--muted); white-space: nowrap; padding-bottom: 6px; }
.more:hover { color: var(--fg); }
.more::after { content: " →"; }

/* 강의 카드 */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
.card { position: relative; }
.card-thumb { display: block; aspect-ratio: 16 / 10; border-radius: var(--r-card); overflow: hidden; }
.card-thumb svg { width: 100%; height: 100%; transition: transform .35s ease; }
.card:hover .card-thumb svg { transform: scale(1.04); }
.wish { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.wish svg { fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-linejoin: round; }
.wish[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
.card-body { padding-top: 16px; }
.card-meta { font-size: 14px; line-height: 20px; color: var(--faint); font-weight: 500; }
.card-title { margin-top: 6px; font-size: 20px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.card-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.wish { z-index: 1; }
.card-inst { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--muted); }
.card-price { margin-top: 12px; font-size: 18px; font-weight: 700; }
.is-free { color: var(--accent); }

/* 원칙 */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--fg); }
.principles li { padding: 32px 32px 8px 0; }
.principles li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.num { display: block; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent); margin-bottom: 14px; }
.principles h4 { font-size: 20px; line-height: 30px; font-weight: 600; margin-bottom: 10px; }
.principles p { color: var(--muted); }

/* FAQ · 아코디언 */
.faq { border-top: 1px solid var(--fg); }
.faq details, .curri details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.faq summary { position: relative; padding: 24px 48px 24px 0; font-size: 18px; font-weight: 600; }
.faq summary::after, .curri summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--fg); border-bottom: 2px solid var(--fg); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq p { padding: 0 48px 28px 0; color: var(--muted); }

/* 목록 페이지 */
.page-head { padding-top: 64px; padding-bottom: 32px; }
.page-head .chip-row { margin-top: 24px; }
.filters { display: grid; gap: 14px; padding: 24px 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 16px; border: 1px solid var(--pill-line); border-radius: 9999px; font-size: 15px; line-height: 22px; }
.chip:hover { border-color: var(--fg); }
.chip.is-on { background: var(--fg); border-color: var(--fg); color: #fff; font-weight: 600; }
.filter-form { display: flex; gap: 8px; margin-top: 6px; }
.filter-form input[type="search"] { flex: 1; min-width: 0; max-width: 420px; }
input[type="search"], input[type="text"], input[type="email"], input[type="password"], select { height: 48px; padding: 0 16px; border: 1px solid var(--pill-line); border-radius: 10px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--fg); }
.result-count { padding: 28px 0 24px; color: var(--muted); }
.result-count strong { color: var(--fg); }
.empty { padding: 72px 24px; text-align: center; border: 1px dashed var(--pill-line); border-radius: var(--r-tile); }
.empty h4 { font-size: 20px; line-height: 30px; font-weight: 600; }
.empty p { color: var(--muted); margin: 6px 0 24px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 10px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-solid { background: var(--fg); color: #fff; }
.btn-solid:hover { background: #000; }
.btn-line { border: 1px solid var(--pill-line); background: #fff; }
.btn-line:hover { border-color: var(--fg); }
.btn-line[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* 상세 */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; padding-top: 48px; align-items: start; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--faint); margin-bottom: 24px; }
.crumbs a:hover { color: var(--fg); }
.detail h1 { margin-top: 8px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.35; font-weight: 800; letter-spacing: -.025em; }
.lead { margin-top: 16px; font-size: 18px; line-height: 30px; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 28px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 600; }
.facts span { display: block; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--faint); }
.block { margin-top: 64px; }
.block h2, .my h2 { font-size: 24px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px; }
.learn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; padding: 32px; background: var(--warm); border-radius: var(--r-tile); }
.learn li { position: relative; padding-left: 26px; }
.learn li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.curri { border-top: 1px solid var(--fg); }
.curri summary { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 20px 40px 20px 0; font-weight: 600; font-size: 17px; }
.curri summary em { font-style: normal; font-weight: 400; color: var(--faint); white-space: nowrap; }
.curri ol { padding-bottom: 16px; counter-reset: l; }
.curri li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 40px 10px 0; color: var(--muted); counter-increment: l; }
.l-title::before { content: counter(l, decimal-leading-zero); margin-right: 14px; color: var(--faint); font-variant-numeric: tabular-nums; }
.l-min { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.free { margin-left: 10px; padding: 2px 8px; border-radius: 9999px; border: 1px solid var(--accent); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.inst { display: flex; align-items: center; gap: 20px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.inst h4 { font-size: 18px; font-weight: 600; }
.inst p { color: var(--muted); }
.note { padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--r-tile); }
.note h2 { font-size: 17px; line-height: 26px; margin-bottom: 8px; }
.note p { font-size: 14px; line-height: 22px; color: var(--muted); }
.buy { position: sticky; top: 104px; display: grid; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-tile); }
.buy-thumb { aspect-ratio: 16 / 10; border-radius: var(--r-card); overflow: hidden; margin-bottom: 10px; }
.buy-thumb svg { width: 100%; height: 100%; }
.buy-price { font-size: 28px; line-height: 40px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.buy-list { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; line-height: 22px; color: var(--muted); }

/* 로드맵 */
.track + .track { padding-top: 120px; }
.steps { border-top: 1px solid var(--fg); }
.steps > li { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.step-head h4 { font-size: 24px; line-height: 36px; font-weight: 700; }
.step-head p { margin-top: 6px; color: var(--muted); }
.step-courses { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.mini { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); }
.mini:hover { border-color: var(--fg); }
.mini-thumb { flex: 0 0 96px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.mini-thumb svg { width: 100%; height: 100%; }
.mini b { display: block; font-weight: 600; line-height: 22px; }
.mini em { display: block; margin-top: 4px; font-style: normal; font-size: 14px; color: var(--faint); }

/* 로그인 */
.auth { max-width: 440px; margin: 0 auto; padding: 80px 24px 40px; }
.auth h1 { font-size: 32px; line-height: 48px; font-weight: 700; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 32px 0 24px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 14px 0; font-weight: 600; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.auth-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; accent-color: var(--fg); }
.form-error { font-size: 14px; color: #d92d20; }
.auth-note { margin-top: 20px; font-size: 14px; line-height: 22px; color: var(--faint); text-align: center; }
[hidden] { display: none !important; }

/* 내 강의실 */
.my h2 { margin-top: 24px; }
.my .grid + .empty, .my .grid { margin-bottom: 56px; }
.my .grid:empty { display: none; }

/* 푸터 */
.site-footer { margin-top: 128px; padding: 56px 0 64px; border-top: 1px solid var(--line); }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-tag { margin-top: 12px; color: var(--muted); }
.footer-cols { display: flex; gap: 72px; }
.footer-cols h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.footer-cols a { display: block; padding: 4px 0; color: var(--muted); }
.footer-cols a:hover { color: var(--fg); }
.disclaimer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; line-height: 21px; color: var(--muted); }
.copy { margin-top: 10px; font-size: 13px; line-height: 21px; color: var(--faint); }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 90; transform: translate(-50%, 24px); max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 9999px; background: var(--fg); color: #fff; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 반응형 */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
  .page-home .grid .card:nth-child(4) { display: none; }
  .steps > li { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .header-in { height: 60px; gap: 16px; }
  .menu-btn { display: flex; }
  .link-my { display: none; }
  .pill { padding: 8px 14px; font-size: 14px; }
  .gnb { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--line); }
  .gnb.is-open { display: flex; }
  .gnb a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .gnb a[aria-current="page"]::after { display: none; }
  .gnb a[aria-current="page"] { color: var(--accent); }
  .gnb .gnb-my { display: block; border-bottom: 0; }
  .hero { padding-top: 56px; padding-bottom: 48px; }
  .search { margin-top: 32px; }
  .search input[type="search"] { font-size: 18px; }
  .promos { grid-template-columns: 1fr; gap: 16px; }
  .promo { min-height: 240px; padding: 28px; }
  .section { padding-top: 72px; }
  .section-head h3, .page-head h1 { font-size: 26px; line-height: 38px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .page-home .grid .card:nth-child(4) { display: block; }
  .card-title { font-size: 17px; line-height: 26px; }
  .principles { grid-template-columns: 1fr; }
  .principles li, .principles li + li { padding: 28px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .detail { grid-template-columns: 1fr; padding-top: 32px; }
  .buy { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .buy-thumb, .buy-list { display: none; }
  .buy-price { margin: 0; font-size: 20px; line-height: 28px; }
  .buy .btn { padding: 0 16px; }
  .buy .btn-solid { order: 3; }
  body:has(.buy) .site-footer { padding-bottom: 120px; }
  body:has(.buy) .toast { bottom: 88px; }
  .learn { grid-template-columns: 1fr; padding: 24px; }
  .step-courses { grid-template-columns: 1fr; }
  .filter-form { flex-wrap: wrap; }
  .filter-form input[type="search"] { flex-basis: 100%; max-width: none; }
  .filter-form select { flex: 1; }
  .footer-cols { gap: 48px; }
  .site-footer { margin-top: 88px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .logo { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
