/* IT Solowils Learn - shared stylesheet
   Original work. Layout patterns studied from public learning-platform UX; no third-party CSS, fonts or assets copied.
   Fonts: Newsreader, Hanken Grotesk, IBM Plex Mono (SIL Open Font License 1.1, self-hosted). */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-opsz.woff2") format("woff2-variations"), url("../fonts/newsreader-latin-opsz.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-wght.woff2") format("woff2-variations"), url("../fonts/hanken-grotesk-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Newsreader", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f8f5f1;
  --surface: #ffffff;
  --surface-2: #f3ede9;
  --surface-3: #e9e2dd;
  --line: #e5deda;
  --line-strong: #cdc5c1;
  --ink: #1b1918;
  --ink-2: #443e3a;
  --ink-3: #6c615c;
  --ink-4: #8a7d76;
  --accent: #157a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2eb;
  --warn-bg: #fff4ea;
  --warn-line: #e8a46b;
  --ok-bg: #eaf8f1;
  --ok-line: #4fae86;
  --err-bg: #fdeeea;
  --err-line: #d9785f;
  --inverse-bg: #1b1918;
  --inverse-ink: #f3ede9;
  --glass: rgba(251, 250, 248, .82);
  --shadow-1: 0 1px 2px rgba(27, 25, 24, .05), 0 4px 12px rgba(27, 25, 24, .05);
  --shadow-2: 0 2px 4px rgba(27, 25, 24, .04), 0 12px 32px rgba(27, 25, 24, .10);

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --col: 43rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #211e1d; --surface: #1b1918; --surface-2: #2b2725; --surface-3: #36312f;
    --line: #3a3532; --line-strong: #58504d; --ink: #ece6e2; --ink-2: #cdc5c1; --ink-3: #b0a6a1; --ink-4: #928782;
    --accent: #52c49c; --accent-ink: #10251e; --accent-soft: #19362c;
    --warn-bg: #3a2414; --warn-line: #b8743f; --ok-bg: #12302a; --ok-line: #3f9b78; --err-bg: #3b1a12; --err-line: #b5604a;
    --inverse-bg: #f3ede9; --inverse-ink: #1b1918; --glass: rgba(27, 25, 24, .82);
    --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 12px 32px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #211e1d; --surface: #1b1918; --surface-2: #2b2725; --surface-3: #36312f;
  --line: #3a3532; --line-strong: #58504d; --ink: #ece6e2; --ink-2: #cdc5c1; --ink-3: #b0a6a1; --ink-4: #928782;
  --accent: #52c49c; --accent-ink: #10251e; --accent-soft: #19362c;
  --warn-bg: #3a2414; --warn-line: #b8743f; --ok-bg: #12302a; --ok-line: #3f9b78; --err-bg: #3b1a12; --err-line: #b5604a;
  --inverse-bg: #f3ede9; --inverse-ink: #1b1918; --glass: rgba(27, 25, 24, .82);
  --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 12px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; }
p { margin: 0 0 1.1em; }
strong { color: var(--ink); font-weight: 600; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .08em .38em; border-radius: 5px; color: var(--ink); }
kbd { font-family: var(--font-mono); font-size: .82em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; background: var(--surface); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line-strong); margin: 2.25rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: .5rem .9rem; border-radius: var(--r-md); font-size: .9375rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; transition: background .15s, border-color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); color: var(--bg); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { filter: brightness(1.06); background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .35rem .65rem; font-size: .8125rem; border-radius: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.topbar .back { color: var(--ink-3); }
.readbar { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.readbar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .1s linear; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand small { font-weight: 500; color: var(--ink-3); }

/* ---------- Layout ---------- */
.page { padding: 28px 20px 140px; }
.column { max-width: var(--col); margin: 0 auto; }
@media (min-width: 1240px) { .page { padding-right: 340px; padding-left: 340px; } .column { margin: 0 auto; } }

/* ---------- Project header ---------- */
.mark-step { stroke: var(--bg); }
.author-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px 10px; font-size: .875rem; color: var(--ink); background: var(--surface); }
.project-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.1rem, 5vw, 2.75rem); line-height: 1.12; letter-spacing: -.015em; margin: 14px 0 6px; font-optical-sizing: auto; }
.project-sub { color: var(--ink-2); margin: 0 0 18px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.progress-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .9375rem; }
.ring { width: 34px; height: 34px; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: var(--surface-3); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .5s var(--ease); }
.header-actions { display: flex; gap: 8px; }
.rule { border: 0; border-top: 1px solid var(--line-strong); margin: 22px 0; }

