:root {
  --orange: #f99d1c;
  --magenta: #e20082;
  --magenta-dark: #b8006a;
  --ink: #111318;
  --body: #3b3f48;
  --muted: #6b7180;
  --line: #e4e6eb;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --blue: #0b6ea8;
  --note-bg: #fff6e8;
  --note-line: #f99d1c;
  --warn-bg: #fdecf5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 19, 24, .06), 0 8px 24px rgba(17, 19, 24, .06);
  --gradient: linear-gradient(90deg, var(--orange), var(--magenta));
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--magenta-dark); text-underline-offset: 2px; }
a:hover { color: var(--magenta); }
strong { color: var(--ink); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.topbar { height: 6px; background: var(--gradient); }
.byline-bar { background: var(--ink); color: #c9ccd4; font-size: 13px; padding: 7px 0; }
.byline-bar .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; text-align: center; }
.byline-bar strong { color: #fff; font-weight: 700; }
.byline-sep { color: #6b7180; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--body); font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero.compact { padding: 48px 0 24px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--magenta-dark); background: var(--warn-bg); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 52px); margin: 0 0 16px; font-weight: 800; }
.accent { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 12px; font-weight: 800; }
h3 { font-size: 20px; margin: 28px 0 10px; font-weight: 700; }
.lead { font-size: 19px; color: var(--body); max-width: 780px; margin: 0; }

/* ---------- Role cards (home) ---------- */
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 40px 0 24px; }
.role-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff;
  text-decoration: none; color: var(--body); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}
.role-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--gradient); }
.role-card:hover { transform: translateY(-3px); border-color: #d5d8de; box-shadow: 0 12px 32px rgba(17, 19, 24, .10); color: var(--body); }
.role-card .tag { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.role-card h2 { font-size: 24px; margin: 0; }
.role-card p { margin: 0; }
.role-card ul { margin: 4px 0 0; padding-left: 20px; }
.role-card .cta { margin-top: auto; padding-top: 12px; font-weight: 700; color: var(--magenta-dark); }

.glossary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 56px; }
.glossary div { background: var(--bg-soft); border-radius: 12px; padding: 18px 20px; }
.glossary dt { font-weight: 800; color: var(--ink); }
.glossary dd { margin: 4px 0 0; font-size: 15px; }

/* ---------- Steps (learner) ---------- */
.progress {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 32px 0 8px;
  list-style: none; padding: 0;
}
.progress li a {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1.3;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; height: 100%;
}
.progress li a:hover { border-color: var(--magenta); }
.progress .num {
  flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 14px;
}

.steps { list-style: none; padding: 0; margin: 32px 0; position: relative; }
.step {
  position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 24px;
  padding-bottom: 40px;
}
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 35px; top: 72px; bottom: 0; width: 2px;
  background: linear-gradient(var(--magenta), var(--line));
}
.step-badge {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; align-content: center; text-align: center;
  background: var(--gradient); color: #fff; font-weight: 800; line-height: 1; box-shadow: 0 6px 18px rgba(226, 0, 130, .25);
}
.step-badge small { display: block; font-size: 11px; letter-spacing: .1em; font-weight: 700; opacity: .9; margin-bottom: 2px; }
.step-badge span { font-size: 28px; }
.step-body {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow);
  min-width: 0;
}
.step-body h2 { font-size: 24px; margin-bottom: 8px; }
.step-body p { margin: 8px 0; }
.step-body ul, .step-body ol { margin: 8px 0; padding-left: 22px; }
.step-body ul { list-style: disc; }
.step-body ol { list-style: decimal; }
.step-body li { margin: 4px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px;
  padding: 11px 18px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; line-height: 1.2;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2e37; color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: #cfd3da; }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: 12px; padding: 16px 20px; margin: 16px 0; border-left: 5px solid var(--note-line); background: var(--note-bg);
}
.callout p { margin: 4px 0; }
.callout ul { margin: 6px 0; padding-left: 20px; }
.callout-title { font-weight: 800; color: var(--ink); display: block; margin-bottom: 2px; }
.callout.tip { background: #eef7f1; border-left-color: #1f9d55; }
.callout.important { background: var(--warn-bg); border-left-color: var(--magenta); }
.callout.info { background: #eef5fb; border-left-color: var(--blue); }

/* ---------- Learner next section ---------- */
.next-section { border-top: 1px solid var(--line); padding: 40px 0 8px; margin-bottom: 24px; }
.next-section .intro { font-size: 17px; margin: 4px 0 16px; max-width: 780px; }
.progress-next { margin: 4px 0 0; font-size: 15px; }

/* ---------- Figures ---------- */
figure.shot { margin: 20px 0; }
figure.shot button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: zoom-in; overflow: hidden; box-shadow: var(--shadow);
}
figure.shot button:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
figure.shot.narrow { max-width: 520px; }
figure.shot.medium { max-width: 760px; }
figure.shot figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.inline-icon { display: inline-block; vertical-align: middle; height: 22px; width: auto; margin: 0 2px; border-radius: 4px; }

/* ---------- COM layout ---------- */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 64px; }
.toc {
  position: sticky; top: 88px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff;
}
.toc-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--body);
  font-size: 14px; font-weight: 600; padding: 7px 10px; border-radius: 8px; line-height: 1.35;
}
.toc a .n { color: var(--muted); font-weight: 700; min-width: 16px; }
.toc a:hover { background: var(--bg-soft); color: var(--ink); }
.toc a.active { background: var(--warn-bg); color: var(--magenta-dark); }
.toc a.active .n { color: var(--magenta-dark); }

