:root {
    --ink: #1a2332;
    --muted: #4a5568;
    --paper: #f5f1e8;
    --surface: rgba(255, 255, 255, 0.88);
    --line: rgba(16, 32, 51, 0.10);
    --brand: #0d6b64;
    --brand-soft: rgba(15, 118, 110, 0.10);
    --accent: #c97a17;
    --accent-soft: rgba(201, 122, 23, 0.14);
    --danger: #b45309;
    --shadow: 0 8px 24px -12px rgba(16, 32, 51, 0.18);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background:
        radial-gradient(circle at 12% 8%, rgba(15, 118, 110, 0.12), transparent 26%),
        radial-gradient(circle at 88% 10%, rgba(201, 122, 23, 0.10), transparent 26%),
        linear-gradient(180deg, #f6f4f0 0%, #f8f9f7 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 80px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 14px;
    z-index: 20;
    box-shadow: 0 4px 16px -8px rgba(16, 32, 51, 0.15);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #134e4a);
    color: white;
    font-weight: 800;
}

.brand-copy small,
.eyebrow,
.section-kicker,
.mini-label {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-copy small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.brand-copy strong {
    font-size: 15px;
}

.topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar nav a,
.topbar nav span {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    color: var(--muted);
}

.topbar nav a:hover {
    background: rgba(16, 32, 51, 0.06);
    color: var(--ink);
}

.topbar nav .active {
    background: var(--brand);
    color: white;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 26px;
    margin-top: 28px;
}

.panel {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero-main,
.hero-side,
.section-panel {
    padding: 24px;
}

.eyebrow,
.section-kicker,
.mini-label {
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
}

.hero h1,
.section-title {
    margin: 8px 0 12px;
    line-height: 1.1;
}

.hero h1 {
    font-size: clamp(28px, 3.2vw, 38px);
}

.hero p,
.section-copy,
.card-copy,
.body-copy {
    color: var(--muted);
    line-height: 1.7;
}

.hero-stats,
.lesson-grid,
.message-grid,
.two-up,
.card-grid,
.bullet-grid,
.workshop-grid,
.reference-grid,
.router-buttons,
.context-grid {
    display: grid;
    gap: 16px;
}

.hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
}

.stat-card,
.message-card,
.lesson-card,
.card,
.check-card,
.reference-card,
.context-card,
.comparison-card,
.warning-card,
.output-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.stat-card strong,
.lesson-card strong,
.card strong,
.message-card strong {
    display: block;
    margin-bottom: 6px;
}

.stat-card span,
.lesson-card span,
.card span,
.message-card span {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.65;
    opacity: 0.82;
}

.hero-side .pill-list,
.lesson-tags,
.check-list,
.plain-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill,
.lesson-tag,
.soft-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.pill strong,
.lesson-tag strong {
    font-size: 12px;
}

.soft-chip {
    color: var(--muted);
}

.callout {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 118, 110, 0.16);
    background: rgba(15, 118, 110, 0.07);
}

.date-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 32, 51, 0.12);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    line-height: 1.65;
}

.date-note strong {
    color: var(--ink);
}

.callout strong {
    display: block;
    margin-bottom: 6px;
}

.section {
    margin-top: 26px;
}

.section-title {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
}

.message-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.lesson-card .badge {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.lesson-card.tbd .badge {
    background: rgba(91, 107, 126, 0.12);
    color: var(--muted);
}

.lesson-card .lesson-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.lesson-card .lesson-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    color: var(--muted);
    font-size: 14px;
}

.lesson-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 15px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-weight: 700;
}

.lesson-link:hover {
    background: var(--brand);
}

.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bullet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plain-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plain-list div,
.check-list li {
    color: var(--muted);
    line-height: 1.7;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li::before {
    content: "•";
    color: var(--brand);
    margin-right: 10px;
}

.mini-board {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 247, 244, 0.9));
}

.mini-board h3 {
    margin: 0;
}

.router-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.router-button,
.context-button {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--ink);
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.router-button:hover,
.context-button:hover,
.router-button.is-active,
.context-button.is-active {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(15, 118, 110, 0.35);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
}

.router-output,
.builder-output {
    min-height: 290px;
}

.output-title {
    font-size: 24px;
    margin: 8px 0 12px;
}

