@font-face { font-family: 'Mona Sans Expanded'; src: url('/fonts/MonaSansDisplayExpanded-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Mona Sans Expanded'; src: url('/fonts/MonaSansDisplayExpanded-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Mona Sans Expanded'; src: url('/fonts/MonaSansDisplayExpanded-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ── Tokens (dotiy.de system; light is the default here, dark via toggle) ── */
:root {
  --bg:          #f4f4f4;
  --surface:     #ffffff;
  --fg:          #0a0a0a;
  --muted:       rgba(10,10,10,.58);
  --dim:         rgba(10,10,10,.36);
  --line:        rgba(10,10,10,.09);
  --line-strong: rgba(10,10,10,.2);
  --glass:       rgba(10,10,10,.03);

  --good:      #15803d;
  --good-bg:   #ecfaf1;
  --good-line: rgba(21,128,61,.3);
  --bad:       #dc2626;
  --bad-bg:    #fdf0f0;
  --bad-line:  rgba(220,38,38,.3);
  --xp:        #d97706;

  --f-display: 'Mona Sans Expanded', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r-md: 15px;
  --r-lg: 20px;
  --r-full: 999px;
  --ease: .2s ease;
  --spring: cubic-bezier(.34,1.56,.64,1);
  --page: 40px;
  --zig: 56px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --fg:          #ffffff;
  --muted:       rgba(255,255,255,.52);
  --dim:         rgba(255,255,255,.28);
  --line:        rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.2);
  --glass:       rgba(255,255,255,.03);

  --good:      #4ade80;
  --good-bg:   rgba(74,222,128,.08);
  --good-line: rgba(74,222,128,.3);
  --bad:       #f87171;
  --bad-bg:    rgba(248,113,113,.08);
  --bad-line:  rgba(248,113,113,.3);
  --xp:        #fcd34d;
  color-scheme: dark;
}

@media (max-width: 768px) {
  :root { --page: 20px; --zig: 22px; }
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  transition: background-color var(--ease), color var(--ease);
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
::selection { background: rgba(180,40,20,.22); }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin-inline: auto; padding-inline: var(--page); }
.wrap--narrow { max-width: 760px; }

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding-inline: 28px;
  border-radius: var(--r-full);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: opacity var(--ease), transform .1s, background-color var(--ease), color var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { opacity: .86; }
.btn--primary:disabled { background: var(--line); color: var(--dim); cursor: not-allowed; opacity: 1; transform: none; }
.btn--ghost { border: 1px solid var(--line-strong); }
.btn--ghost:hover { border-color: var(--fg); }

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: border-color var(--ease), color var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--muted);
  transition: border-color var(--ease), color var(--ease);
}
.chip-btn:hover { border-color: var(--line-strong); color: var(--fg); }
.chip-btn svg { width: 11px; height: 11px; }

/* ── Nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-inline: var(--page);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
body[data-view="lesson"] .nav { display: none; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo {
  display: block;
  width: 70px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url('/logo.svg') no-repeat left center / contain;
  mask: url('/logo.svg') no-repeat left center / contain;
}
.brand__sub {
  font-family: var(--f-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  line-height: 20px;
}
.nav__right { display: flex; align-items: center; gap: 8px; }
.xp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-family: var(--f-display);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.xp svg { width: 12px; height: 12px; color: var(--xp); }

/* ── Speech bubble ────────────────────────────────────────────────────── */
.bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 18px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
  min-height: 54px;
}
.bubble::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.bubble--down::before { left: 50%; top: auto; bottom: -7px; margin-left: -6px; transform: rotate(-45deg); }
.bubble.is-fresh { animation: pop .22s ease; }
@keyframes pop { from { opacity: .35; transform: translateY(3px); } }

