/* ════════════════════════════════════════════════════════════════
   Bohrline · Lesson page common styles
   ────────────────────────────────────────────────────────────────
   Imported by every lesson HTML to avoid 200+ lines of duplicate
   CSS. Hero + workbench + params + principles + formula-block.
   ════════════════════════════════════════════════════════════════ */

.lesson-hero { padding: 40px 0 50px; border-bottom: 1px solid var(--rule); }
.lesson-title { font-family: var(--font-display); font-style: normal; font-size: clamp(44px, 6.5vw, 80px); font-weight: 300; line-height: 0.95; letter-spacing: -0.035em; margin-bottom: 14px; color: var(--text-warm); }
.lesson-title .accent { color: var(--accent); }
.lesson-title-kr { font-family: var(--font-serif); font-size: clamp(20px, 2.3vw, 24px); font-weight: 300; color: var(--text-dim); letter-spacing: -0.03em; line-height: 1.4; margin-bottom: 22px; max-width: 760px; }
.lesson-lead-kr { font-family: var(--font-serif); font-size: 15.5px; color: var(--text-dim); line-height: 1.9; max-width: 760px; margin-bottom: 28px; font-weight: 300; }
.lesson-lead-kr em { color: var(--accent); font-style: normal; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── EN parallel-block siblings (shown only via data-lang-only="en" in lang-en).
   The -kr classes are force-hidden in EN with !important, so English hero text
   uses these dedicated classes instead. Rich body EN content reuses .lp-text /
   .lp-lead-q etc. inside a plain <div data-lang-only="en"> wrapper. ── */
.lesson-subtitle-en { font-family: var(--font-serif); font-size: clamp(20px, 2.3vw, 24px); font-weight: 300; color: var(--text-dim); letter-spacing: -0.03em; line-height: 1.4; margin-bottom: 22px; max-width: 760px; }
.lesson-lead-en { font-family: var(--font-serif); font-size: 15.5px; color: var(--text-dim); line-height: 1.9; max-width: 760px; margin-bottom: 28px; font-weight: 300; }
.lesson-lead-en em { color: var(--accent); font-style: normal; }
.lesson-lead-en strong { color: var(--accent); font-weight: 500; }

.workbench { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 40px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 980px) { .workbench { grid-template-columns: 1fr; } }
.viewport-block, .params-panel { display: flex; flex-direction: column; border: 1px solid var(--glass-border); background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur-lg); box-shadow: var(--glass-shadow); border-radius: var(--r-3); overflow: hidden; }
.viewport-block { box-shadow: var(--glass-shadow-lg); }
.vp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--text-dim); text-transform: uppercase; }
.vp-head .id { color: var(--accent); }
.vp-body { position: relative; min-height: 480px; background: radial-gradient(ellipse at 50% 40%, #051428 0%, #02091A 60%, #02050C 100%); }
.vp-body canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.vp-controls { padding: 14px 18px; border-top: 1px solid var(--rule); }
.type-pills { display: grid; gap: 4px; }
.type-pills .pill { padding: 9px 4px; font-size: 10.5px; text-align: center; font-family: var(--font-mono); }
.type-pills.cols-2 { grid-template-columns: repeat(2, 1fr); }
.type-pills.cols-3 { grid-template-columns: repeat(3, 1fr); }
.type-pills.cols-4 { grid-template-columns: repeat(4, 1fr); }
.type-pills.cols-5 { grid-template-columns: repeat(5, 1fr); }
.type-pills.cols-6 { grid-template-columns: repeat(6, 1fr); }

.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; }
.slider-row label { color: var(--text); letter-spacing: 0.08em; text-transform: uppercase; min-width: 160px; font-weight: 500; }
.slider-row input[type="range"] { flex: 1; }
.slider-row .val { color: var(--accent); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }

.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row button { flex: 1; padding: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; }

.params-head { padding: 14px 20px; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.params-head::before { content: ''; display: inline-block; width: 14px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 10px; }
.params-body { padding: 18px 20px; }
.param-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 12.5px; }
.param-row:last-child { border-bottom: 0; }
.param-row .k { color: var(--text-dim); }
.param-row .v { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.param-row .v.alt { color: var(--accent-2); }
.param-row .v.warm { color: var(--text-warm); }
.param-row .v.hot { color: var(--accent-2); }
.param-row .v.danger { color: var(--danger); }

.params-narrative { padding: 18px 20px; border-top: 1px solid var(--rule); background: var(--glass-bg); font-family: var(--font-serif); font-size: 13.5px; color: var(--text); line-height: 1.9; font-weight: 300; }
.params-narrative em { color: var(--accent); font-style: normal; }

.principles { padding: 60px 0; border-top: 1px solid var(--rule); }
.formula-block { margin-top: 20px; padding: 22px 24px; background: linear-gradient(135deg, rgba(94, 234, 212, 0.04) 0%, rgba(94, 234, 212, 0.01) 100%); border: 1px solid rgba(94, 234, 212, 0.18); border-radius: var(--r-3); }
.formula-block .step { padding: 8px 0; border-bottom: 1px dotted rgba(94, 234, 212, 0.18); font-family: var(--font-serif); font-size: 13.5px; color: var(--text); line-height: 1.7; }
.formula-block .step:last-child { border-bottom: 0; }
.formula-block .step strong { color: var(--text-warm); font-weight: 500; }
.formula-block .meaning { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--font-serif); font-size: 14px; color: var(--text); line-height: 1.85; }
.formula-block .meaning em { color: var(--accent-2); font-style: normal; }

/* ════════════════════════════════════════════════════════════════
   Web art baseline upgrades (synthesized from 100-design research:
   Editorial + Scientific + WebGL + Museum + Data viz categories)
   ════════════════════════════════════════════════════════════════ */

/* Tabular numerals lock-in (Bloomberg / FT / Stripe) — values stop dancing */
.param-row .v, .param-row .k,
.formula-block .step, .params-narrative,
.bench-stats .row .v, .bench-stats .row .k,
.vp-head .id, td.num, .stat-num, .formula-rhs {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* Derivation reveal cards (Distill / Ciechanowski) */
/* Disclosure / reveal — editorial index style.
   Deliberately NOT the "box + left accent bar + fill" callout (a template/AI
   cliche). Instead: full-width hairline dividers, a hanging mono number like a
   museum wall-label, an italic display question, and a + -> x marker at right. */
.derivation-step {
  margin: 0; padding: 20px 2px 22px;
  border-top: 1px solid var(--rule);
  background: none; border-radius: 0;
}
.derivation-step:last-of-type { border-bottom: 1px solid var(--rule); }
.derivation-step > summary {
  cursor: pointer; list-style: none; outline: none;
  display: flex; align-items: baseline; gap: 20px;
  font-family: var(--font-display); font-style: normal; font-weight: 300;
  font-size: 21px; color: var(--text-warm); line-height: 1.45;
  transition: color 0.25s ease;
}
.derivation-step > summary:hover { color: var(--accent); }
.derivation-step > summary::-webkit-details-marker { display: none; }
.derivation-step .summary-no {
  flex: 0 0 auto; align-self: flex-start; padding-top: 9px; min-width: 28px;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.18em; text-transform: uppercase;
}
.derivation-step > summary::after {
  content: '+'; margin-left: auto; flex: 0 0 auto; align-self: center;
  font-family: var(--font-mono); font-weight: 300; font-size: 20px;
  color: var(--accent); line-height: 1;
  transition: transform 0.3s cubic-bezier(.22,.61,.36,1);
}
.derivation-step[open] > summary::after { transform: rotate(135deg); }
.derivation-step .deriv-body {
  margin: 16px 0 0; padding-left: 48px; max-width: 720px;
  font-family: var(--font-serif); font-size: 15px; line-height: 1.95;
  color: var(--text); font-weight: 300;
  animation: derivReveal 0.4s cubic-bezier(.22,.61,.36,1);
}
@keyframes derivReveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.derivation-step .deriv-body em { color: var(--accent); font-style: normal; }
.derivation-step .deriv-body strong { color: var(--text-warm); font-weight: 500; }
@media (max-width: 600px) {
  .derivation-step > summary { font-size: 18px; gap: 12px; }
  .derivation-step .deriv-body { padding-left: 0; }
}

/* Margin-note sidenote (Tufte / Distill) */
.margin-note {
  font-family: var(--font-serif); font-size: 13px; line-height: 1.7;
  color: var(--text-dim); font-weight: 300;
  border-top: 1px solid var(--accent);
  padding-top: 8px; margin-top: 10px;
}
.margin-note .mn-label {
  display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 6px;
}
@media (min-width: 1280px) {
  .lesson-body-grid { display: grid; grid-template-columns: 1fr 240px; gap: 56px; align-items: start; }
  .margin-note { margin: 0; }
}

/* Source line — every chart/formula gets provenance */
.src-line {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-serif); font-style: normal;
  font-size: 11px; line-height: 1.6; color: var(--text-very-dim);
}
.src-line strong { color: var(--text-dim); font-weight: 400; font-style: normal; }
.src-line em { color: var(--accent); font-style: normal; }

/* Exhibition-grade lesson eyebrow (museum wall-label) */
.lesson-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.lesson-eyebrow::before {
  content: ''; width: 28px; height: 1px; background: var(--accent); opacity: 0.6;
}
.lesson-eyebrow .ord { color: var(--text-warm); font-weight: 500; }

/* Status pill (Bloomberg / Linear) */
.status-pill {
  display: inline-flex; align-items: center; height: 18px;
  padding: 0 8px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 9px; border: 1px solid currentColor;
  font-variant-numeric: tabular-nums;
}
.status-pill[data-state="verified"] { color: var(--accent-2); background: rgba(163, 230, 53, 0.10); }
.status-pill[data-state="live"]     { color: var(--accent);   background: rgba(94, 234, 212, 0.10); }
.status-pill[data-state="cached"]   { color: var(--text-dim); background: rgba(148, 163, 184, 0.10); }
.status-pill[data-state="draft"]    { color: var(--accent-2);         background: rgba(255, 170, 94, 0.10); }

/* ============================================================
   Web-art spec additions (research-driven, additive/opt-in)
   ============================================================ */

/* P0 #2 — global tabular-figure utility for any live numeric readout */
.tnum, .lesson .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* P2 #15 — Are.na block model: related-concept chips at lesson end */
.concept-chips {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 40px 0 8px; padding-top: 28px;
  border-top: 1px solid var(--rule, rgba(94,234,212,0.10));
}
.concept-chips .ic-label {
  flex: 0 0 100%; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--text-very-dim); margin-bottom: 4px;
}
.concept-chip {
  display: inline-flex; flex-direction: column; gap: 3px;
  padding: 12px 16px; min-width: 150px;
  border: 1px solid var(--accent-dim, rgba(94,234,212,0.22));
  border-radius: 12px; background: rgba(94,234,212,0.03);
  text-decoration: none; transition: border-color .25s, background .25s, transform .25s;
}
.concept-chip:hover {
  border-color: var(--accent, #5EEAD4); background: rgba(94,234,212,0.08);
  transform: translateY(-2px);
}
.concept-chip .cc-kr { font-family: var(--font-serif); font-size: 14px; color: var(--text-warm); }
.concept-chip .cc-en { font-family: var(--font-display); font-style: normal; font-size: 12px; color: var(--text-dim); }
.concept-chip .cc-meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
/* Lang-aware: each mode shows exactly one label (KO 또는 EN, 둘 다 X) */
body.lang-en .concept-chip .cc-kr { display: none; }
body:not(.lang-en) .concept-chip .cc-en { display: none; }
body.lang-en .concept-chip .cc-en {
  font-family: var(--font-serif); font-size: 14px; color: var(--text-warm); font-style: normal;
}

/* P1 #10 — opt-in section reveal on scroll-enter (no effect unless class is present) */
.reveal-on-enter { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }
.reveal-on-enter.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-on-enter { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Reusable rich-content vocabulary (narrative lesson upgrades)
   Used to convert telegraphic 단답형 lessons into 서술형 depth.
   ============================================================ */
.lesson-prose { padding: 4px 0 8px; }
.lp-text {
  font-family: var(--font-serif); font-size: 16px; line-height: 1.95;
  color: var(--text); font-weight: 300; max-width: 760px;
  margin: 0 0 18px; word-break: keep-all;
}
.lp-text strong { color: var(--accent); font-weight: 500; }
.lp-text .hi { color: var(--text-warm); }
.lp-text em { color: var(--accent); font-style: normal; }
.lp-lead-q {
  font-family: var(--font-display); font-style: normal; font-size: 23px;
  color: var(--text-warm); margin: 6px 0 22px; line-height: 1.45; max-width: 760px;
}

/* Application cards (real-world stories) */
.app-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px; margin: 26px 0 8px;
}
.app-card {
  padding: 20px; border: 1px solid var(--rule); border-radius: 14px;
  background: rgba(94,234,212,0.025); transition: border-color .25s, transform .25s;
}
.app-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.app-card .ac-tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px;
}
.app-card .ac-title {
  font-family: var(--font-serif); font-size: 16px; color: var(--text-warm);
  font-weight: 500; margin-bottom: 8px;
}
.app-card .ac-body {
  font-family: var(--font-serif); font-size: 13.5px; line-height: 1.78;
  color: var(--text-dim); word-break: keep-all;
}
.app-card .ac-body em { color: var(--accent-2); font-style: normal; }
