/*
 * Free DevOps Roadmap — free.learnlinuxforwork.com
 * Copyright (C) 2026 Shea's Tech
 * Licensed under the GNU AGPL v3.0 or later.
 */

/* ------------------------------------------------------------ tokens --- */
:root {
  --cyan: #00b3bf;
  --cyan-bright: #00e5ee;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: min(1520px, 96vw);
  --sidebar-w: 268px;
  --header-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* light (default) */
:root,
[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-elev: #ffffff;
  --bg-sunken: #eef1f4;
  --bg-hover: #f0f3f6;
  --text: #10131a;
  --text-2: #4a5260;
  --text-3: #757e8c;
  --border: #dde2e8;
  --border-strong: #c3cbd4;
  --accent: #00757f;
  --accent-2: #00b3bf;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(16, 19, 26, 0.06), 0 4px 14px rgba(16, 19, 26, 0.05);
  --shadow-lg: 0 8px 32px rgba(16, 19, 26, 0.12);
  --ok: #0a7d4a;
  --ok-bg: #e6f6ee;
  --warn: #9a6400;
  --warn-bg: #fff6e3;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info-bg: #e6fcfd;
  --hero-from: #0b0b0f;
  --hero-to: #12242a;
}

[data-theme="dark"] {
  --bg: #0b0d10;
  --bg-elev: #14171c;
  --bg-sunken: #0f1215;
  --bg-hover: #1b1f26;
  --text: #e8ecf1;
  --text-2: #a8b2bf;
  --text-3: #7b8593;
  --border: #242a33;
  --border-strong: #333b46;
  --accent: #22d3de;
  --accent-2: #00e5ee;
  --accent-contrast: #04191c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --ok: #4ade80;
  --ok-bg: #0e2a1c;
  --warn: #fbbf24;
  --warn-bg: #2a2109;
  --danger: #f87171;
  --danger-bg: #2c1414;
  --info-bg: #06272b;
  --hero-from: #06080a;
  --hero-to: #0b1e23;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0d10;
    --bg-elev: #14171c;
    --bg-sunken: #0f1215;
    --bg-hover: #1b1f26;
    --text: #e8ecf1;
    --text-2: #a8b2bf;
    --text-3: #7b8593;
    --border: #242a33;
    --border-strong: #333b46;
    --accent: #22d3de;
    --accent-2: #00e5ee;
    --accent-contrast: #04191c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
    --ok: #4ade80;
    --ok-bg: #0e2a1c;
    --warn: #fbbf24;
    --warn-bg: #2a2109;
    --danger: #f87171;
    --danger-bg: #2c1414;
    --info-bg: #06272b;
    --hero-from: #06080a;
    --hero-to: #0b1e23;
  }
}

/* ------------------------------------------------------------- reset --- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 5px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ header --- */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid; place-items: center;
  color: var(--accent-contrast);
  font-weight: 800; font-size: 13px; letter-spacing: -0.02em;
}
.brand__mark--logo {
  background: #0b0d10;
  border: 1px solid var(--border);
  padding: 4px;
}
.brand__mark--logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand__text { min-width: 0; display: block; }
.brand__title {
  display: block;
  font-size: 14.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__sub { display: block; font-size: 11px; color: var(--text-3); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header__spacer { flex: 1; }

.header__progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.mini-bar {
  width: 110px; height: 6px; border-radius: 99px;
  background: var(--bg-sunken); overflow: hidden;
  border: 1px solid var(--border);
}
.mini-bar__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s var(--ease);
}

.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 13px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.1s var(--ease);
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--icon { padding: 7px; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-contrast);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn svg { width: 16px; height: 16px; }

.btn--menu { display: none; }

/* theme toggle icon swap */
[data-theme="dark"] .icon-sun,
:root:not([data-theme]) .icon-sun { display: none; }
[data-theme="dark"] .icon-moon,
:root:not([data-theme]) .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .icon-sun { display: block; }
  :root:not([data-theme]) .icon-moon { display: none; }
}