.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 4px 0 22px; }
@media (max-width: 640px) {
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; }
  .meta { align-items: flex-start; line-height: 1.3; }
  .meta b { display: block; font-size: .6875rem; margin: 1px 0 2px; }
}
.meta { display: flex; align-items: center; gap: 10px; font-size: .9375rem; color: var(--ink-2); min-width: 0; }
.meta .ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.meta .ico svg { width: 16px; height: 16px; }
.meta b { color: var(--ink); text-transform: uppercase; font-weight: 700; font-size: .8125rem; letter-spacing: .02em; margin-right: 4px; }
.label-caps { text-transform: uppercase; font-weight: 700; font-size: .8125rem; letter-spacing: .03em; color: var(--ink); margin: 0 0 10px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 12px; font-size: .8125rem; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--surface); }
.pill svg { width: 12px; height: 12px; }
.pill[aria-disabled="true"] { color: var(--ink-3); border-style: dashed; cursor: default; }
.pill-soft { background: var(--surface-2); border-color: transparent; font-weight: 500; }

/* ---------- Content typography ---------- */
.prose h2.section-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2rem); line-height: 1.2; letter-spacing: -.01em; margin: 2.6rem 0 .9rem; }
.prose h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.005em; margin: 2rem 0 .6rem; }
.prose h4 { font-size: 1.0625rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--ink-4); }
.prose ol > li::marker { font-weight: 600; color: var(--ink-3); }
.lead { font-size: 1.1875rem; color: var(--ink-2); }
.emoji { font-style: normal; margin-right: .3em; }