/* ── Dot ──────────────────────────────────────────────────────────────── */
.dot { width: var(--dot-size); height: var(--dot-size); flex: none; }
.dot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dot__body { fill: var(--fg); transition: fill var(--ease); }
.dot__eyes ellipse, .dot__mouth { fill: var(--bg); transition: fill var(--ease); }
.dot__happy, .dot__smile, .dot__frown {
  fill: none;
  stroke: var(--bg);
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: opacity .15s;
}
.dot__happy, .dot__frown, .dot__mouth { opacity: 0; }
.dot__float { animation: float 4.2s ease-in-out infinite; }
.dot__eyes { transition: transform .25s ease, opacity .15s; }
.dot__eye-l, .dot__eye-r { transform-box: fill-box; transform-origin: center; transition: transform .1s; }
.dot__mouth { transform-box: fill-box; transform-origin: center; transition: transform .08s; }

.dot.is-blink .dot__eye-l, .dot.is-blink .dot__eye-r { transform: scaleY(.1); }
.dot.is-talking .dot__mouth { opacity: 1; }
.dot.is-talking .dot__smile, .dot.is-talking .dot__frown { opacity: 0; }
.dot.is-think .dot__eyes { transform: translate(3px, -4px); }
.dot.is-happy .dot__eyes { opacity: 0; }
.dot.is-happy .dot__happy { opacity: 1; }
.dot.is-happy svg { animation: hop .6s var(--spring); }
.dot.is-sad .dot__eyes { transform: translateY(3px); }
.dot.is-sad:not(.is-talking) .dot__smile { opacity: 0; }
.dot.is-sad:not(.is-talking) .dot__frown { opacity: 1; }
.dot.is-sad svg { animation: shake .4s ease; }

@keyframes float { 50% { transform: translateY(-3px); } }
@keyframes hop { 35% { transform: translateY(-12px) scale(1.04); } 70% { transform: translateY(0) scale(.97, 1.03); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ── Home ─────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
  padding-block: 72px 64px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 6px 12px;
  margin-bottom: 24px;
}
.tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.hero h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.hero h1 span { display: block; color: var(--dim); margin-top: 6px; }
.hero__desc { margin-top: 22px; color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 52ch; }
.hero__cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 30px; }
.hero__meta { font-size: 13px; color: var(--dim); }

.hero__dot { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 230px; }
.hero__dot .bubble { text-align: center; font-size: 14px; }
.hero__dotbtn { border-radius: 50%; transition: transform .2s var(--spring); }
.hero__dotbtn:hover { transform: scale(1.04) rotate(-3deg); }

.course { border-top: 1px solid var(--line); padding-top: 40px; }
.course__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.course__title { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
.course__meta { margin-top: 6px; font-size: 13px; color: var(--muted); }
.course__progress { display: flex; flex-direction: column; gap: 8px; width: 220px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.track { flex: 1; height: 10px; border-radius: var(--r-full); background: var(--line); overflow: hidden; }
.track--thin { flex: none; height: 4px; }
.track__fill { height: 100%; width: 0; background: var(--fg); border-radius: inherit; transition: width .5s cubic-bezier(.4,0,.2,1); }

.path { list-style: none; display: flex; flex-direction: column; gap: 6px; padding-block: 32px 16px; }
.path__btn {
  --x: calc(var(--k, 0) * var(--zig));
  display: flex;
  align-items: center;
  gap: 20px;
  width: calc(100% - var(--x));
  margin-left: var(--x);
  padding: 10px 14px 10px 10px;
  text-align: left;
  border-radius: var(--r-lg);
  transition: background-color var(--ease);
}
.path__btn:hover:not(:disabled) { background: var(--glass); }
.path__btn:disabled { cursor: default; }

.node {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.node svg { width: 22px; height: 22px; }
.node--done { background: var(--fg); color: var(--bg); }
.node--current { background: var(--fg); color: var(--bg); box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--fg); }
.node--current::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  animation: ping 2.2s ease-out infinite;
}
.node--locked { border: 1px dashed var(--line-strong); color: var(--dim); }
@keyframes ping { to { transform: scale(1.4); opacity: 0; } }

.path__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.path__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.path__title { font-family: var(--f-display); font-weight: 600; font-size: 16px; letter-spacing: -.01em; line-height: 1.3; }
.path__meta { font-size: 13px; color: var(--muted); }
.path__btn:disabled .path__title { color: var(--dim); }
.path__chip {
  flex: none;
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--fg);
  color: var(--bg);
}
.path__chip--soft { background: none; color: var(--muted); border: 1px solid var(--line); }