.output-block {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(15, 118, 110, 0.06);
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.output-block.warning {
    background: rgba(180, 83, 9, 0.08);
    border-color: rgba(180, 83, 9, 0.2);
}

.output-block strong {
    display: block;
    margin-bottom: 6px;
}

.chart-wrap {
    height: 320px;
}

.canvas-panel {
    padding: 22px;
}

.context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-card {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.context-card:hover,
.context-card.is-active {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(15, 118, 110, 0.3);
}

.comparison-card.bad {
    background: rgba(180, 83, 9, 0.08);
    border-color: rgba(180, 83, 9, 0.18);
}

.comparison-card.good {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.18);
}

.code-block {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: #0b1420;
    color: #dbe7f3;
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}

.footer-note {
    margin-top: 30px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(16, 32, 51, 0.16);
    color: var(--muted);
    text-align: center;
}

.reference-card a {
    color: var(--brand);
    font-weight: 700;
}

.reference-card p {
    color: var(--muted);
    margin: 8px 0 0;
    line-height: 1.65;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.table-wrap th,
.table-wrap td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table-wrap th {
    background: rgba(16, 32, 51, 0.04);
    color: var(--ink);
    font-size: 14px;
}

.table-wrap td {
    color: var(--muted);
    line-height: 1.65;
    font-size: 14px;
}

.lesson-track {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lesson-track a,
.lesson-track span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 13px;
}

.lesson-track .current {
    background: var(--ink);
    color: white;
}

.lesson-track .pending {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

/* ========================================================
   index.html: 컴팩트 인트로
   ======================================================== */

.index-intro {
    margin-top: 28px;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.intro-text {
    flex: 1;
    min-width: 0;
}

.intro-title {
    margin: 6px 0 10px;
    font-size: clamp(22px, 2.6vw, 30px);
    line-height: 1.15;
    font-weight: 800;
}

.intro-desc {
    color: var(--muted);
    line-height: 1.7;
    max-width: 68ch;
    margin: 0;
    font-size: 15px;
}

.intro-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.meta-chip-cta {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
    font-weight: 700;
    margin-top: 4px;
}

.meta-chip-cta:hover {
    background: var(--brand);
    border-color: var(--brand);
}

/* 공통예시 + 용어사전 나란히 */
.ref-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

/* 용어사전 리스트형 */
.glossary-list {
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.glossary-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-item dt {
    font-weight: 700;
    font-size: 13px;
    color: var(--brand);
}

.glossary-item dd {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.glossary-item dd a {
    color: var(--brand);
    font-weight: 600;
    margin-left: 4px;
}

.glossary-item dd a:hover {
    text-decoration: underline;
}

/* ========================================================
   index.html 호환 + 누락 클래스 추가
   ======================================================== */

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 80px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
}

.nav-link:hover,
.nav-link.active {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
}

.hero-stack,
.card-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-title {
    margin-top: 8px;
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.08;
}

.hero-copy {
    margin-top: 12px;
    max-width: 70ch;
    color: var(--muted);
    line-height: 1.7;
}

.stat-row {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-chip {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.stat-chip strong {
    display: block;
    margin-bottom: 6px;
}

.stat-chip span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.summary-card {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.summary-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
}

.summary-card span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.curriculum-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.curriculum-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.curriculum-card span {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    align-self: flex-start;
}

.curriculum-card strong {
    font-size: 17px;
    line-height: 1.3;
}

.curriculum-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    margin: 0;
}

.split-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.summary-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    align-items: baseline;
}

.summary-row strong {
    font-size: 13px;
    color: var(--ink);
    white-space: nowrap;
}

.summary-row span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ========================================================
   workshop & reference (week pages)
   ======================================================== */

.workshop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workshop-card {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.workshop-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.workshop-card p {
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reference-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.reference-list a::after {
    content: "↗";
    opacity: 0.6;
    font-size: 15px;
    flex-shrink: 0;
}

.reference-list a:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 14px -4px rgba(15, 118, 110, 0.2);
    border-color: rgba(15, 118, 110, 0.28);
}

/* ========================================================
   UX: prev/next nav, footer, scroll-to-top
   ======================================================== */

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

.lesson-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-weight: 700;
    font-size: 14px;
    transition: background 150ms ease;
}

.lesson-nav a:hover {
    background: var(--brand);
}

.lesson-nav a.nav-prev {
    margin-right: auto;
}

.lesson-nav a.nav-next {
    margin-left: auto;
}

.site-footer {
    margin-top: 48px;
    padding: 22px 28px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(16, 32, 51, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 13px;
}

.site-footer a {
    color: var(--brand);
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px -4px rgba(16, 32, 51, 0.4);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 200ms ease, transform 200ms ease, background 150ms ease;
    z-index: 100;
    pointer-events: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: var(--brand);
}

/* ========================================================
   glossary (index.html)
   ======================================================== */

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.glossary-card {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.glossary-card dt {
    font-weight: 800;
    font-size: 15px;
    color: var(--brand);
    margin-bottom: 8px;
}

.glossary-card dd {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

/* ========================================================
   code examples (week pages)
   ======================================================== */

.code-example {
    margin-top: 18px;
}

.code-example-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px 999px 0 0;
    background: #0b1420;
    color: rgba(219, 231, 243, 0.7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.code-example .code-block {
    border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
    margin-top: 0;
}

/* details/summary 공통 예시 접기 */
details.common-example {
    margin-top: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.72));
    overflow: hidden;
}

details.common-example summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: var(--brand);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

details.common-example summary::after {
    content: "▸";
    font-size: 12px;
    opacity: 0.7;
    transition: transform 200ms ease;
}

details.common-example[open] summary::after {
    transform: rotate(90deg);
}

details.common-example .callout-body {
    padding: 0 18px 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 960px) {
    .hero,
    .two-up,
    .message-grid,
    .lesson-grid,
    .card-grid,
    .bullet-grid,
    .router-buttons,
    .reference-grid,
    .context-grid,
    .split-layout,
    .curriculum-grid,
    .stat-row,
    .glossary-grid,
    .workshop-grid,
    .ref-split {
        grid-template-columns: 1fr;
    }

    .index-intro {
        flex-direction: column;
        gap: 20px;
    }

    .intro-meta {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        border-radius: 24px;
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 18px;
    }

    .hero-main,
    .hero-side,
    .section-panel {
        padding: 22px;
    }

    .hero h1 {
        font-size: 36px;
    }
}

/* ========================================================
   Visual Diagrams — step-flow, flow-chart, load-order, timeline
   ======================================================== */

/* Step Flow — week1, week4 */
.step-flow {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    row-gap: 12px;
    margin-top: 20px;
}

.step-item {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    backdrop-filter: blur(6px);
}

.step-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.step-item strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
    display: block;
}

.step-item span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.step-arrow {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--brand);
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Channel Flow Chart — week3 */
.flow-chart {
    margin-top: 20px;
}

.flow-question {
    text-align: center;
    padding: 14px 20px;
    background: rgba(15, 118, 110, 0.08);
    border: 1.5px solid rgba(15, 118, 110, 0.25);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 0;
    position: relative;
}

.flow-connector {
    display: flex;
    justify-content: center;
    gap: 0;
    height: 28px;
    position: relative;
}

.flow-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: rgba(15, 118, 110, 0.3);
    top: 50%;
}

.flow-connector-line {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.flow-connector-line::before {
    content: '';
    display: block;
    width: 1px;
    height: 28px;
    background: rgba(15, 118, 110, 0.3);
}

.flow-branches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-condition {
    padding: 10px 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
}

.flow-arrow-down {
    text-align: center;
    color: rgba(15, 118, 110, 0.5);
    font-size: 16px;
    line-height: 1;
}

.flow-result {
    padding: 12px 8px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.flow-result.ide {
    background: rgba(59, 130, 246, 0.1);
    border: 1.5px solid rgba(59, 130, 246, 0.28);
    color: #1d4ed8;
}

.flow-result.cli {
    background: rgba(15, 118, 110, 0.1);
    border: 1.5px solid rgba(15, 118, 110, 0.28);
    color: #0f766e;
}

.flow-result.cloud {
    background: rgba(124, 58, 237, 0.08);
    border: 1.5px solid rgba(124, 58, 237, 0.22);
    color: #6d28d9;
}

.flow-result.pr {
    background: rgba(180, 83, 9, 0.08);
    border: 1.5px solid rgba(180, 83, 9, 0.22);
    color: #b45309;
}

/* AGENTS.md Load Order — week5 */
.load-order-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.load-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    position: relative;
}

.load-step + .load-step {
    margin-top: 10px;
}

.load-step + .load-step::before {
    content: '↓  먼저 로드';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--brand);
    font-weight: 600;
    white-space: nowrap;
    background: transparent;
}

.load-order-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.load-order-num.first {
    background: rgba(15, 118, 110, 0.15);
    color: #0f766e;
}

.load-order-num.second {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.load-step-body strong {
    font-size: 14px;
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
}

.load-step-body span {
    font-size: 12px;
    color: var(--muted);
}

/* Lesson Timeline — week9 */
.lesson-timeline {
    margin-top: 28px;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-bottom: 8px;
}

.lesson-timeline::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand) 0%, rgba(15, 118, 110, 0.18) 100%);
    z-index: 0;
}

.timeline-node {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2.5px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: var(--brand);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.9);
}

.timeline-label {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
    max-width: 78px;
    word-break: keep-all;
}

.timeline-node.final .timeline-dot {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}
