@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #172033;
  --muted: #647087;
  --line: #dfe4ec;
  --soft: #f3f5f8;
  --paper: #fbfcfe;
  --white: #fff;
  --accent: #5b4ef2;
  --accent-dark: #4035c8;
  --accent-soft: #eeecff;
  --mint: #bbf2df;
  --orange: #ffbd71;
  --green: #12805c;
  --sidebar: 272px;
  --topbar: 76px;
  --shadow: 0 18px 60px rgba(28, 38, 63, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Sans KR", sans-serif; line-height: 1.65; word-break: keep-all; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
code { font-family: "DM Mono", monospace; }

.topbar { height: var(--topbar); padding: 0 38px; position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(251,252,254,.93); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--accent); font: 600 14px "DM Mono"; box-shadow: 5px 5px 0 #cbc6ff; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 14px; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: var(--muted); font: 400 10px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.top-actions { display: flex; align-items: center; gap: 24px; font-size: 13px; font-weight: 600; }
.top-actions a:hover { color: var(--accent); }
.top-actions .code-link { padding: 9px 14px; color: white; border-radius: 9px; background: var(--ink); }
.top-actions .code-link:hover { color: white; background: var(--accent); }
.mobile-progress { display: none; }

.home-main { overflow: hidden; }
.hero { max-width: 1240px; min-height: 620px; margin: 0 auto; padding: 104px 42px 80px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.eyebrow { color: var(--accent); font: 600 12px "DM Mono"; letter-spacing: .12em; }
.hero h1 { margin: 20px 0 24px; font-size: clamp(52px, 6.2vw, 82px); line-height: 1.08; letter-spacing: -.06em; }
.hero h1 em { color: var(--accent); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 8px; border-radius: 50%; background: var(--mint); z-index: -1; transform: rotate(-1deg); }
.hero-copy > p { max-width: 580px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.8; }
.hero-actions { margin-top: 38px; display: flex; align-items: center; gap: 26px; }
.primary-button { padding: 15px 22px; border-radius: 11px; color: white; background: var(--accent); font-weight: 700; box-shadow: 0 9px 24px rgba(91,78,242,.24); transition: .2s ease; }
.primary-button:hover { transform: translateY(-2px); background: var(--accent-dark); }
.text-button { color: var(--muted); font-size: 14px; font-weight: 600; }
.learning-loop { min-height: 390px; padding: 36px; display: flex; align-items: center; justify-content: center; gap: 13px; position: relative; border: 1px solid var(--line); border-radius: 40% 60% 42% 58% / 55% 42% 58% 45%; background: var(--white); box-shadow: var(--shadow); }
.learning-loop::before, .learning-loop::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; }
.learning-loop::before { width: 110px; height: 110px; right: -30px; top: -35px; background: var(--mint); }
.learning-loop::after { width: 76px; height: 76px; left: -28px; bottom: 5px; background: var(--orange); }
.learning-loop div { width: 118px; height: 145px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 18px; background: var(--soft); text-align: center; }
.learning-loop div:nth-child(3) { background: var(--accent-soft); }
.learning-loop div:nth-child(5) { color: white; background: var(--accent); transform: translateY(-12px); }
.learning-loop div > span { margin-bottom: 10px; opacity: .55; font: 500 11px "DM Mono"; }
.learning-loop b { font: 600 22px "DM Mono"; }
.learning-loop small { margin-top: 9px; font-size: 11px; }
.learning-loop > i { color: #a9b0bf; font-style: normal; }

.course-status { max-width: 1156px; margin: 0 auto 112px; padding: 20px 24px; display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 24px; border-radius: 15px; background: var(--ink); color: white; }
.course-status > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.course-status span { color: #aeb8cb; font-size: 12px; }
.course-status strong { font: 500 13px "DM Mono"; }
.progress-track, .sidebar-track { overflow: hidden; height: 5px; border-radius: 10px; background: rgba(255,255,255,.15); }
.progress-track i, .sidebar-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--mint); transition: width .35s ease; }
.course-status button { padding: 0; border: 0; color: #aeb8cb; background: transparent; font-size: 11px; cursor: pointer; }

.curriculum { max-width: 1240px; margin: 0 auto; padding: 0 42px 120px; }
.section-heading { margin-bottom: 38px; display: flex; align-items: end; justify-content: space-between; }
.section-heading h2, .method > h2 { margin: 10px 0 0; font-size: 36px; letter-spacing: -.045em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.topic-card { min-height: 275px; padding: 28px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; transition: .22s ease; }
.topic-card:hover { z-index: 2; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
.topic-card-head { display: flex; align-items: center; justify-content: space-between; }
.topic-number { color: #a2aabc; font: 500 11px "DM Mono"; }
.topic-icon { min-width: 40px; height: 40px; padding: 0 9px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); font: 500 17px "DM Mono"; }
.topic-card h2 { margin: 34px 0 10px; font-size: 20px; letter-spacing: -.03em; }
.topic-card > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.topic-card-foot { margin-top: auto; padding-top: 26px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.topic-card-foot b { font-weight: 600; }
.completion-dot { width: 7px; height: 7px; border-radius: 50%; background: #c9ced7; }
.topic-card.is-complete .completion-dot { background: var(--green); box-shadow: 0 0 0 4px #dcf7ed; }
.topic-card.is-complete .completion-label { color: var(--green); }
.method { padding: 100px max(42px, calc((100vw - 1156px)/2)); background: #eeecff; }
.method-grid { margin-top: 42px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.method-grid > div { padding: 30px; border-radius: 15px; background: rgba(255,255,255,.7); }
.method-grid b { color: var(--accent); font: 500 12px "DM Mono"; }
.method-grid h3 { margin: 45px 0 8px; font-size: 17px; }
.method-grid p { margin: 0; color: var(--muted); font-size: 13px; }

.course-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh - var(--topbar)); }
.course-sidebar { width: var(--sidebar); height: calc(100vh - var(--topbar)); padding: 28px 18px; position: sticky; top: var(--topbar); border-right: 1px solid var(--line); background: #f5f6f9; overflow-y: auto; }
.sidebar-heading { padding: 0 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.sidebar-heading a { font-size: 13px; font-weight: 700; }
.sidebar-heading span { color: var(--muted); font: 500 10px "DM Mono"; }
.sidebar-track { margin: 0 10px 24px; background: #dfe2e9; }
.sidebar-track i { background: var(--accent); }
.course-sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.course-nav-link { padding: 10px 11px; display: flex; align-items: center; gap: 11px; border-radius: 8px; color: #697389; font-size: 12px; font-weight: 500; }
.course-nav-link span { width: 20px; color: #a1a9b8; font: 400 10px "DM Mono"; }
.course-nav-link:hover { color: var(--ink); background: white; }
.course-nav-link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.course-nav-link.is-complete span::after { content: "✓"; color: var(--green); }
.course-nav-link.is-complete span { font-size: 0; }
.course-nav-link.is-complete span::after { font-size: 11px; }

.lesson { width: min(900px, calc(100% - 64px)); margin: 0 auto; padding: 38px 0 100px; }
.breadcrumb { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; }
.breadcrumb b { color: var(--accent); font: 500 11px "DM Mono"; }
.lesson-hero { min-height: 320px; display: flex; align-items: center; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); }
.lesson-number { color: var(--accent); font: 600 11px "DM Mono"; letter-spacing: .1em; }
.lesson-hero h1 { margin: 15px 0 12px; font-size: clamp(42px, 6vw, 64px); letter-spacing: -.055em; line-height: 1.15; }
.lesson-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.lesson-icon { flex: 0 0 auto; min-width: 118px; height: 118px; padding: 0 20px; display: grid; place-items: center; border: 1px solid #d8d3ff; border-radius: 34px; color: var(--accent); background: var(--accent-soft); font: 500 34px "DM Mono"; transform: rotate(3deg); }
.lesson-toc { padding: 20px 0; display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.lesson-toc a { color: var(--muted); font-size: 12px; font-weight: 600; }
.lesson-toc a:hover { color: var(--accent); }
.lesson-section { padding: 92px 0; display: grid; grid-template-columns: 110px 1fr; gap: 42px; border-bottom: 1px solid var(--line); }
.section-label { padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.section-label span { color: var(--accent); font: 600 11px "DM Mono"; }
.section-label b { color: #adb4c1; font: 500 10px "DM Mono"; letter-spacing: .08em; }
.section-content h2 { margin: 0 0 22px; font-size: 31px; line-height: 1.35; letter-spacing: -.04em; }
.lead { margin: 0; color: #3f4a60; font-size: 17px; line-height: 1.95; }
.lead code { padding: 2px 6px; color: var(--accent-dark); border-radius: 5px; background: var(--accent-soft); font-size: .88em; }
.section-intro { margin: -8px 0 28px; color: var(--muted); font-size: 14px; }
.mental-model { margin-top: 34px; padding: 21px 24px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.mental-model b { color: var(--accent-dark); font-size: 11px; }
.mental-model p { margin: 6px 0 0; font-size: 14px; }
.friendly-examples { margin-top: 48px; }
.friendly-heading > span { color: var(--accent); font: 600 9px "DM Mono"; letter-spacing: .12em; }
.friendly-heading h3 { margin: 7px 0 5px; font-size: 20px; letter-spacing: -.03em; }
.friendly-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.friendly-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.friendly-grid article { min-height: 260px; padding: 24px; display: flex; flex-direction: column; border: 1px solid #d8d3ff; border-radius: 15px; background: linear-gradient(145deg, #fff 0%, #f5f3ff 100%); }
.friendly-grid article > span { color: var(--accent); font: 600 9px "DM Mono"; }
.friendly-grid article h3 { margin: 26px 0 10px; font-size: 17px; }
.friendly-grid article > p { margin: 0; color: #4b566b; font-size: 13px; line-height: 1.8; }
.friendly-grid article > div { margin-top: auto; padding-top: 18px; color: var(--accent-dark); font-size: 12px; line-height: 1.7; border-top: 1px solid #ddd8ff; }
.friendly-grid article > div b { margin-bottom: 4px; display: block; color: #8b82dc; font-size: 9px; }
.use-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.use-grid article { min-height: 190px; padding: 21px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: white; }
.use-grid article > span { color: var(--accent); font: 500 10px "DM Mono"; }
.use-grid h3 { margin: 31px 0 8px; font-size: 15px; }
.use-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.complexity-card { margin-top: 45px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.complexity-card > h3 { margin: 0; padding: 18px 21px; border-bottom: 1px solid var(--line); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 13px 20px; text-align: left; border-bottom: 1px solid #edf0f4; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); background: #f8f9fb; font-size: 10px; }
td code { color: var(--accent-dark); }
td b { font: 500 11px "DM Mono"; }
.walkthrough { margin-top: 28px; overflow: hidden; border-radius: 14px; color: #e7eaf1; background: #20283a; }
.walkthrough-head { padding: 23px 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.walkthrough-head span { color: #8f9ab0; font: 500 9px "DM Mono"; letter-spacing: .12em; }
.walkthrough-head h3 { margin: 5px 0 0; color: white; font-size: 16px; }
.walkthrough ol { margin: 0; padding: 8px 26px 22px; list-style: none; counter-reset: none; }
.walkthrough li { min-height: 67px; display: grid; grid-template-columns: 31px 1fr; align-items: center; gap: 12px; position: relative; }
.walkthrough li:not(:last-child)::after { content: ""; width: 1px; height: 23px; position: absolute; left: 14px; bottom: -3px; background: #48526a; }
.walkthrough li > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--mint); border: 1px solid #566078; font: 500 10px "DM Mono"; }
.walkthrough li div { min-width: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 20px; }
.walkthrough li b { font-size: 12px; }
.walkthrough li code { color: #c2cada; font-size: 11px; white-space: normal; }
.pitfall-card { margin-top: 28px; padding: 24px 26px; border: 1px solid #f1d7a9; border-radius: 13px; background: #fffaf0; }
.pitfall-card h3 { margin: 0 0 12px; font-size: 14px; }
.pitfall-card ul { margin: 0; padding-left: 20px; color: #5e5660; font-size: 13px; }
.pitfall-card li + li { margin-top: 7px; }
.pitfall-card code { font-size: .9em; }
.practice-section { border-bottom: 0; }
.practice-heading { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.practice-heading h2 { margin: 0; }
.practice-heading > span { display: flex; gap: 7px; white-space: nowrap; }
.practice-heading > span b { padding: 5px 9px; border-radius: 99px; font: 600 9px "DM Mono"; }
.practice-heading > span b:first-child { color: #08714e; background: #dff8ee; }
.practice-heading > span b:last-child { color: #9b6109; background: #fff0d2; }
.problem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.problem-card { min-height: 190px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; background: white; transition: .2s ease; }
.problem-card:hover { border-color: var(--accent); box-shadow: 0 12px 35px rgba(42,48,78,.1); transform: translateY(-2px); }
.problem-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.level { padding: 3px 8px; border-radius: 99px; font: 600 9px "DM Mono"; text-transform: uppercase; }
.level.easy { color: #08714e; background: #dff8ee; }
.level.medium { color: #9b6109; background: #fff0d2; }
.level.hard { color: #a43b52; background: #ffe4ea; }
.problem-card > strong { margin-top: 25px; font-size: 16px; }
.problem-card > p { margin: 5px 0 16px; color: var(--muted); font-size: 12px; }
.problem-cta { margin-top: auto; color: var(--accent); font-size: 11px; font-weight: 700; }
.complete-button { width: 100%; margin-top: 18px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; border: 1px dashed #a9a1fb; border-radius: 13px; background: var(--accent-soft); text-align: left; cursor: pointer; }
.complete-button:hover { border-style: solid; }
.complete-button .check { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #aaa3ef; border-radius: 50%; color: transparent; background: white; }
.complete-copy { display: flex; flex-direction: column; }
.complete-copy b { font-size: 13px; }
.complete-copy small { color: var(--muted); font-size: 10px; }
.complete-button.is-complete { border-style: solid; border-color: #82d8b9; background: #e7faf3; }
.complete-button.is-complete .check { color: white; border-color: var(--green); background: var(--green); }
.complete-button.is-complete .complete-copy b { color: var(--green); }
.lesson-pagination { padding-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--line); }
.lesson-pagination a { padding: 18px 20px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: white; }
.lesson-pagination a:hover { border-color: var(--accent); }
.lesson-pagination a.next { text-align: right; }
.lesson-pagination small { color: var(--muted); font-size: 10px; }
.lesson-pagination b { margin-top: 4px; font-size: 13px; }

.footer { min-height: 100px; padding: 30px 42px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); background: white; font: 400 11px "DM Mono"; }
.footer a { color: var(--accent); }

@media (max-width: 1000px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 80px; }
  .learning-loop { min-height: 310px; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .course-shell { display: block; }
  .course-sidebar { display: none; }
  .lesson { width: min(800px, calc(100% - 48px)); }
  .mobile-progress { height: 32px; padding: 0 24px; display: flex; align-items: center; gap: 14px; position: sticky; top: var(--topbar); z-index: 45; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(251,252,254,.96); font: 500 9px "DM Mono"; }
  .mobile-progress i { height: 3px; flex: 1; overflow: hidden; border-radius: 10px; background: var(--line); }
  .mobile-progress b { width: 0; height: 100%; display: block; background: var(--accent); transition: width .3s; }
}

@media (max-width: 680px) {
  :root { --topbar: 66px; }
  body { word-break: normal; }
  .topbar { padding: 0 18px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: 3px 3px 0 #cbc6ff; }
  .brand b { font-size: 12px; }
  .brand small, .top-actions > a:first-child { display: none; }
  .top-actions .code-link { padding: 8px 11px; font-size: 11px; }
  .hero { padding: 64px 22px 55px; gap: 50px; }
  .hero h1 { font-size: 46px; }
  .hero-copy > p { font-size: 15px; }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 15px; }
  .primary-button { text-align: center; }
  .text-button { text-align: center; }
  .learning-loop { min-height: 260px; padding: 24px 14px; gap: 7px; border-radius: 24px; }
  .learning-loop div { width: 90px; height: 120px; }
  .learning-loop b { font-size: 17px; }
  .learning-loop small { font-size: 9px; }
  .course-status { margin: 0 22px 80px; padding: 18px; grid-template-columns: 1fr auto; gap: 12px; }
  .course-status .progress-track { grid-row: 2; grid-column: 1 / -1; }
  .curriculum { padding: 0 22px 85px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .section-heading h2, .method > h2 { font-size: 30px; }
  .section-heading > p { text-align: left; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 230px; }
  .method { padding: 75px 22px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid h3 { margin-top: 25px; }
  .lesson { width: calc(100% - 36px); padding-top: 24px; }
  .lesson-hero { min-height: 280px; align-items: flex-start; flex-direction: column-reverse; justify-content: center; gap: 28px; }
  .lesson-icon { min-width: 65px; height: 65px; border-radius: 19px; font-size: 22px; }
  .lesson-hero h1 { font-size: 39px; }
  .lesson-hero p { font-size: 14px; }
  .lesson-toc { gap: 14px; overflow-x: auto; white-space: nowrap; }
  .lesson-section { padding: 68px 0; display: block; }
  .section-label { margin-bottom: 24px; flex-direction: row; gap: 8px; }
  .section-content h2 { font-size: 26px; }
  .lead { font-size: 15px; }
  .use-grid, .problem-grid { grid-template-columns: 1fr; }
  .friendly-grid { grid-template-columns: 1fr; }
  .friendly-grid article { min-height: 230px; }
  .practice-heading { align-items: flex-start; flex-direction: column; }
  .use-grid article { min-height: 150px; }
  .use-grid h3 { margin-top: 22px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 480px; }
  .walkthrough ol { padding-left: 18px; padding-right: 18px; }
  .walkthrough li div { display: block; }
  .walkthrough li code { margin-top: 4px; display: block; }
  .lesson-pagination { grid-template-columns: 1fr; }
  .lesson-pagination a.next { text-align: left; }
  .footer { padding: 28px 20px; flex-direction: column; gap: 8px; align-items: flex-start; }
}

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