/* Connelly Labs shared stylesheet.
   Layout: one calm reading column (about 68 characters wide), a slim sticky
   progress bar on lab pages, and every task as its own numbered section.
   Light theme = soft paper. Dark theme = soft charcoal. The site follows the
   student's system setting automatically. No external fonts or libraries. */

:root {
  --bg: #f3f2ed;          /* page: soft paper, never pure white */
  --surface: #fbfaf6;     /* raised panels */
  --ink: #26292d;         /* body text: charcoal, never pure black */
  --muted: #5c6168;       /* secondary text */
  --rule: #d9d6cc;        /* borders and dividers */
  --accent: #1d5c68;      /* deep slate teal: links, buttons, quick checks */
  --accent-ink: #ffffff;
  --accent-soft: #e1ecec;
  --ok: #2b6a3d;
  --ok-soft: #e2efe3;
  --wrong: #9a3a2c;
  --wrong-soft: #f6e5e0;
  --capture: #7a5100;     /* screenshot and photo steps */
  --capture-soft: #f5ead2;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 68ch;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1e21; --surface: #23272b; --ink: #e2e0da; --muted: #a2a6ab; --rule: #363b40;
    --accent: #84bcc6; --accent-ink: #13282c; --accent-soft: #233437;
    --ok: #8fc79c; --ok-soft: #22322a; --wrong: #e59a8c; --wrong-soft: #3a2723;
    --capture: #e0b55e; --capture-soft: #332c1e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1e21; --surface: #23272b; --ink: #e2e0da; --muted: #a2a6ab; --rule: #363b40;
  --accent: #84bcc6; --accent-ink: #13282c; --accent-soft: #233437;
  --ok: #8fc79c; --ok-soft: #22322a; --wrong: #e59a8c; --wrong-soft: #3a2723;
  --capture: #e0b55e; --capture-soft: #332c1e;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;      /* 18px */
  line-height: 1.65;
}
.wrap {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 auto;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.9em; }
kbd {
  border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px;
  padding: 0.05em 0.35em; background: var(--surface);
}
.flow > * + * { margin-top: 1rem; }
.flow ul, .flow ol { padding-left: 1.4rem; }
.flow li + li { margin-top: 0.35rem; }

/* Mono label: used for every eyebrow and callout tag, so students learn one pattern. */
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Site header and footer ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.5rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; color: var(--ink); text-decoration: none;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.site-header nav a { font-size: 0.95rem; }

.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; }
.site-footer .wrap {
  padding-block: 1.5rem 2.5rem;
  display: grid; gap: 0.4rem;
  font-size: 0.9rem; color: var(--muted);
}

/* ---------- Home page ---------- */
.intro { padding-block: 3rem 2rem; }
.intro .wrap > * + * { margin-top: 1rem; }
.intro p { max-width: var(--measure); color: var(--muted); font-size: 1.15rem; }

.how {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-top: 2rem;
  padding: 0; list-style: none;
}
.how li { border-top: 2px solid var(--ink); padding-top: 0.75rem; }
.how li .label { color: var(--ink); }
.how li p { margin-top: 0.35rem; color: var(--muted); font-size: 1rem; }

.course { margin-top: 3rem; }
.course > h2 { margin-bottom: 0.25rem; }
.course > p { color: var(--muted); }
.lab-list { list-style: none; padding: 0; margin-top: 1rem; border-top: 1px solid var(--rule); }
.lab-row {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 1rem;
  align-items: baseline;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}
.lab-row .num { font-family: var(--font-mono); color: var(--muted); font-size: 0.95rem; }
.lab-row h3 a { color: var(--ink); text-decoration: none; }
.lab-row h3 a:hover { color: var(--accent); text-decoration: underline; }
.lab-row p { color: var(--muted); font-size: 1rem; margin-top: 0.2rem; }
.status {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--muted);
}
.status.ready { border-color: var(--accent); color: var(--accent); }
.status.progress { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.status.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.lab-row.soon h3 { color: var(--muted); font-weight: 600; }
@media (max-width: 34rem) {
  .lab-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lab-row .num { grid-column: 1 / -1; }
}

/* ---------- Lab page: progress bar ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg);
}
.progress {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.progress .wrap {
  display: flex; align-items: center; gap: 1rem;
  padding-block: 0.6rem;
}
.progress-track {
  flex: 1; height: 8px; border-radius: 999px;
  background: var(--rule); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-text {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

.lab-head { padding-block: 2.5rem 1rem; }
.lab-head .wrap > * + * { margin-top: 0.75rem; }
.lab-head p { color: var(--muted); max-width: var(--measure); }

.notice {
  margin-top: 1rem; padding: 0.75rem 1rem;
  border: 1px solid var(--capture); border-radius: var(--radius);
  background: var(--capture-soft); font-size: 1rem;
}

/* ---------- Lab page: task sections ---------- */
.task { padding-block: 2rem; border-top: 1px solid var(--rule); }
.task-body { max-width: var(--measure); }
.task-head { margin-bottom: 1.25rem; }
.task-head h2 { margin-top: 0.25rem; }
.task.is-locked .task-body { display: none; }
.task.is-locked .task-head h2 { color: var(--muted); }
.locked-note { display: none; color: var(--muted); font-size: 1rem; }
.task.is-locked .locked-note { display: block; }
.task.is-done .task-head .label::after { content: "  ·  done"; color: var(--ok); }

/* Callouts: hint, capture (screenshot/photo), quick check. Same shape, different color. */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid; gap: 0.5rem;
}
.callout .label { color: inherit; }
.hint { border: 1px dashed var(--rule); color: var(--muted); }
.hint .label { color: var(--ink); }
.capture { background: var(--capture-soft); color: var(--ink); }
.capture .label { color: var(--capture); }
.capture label {
  display: flex; gap: 0.6rem; align-items: center;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  margin-top: 0.25rem;
}
.capture input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--capture); flex: none; }