/* Concept chips + glossary terms */
.concept { display: inline-flex; align-items: center; gap: 5px; border: 0; cursor: pointer; padding: 0 .45em; border-radius: 6px; background: var(--surface-2); color: var(--ink); font: inherit; line-height: 1.5; }
.concept svg { width: 13px; height: 13px; color: var(--ink-3); }
.concept:hover { background: var(--surface-3); }
.term { border-bottom: 1.5px dashed var(--ink-4); cursor: help; color: var(--ink); }
.popover {
  position: absolute; z-index: 60; max-width: min(340px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-size: .9375rem; line-height: 1.55; color: var(--ink-2);
}
.popover h5 { margin: 0 0 4px; font-size: .9375rem; color: var(--ink); }
.popover p { margin: 0; }

/* Figures */
.figure { margin: 1.8rem 0 2rem; }
.figure-frame { background: var(--surface-2); border-radius: var(--r-xl); padding: clamp(16px, 5vw, 44px); }
.figure-frame > * { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.figure figcaption { text-align: center; color: var(--ink-3); font-size: .875rem; margin-top: 12px; }

/* Callouts */
.callout { position: relative; background: var(--surface-2); border-left: 3px solid var(--ink); border-radius: 0 var(--r-lg) var(--r-lg) 0; padding: 18px 22px; margin: 1.6rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); margin: 0 0 6px; font-size: 1rem; }
.callout.tip { border-left-color: var(--accent); }
.callout.warn { background: var(--warn-bg); border-left-color: var(--warn-line); }
.callout.ok { background: var(--ok-bg); border-left-color: var(--ok-line); }
.callout.err { background: var(--err-bg); border-left-color: var(--err-line); }

/* Toggles */
details.toggle { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1.2rem 0; }
details.toggle + details.toggle { margin-top: -1.2rem; border-top: 0; }
details.toggle > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 2px; font-weight: 600; color: var(--ink); }
details.toggle > summary::-webkit-details-marker { display: none; }
details.toggle > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s var(--ease); flex: none; }
details.toggle[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.toggle > .toggle-body { padding: 0 2px 14px; }
details.toggle > .toggle-body > :last-child { margin-bottom: 0; }

/* Code blocks */
.code { margin: 1.1rem 0 1.4rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .8125rem; color: var(--ink-3); font-weight: 500; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 400 .875rem/1.6 var(--font-mono); color: var(--ink); background: transparent; tab-size: 2; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.ph { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 .2em; font-weight: 500; }
.copy-btn[data-state="done"] { color: var(--accent); border-color: var(--accent); }

/* Personalise form */
.personalise { display: grid; gap: 8px; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); margin: 1.4rem 0; }
.personalise label { font-weight: 600; color: var(--ink); }
.personalise .row { display: flex; gap: 8px; flex-wrap: wrap; }
.input { flex: 1 1 220px; min-width: 0; padding: .6rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); color: var(--ink); font: inherit; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint-text { font-size: .875rem; color: var(--ink-3); margin: 0; }
.mb-14 { margin-bottom: 14px; }

/* Segmented control (guidance track) */
.segmented { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); max-width: 100%; overflow-x: auto; }
.segmented button { border: 0; background: transparent; padding: .5rem .95rem; border-radius: 8px; cursor: pointer; font-size: .875rem; color: var(--ink-3); white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.track-note { color: var(--ink-3); font-size: .9375rem; margin-top: 10px; }
[data-track] { display: none; }
body[data-active-track="low"] [data-track~="low"],
body[data-active-track="medium"] [data-track~="medium"],
body[data-active-track="high"] [data-track~="high"] { display: block; }
body[data-active-track="low"] li[data-track~="low"],
body[data-active-track="medium"] li[data-track~="medium"],
body[data-active-track="high"] li[data-track~="high"] { display: list-item; }

/* Steps */
.step { margin-top: 4.5rem; }
.step-label { display: flex; align-items: center; gap: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; margin-bottom: 18px; }
.step-label::before, .step-label::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.step-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 3.8vw, 2.1rem); line-height: 1.18; letter-spacing: -.012em; }
.step-collapse { border: 0; background: none; cursor: pointer; padding: 8px; margin-top: 2px; color: var(--ink-3); border-radius: 8px; }
.step-collapse svg { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.step.is-collapsed .step-collapse svg { transform: rotate(180deg); }
.step-body { margin-top: 14px; }
.step.is-collapsed .step-body { display: none; }
.step-done-badge { display: none; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 99px; margin-top: 8px; }
.step.is-done .step-done-badge { display: inline-flex; }
.objectives { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; margin: 1rem 0 1.4rem; }
.objectives p { margin: 0 0 6px; color: var(--ink); font-weight: 600; }
.objectives ul { margin: 0; }
.instructions > li { margin: .7em 0; }
.instructions > li > ul { margin-top: .4em; }
.ui { font-weight: 600; color: var(--ink); }
.step-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 2rem; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.complete-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Stuck chooser */
.stuck { margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 16px 18px; }
.stuck > p { margin: 0 0 10px; font-weight: 600; color: var(--ink); }
.stuck .choices { display: flex; gap: 8px; flex-wrap: wrap; }
.stuck .answer { display: none; margin-top: 14px; }
.stuck .answer.is-open { display: block; }
.stuck .answer > :last-child { margin-bottom: 0; }

/* Evidence tasks */
.evidence { margin: 1.6rem 0; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: 16px 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.evidence-title { font-weight: 700; color: var(--ink); display: flex; gap: 6px; align-items: center; margin: 0; }
.status { font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); }
.status.done { background: var(--accent-soft); color: var(--accent); }
.status.later { background: var(--warn-bg); color: var(--ink-2); }
.evidence p.prompt { margin: 8px 0 12px; }
.evidence textarea { width: 100%; min-height: 84px; resize: vertical; padding: .6rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); color: var(--ink); font: inherit; font-size: .9375rem; }
.evidence .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.evidence .shot { margin-top: 12px; display: none; }
.evidence .shot.has-img { display: block; }
.evidence .shot img { border-radius: 10px; border: 1px solid var(--line); max-height: 280px; width: auto; }
.file-label { position: relative; overflow: hidden; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Quiz */
.quiz-card { background: var(--inverse-bg); color: var(--inverse-ink); border-radius: 22px; padding: clamp(22px, 5vw, 40px); margin: 1.8rem 0; text-align: center; position: relative; overflow: hidden; }
.quiz-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--inverse-ink) 14%, transparent) 1px, transparent 0); background-size: 18px 18px; opacity: .5; pointer-events: none; }
.quiz-card > * { position: relative; }
.quiz-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; color: inherit; margin: 0 0 8px; }
.quiz-card p { color: color-mix(in srgb, var(--inverse-ink) 82%, transparent); max-width: 30rem; margin: 0 auto 18px; }
.quiz-card .btn { background: var(--inverse-ink); color: var(--inverse-bg); border-color: var(--inverse-ink); }
.quiz-body { text-align: left; max-width: 34rem; margin: 0 auto; }
.quiz-q { font-weight: 600; font-size: 1.0625rem; color: inherit; margin: 6px 0 14px; }
.quiz-meta { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.quiz-options { display: grid; gap: 8px; }
.quiz-options button { text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--inverse-ink) 28%, transparent); background: color-mix(in srgb, var(--inverse-ink) 6%, transparent); color: inherit; }
.quiz-options button:hover:not(:disabled) { background: color-mix(in srgb, var(--inverse-ink) 12%, transparent); }
.quiz-options button.correct { border-color: #52c49c; background: rgba(82, 196, 156, .18); }
.quiz-options button.wrong { border-color: #e0856d; background: rgba(224, 133, 109, .16); }
.quiz-options button:disabled { cursor: default; }
.quiz-explain { margin-top: 12px; font-size: .9375rem; opacity: .92; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }

/* TOC rail */
.toc { position: fixed; top: 92px; right: 24px; width: 300px; max-height: calc(100vh - 200px); overflow: auto; display: none; padding: 6px; }
@media (min-width: 1240px) { .toc { display: block; } }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; color: var(--ink-3); text-decoration: none; font-size: .875rem; line-height: 1.35; }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.toc a.is-active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.toc .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chk { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.is-done .chk { background: var(--accent); border-color: var(--accent); }
.is-done .chk::after { content: ""; width: 7px; height: 4px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); }

/* Dock */
.dock { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 99px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow-2); max-width: calc(100vw - 24px); }
.dock .dock-logo { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); flex: none; }
.dock .dock-logo svg { width: 24px; height: 24px; }
.dock button.dock-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--ink); padding: 9px 14px; border-radius: 99px; cursor: pointer; font-size: .9375rem; white-space: nowrap; }
.dock button.dock-btn:hover { background: var(--surface-2); }
.dock button.dock-btn svg { width: 17px; height: 17px; flex: none; }
.dock .dock-status { font-size: .8125rem; color: var(--ink-3); padding: 0 12px 0 4px; white-space: nowrap; }
@media (max-width: 420px) { .dock .dock-status { display: none; } }