.task-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 8px; }
.task {
  display: block; text-decoration: none; color: var(--body); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; background: #fff; transition: border-color .15s ease, transform .15s ease;
}
.task:hover { border-color: var(--magenta); transform: translateY(-2px); color: var(--body); }
.task .t { display: block; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.task .d { font-size: 14px; }

.section { padding: 40px 0 16px; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 8px; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.section-num {
  flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 20px;
}
.section-head h2 { margin: 0; }
.section > p.intro { font-size: 17px; margin: 4px 0 16px; }

ol.howto { counter-reset: h; list-style: none; padding: 0; margin: 16px 0; }
ol.howto > li { counter-increment: h; position: relative; padding-left: 44px; margin: 12px 0; min-height: 30px; }
ol.howto > li::before {
  content: counter(h); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--magenta); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
ol.howto.alpha > li::before { content: counter(h, upper-alpha); background: var(--ink); }

.substep {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; background: #fff;
}
.substep h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.substep h3 .pill {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--ink); border-radius: 999px; padding: 3px 10px;
}

.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.video-card {
  display: block; border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-decoration: none; color: var(--body);
}
.video-card:hover { border-color: var(--magenta); color: var(--body); }
.video-card .t { display: block; font-weight: 800; color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 32px 0; font-size: 14px; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer p { margin: 2px 0; }
.site-footer .disclaimer { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; font-size: 13px; }

/* ---------- Lightbox ---------- */
dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(10, 12, 16, .85); }
dialog.lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 10px; background: #fff; cursor: zoom-out; }
dialog.lightbox p { color: #e6e8ec; text-align: center; margin: 10px 0 0; font-size: 14px; }
dialog.lightbox .close {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: #fff; color: var(--ink); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
}

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--ink); color: #fff; font-size: 20px; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; margin-bottom: 24px; }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .glossary { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .role-grid, .video-grid { grid-template-columns: 1fr; }
  .progress { grid-template-columns: repeat(2, 1fr); }
  .step { grid-template-columns: 1fr; gap: 12px; }
  .step::before { display: none; }
  .step-badge { width: auto; height: auto; border-radius: 999px; padding: 8px 16px; justify-self: start; display: flex; gap: 8px; align-items: center; }
  .step-badge small { font-size: 13px; margin: 0; }
  .step-badge span { font-size: 18px; }
  .step-body { padding: 20px; }
  .hero { padding: 40px 0 24px; }
}
@media (max-width: 480px) {
  .task-grid { grid-template-columns: 1fr; }
  .nav a { padding: 6px 9px; font-size: 13px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .toc, .to-top, .topbar, .btn-row { display: none !important; }
  .layout { display: block; }
  .step-body, .substep, figure.shot button { box-shadow: none; }
  .section, .step, figure.shot { break-inside: avoid; }
  a { color: var(--ink); }
}