/* Quick checks */
.check { background: var(--accent-soft); }
.check .label { color: var(--accent); }
.check .q { font-weight: 600; }
.options { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.option {
  display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.5rem; align-items: start;
  width: 100%; text-align: left;
  font: inherit; font-size: 1rem; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.6rem 0.75rem; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option .key { font-family: var(--font-mono); font-weight: 700; color: var(--muted); }
.option.is-wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.option.is-wrong .key { color: var(--wrong); }
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.option.is-correct .key { color: var(--ok); }
.option:disabled { cursor: default; }
.option:disabled:not(.is-correct) { opacity: 0.6; }
.feedback { font-size: 1rem; }
.feedback:empty { display: none; }
.feedback strong { display: block; }
.feedback.ok strong { color: var(--ok); }
.feedback.no strong { color: var(--wrong); }

/* Kitchen table */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 36rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

/* Photo placeholders for Task 3 */
.figure {
  border: 1px dashed var(--rule); border-radius: var(--radius);
  min-height: 9rem; display: grid; place-items: center; text-align: center;
  padding: 1rem; color: var(--muted); font-size: 0.95rem; background: var(--surface);
}
.figure .label { display: block; margin-bottom: 0.35rem; }

/* Name field */
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; }
.field input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.55rem 0.75rem; max-width: 24rem; width: 100%;
}
.field input:focus { border-color: var(--accent); }
.field small { color: var(--muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: inherit; font-size: 1rem; font-weight: 600;
  padding: 0.6rem 1.1rem; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--rule); font-weight: 500; }
.next { margin-top: 1.5rem; }
.next[hidden] { display: none; }

/* Legend on the first section */
.legend { display: grid; gap: 0.5rem; padding: 0; list-style: none; }
.legend li { display: flex; gap: 0.75rem; align-items: baseline; }
.swatch {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 4px; white-space: nowrap; flex: none;
}
.swatch-hint { border: 1px dashed var(--rule); color: var(--ink); }
.swatch-capture { background: var(--capture-soft); color: var(--capture); }
.swatch-check { background: var(--accent-soft); color: var(--accent); }

/* ---------- Badge ---------- */
.badge {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; align-items: center;
  border: 2px solid var(--ink); border-radius: 10px; padding: 1.25rem;
  background: var(--surface); max-width: 32rem;
}
.badge svg { width: 100%; height: auto; }
.badge h3 { font-size: 1.35rem; margin-top: 0.15rem; }
.badge .who { font-size: 1.1rem; margin-top: 0.4rem; overflow-wrap: anywhere; }
.badge .meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; font-variant-numeric: tabular-nums; }
@media (max-width: 30rem) { .badge { grid-template-columns: 1fr; } .badge svg { max-width: 7rem; } }

.submit-list { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.submit-list li { display: flex; gap: 0.6rem; align-items: baseline; }
.submit-list li::before {
  content: "○"; font-family: var(--font-mono); color: var(--muted); flex: none; width: 1rem;
}
.submit-list li.done::before { content: "✓"; color: var(--ok); font-weight: 700; }

.reset-zone { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; font-size: 0.95rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Folder tree diagrams */
pre.tree {
  margin: 0; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.85rem 1rem; line-height: 1.5;
}
pre.tree code { font-size: 0.95rem; }

/* ---------- Page-by-page steps ---------- */
.locked-note { display: none !important; }
.task { border-top: 0; }
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}
.pager-next { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-left: auto; }
.pager-note { color: var(--muted); font-size: 0.95rem; }
.pager .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pager .next { margin-top: 0; }
.task[data-enter="forward"] .task-body, .task[data-enter="forward"] .task-head { animation: slide-in-right 0.25s ease-out; }
.task[data-enter="back"] .task-body, .task[data-enter="back"] .task-head { animation: slide-in-left 0.25s ease-out; }
@keyframes slide-in-right { from { opacity: 0.2; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-left { from { opacity: 0.2; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .task[data-enter] .task-body, .task[data-enter] .task-head { animation: none; } }

/* Home page: the whole row is clickable, including the Start label */
.lab-row { position: relative; }
.lab-row h3 a::after { content: ""; position: absolute; inset: 0; }
.lab-row:not(.soon):hover { background: var(--surface); }
.lab-row:not(.soon):hover .status.ready { background: var(--accent); color: var(--accent-ink); }

/* ---------- Header nav ---------- */
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }

/* ---------- Start Here card on the home page ---------- */
.start-card {
  display: grid; gap: 0.35rem; margin-top: 1rem;
  padding: 1.1rem 1.25rem; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); text-decoration: none;
}
.start-card .label { color: var(--accent); }
.start-title { font-weight: 600; font-size: 1.1rem; }
.start-go { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.start-card:hover .start-go { text-decoration: underline; }

/* ---------- Start Here guide ---------- */
.guide .lab-head { padding-bottom: 0.5rem; }
.toc { max-width: var(--measure); padding: 1rem 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.toc ol { margin: 0.5rem 0 0; padding-left: 1.4rem; display: grid; gap: 0.2rem; }
.guide-section { max-width: var(--measure); padding-top: 2.25rem; scroll-margin-top: 1rem; }
.guide-section ul { padding-left: 1.3rem; }
.template-box { display: grid; gap: 0.6rem; justify-items: start; }
.template-box pre {
  margin: 0; width: 100%; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1rem; font-size: 0.9rem; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.copy-status { font-size: 0.9rem; color: var(--muted); }
.example-report { border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 1rem; }
.example-report .caption { color: var(--muted); font-size: 0.95rem; }
.guide-end { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }
.guide-end .btn { text-decoration: none; }
