/* ============ GREEN THEME ============ */
:root {
  --bg: #dde8da;
  --bg-2: #cfe0cb;
  --card: #f7fbf6;
  --text: #13271a;
  --muted: #3f5a47;
  --accent: #186b32;
  --accent-2: #257a41;
  --lime: #b8e84f;
  --gold: #e7b92b;
  --border: #b7cfb3;
  --done: #186b32;
  --head-a: #0f4a26;
  --head-b: #2b9a4c;
  --shadow: 0 8px 22px rgba(16, 60, 30, .10);
  --fig-l: #d6f2dc;
  --fig-m: #8fd6a6;
  --fig-d: #4aa96e;
}

:root[data-theme="dark"] {
  --bg: #0b1810;
  --bg-2: #10231700;
  --card: #132b1d;
  --text: #e8f6ec;
  --muted: #a3c7ad;
  --accent: #5ed687;
  --accent-2: #3fbf6d;
  --lime: #c8f263;
  --gold: #f2c94c;
  --border: #25463099;
  --done: #7be39b;
  --head-a: #06240f;
  --head-b: #1e7a3f;
  --shadow: 0 8px 22px rgba(0, 0, 0, .4);
  --fig-l: #2d5e3f;
  --fig-m: #3f8a5b;
  --fig-d: #256b42;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1810;
    --bg-2: #10231700;
    --card: #132b1d;
    --text: #e8f6ec;
    --muted: #a3c7ad;
    --accent: #5ed687;
    --accent-2: #3fbf6d;
    --lime: #c8f263;
    --gold: #f2c94c;
    --border: #25463099;
    --done: #7be39b;
    --head-a: #06240f;
    --head-b: #1e7a3f;
    --shadow: 0 8px 22px rgba(0, 0, 0, .4);
    --fig-l: #2d5e3f;
    --fig-m: #3f8a5b;
    --fig-d: #256b42;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, var(--bg-2) 0, transparent 40%),
                    radial-gradient(circle at 100% 100%, var(--bg-2) 0, transparent 35%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--accent); font-weight: 600; }
a:hover { color: var(--accent-2); }
a:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* ============ HEADER ============ */
header.site {
  background: linear-gradient(110deg, var(--head-a), var(--head-b));
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 5px solid var(--lime);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
header.site a.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .02em;
}
header.site a.brand::before {
  content: "◆ ";
  color: var(--lime);
}

#theme-toggle {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 2px solid var(--lime);
  border-radius: 999px;
  padding: 6px 16px;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
#theme-toggle:hover { background: var(--lime); color: #0f3b1e; }
#theme-toggle:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* ============ LAYOUT ============ */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

h1 { font-size: 2.05rem; margin: .4em 0 .2em; line-height: 1.18; }
h2 {
  font-size: 1.35rem;
  margin-top: 2em;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--lime), var(--accent-2));
  flex: 0 0 auto;
}

.meta { color: var(--muted); font-size: .95rem; margin-bottom: 1.2em; }

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--head-a), var(--head-b));
  color: #fff;
  border-radius: 22px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) {
  .hero { grid-template-columns: 1.3fr 1fr; align-items: center; }
}
.hero h1 { color: #fff; margin: 0 0 .3em; }
.hero p { margin: 0; opacity: .95; }
.hero .art { width: 100%; max-width: 260px; justify-self: center; }
.hero .tag {
  display: inline-block;
  background: var(--lime);
  color: #0f3b1e;
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

/* ============ CARDS ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.card.goal { border-left: 8px solid var(--accent); }
.card.tip { border-left: 8px solid var(--lime); }
.card.done-check { border-left: 8px solid var(--accent-2); background: linear-gradient(0deg, var(--card), var(--card)); }
.card strong:first-child { color: var(--accent); }

/* ============ STEPS (numbered circles) ============ */
ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 2px 46px;
  margin-bottom: 1.05em;
  min-height: 34px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
}

kbd {
  font-family: ui-monospace, Menlo, monospace;
  font-size: .86em;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--accent-2);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--text);
}

code {
  font-family: ui-monospace, Menlo, monospace;
  background: rgba(54, 168, 90, .16);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .92em;
}