/* Sheet (mobile steps + record) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 13, 12, .38); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 80; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-2); transform: translateX(102%); transition: transform .32s var(--ease); display: flex; flex-direction: column; }
.sheet.is-open { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.sheet-body { padding: 18px; overflow: auto; flex: 1; }
.sheet .toc-list a { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); }
.sheet .toc-list a:hover { background: var(--surface-2); }
.sheet ol { list-style: none; padding: 0; margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 1.375rem; color: var(--ink); font-weight: 600; line-height: 1.2; }
.stat span { font-size: .8125rem; color: var(--ink-3); }
.todo-list { list-style: none; padding: 0; margin: 0 0 18px; }
.todo-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.todo-list li a { color: var(--ink); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--inverse-bg); color: var(--inverse-ink); padding: 10px 16px; border-radius: 12px; font-size: .9375rem; opacity: 0; transition: opacity .2s, transform .3s var(--ease); z-index: 90; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Finale */
.finale { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(24px, 6vw, 48px); margin-top: 2rem; }
.finale h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; margin: 0 0 8px; }
.finale ul { text-align: left; display: inline-block; margin: 8px auto 18px; }
.finale .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.site-footer { max-width: var(--col); margin: 4rem auto 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .8125rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-3); }

/* ---------- Home ---------- */
body.home { --wrap: 1180px; }
.home main, .home .chips { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.site-footer.hub-footer { max-width: var(--wrap); padding-left: 20px; padding-right: 20px; }
.card-progress { display: block; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.card-progress span { display: block; height: 100%; background: var(--accent); width: 0; }

/* Floating header card */
.navcard { position: sticky; top: 12px; z-index: 40; max-width: calc(var(--wrap) - 40px); margin: 14px auto 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 12px 10px 16px; border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
@media (max-width: 1220px) { .navcard { margin-left: 20px; margin-right: 20px; } }
.wordmark { font-size: 1.25rem; font-weight: 600; letter-spacing: -.03em; color: var(--ink); }
.wordmark em { font-style: normal; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.search { position: relative; justify-self: center; width: min(100%, 420px); }
.search > svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; padding: .55rem .9rem .55rem 2.4rem; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .9375rem; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-2); z-index: 5; }
.search-results a { display: block; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); }
.search-results a span { display: block; font-size: .8125rem; color: var(--ink-3); }
.search-results .sr-empty { padding: 10px 12px; font-size: .9375rem; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .btn { white-space: nowrap; }
.sm-only { display: none; }
@media (max-width: 480px) { .nav-actions .lg { display: none; } .nav-actions .sm-only { display: inline; } }
.nav-guide { border-radius: 99px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
@media (max-width: 860px) {
  .navcard { grid-template-columns: 1fr auto; padding: 14px; gap: 12px; top: 8px; border-radius: 22px; }
  .navcard .brand { grid-column: 1; grid-row: 1; }
  .nav-actions { grid-column: 2; grid-row: 1; }
  .search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .navcard > .nav-guide-mobile { grid-column: 1 / -1; grid-row: 3; width: 100%; justify-content: center; padding: .7rem; border-radius: 99px; }
}
.navcard > .nav-guide-mobile { display: none; }
@media (max-width: 860px) { .nav-actions .nav-guide { display: none; } .navcard > .nav-guide-mobile { display: flex; } }

/* Chips */
.chips { display: flex; gap: 8px; padding-top: 16px; padding-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.chips button:hover { background: var(--surface-2); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 26px; min-height: 460px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px); gap: 28px; align-items: end; padding: 32px; isolation: isolate; box-shadow: var(--shadow-1); }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 30, 24, .14) 0%, rgba(20, 30, 24, .22) 45%, rgba(20, 30, 24, .55) 100%); }
.hero-main { color: #fff; min-width: 0; }
.eyebrow-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .82); color: #3b3633; font-size: .6875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-pill i, .feed-head i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.hero h1 { font-family: var(--font-body); font-weight: 600; font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: .98; letter-spacing: -.045em; color: #fff; margin: 18px 0 20px; text-wrap: balance; text-shadow: 0 2px 28px rgba(0, 0, 0, .28); }
.hero h1 a { color: inherit; text-decoration: none; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.sm { width: 32px; height: 32px; box-shadow: 0 0 0 1px var(--line-strong); }
.who { display: flex; flex-direction: column; line-height: 1.25; margin-right: 8px; }
.who b { color: #fff; font-weight: 600; }
.who small { color: rgba(255, 255, 255, .78); font-size: .8125rem; }
.pill-glass { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .55); color: #fff; font-size: .875rem; background: rgba(255, 255, 255, .08); }
.pill-glass svg { width: 14px; height: 14px; }
.hero-cta { margin-top: 22px; background: #fff; color: #1b1918; border-color: #fff; border-radius: 99px; padding: .65rem 1.1rem; }
.hero-cta:hover { background: #f3ede9; color: #1b1918; }
.feed { align-self: stretch; display: flex; flex-direction: column; border-radius: 18px; padding: 16px 18px; background: rgba(30, 36, 32, .42); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .18); color: #fff; max-height: 400px; }
.feed-head { display: flex; justify-content: space-between; align-items: center; font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .85); margin-bottom: 10px; }
.feed-head span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.feed-head i { background: #52c49c; box-shadow: 0 0 0 3px rgba(82, 196, 156, .25); }
.feed-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.feed-list li { display: grid; grid-template-columns: 44px 24px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); font-size: .875rem; line-height: 1.35; }
.feed-list li:last-child { border-bottom: 0; }
.feed-list time { color: rgba(255, 255, 255, .6); font-size: .75rem; padding-top: 1px; }
.flag { font-size: 1rem; line-height: 1.2; }
.flag.none { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); margin-top: 1px; }
.fi b { color: #fff; font-weight: 600; }
.fi em { font-style: normal; color: rgba(255, 255, 255, .65); }
.fi a { display: block; color: #fff; text-decoration: none; }
.fi a:hover { text-decoration: underline; }
.feed-list li.feed-empty { display: block; color: rgba(255, 255, 255, .85); border: 0; padding: 8px 0; }
.feed-empty b { color: #fff; display: block; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 24px 20px; min-height: 0; align-items: start; }
  .hero::after { background: linear-gradient(180deg, rgba(20, 30, 24, .32) 0%, rgba(20, 30, 24, .42) 50%, rgba(20, 30, 24, .62) 100%); }
  .hero-main { padding-top: 8px; }
  .feed { max-height: none; }
}

/* Ask band */
.ask { margin: 22px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px 32px; align-items: center; padding: 24px 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.ask h2 { font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 6px; }
.ask p { margin: 0; color: var(--ink-3); }
.ask-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px; }
.ask-form #ask-contact { grid-column: 1 / 3; }
.ask-form select.input { appearance: auto; }
.ask-msg { grid-column: 1 / -1; min-height: 1.2em; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 860px) { .ask { grid-template-columns: 1fr; padding: 20px; } .ask-form { grid-template-columns: 1fr; } .ask-form #ask-contact { grid-column: auto; } }

/* Shelves */
.shelf { margin-top: 44px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-head h2 { font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 1.75rem); letter-spacing: -.025em; color: var(--ink-2); }
.shelf-head h2 small { font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin-left: 8px; vertical-align: middle; }
.shelf-toggle { border: 0; background: none; cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.shelf-toggle:hover { color: var(--accent); }
.shelf-blurb { color: var(--ink-3); margin: 4px 0 16px; max-width: 46rem; font-size: .9375rem; }
.pc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.shelf:not(.is-open):not(.is-filtered) .pc-grid > .pc:nth-child(n+4) { display: none; }
@media (max-width: 960px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shelf:not(.is-open):not(.is-filtered) .pc-grid > .pc:nth-child(n+3) { display: none; } }
@media (max-width: 620px) {
  .pc-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 -20px; padding: 2px 20px 12px; scrollbar-width: none; }
  .pc-grid::-webkit-scrollbar { display: none; }
  .pc-grid > .pc { flex: 0 0 84%; scroll-snap-align: start; }
  .shelf:not(.is-open):not(.is-filtered) .pc-grid > .pc:nth-child(n+3) { display: flex; }
  .shelf-toggle { display: none; }
}
.pc[hidden] { display: none !important; }

/* Project card */
.pc { position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; text-decoration: none; color: inherit; background: var(--pc-tint, var(--surface)); box-shadow: 0 0 0 1px rgba(26, 26, 26, .07), 0 12px 24px -12px rgba(58, 44, 36, .18); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
a.pc:hover { transform: translateY(-4px); color: inherit; box-shadow: 0 0 0 1px rgba(26, 26, 26, .16), 0 22px 34px -10px rgba(58, 44, 36, .36), 0 4px 10px rgba(58, 44, 36, .12); }
.pc-sage { --pc-tint: #eef1ec; } .pc-dusk { --pc-tint: #f0ebf0; } .pc-sand { --pc-tint: #f6f0e6; } .pc-slate { --pc-tint: #eceff1; }
:root[data-theme="dark"] .pc { --pc-tint: #292624; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pc { --pc-tint: #292624; } }
.pc-art { position: relative; aspect-ratio: 420 / 250; margin: 6px 6px 0; border-radius: 17px; overflow: hidden; }
.pc-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pc-screen { position: absolute; left: 11%; right: 11%; top: 14%; bottom: 10%; border-radius: 10px; overflow: hidden; background: #faf8f6; box-shadow: 0 0 0 4px rgba(27, 25, 24, .88), 0 14px 28px rgba(27, 25, 24, .25); }
.pc-screen svg { width: 100%; height: 100%; display: block; }
.pc-level { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .92); color: #1b1918; font-size: .75rem; font-weight: 500; padding: 3px 10px; border-radius: 99px; }
.pc-time { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 5px; background: rgba(27, 25, 24, .82); color: #fff; font-size: .75rem; padding: 3px 10px; border-radius: 99px; }
.pc-time svg { width: 12px; height: 12px; }
.pc-track { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .45); overflow: hidden; display: none; }
.pc-track span { display: block; height: 100%; background: #52c49c; }
.pc-body { display: flex; gap: 12px; padding: 14px 16px 18px; align-items: flex-start; }
.pc-text { min-width: 0; }
.pc h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0 0 3px; letter-spacing: -.01em; }
.pc p { margin: 0; font-size: .8125rem; color: var(--ink-3); line-height: 1.45; }
.pc .pc-stat { color: var(--ink-4); }
.pc.is-soon .pc-art { filter: saturate(.55); }
.pc.is-soon .pc-screen { opacity: .8; }
.pc.is-soon h3 { color: var(--ink-2); }
.no-results { text-align: center; padding: 40px 0; color: var(--ink-3); }
.linklike { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

/* Dialogs */
.dlg { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 22px; padding: 26px; background: var(--bg); color: var(--ink-2); box-shadow: var(--shadow-2); }
.dlg::backdrop { background: rgba(15, 13, 12, .45); }
.dlg h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; line-height: 1.2; margin: 4px 0 14px; padding-right: 40px; }
.dlg-close { position: absolute; right: 14px; top: 14px; margin: 0; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 480px) { .opt-grid { grid-template-columns: 1fr; } }
.opt { text-align: left; cursor: pointer; padding: 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.opt:hover { border-color: var(--ink); }
.opt b { display: block; font-weight: 600; }
.opt span { font-size: .8125rem; color: var(--ink-3); }
.prog-row { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.prog-row small { color: var(--ink-3); }

/* Feed opt-in on project pages */
.feed-optin { margin-top: 1.6rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px; }
.feed-optin h4 { margin: 0 0 4px; }
.feed-optin .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.feed-optin select.input { flex: 0 1 220px; appearance: auto; }
.feed-optin label.consent { display: flex; gap: 8px; align-items: flex-start; font-size: .875rem; color: var(--ink-3); margin-bottom: 10px; }

/* ---------- Print: completion record ---------- */
#record-print { display: none; }
@media print {
  body.print-record > *:not(#record-print) { display: none !important; }
  body.print-record #record-print { display: block !important; color: #111; font: 11pt/1.5 var(--font-body); }
  #record-print h1 { font-family: var(--font-display); font-weight: 500; font-size: 22pt; margin: 0 0 4pt; color: #111; }
  #record-print h2 { font-size: 13pt; margin: 16pt 0 6pt; color: #111; }
  #record-print .rec-meta { color: #444; margin-bottom: 10pt; }
  #record-print table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  #record-print td, #record-print th { border: 1px solid #bbb; padding: 4pt 6pt; text-align: left; vertical-align: top; }
  #record-print img { max-width: 100%; max-height: 9cm; border: 1px solid #ccc; margin-top: 4pt; }
  #record-print .rec-task { break-inside: avoid; margin-bottom: 10pt; }
  @page { margin: 16mm; }
}