/* ------------------------------------------------------------ layout --- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: var(--maxw);
  margin: 0;
  gap: 0;
}

.sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 22px 12px 40px 20px;
  border-right: 1px solid var(--border);
}
.sidebar__group { margin-bottom: 20px; }
.sidebar__label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
  padding: 0 10px; margin-bottom: 7px;
}
.navlink {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 1px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-2); font-weight: 500;
  border-left: 2px solid transparent;
}
.navlink:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.navlink.is-active {
  background: var(--bg-elev); color: var(--text); font-weight: 650;
  border-left-color: var(--accent-2);
  box-shadow: var(--shadow);
}
.navlink__n {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  background: var(--bg-sunken); color: var(--text-3);
  border: 1px solid var(--border);
}
.navlink.is-active .navlink__n,
.navlink.is-done .navlink__n {
  background: var(--accent); color: var(--accent-contrast); border-color: var(--accent);
}
.navlink__pct { margin-left: auto; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.main { padding: 30px 28px 96px; min-width: 0; }

/* -------------------------------------------------------------- hero --- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 16px;
  padding: 38px 34px;
  margin-bottom: 30px;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(90deg, var(--cyan-bright), transparent 65%);
}
.hero__kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cyan-bright); margin-bottom: 12px;
}
.hero h1 { font-size: clamp(28px, 2.5vw, 40px); letter-spacing: -0.025em; margin-bottom: 10px; }
.hero__lead { font-size: 15.5px; color: #c9d4d8; max-width: 62ch; margin-bottom: 22px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 24px; }
.stat__v { font-size: 25px; font-weight: 800; color: var(--cyan-bright); line-height: 1.1; }
.stat__l { font-size: 11.5px; color: #94a3ab; text-transform: uppercase; letter-spacing: 0.07em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, 0.16); }
.hero .btn--primary { background: var(--cyan-bright); border-color: var(--cyan-bright); color: #04191c; }
.hero .btn--primary:hover { background: #6ef2f8; border-color: #6ef2f8; }

/* ---------------------------------------------------------- sections --- */
.section { margin-bottom: 46px; scroll-margin-top: calc(var(--header-h) + 16px); }
.section__head { margin-bottom: 16px; }
.section__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.section__eyebrow::before {
  content: ""; width: 22px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.section h2 { font-size: clamp(22px, 1.6vw, 28px); letter-spacing: -0.02em; margin-bottom: 5px; }
.section__sub { color: var(--text-2); font-size: 14.5px; }

.prose { max-width: 78ch; color: var(--text-2); }
.prose strong { color: var(--text); }

/* ---------------------------------------------------------- surfaces --- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card--pad { padding: 18px 20px; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* callouts */
.callout {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  background: var(--info-bg);
  padding: 15px 18px;
  margin: 16px 0;
}
.callout__title { font-weight: 700; font-size: 14.5px; margin-bottom: 5px; }
.callout p:last-child, .callout ol:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout--warn { background: var(--warn-bg); border-left-color: var(--warn); }
.callout--danger { background: var(--danger-bg); border-left-color: var(--danger); }
.callout--success { background: var(--ok-bg); border-left-color: var(--ok); }
.callout ol { margin: 8px 0 0; padding-left: 20px; }
.callout ol li { margin-bottom: 6px; }

/* rhythm bars */
.rhythm { display: grid; gap: 8px; margin: 16px 0 22px; }
.rhythm__row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.rhythm__pct { flex: none; width: 44px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.rhythm__track { flex: none; width: 110px; height: 8px; border-radius: 99px; background: var(--bg-sunken); border: 1px solid var(--border); overflow: hidden; }
.rhythm__fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rhythm__text { color: var(--text-2); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 11px 14px; background: var(--bg-sunken);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-hover); }
tbody td:first-child { color: var(--text); font-weight: 600; }

/* ----------------------------------------------------------- phases ---- */
.phase { margin-bottom: 16px; }
.phase__head {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font: inherit; color: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.phase__head:hover { border-color: var(--border-strong); }
.phase.is-open .phase__head { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
.phase__badge {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
}
.phase__badge b { font-size: 17px; font-weight: 800; }
.phase__badge span { display: block; font-size: 8.5px; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.85; }
.phase__meta { min-width: 0; flex: 1; }
.phase__title { font-size: 16px; font-weight: 700; }
.phase__sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.phase__right { display: flex; align-items: center; gap: 12px; flex: none; }
.phase__count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.phase__ring { flex: none; }
.phase__chev { flex: none; color: var(--text-3); transition: transform 0.2s var(--ease); }
.phase.is-open .phase__chev { transform: rotate(180deg); }

.phase__body {
  display: none;
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.phase.is-open .phase__body { display: block; }

.week { border-top: 1px solid var(--border); padding: 16px 18px; }
.week:first-child { border-top: 0; }
.week__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.week__n {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); background: var(--info-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 2px 8px; border-radius: 99px;
}
.week__focus { font-weight: 700; font-size: 14.5px; }
.week__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.week__hrs { font-size: 12px; color: var(--text-3); }
.week__lab {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px;
  background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}
.week__lab:hover { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); text-decoration: none; }
.week__lab svg { width: 12px; height: 12px; }

.tasks { list-style: none; margin: 0 0 10px; padding: 0; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.task input[type="checkbox"] {
  appearance: none; flex: none;
  width: 18px; height: 18px; margin: 2px 0 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: var(--bg); cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.task input[type="checkbox"]:hover { border-color: var(--accent); }
.task input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.task input[type="checkbox"]:checked::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid var(--accent-contrast);
  border-bottom: 2px solid var(--accent-contrast);
  transform: rotate(-45deg) translate(1px, -1px);
}
.task label { cursor: pointer; color: var(--text-2); font-size: 13.8px; }
.task input:checked + label { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text-2);
}
a.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--info-bg); }
.chip--accent { background: var(--info-bg); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.chip--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }

/* progress ring */
.ring { display: block; transform: rotate(-90deg); }
.ring__bg { stroke: var(--bg-sunken); }
.ring__fg { stroke: var(--accent-2); stroke-linecap: round; transition: stroke-dasharray 0.4s var(--ease); }

/* ------------------------------------------------------------- certs --- */
.cert {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.cert--featured { border-left-color: var(--accent-2); background: var(--info-bg); }
.cert__n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--bg-sunken); color: var(--text-3); border: 1px solid var(--border);
}
.cert--featured .cert__n { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.cert__body { min-width: 0; flex: 1; }
.cert__name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cert__meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.cert__meta span + span::before { content: "·"; margin: 0 7px; opacity: 0.6; }

/* -------------------------------------------------------- home lab ----- */
.lab-group { margin-bottom: 26px; }
.lab-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.lab-group__step {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent-contrast); background: var(--accent);
  padding: 3px 9px; border-radius: 99px;
}
.lab-group h3 { font-size: 17px; }
.lab-group__intro { color: var(--text-2); font-size: 14px; margin-bottom: 12px; max-width: 78ch; }