/* ============ REMINDER CHIPS ============ */
.chip {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: 2px;
  background: var(--accent);
  color: #fff;
}
.chip-mouse { background: var(--lime); color: #0f3b1e; }
.chip-menu  { background: #0f4a26; color: #bff0cf; }
.chip-tool  { background: var(--accent-2); color: #fff; }
.chip-check { background: var(--gold); color: #3a2a00; }

.verify {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px dashed var(--muted);
  border-radius: 6px;
  padding: 0 6px;
  white-space: normal;
}

/* ============ FIGURES ============ */
figure.fig {
  margin: 20px 0;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
figure.fig .fig-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
figure.fig svg { width: 100%; height: auto; display: block; }
figure.fig figcaption {
  font-size: .94rem;
  color: var(--muted);
  margin-top: 12px;
}
figure.fig figcaption strong { color: var(--text); }

.f-panel   { fill: var(--bg-2); stroke: var(--border); stroke-width: 2; }
.f-bg      { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.f-text    { fill: var(--text); font-family: system-ui, sans-serif; }
.f-muted   { fill: var(--muted); font-family: system-ui, sans-serif; }
.f-accent  { fill: var(--accent); }
.f-lime    { fill: var(--lime); }
.f-gold    { fill: var(--gold); }
.f-done    { fill: var(--done); }
.f-x       { fill: #c8414a; }
.f-y       { fill: #2e8b3e; }
.f-z       { fill: #2f6fd0; }
.f-face-l  { fill: var(--fig-l); }
.f-face-m  { fill: var(--fig-m); }
.f-face-d  { fill: var(--fig-d); }
.f-stroke-m{ fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.f-body    { fill: var(--card); stroke: var(--muted); stroke-width: 3; }
.f-line    { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.f-num     { fill: #fff; font-weight: 800; font-family: system-ui, sans-serif; }
.f-num-bg  { fill: var(--accent); }

/* ============ CHECKBOXES ============ */
.checkpoint label {
  display: block;
  position: relative;
  padding-left: 34px;
  margin: 10px 0;
  line-height: 1.5;
  cursor: pointer;
}
.checkpoint input { position: absolute; left: 0; top: 4px; margin: 0; width: 18px; height: 18px; accent-color: var(--accent); }

/* ============ NAV ============ */
.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.nav-row a {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.nav-row a:hover { background: var(--accent-2); color: #fff; }
.nav-row a.back { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }

/* ============ LESSON INDEX ============ */
.lesson-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
}
@media (min-width: 620px) {
  .lesson-grid { grid-template-columns: 1fr 1fr; }
}
.lesson-grid li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 14px 74px;
  box-shadow: var(--shadow);
}
.lesson-grid .num {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lime), var(--accent-2));
  color: #0f3b1e;
  font-weight: 900;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
}
.lesson-grid a { color: var(--accent); font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.lesson-grid p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.unverified { font-size: .9rem; color: var(--muted); font-style: italic; }

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .hero { padding: 22px 18px; }
}

/* ============ REAL MANUAL SCREENSHOTS ============ */
figure.fig img { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 0 auto; background: #2a2d31; }
figure.fig .pair { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { figure.fig .pair { grid-template-columns: 1fr 1fr; } }
figure.fig .cap { font-size: .92rem; color: var(--muted); margin: 8px 0 0; }
p.attrib { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }

/* ============ SCREENSHOT WITH CALLOUTS ============ */
figure.fig .shot { position: relative; }
figure.fig .shot img { display: block; width: 100%; height: auto; border-radius: 10px; }
figure.fig .shot svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ============ WIDE FIGURE (screenshots that need room) ============ */
figure.fig.wide {
  width: min(1100px, 94vw);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
figure.fig .shot img { cursor: zoom-in; }

/* ============ LESSON LAYOUT: objectives panel ============ */
.layout { max-width: 800px; margin: 0 auto; }
.layout > main { max-width: none; margin: 0; padding: 8px 20px 64px; }
.objectives { padding: 16px 20px 0; }
.obj-label {
  font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 4px;
}
.objectives .card { margin: 12px 0; }

@media (min-width: 1180px) {
  .layout {
    max-width: 1220px;
    display: grid;
    grid-template-columns: 300px minmax(0, 800px);
    gap: 36px;
    justify-content: center;
    align-items: start;
    padding: 0 20px;
  }
  .objectives {
    position: sticky;
    top: 20px;
    padding: 24px 0 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  .layout > main { padding: 24px 0 64px; }
}

/* Phone-width guard: keep the objectives card inside the screen */
.layout, .layout > main, .objectives { min-width: 0; box-sizing: border-box; }
.layout { width: 100%; }
.objectives { overflow-wrap: anywhere; }

/* ============ UNIT PAGES: progress counts ============ */
.lesson-grid .prog { margin: 4px 0 0; font-size: .85rem; font-weight: 700; color: var(--muted); }
.lesson-grid .prog.is-complete { color: var(--accent); }
.unit-progress { font-weight: 700; color: var(--accent); }
