/* Closed Complete — site styles */
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --ink: #0F1720;
  --ink-2: #2A3642;
  --muted: #4B5866;
  --line: #E3E6E9;
  --bg: #F6F7F8;
  --card: #FFFFFF;
  --green: #1F9D61;
  --green-dark: #167A4A;
  --green-soft: #E6F5EE;
  --red: #C2362B;
  --red-soft: #FBEAE8;
  --amber-soft: #FFF6E0;
  --radius: 12px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 17px; }
a { color: var(--green-dark); }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
code { background: #EEF0F2; padding: 1px 6px; border-radius: 5px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* Header + footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.site-header img { height: 30px; width: auto; display: block; }
.site-header nav { display: flex; gap: 20px; font-size: 15px; }
.site-header nav a { color: var(--ink-2); text-decoration: none; }
.site-header nav a:hover { color: var(--green-dark); }
.site-footer { margin-top: 80px; padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0 0 .4em; }

/* Bits */
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink-2); color: #fff; }
.btn.green { background: var(--green-dark); }
.btn.green:hover { background: #0F5E38; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }

/* Home */
.hero { padding: 72px 0 56px; }
.hero p.lead { font-size: 20px; color: var(--ink-2); max-width: 640px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps .card h3 { display: flex; align-items: center; gap: 10px; }
.steps .num { font-family: var(--mono); font-size: 13px; color: var(--green-dark); }
.domains { display: flex; flex-direction: column; gap: 10px; }
.domain { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.domain .weight { font-family: var(--display); font-weight: 700; font-size: 22px; }
.domain .bar { height: 6px; background: #EEF0F2; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.domain .bar span { display: block; height: 100%; background: var(--green); }
.domain .meta { font-size: 14px; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 6px; background: #EEF0F2; color: var(--ink-2); white-space: nowrap; }
.tag.free { background: var(--green-soft); color: var(--green-dark); }
section.block { padding: 40px 0; }

/* Lesson */
.crumbs { font-size: 14px; color: var(--muted); margin: 28px 0 8px; }
.crumbs a { color: var(--muted); }
.stepper { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.stepper ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 12px 0; }
.stepper a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.stepper a .dot { width: 8px; height: 8px; border-radius: 50%; background: #C5CBD1; }
.stepper a.done .dot { background: var(--green); }
.lesson-section { padding: 48px 0 16px; scroll-margin-top: 64px; }
.learn p, .learn li { max-width: 68ch; }
.learn ul { padding-left: 22px; }
.learn li { margin-bottom: .4em; }
.callout { border-radius: 10px; padding: 14px 18px; margin: 20px 0; background: var(--amber-soft); border: 1px solid #F1DFAE; max-width: 68ch; }
.callout strong { display: block; margin-bottom: 2px; }
.shortcuts { border-collapse: collapse; margin: 12px 0 20px; font-size: 15px; background: var(--card); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.shortcuts th, .shortcuts td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.shortcuts th { background: #F1F3F5; font-weight: 600; }
.shortcuts tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.next { margin-top: 24px; }

/* Simulator */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.sim { border: 1px solid #C9CFD5; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(15,23,32,.06); min-height: 460px; display: flex; flex-direction: column; }
.sim-bar { background: #1B2733; color: #fff; display: flex; align-items: center; gap: 4px; padding: 6px 10px; position: relative; flex-wrap: wrap; }
.sim-brand { font-family: var(--mono); font-size: 13px; color: #9FB0BF; margin-right: 10px; padding: 0 6px; }
.sim-menu-btn { background: transparent; color: #fff; border: 0; font: 600 14px var(--sans); padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.sim-menu-btn:hover, .sim-menu-btn[aria-expanded="true"] { background: #2E3D4B; }
.sim-spacer { flex-grow: 1; }
.sim-user { width: 30px; height: 30px; border-radius: 50%; background: #3E8E6A; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.sim-panel { position: absolute; top: 100%; left: 10px; width: min(340px, calc(100% - 20px)); background: #fff; color: var(--ink); border: 1px solid #C9CFD5; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,32,.18); z-index: 4; max-height: 400px; display: flex; flex-direction: column; }
.sim-panel[hidden] { display: none; }
.sim-filter { padding: 10px; border-bottom: 1px solid var(--line); }
.sim-filter input { width: 100%; font: 15px var(--sans); padding: 9px 12px; border: 1.5px solid #B8C0C8; border-radius: 8px; }
.sim-filter input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.sim-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sim-tree { overflow-y: auto; padding: 6px 0; }
.sim-app { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px 4px; }
.sim-mod { display: flex; align-items: center; }
.sim-mod button.open { flex-grow: 1; text-align: left; background: none; border: 0; font: 15px var(--sans); color: var(--ink); padding: 8px 14px 8px 24px; cursor: pointer; min-height: 38px; }
.sim-mod button.open:hover { background: #F1F3F5; }
.sim-mod button.star { background: none; border: 0; cursor: pointer; padding: 6px 12px; color: #8A96A3; min-height: 38px; }
.sim-mod button.star:hover { color: var(--ink); }
.sim-mod button.star[aria-pressed="true"] { color: #D99A00; }
.sim-empty { padding: 14px; font-size: 14px; color: var(--muted); }
.sim-main { padding: 22px; flex-grow: 1; }
.sim-main h4 { font-family: var(--display); font-size: 20px; margin: 0 0 12px; }
.sim-note { font-size: 13px; background: var(--amber-soft); border: 1px solid #F1DFAE; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.sim-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.sim-list th, .sim-list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sim-list th { color: var(--muted); font-weight: 600; font-size: 13px; }
.sim-home p { color: var(--muted); }
.tasks { position: sticky; top: 72px; }
.tasks h3 { font-size: 18px; }
.tasks ol { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.tasks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.45; }
.tasks .box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B8C0C8; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.tasks li.done .box { background: var(--green); border-color: var(--green); }
.tasks li.done .box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.tasks li.done span.text { color: var(--muted); text-decoration: line-through; }
.tasks .feedback { font-size: 14px; color: var(--ink-2); margin: 0 0 16px; }
.tasks .feedback:empty { display: none; }
.complete { display: none; }
.complete.show { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 4px; }
.complete p { margin: 0; }
.complete .btn { width: 100%; }
.tasks-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.reset-link { background: none; border: 0; padding: 6px 0; min-height: 36px; font: 500 14px var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reset-link:hover { color: var(--ink); }

/* Quiz */
.q { margin-bottom: 20px; }
.q fieldset { border: 0; margin: 0; padding: 0; }
.q legend { font-weight: 600; font-size: 18px; margin-bottom: 4px; padding: 0; }
.q .qmeta { font-size: 13px; color: var(--muted); font-family: var(--mono); margin-bottom: 10px; }
.q label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.q label:hover { border-color: #B8C0C8; }
.q input { margin-top: 5px; accent-color: var(--green); width: 16px; height: 16px; }
.q label.right { border-color: var(--green); background: var(--green-soft); }
.q label.wrong { border-color: var(--red); background: var(--red-soft); }
.q .explain { display: none; border-radius: 10px; padding: 12px 16px; margin-top: 6px; font-size: 15px; }
.q .explain.show { display: block; }
.q .explain.ok { background: var(--green-soft); }
.q .explain.no { background: var(--red-soft); }
.score { font-family: var(--display); font-size: 22px; }

@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .tasks { position: static; order: -1; }
  .site-header nav { display: none; }
  .domain { grid-template-columns: 48px minmax(0, 1fr); }
  .domain .tag { grid-column: 2; justify-self: start; }
}

/* Lesson 2: instance console */
.inst-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; align-items: start; }
.inst { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #FAFBFC; display: flex; flex-direction: column; gap: 10px; }
.inst.marked { border-color: var(--green); background: var(--green-soft); }
.inst-host { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.inst-btn { align-self: flex-start; background: #fff; border: 1.5px solid #B8C0C8; border-radius: 8px; padding: 7px 12px; min-height: 38px; font: 600 14px var(--sans); color: var(--ink); cursor: pointer; }
.inst-btn:hover { border-color: var(--ink); }
.inst-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 14px; }
.inst-dl dt { color: var(--muted); }
.inst-dl dd { margin: 0; font-weight: 600; }
.inst-note { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.sim-block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.sim-block h5 { font-family: var(--display); font-size: 17px; margin: 0 0 4px; }
.sim-sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.path-slots { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot { display: flex; align-items: center; gap: 10px; border: 1.5px dashed #B8C0C8; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--muted); min-height: 48px; }
.slot.filled { border-style: solid; border-color: var(--ink); color: var(--ink); background: #fff; }
.slot-n { font-family: var(--mono); font-size: 12px; width: 22px; height: 22px; border-radius: 50%; background: #EEF0F2; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.path-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip { background: #fff; border: 1.5px solid #B8C0C8; border-radius: 999px; padding: 8px 14px; min-height: 40px; font: 500 14px var(--sans); cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.clone-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.clone-form .btn { grid-column: 1 / -1; justify-self: start; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field select { width: 100%; font: 15px var(--sans); padding: 9px 10px; border: 1.5px solid #B8C0C8; border-radius: 8px; background: #fff; min-height: 42px; }
.clone-msg { font-size: 14px; margin: 12px 0 0; }
.clone-msg:empty { display: none; }
.clone-msg.ok { background: var(--green-soft); border-radius: 8px; padding: 10px 12px; }
.clone-msg.no { background: var(--red-soft); border-radius: 8px; padding: 10px 12px; }
@media (max-width: 860px) {
  .inst-grid, .path-slots, .clone-form { grid-template-columns: minmax(0, 1fr); }
}
