/* TaekwonWiki — site styles */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e4e8ef;
  --soft: #eef2f7;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #e7efff;
  --good: #15803d;
  --good-soft: #e8f6ee;
  --bad: #c8102e;
  --bad-soft: #fdecee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .05);
  --shadow-hover: 0 2px 6px rgba(15, 23, 42, .06), 0 14px 34px rgba(15, 23, 42, .1);
  --side-w: 264px;
  --gutter: clamp(1rem, 3vw, 2.25rem);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-weight: 500; }
h2 { font-size: 1.35rem; font-weight: 500; }
h3 { font-size: 1.05rem; font-weight: 600; }
h1 b, h2 b { font-weight: 700; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.light { font-weight: 400; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- focus, skip link, motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1:focus { outline: none; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: .8rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: .5rem var(--gutter) 4rem; outline: none; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 1.2rem .9rem 1rem; scrollbar-width: thin; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .5rem 1.2rem; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-size: 1.1rem; letter-spacing: -0.01em; }
.logo b { font-weight: 700; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem; box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.side-close { display: none; }
.side-nav { flex: 1; }
.side-links { display: flex; flex-direction: column; gap: 1px; }
.side-links a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.side-links a:hover { background: var(--soft); color: var(--ink); }
.side-links a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.main-links { padding-bottom: .8rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.side-group { margin-bottom: .2rem; }
.side-group summary { list-style: none; cursor: pointer; padding: .55rem .7rem .35rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; border-radius: 8px; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; transition: transform .15s; }
.side-group:not([open]) summary::after { transform: rotate(-45deg); }
.side-group summary:hover { color: var(--ink); }
.side-group .side-links { padding: 0 0 .4rem .5rem; border-left: 1px solid var(--line); margin-left: .75rem; }
.side-gups { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; padding: .3rem .2rem .3rem 0; }
.side-gups a { text-align: center; padding: .35rem 0; border-radius: 8px; background: var(--soft); font-size: .8rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.side-gups a:hover, .side-gups a.active { background: var(--accent); color: #fff; }
.side-foot { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: 1rem .7rem 0; border-top: 1px solid var(--line); margin-top: 1rem; font-size: .8rem; }
.side-foot a { color: var(--muted); text-decoration: none; }
.side-foot a:hover { color: var(--ink); }
.scrim { display: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; padding: 1rem var(--gutter); max-width: 1180px; width: 100%; margin: 0 auto; background: linear-gradient(var(--bg) 70%, rgba(243, 245, 249, 0)); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 1.2rem; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.menu-btn { display: none; }
.top-search { flex: 1; display: flex; align-items: center; gap: .6rem; height: 50px; padding: 0 .55rem 0 .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.top-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .95rem; color: var(--ink); }
.top-search input::placeholder { color: #94a3b8; }
.top-search kbd { font: inherit; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: .05rem .45rem; }
.my-gup { display: flex; align-items: center; gap: .45rem; height: 50px; padding: 0 .4rem 0 .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.my-gup select { border: 0; background: var(--soft); border-radius: 9px; padding: .45rem .5rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer; }

/* ---------- headings ---------- */
.welcome { padding: .8rem 0 .4rem; }
.welcome h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.page-head { padding: .8rem 0 1.2rem; }
.page-sub { color: var(--muted); max-width: 70ch; margin: .5rem 0 0; }
.section { margin-top: 2.2rem; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.sec-head h2 { font-size: 1.4rem; }
.head-actions { display: flex; align-items: center; gap: .6rem; }
.link-more { font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.back-link { display: inline-block; margin: .6rem 0 .4rem; font-size: .88rem; font-weight: 500; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .85); }
.eyebrow-dark { color: var(--accent-ink); margin-bottom: .5rem; }

/* ---------- buttons, tags, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #cbd3df; background: #fafbfd; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 .75rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { height: 52px; padding: 0 1.6rem; font-size: 1rem; border-radius: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 500; padding: .2rem .55rem; border-radius: 999px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-row { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 1rem; padding-bottom: .2rem; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; font: inherit; font-size: .84rem; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: #cbd3df; color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Gup badges: numbered, light → strong blue as grades rise (no belt colours). */
.gup-badge { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; background: var(--g-bg, var(--soft)); color: var(--g-ink, var(--ink-2)); }
.gup-all { --g-bg: var(--soft); --g-ink: var(--ink-2); }
.gup-10 { --g-bg: #eef3ff; --g-ink: #3b5bb5; } .gup-9 { --g-bg: #e5edff; --g-ink: #3654ad; }
.gup-8 { --g-bg: #dbe6ff; --g-ink: #2f4ea6; } .gup-7 { --g-bg: #cfdcff; --g-ink: #29479e; }
.gup-6 { --g-bg: #bfd0ff; --g-ink: #233f94; } .gup-5 { --g-bg: #a9c0fd; --g-ink: #1d378a; }
.gup-4 { --g-bg: #8eabf8; --g-ink: #fff; } .gup-3 { --g-bg: #6f92f0; --g-ink: #fff; }
.gup-2 { --g-bg: #4f77e6; --g-ink: #fff; } .gup-1 { --g-bg: #2f5bd6; --g-ink: #fff; }
.gup-dan { --g-bg: #0f172a; --g-ink: #fff; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.org h3 { margin-bottom: .4rem; }
.org p { color: var(--ink-2); margin: 0 0 .9rem; font-size: .93rem; }
.org p:last-child { margin-bottom: 0; }

/* hero (featured) photo cards */
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.hero-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-grid-1 { grid-template-columns: 1fr; }
.hero-grid-1 .hero-card { min-height: 300px; }
.hero-card { position: relative; display: block; min-height: 270px; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; background: #1e293b; box-shadow: var(--shadow); isolation: isolate; }
.hero-grid-3 .hero-card { min-height: 220px; }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s; }
.hero-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(15, 23, 42, 0) 25%, rgba(15, 23, 42, .55) 55%, rgba(15, 23, 42, .9) 100%); }
.hero-card:hover img { transform: scale(1.04); }
.hero-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.3rem 1.4rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; }
.hero-overlay h3 { color: #fff; font-size: 1.5rem; font-weight: 600; }
.hero-overlay p { margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .88); max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-more { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-end; font-size: .85rem; font-weight: 600; color: #fff; margin-top: .2rem; }
.hero-more svg { color: #93b4ff; transition: transform .2s; }
.hero-card:hover .hero-more svg, .mini-card:hover .hero-more svg { transform: translateX(3px); }
.hangul-light { font-weight: 400; opacity: .75; font-size: .8em; }
.photo-credit { position: absolute; top: .6rem; right: .7rem; font-size: .62rem; color: rgba(255, 255, 255, .75); background: rgba(15, 23, 42, .35); padding: .1rem .45rem; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.hero-card:hover .photo-credit, .banner:hover .photo-credit { opacity: 1; }

/* home row: learn today + latest posts */
.home-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mini-card { position: relative; min-height: 220px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; display: flex; flex-direction: column; isolation: isolate; }
.mini-photo { color: #fff; background: #1e293b; }
.mini-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s; }
.mini-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(15, 23, 42, .1), rgba(15, 23, 42, .88) 75%); }
.mini-photo:hover img { transform: scale(1.04); }
.mini-photo .hero-overlay p { -webkit-line-clamp: 4; }
.term-day { background: linear-gradient(150deg, #1e3a8a, #2563eb); color: #fff; padding: 1.2rem 1.3rem; gap: .2rem; justify-content: flex-end; }
.term-day-main { display: flex; align-items: center; gap: .6rem; margin: auto 0 .2rem; }
.term-day-hangul { font-size: 2.4rem; font-weight: 600; letter-spacing: .02em; }
.term-day strong { font-size: 1.15rem; }
.term-day > span:not(.eyebrow) { color: rgba(255, 255, 255, .85); font-size: .9rem; }
.term-day .speak { background: rgba(255, 255, 255, .16); color: #fff; }
.term-day .speak:hover { background: rgba(255, 255, 255, .28); }
.term-day .hero-more { text-decoration: none; }
.news-list { display: flex; flex-direction: column; gap: .7rem; }
.news-item { display: flex; gap: .9rem; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink-2); font-size: .9rem; transition: box-shadow .15s, transform .15s; }
a.news-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.news-item strong { color: var(--accent-ink); font-weight: 600; }
.news-date { flex: none; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 3.4rem; }

/* my gup */
.my-gup-card .my-gup-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.my-gup-card .my-gup-top strong { font-size: 1.1rem; }
.my-gup-card p { color: var(--ink-2); margin: 0 0 1rem; }
.gup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.gup-pick { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.gup-pick:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* media cards */
.mcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.mcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.mcard-media { display: block; aspect-ratio: 16 / 9; background: var(--soft); overflow: hidden; }
.mcard-media img { width: 100%; height: 100%; object-fit: cover; }
.mcard-body { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem 1.05rem; flex: 1; }
.mcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.mcard-meta a { text-decoration: none; }
.mcard h3 a { color: inherit; text-decoration: none; }
.mcard h3 a:hover { color: var(--accent-ink); }
.mcard p { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-foot { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .82rem; }
.mcard-foot a:not(.btn) { text-decoration: none; font-weight: 500; }
.learned-badge { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 600; color: var(--good); background: var(--good-soft); padding: .2rem .5rem; border-radius: 999px; }

/* rails */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, calc((100% - 2.2rem) / 3)); gap: 1.1rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .2rem .2rem 1rem; margin: -.2rem -.2rem 0; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-arrows { display: flex; gap: .25rem; }
.arrow { width: 34px; height: 34px; background: var(--surface); border: 1px solid var(--line); font-size: 1.3rem; line-height: 1; }

/* tools */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.tool-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s; }
a.tool-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tool-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tool-text { display: flex; flex-direction: column; gap: .2rem; }
.tool-text span { color: var(--muted); font-size: .86rem; }
.tool-soon { border-style: dashed; box-shadow: none; background: transparent; }
.tool-soon .tool-icon { background: var(--soft); color: var(--muted); }
.tool-hint { color: var(--muted); font-size: .82rem; margin: 1rem 0 0; text-align: center; }

/* round timer */
.timer-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.timer-presets .chip { height: auto; padding: .45rem .9rem; flex-direction: column; align-items: flex-start; border-radius: 12px; }
.timer-presets .chip small { font-size: .72rem; opacity: .75; }
.timer-face { --phase: var(--ink); text-align: center; padding: 2rem 1rem 1.6rem; border-radius: var(--radius); background: var(--soft); transition: background .3s; }
.timer-face[data-phase="prep"] { background: #fff7e6; --phase: #b45309; }
.timer-face[data-phase="work"] { background: #fdecee; --phase: #c8102e; }
.timer-face[data-phase="rest"] { background: var(--good-soft); --phase: var(--good); }
.timer-face[data-phase="done"] { background: var(--accent-soft); --phase: var(--accent-ink); }
.timer-phase { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--phase); }
.timer-clock { font-size: clamp(4.5rem, 16vw, 8.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--phase); margin: .4rem 0; }
.timer-round { color: var(--ink-2); font-weight: 500; }
.timer-bar { height: 8px; border-radius: 999px; background: rgba(15, 23, 42, .08); overflow: hidden; margin: 1.2rem auto 0; max-width: 520px; }
.timer-bar-fill { height: 100%; width: 0; background: var(--phase); transition: width .1s linear; }
.timer-controls { display: flex; justify-content: center; gap: .8rem; margin: 1.3rem 0; }
.timer-controls .btn { min-width: 150px; }
.timer-settings { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; justify-content: center; align-items: center; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.timer-settings label { display: flex; align-items: center; gap: .5rem; }
.timer-settings input[type=number] { width: 84px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 .6rem; font: inherit; }
.timer-settings .check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- filters ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.filters input, .filters select { font: inherit; font-size: .9rem; height: 42px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.filters input { flex: 1 1 240px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results-bar { display: flex; align-items: center; gap: .8rem; min-height: 32px; margin-bottom: 1.2rem; color: var(--muted); font-size: .88rem; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.2rem 1.5rem; text-align: center; }
.empty p { margin: .2rem 0; }

/* ---------- article / detail pages ---------- */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.3rem, 3vw, 2.4rem); max-width: 880px; }
.article > h1 { margin: .2rem 0 .7rem; }
.article h2 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 .8rem; }
.lead { font-size: 1.08rem; color: var(--ink-2); margin: 1rem 0 0; }
.detail-img { width: 100%; max-height: 440px; object-fit: cover; border-radius: 12px; margin: 1.4rem 0; }
.detail-video { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; margin: 1.2rem 0; }
.banner { position: relative; min-height: 190px; border-radius: var(--radius); overflow: hidden; margin: .6rem 0 1.2rem; display: flex; align-items: flex-end; padding: 1.4rem 1.6rem; background: linear-gradient(180deg, rgba(15, 23, 42, .15), rgba(15, 23, 42, .85)), var(--banner) center / cover; color: #fff; box-shadow: var(--shadow); }
.banner h1 { color: #fff; }
.source-note { color: var(--muted); font-size: .82rem; margin: .6rem 0 1.2rem; }
.source-list { padding-left: 1.2rem; }
.source-list li { margin: .4rem 0; }
.callout { background: #fff8e8; border: 1px solid #f5e1b5; border-radius: 12px; padding: .2rem 1.1rem; margin-top: 1.4rem; }

/* poomsae */
.pz-art { width: 100%; height: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; background: var(--pz-bg, var(--soft)); color: var(--pz-ink, var(--ink)); }
.pz-symbol { font-size: 4.6rem; line-height: 1; }
.pz-hangul { font-size: .95rem; letter-spacing: .05em; opacity: .7; }
.pz-basics { --pz-bg: linear-gradient(135deg, #eef3ff, #dbe6ff); --pz-ink: #1e3a8a; }
.pz-basics .pz-symbol { font-size: 2.4rem; font-weight: 600; }
.pz-taegeuk { --pz-bg: linear-gradient(135deg, #e7efff, #c9d8ff); --pz-ink: #1e3a8a; }
.pz-black-belt { --pz-bg: linear-gradient(135deg, #1e293b, #0f172a); --pz-ink: #f1f5f9; }
.pz-black-belt .pz-symbol { font-size: 3rem; font-weight: 600; letter-spacing: .05em; }
.pz-diagram { background: #fff; padding: .6rem; }
.pz-diagram img { width: 100%; height: 100%; object-fit: contain; }
.pz-card .mcard-media { border-bottom: 1px solid var(--line); }
.pz-head { display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem; align-items: center; }
.pz-art-big { height: 150px; border-radius: 14px; }
.pz-art-big .pz-symbol { font-size: 5rem; }
.pz-art-big.pz-basics .pz-symbol { font-size: 1.9rem; text-align: center; }
.pz-art-big.pz-black-belt .pz-symbol { font-size: 3.2rem; }
.pz-head h1 { margin: 0 0 .25rem; }
.pz-hangul-line { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: 0 0 .7rem; color: var(--ink-2); }
.hangul-sm { color: var(--muted); font-size: .82rem; font-weight: 400; }
.practice-box { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.6rem; padding: .9rem 1.1rem; background: var(--soft); border-radius: 12px; }
.learned-toggle { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; cursor: pointer; }
.learned-toggle input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.practice-count { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .9rem; }
.tech-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.tech-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.term-link { color: var(--muted); font-style: italic; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.diagram { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem; }
.diagram img { width: 100%; height: auto; }
.diagram figcaption { font-size: .78rem; color: var(--muted); margin-top: .6rem; }

/* speaker */
.speak { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; flex: none; transition: background .15s; }
.speak:hover { background: #d4e2ff; }

/* gup pages */
.gup-head { display: flex; align-items: center; gap: 1.2rem; }
.gup-big { flex: none; width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; font-weight: 700; background: var(--g-bg); color: var(--g-ink); box-shadow: var(--shadow); }
.gup-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.rank-list { padding: .4rem .6rem; }
.rank-row { display: grid; grid-template-columns: auto minmax(0, 15rem) 1fr auto; align-items: center; gap: 1rem; padding: .8rem .6rem; border-radius: 12px; text-decoration: none; color: var(--ink); }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-row:hover { background: var(--soft); }
.rank-row.is-mine { background: var(--accent-soft); }
.gup-num { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: .95rem; background: var(--g-bg); color: var(--g-ink); }
.rank-main { display: flex; flex-direction: column; }
.rank-main .muted { font-size: .84rem; }
.rank-pz { color: var(--muted); font-size: .88rem; }
.rank-go { color: var(--muted); display: grid; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; max-width: 880px; }
.table-title { font-size: 1.05rem; margin-bottom: .8rem; }
.table-wrap { overflow-x: auto; }
.data-table, .prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td, .prose th, .prose td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); }
.data-table th, .prose th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:hover { background: #fafbfd; }
.prose td:last-child, .prose th:last-child { text-align: right; }

/* learn start steps */
.start-steps h2 { margin-bottom: 1rem; }
.start-steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.start-steps li { counter-increment: step; }
.start-steps a { display: block; height: 100%; background: var(--soft); border-radius: 12px; padding: 1rem 1.1rem 1.1rem 3.2rem; position: relative; text-decoration: none; color: var(--ink); transition: background .15s; }
.start-steps a:hover { background: var(--accent-soft); }
.start-steps a::before { content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 600; }
.start-steps strong { display: block; margin-bottom: .2rem; }
.start-steps span { color: var(--muted); font-size: .86rem; }

/* terminology */
.term-group { margin-bottom: 1rem; padding-bottom: .6rem; }
.term-group h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.term-list { list-style: none; padding: 0; margin: 0; }
.term { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: center; padding: .65rem .2rem; border-top: 1px solid var(--line); }
.term-ko { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.term-ko strong { font-weight: 600; }
.hangul { color: var(--muted); }
.term-en { color: var(--ink-2); }
.term-note { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }

/* quiz */
.quiz-card { max-width: 720px; margin-top: .4rem; }
.question { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: 1.3rem 0 1rem; }
.q-main { display: block; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; }
.q-hangul { display: block; color: var(--muted); font-size: 1.15rem; margin-top: .2rem; }
.q-note { display: block; color: var(--muted); font-size: .9rem; margin-top: .5rem; }
.options { display: grid; gap: .55rem; }
.option { display: flex; align-items: center; gap: .9rem; text-align: left; width: 100%; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover:not(:disabled) { border-color: var(--accent); background: #fafcff; }
.option:disabled { cursor: default; color: var(--ink); }
.opt-key { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 7px; background: var(--soft); font-size: .8rem; font-weight: 600; flex: none; }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
.quiz-feedback { margin-right: auto; font-weight: 600; }
.flashcard { width: 100%; min-height: 230px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1rem; padding: 2rem 1.5rem; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, #fff, #f6f8fc); font: inherit; color: var(--ink); cursor: pointer; text-align: center; margin-top: 1rem; }
.flashcard.flipped { background: var(--accent-soft); }
.fc-hint { color: var(--muted); font-size: .8rem; }
.quiz-end { text-align: center; padding: 1rem 0; }
.quiz-end .quiz-actions { justify-content: center; }
.quiz-score { font-size: 3.2rem; font-weight: 700; margin: 0; letter-spacing: -0.03em; color: var(--accent-ink); }

/* progress bar (shared) */
.progress { display: flex; align-items: center; gap: 1rem; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s; }
.progress-text { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* session (workout / WOD) */
.session-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 .8rem; }
.session-head h2 { margin: 0; }
.session-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist label { display: grid; grid-template-columns: 1.4rem 2.2rem 1fr auto; gap: .9rem; align-items: center; padding: .9rem .3rem; cursor: pointer; border-radius: 8px; }
.checklist label:hover { background: #fafbfd; }
.checklist input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.ex-num { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.ex-detail { color: var(--muted); font-size: .88rem; text-align: right; }
.checklist input:checked ~ strong { text-decoration: line-through; color: var(--muted); }
.complete { margin-top: 1rem; padding: 1rem 1.2rem; background: var(--good-soft); color: #14532d; border-radius: 12px; }

/* progress page */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--shadow); }
.stat-num { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-num small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.stat-label { color: var(--muted); font-size: .84rem; }
.pz-checklist, .plain-list { list-style: none; margin: 0; padding: .3rem 1.2rem; }
.pz-checklist li, .plain-list li { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.pz-checklist li:last-child, .plain-list li:last-child { border-bottom: 0; }
.pz-checklist label { display: flex; align-items: center; gap: .6rem; flex: 1; cursor: pointer; }
.pz-checklist input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.plain-list li span:first-child { flex: 1; }

/* credits */
.credits { list-style: none; margin: 0; padding: .3rem 1.2rem; }
.credits li { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.credits li:last-child { border-bottom: 0; }
.credit-thumb { flex: none; width: 84px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.credit-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* prose */
.prose { color: var(--ink-2); }
.prose h2, .prose h3 { margin: 1.6rem 0 .6rem; }
.prose a { text-underline-offset: 3px; }
.prose img { border-radius: 10px; }
.prose blockquote { margin: 1.4rem 0; padding: 1rem 1.2rem; background: var(--soft); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; }
.prose blockquote p { margin: 0; }
.prose.small { font-size: .88rem; color: var(--muted); }

/* youtube lite embed */
.yt { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.yt:hover img { transform: scale(1.03); }
.yt-play { position: absolute; left: 1rem; bottom: 1rem; width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.yt-play::after { content: ""; position: absolute; left: 19px; top: 15px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent var(--ink); }
.yt-frame { width: 100%; height: 100%; border: 0; display: block; }

/* footer */
.site-footer { max-width: 1180px; width: 100%; margin: 0 auto; padding: 1.5rem var(--gutter) 2rem; color: var(--muted); font-size: .82rem; }
.site-footer p { margin: 0; max-width: 80ch; }
.loading { padding: 2rem 0; }

/* tab bar (phones) */
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 10px 40px rgba(15, 23, 42, .2); }
  .side-open .sidebar { transform: none; }
  .side-close, .menu-btn { display: inline-grid; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .35); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  .side-open .scrim { opacity: 1; pointer-events: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-steps ol { grid-template-columns: 1fr; }
  .rail { grid-auto-columns: minmax(250px, 72%); }
}
@media (max-width: 640px) {
  .topbar { padding: .7rem 1rem; gap: .5rem; flex-wrap: wrap; }
  .top-search { order: 3; flex-basis: 100%; height: 46px; }
  .top-search kbd { display: none; }
  .my-gup { margin-left: auto; height: 42px; }
  .my-gup span { display: none; }
  main { padding: .2rem 1rem 3rem; }
  .hero-grid, .hero-grid-3, .two-col, .mini-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 240px; }
  .hero-overlay h3 { font-size: 1.25rem; }
  .pz-head { grid-template-columns: 1fr; }
  .pz-art-big { height: 130px; }
  .rank-row { grid-template-columns: auto 1fr auto; }
  .rank-pz { display: none; }
  .term { grid-template-columns: 1fr; gap: .2rem; }
  .checklist label { grid-template-columns: 1.4rem 1fr; row-gap: .2rem; }
  .ex-num { display: none; }
  .ex-detail { grid-column: 2; text-align: left; }
  .gup-head { align-items: flex-start; }
  .gup-big { width: 60px; height: 60px; font-size: 1.6rem; border-radius: 16px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; height: 60px; text-decoration: none; color: var(--muted); font-size: .7rem; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .timer-controls .btn { min-width: 0; flex: 1; }
}

/* ---------- print: just the session ---------- */
@media print {
  .sidebar, .topbar, .site-footer, .tabbar, .no-print, .skip-link, .scrim { display: none !important; }
  .shell { display: block; }
  body { background: #fff; padding: 0; }
  main { padding: 0; max-width: none; }
  .article { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .checklist input { appearance: none; border: 1.5px solid #000; border-radius: 3px; }
  .checklist input:checked ~ strong { text-decoration: none; color: inherit; }
  a { text-decoration: none; color: inherit; }
}