.notice {
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.notice p:last-child { font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 70ch; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 56px 40px;
  font-size: 12px;
  color: var(--dim);
}
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; color: var(--muted); }
.footer a:hover { color: var(--fg); }

/* ── Lesson ───────────────────────────────────────────────────────────── */
.lesson {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--page);
  padding-bottom: 180px;
}
.lessonbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: 12px;
  background: var(--bg);
}

.coach { display: flex; gap: 18px; align-items: flex-start; padding-block: 18px 24px; }
.coach__talk { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.coach__controls { display: flex; gap: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  animation: rise .28s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin-bottom: 18px;
}

.prose { display: grid; gap: 12px; color: var(--muted); font-size: 15.5px; line-height: 1.75; max-width: 62ch; }
.prose strong { color: var(--fg); font-weight: 600; }

.note {
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--glass);
  font-size: 14.5px;
  line-height: 1.6;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.fact { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--surface); }
.fact__num { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fact__desc { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.items, .risks { list-style: none; display: grid; gap: 8px; margin-top: 20px; }
.items li { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.items__title, .risk__title { font-weight: 600; font-size: 14.5px; }
.items__desc, .risk__desc { font-size: 13px; color: var(--muted); }
.risk { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.risk > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.risk__dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--tone); }
.risk--red { --tone: #ef4444; }
.risk--amber { --tone: #f59e0b; }
.risk--violet { --tone: #8b5cf6; }
.risk--blue { --tone: #3b82f6; }
.risk--green { --tone: #22c55e; }

.rules { list-style: none; counter-reset: rule; margin-top: 12px; border-top: 1px solid var(--line); }
.rules li {
  counter-increment: rule;
  display: flex;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.rules li::before {
  content: counter(rule, decimal-leading-zero);
  min-width: 20px;
  padding-top: 3px;
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* Quiz */
.card__title--q { font-size: clamp(19px, 2.4vw, 23px); }
.options { display: grid; gap: 10px; }
.options--tf { grid-template-columns: 1fr 1fr; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 2px 0 var(--line-strong);
  transition: border-color var(--ease), background-color var(--ease), box-shadow var(--ease), transform .08s;
}
.option:hover { border-color: var(--muted); }
.option:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line-strong); }
.option kbd {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  transition: inherit;
}
.option.is-selected { border-color: var(--fg); box-shadow: 0 2px 0 var(--fg); }
.option.is-selected kbd { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.option.is-correct { border-color: var(--good); background: var(--good-bg); box-shadow: 0 2px 0 var(--good); }
.option.is-correct kbd { background: var(--good); border-color: var(--good); color: var(--surface); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 2px 0 var(--bad); }
.option.is-wrong kbd { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.options.is-locked .option { cursor: default; transform: none; }
.options.is-locked .option:not(.is-correct):not(.is-wrong) { opacity: .45; }
.options--tf .option { justify-content: center; padding-block: 24px; font-family: var(--f-display); font-weight: 600; font-size: 15px; }
@media (hover: none) { .option kbd { display: none; } }

/* Done card */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 4px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; background: var(--surface); }
.stat__num { font-family: var(--f-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--muted); line-height: 1.4; }
.link-btn { margin-top: 20px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--fg); }

/* Action bar */
.actionbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  background-color: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: border-color var(--ease);
}
.actionbar[data-state="correct"] { background-image: linear-gradient(var(--good-bg), var(--good-bg)); border-top-color: var(--good-line); }
.actionbar[data-state="wrong"] { background-image: linear-gradient(var(--bad-bg), var(--bad-bg)); border-top-color: var(--bad-line); }
.actionbar__inner {
  max-width: 720px;
  margin-inline: auto;
  padding: 18px var(--page);
  display: flex;
  align-items: center;
  gap: 20px;
}
.actionbar__inner .btn { margin-left: auto; min-width: 160px; }
.actionbar__msg { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.actionbar[data-state="content"] .actionbar__msg,
.actionbar[data-state="ask"] .actionbar__msg { display: none; }
.actionbar__icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--surface); }
.actionbar__icon svg { width: 16px; height: 16px; }
.actionbar[data-state="correct"] .actionbar__icon { background: var(--good); }
.actionbar[data-state="wrong"] .actionbar__icon { background: var(--bad); }
.actionbar[data-state="done"] .actionbar__icon { background: var(--fg); color: var(--xp); }
.actionbar__title { font-family: var(--f-display); font-weight: 600; font-size: 16px; }
.actionbar[data-state="correct"] .actionbar__title { color: var(--good); }
.actionbar[data-state="wrong"] .actionbar__title { color: var(--bad); }
.actionbar__text { margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 54ch; }
.actionbar[data-state="correct"] .btn--primary { background: var(--good); color: var(--surface); }
.actionbar[data-state="wrong"] .btn--primary { background: var(--bad); color: var(--surface); }

/* ── Certificate ──────────────────────────────────────────────────────── */
.cert { padding-block: 48px 72px; }
.cert__intro { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.cert__intro h1 { font-family: var(--f-display); font-weight: 600; font-size: 28px; letter-spacing: -.025em; }
.cert__intro p { color: var(--muted); margin-top: 4px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.field span { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.field input {
  height: 52px;
  padding-inline: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  outline: none;
  transition: border-color var(--ease);
}
.field input:focus { border-color: var(--fg); }
.field input::placeholder { color: var(--dim); }

.cert-doc {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 56px 56px 40px;
  text-align: center;
}
.cert-doc::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  pointer-events: none;
}
.cert-doc__head { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.cert-doc__kind { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 28px; }
.cert-doc__lead { font-size: 14px; color: var(--muted); }
.cert-doc__name {
  display: inline-block;
  min-width: min(360px, 100%);
  margin: 10px 0 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.cert-doc__name.is-empty { color: var(--dim); }
.cert-doc__course { font-family: var(--f-display); font-weight: 600; font-size: 18px; margin: 6px 0; }
.cert-doc__topics { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; }
.cert-doc__topics li { font-size: 11.5px; padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--r-full); color: var(--muted); }
.cert-doc__legal { font-size: 12px; color: var(--muted); max-width: 56ch; margin: 24px auto 0; line-height: 1.6; }
.cert-doc__foot {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
}
.cert-doc__foot strong { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg); }
.cert-doc__seal { margin-left: auto; }
.cert__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 40px; }
  .hero__dot { order: -1; flex-direction: row-reverse; justify-content: flex-end; width: auto; }
  .hero__dot .bubble { text-align: left; }
  .hero__dot .bubble--down::before { left: -7px; top: 20px; bottom: auto; margin-left: 0; transform: rotate(45deg); }
  .course__progress { width: 100%; }
  .card { padding: 22px; }
  .facts { grid-template-columns: 1fr; }
  .stat { padding: 14px 12px; }
  .stat__num { font-size: 19px; }
  .coach { gap: 12px; }
  .actionbar__inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .actionbar__inner .btn { width: 100%; margin-left: 0; }
  .cert-doc { padding: 40px 22px 28px; }
  .cert-doc__foot { flex-wrap: wrap; gap: 16px 24px; }
  .path__chip { display: none; }
}

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

/* ── Print: certificate only, always light ────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 0; }
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --fg: #0a0a0a;
    --muted: rgba(10,10,10,.62); --dim: rgba(10,10,10,.42);
    --line: rgba(10,10,10,.14); --line-strong: rgba(10,10,10,.3);
  }
  body { background: #fff; }
  .nav, [data-view-panel="home"], [data-view-panel="lesson"], .cert__intro, .field, .cert__actions { display: none !important; }
  .cert { padding: 0; max-width: none; }
  .cert-doc {
    width: 297mm;
    height: 210mm;
    border: 0;
    border-radius: 0;
    padding: 20mm 28mm 14mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .cert-doc::before { inset: 8mm; border-radius: 0; }
  .cert-doc__foot { width: 100%; margin-top: auto; }
  .dot__float { animation: none; }
}