.lab-card {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 16px; align-items: start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.lab-card:last-child { border-bottom: 0; }
.lab-card:hover { background: var(--bg-hover); }
.lab-card__name { font-weight: 700; font-size: 13.8px; }
.lab-card__sub { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); word-break: break-all; }
.lab-card__desc { font-size: 13.4px; color: var(--text-2); }
.lab-card__meta { font-size: 11.5px; font-weight: 700; color: var(--accent); text-align: right; white-space: nowrap; }

/* ------------------------------------------------------- resources ----- */
.res-group { margin-bottom: 22px; }
.res-group h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); margin-bottom: 9px;
}
.res {
  display: block; padding: 13px 15px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: var(--shadow);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.res:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.res__name { font-weight: 700; font-size: 13.8px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.res__name svg { width: 13px; height: 13px; color: var(--text-3); flex: none; }
.res:hover .res__name svg { color: var(--accent); }
.res__desc { font-size: 12.8px; color: var(--text-2); margin-top: 3px; }

/* --------------------------------------------------------- lab pages --- */
.doc-shell { max-width: min(900px, 94vw); margin: 0 auto; padding: 30px 28px 96px; }
.doc-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 18px;
}
.doc-back:hover { color: var(--accent); text-decoration: none; }
.doc-back svg { width: 15px; height: 15px; }

.doc-hero {
  border-radius: 16px; padding: 26px 28px; margin-bottom: 26px;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff; box-shadow: var(--shadow-lg);
}
.doc-hero__kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-bright); margin-bottom: 10px; }
.doc-hero h1 { font-size: clamp(24px, 1.8vw, 30px); letter-spacing: -0.02em; margin-bottom: 8px; color: #fff; }
.doc-hero__meta { font-size: 13.5px; color: #c9d4d8; }
.doc-hero__meta span + span::before { content: "·"; margin: 0 8px; opacity: 0.6; }
.doc-hero__nav { display: flex; gap: 10px; margin-top: 18px; }
.doc-hero .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.doc-hero .btn:hover { background: rgba(255, 255, 255, 0.16); }
.doc-hero .btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.doc-refs { margin-bottom: 30px; }
.doc-refs h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 10px; }
.doc-refs .chips { margin-top: 0; }

.task-block { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.task-block:last-child { border-bottom: 0; margin-bottom: 0; }
.task-block h2 { font-size: 18.5px; letter-spacing: -0.01em; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.task-block__n {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 25px; height: 25px; border-radius: 7px;
  font-size: 12px; font-weight: 800;
  background: var(--accent); color: var(--accent-contrast);
}

pre.codeblock {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}
pre.codeblock code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.codeblock__label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); margin: 16px 0 -2px;
}

/* ---------------------------------------------------------- tips ------- */
.tip { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tip:last-child { border-bottom: 0; }
.tip__arrow { flex: none; color: var(--accent); font-weight: 800; }
.tip__text { color: var(--text-2); font-size: 14px; }
.tip__text b { color: var(--text); }

/* --------------------------------------------------------- footer ------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px 46px;
  color: var(--text-3); font-size: 13px;
}
.footer__inner { max-width: var(--maxw); margin: 0; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer a { color: var(--text-2); }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; }

/* --------------------------------------------------------- responsive -- */
@media (max-width: 1000px) {
  .btn--menu { display: inline-flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: var(--header-h) auto 0 0;
    width: 280px; z-index: 90;
    background: var(--bg-elev);
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .scrim {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 80;
    background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none;
    transition: opacity 0.2s var(--ease);
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .main { padding: 22px 18px 80px; }
  .header__progress .mini-bar { display: none; }
  .doc-shell { padding: 22px 18px 80px; }
}

@media (max-width: 700px) {
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 26px; }
  .hero__stats { gap: 20px; }
  .section h2 { font-size: 21px; }
  .lab-card { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .lab-card__meta { text-align: left; }
  .brand__sub { display: none; }
  .doc-hero { padding: 22px 18px; }
  .doc-hero h1 { font-size: 22px; }
}

/* Below this, header icons alone (menu/mark/reset/theme/github) approach the
   viewport width — drop the progress readout and tighten spacing so the
   brand mark and title never get squeezed to zero width. */
@media (max-width: 480px) {
  .header { padding: 0 12px; gap: 6px; }
  .header__progress { display: none; }
  .btn { padding: 6px 10px; }
  .btn--icon { padding: 6px; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__title { font-size: 13.5px; }
  .hero__stats { gap: 14px 22px; }
  .stat__v { font-size: 21px; }
  .hero__cta { gap: 8px; }
  .doc-hero__nav { flex-wrap: wrap; }
}

@media print {
  .header, .sidebar, .scrim, .footer, .phase__chev, .doc-hero__nav { display: none !important; }
  .phase__body { display: block !important; }
  .main, .doc-shell { padding: 0; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
