/* ------------------------------------------------------------------
   Lecture materials (course pages and lab guides).

   The lab guide components below come from the standalone handout and
   are scoped under .lab so they cannot reach the site nav or footer.
   Their palette tokens are re-pointed at the site's own colours here,
   so the handout inherits MINT Lab's look rather than its own.
   ------------------------------------------------------------------ */

:root {
      --bg: #f6fbf7;
      --surface: #ffffff;
      --line: #d8eadf;
      --ink: #10201a;
      --muted: #5f7168;
      --green: #008c3a;
      --green-soft: #dff5e7;
      --dark: #07130e;
      --radius: 22px;
      --max: 1180px;

      /* handout tokens -> site palette */
      --ground: var(--bg);
      --surface-2: #eef8f1;
      --ink-2: var(--muted);
      --ink-3: #7d8f86;
      --rule: var(--line);
      --rule-strong: #b9d3c4;
      --accent: var(--green);
      --accent-soft: var(--green-soft);
      --accent-ink: #00762f;
      --signal: #a8431a;
      --signal-soft: #f7e9e1;
      --shadow: 0 1px 2px rgba(19, 28, 24, .05), 0 8px 24px -16px rgba(19, 28, 24, .28);

      --sans: Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
      --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Courier New", monospace;
    }
* { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: Inter, system-ui, sans-serif;
      background: var(--bg);
      color: var(--ink);
      line-height: 1.6;
    }

    a { color: inherit; text-decoration: none; }
    .container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

    .nav {
      position: sticky;
      top: 0;
      z-index: 40;
      border-bottom: 1px solid rgba(216, 234, 223, .82);
      background: rgba(246, 251, 247, .82);
      backdrop-filter: blur(18px);
    }

    .nav-inner {
      height: 74px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 22px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 900;
      letter-spacing: -.04em;
    }

    .brand-logo {
      width: 42px;
      height: 42px;
      object-fit: contain;
    }

    .brand-text strong { display: block; line-height: 1; font-size: 1.05rem; }
    .brand-text span { display: block; color: var(--muted); font-size: .74rem; letter-spacing: .01em; margin-top: 3px; }

    .nav-links {
      display: flex;
      gap: 24px;
      align-items: center;
      color: var(--muted);
      font-size: .94rem;
      font-weight: 700;
    }

    .nav-links a {
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }

    .nav-links a:hover,
    .nav-links a.active { color: var(--green); }

    .nav-art {
      display: block;
      width: 80px;
      height: 80px;
      object-fit: contain;
      flex: 0 0 80px;
    }

    .nav-item {
      position: relative;
      display: inline-flex;
      align-items: center;
    }

    .submenu {
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      display: none;
      min-width: 104px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
      box-shadow: 0 14px 32px rgba(0,0,0,.08);
      z-index: 60;
    }

    .nav-item:hover .submenu,
    .nav-item:focus-within .submenu {
      display: grid;
      gap: 4px;
    }

    .submenu a {
      padding: 8px 10px;
      border-radius: 10px;
      white-space: nowrap;
    }

    .submenu a:hover {
      background: var(--green-soft);
      text-decoration: none;
    }


    /* ---- page shell ---- */

    .page-head {
      padding: 44px 0 0;
    }

    .crumb {
      max-width: 780px;
      margin: 0 auto;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      font-size: .9rem;
      color: var(--muted);
    }

    .crumb a { color: var(--green); font-weight: 800; }
    .crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
    .crumb span[aria-hidden] { color: var(--ink-3); }

    main.container { padding-bottom: 8px; }

    /* ---- course index: lab list ---- */

    .course-head {
      padding: 44px 0 6px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .course-head .code {
      font-family: var(--mono);
      font-size: .82rem;
      letter-spacing: .13em;
      color: var(--green);
      font-weight: 700;
    }

    .course-head h1 {
      margin: 0;
      font-size: clamp(2.1rem, 4.4vw, 3.1rem);
      line-height: 1.08;
      letter-spacing: -.02em;
    }

    .course-head .kor {
      color: var(--muted);
      font-size: 1.05rem;
      max-width: 66ch;
    }

    .lab-list {
      display: grid;
      gap: 14px;
      margin: 34px 0 0;
      padding: 0;
      list-style: none;
    }

    .lab-list > li { margin: 0; }

    .lab-card {
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) auto;
      gap: 20px;
      align-items: center;
      padding: 22px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 18px;
      color: inherit;
      transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
    }

    a.lab-card:hover {
      border-color: var(--rule-strong);
      transform: translateY(-1px);
      box-shadow: var(--shadow);
    }

    .lab-no {
      font-family: var(--mono);
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--green);
      letter-spacing: -.02em;
    }

    .lab-card h2 {
      margin: 0 0 4px;
      font-size: 1.14rem;
      letter-spacing: -.02em;
    }

    .lab-card .lab-sub { color: var(--muted); font-size: .95rem; }

    .lab-when {
      display: inline-flex;
      align-items: center;
      min-height: 34px;
      padding: 0 12px;
      border-radius: 999px;
      background: var(--green-soft);
      color: var(--green);
      font-size: .92rem;
      font-weight: 900;
      white-space: nowrap;
    }

    .lab-card.pending {
      border-style: dashed;
      background: rgba(255, 255, 255, .56);
    }

    .lab-card.pending .lab-no,
    .lab-card.pending h2 { color: var(--muted); }

    .lab-card.pending .lab-when {
      background: transparent;
      border: 1px dashed var(--line);
      color: var(--ink-3);
      font-weight: 700;
    }

    .note-box {
      margin: 30px 0 0;
      padding: 18px 20px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface);
      color: var(--muted);
      font-size: .97rem;
    }

    .note-box strong { color: var(--ink); }

    @media (max-width: 760px) {
      .lab-card {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: start;
      }
    }

    .footer-inner { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; }

    footer {
      border-top: 1px solid var(--line);
      margin-top: 80px;
      padding: 32px 0;
      color: var(--muted);
    }

    @media (max-width: 860px) {
      .nav-inner {
        height: auto;
        min-height: 74px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 14px 0;
      }

      .nav-links {
        gap: 14px;
        flex-wrap: wrap;
        font-size: .9rem;
      }

      .brand-text span { display: none; }
    }


/* ---- lab handout components (scoped) ---- */

.lab {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.lab .masthead {
  padding-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.lab .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.lab .eyebrow b { color: var(--accent); font-weight: 600;
}

.lab h1 {
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
}

.lab .standfirst {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0;
}

.lab .standfirst strong { color: var(--ink); font-weight: 600;
}

.lab .spectrum {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.lab .spectrum-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6E1F1F 0%, #A8431A 14%, #B98A16 30%, #2F7D4E 50%, #1B5FA8 70%, #4B2E9E 88%, #2B1B57 100%);
}

.lab .spectrum-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.lab section { display: flex; flex-direction: column; gap: 20px;
}

.lab .sec-head { display: flex; flex-direction: column; gap: 6px;
}

.lab h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

.lab .sec-note { color: var(--ink-2); font-size: 15px; margin: 0; max-width: 62ch;
}

.lab p { margin: 0; max-width: 68ch;
}

.lab a { color: var(--accent-ink); text-underline-offset: 3px;
}

.lab hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0;
}

.lab .timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.lab .tl-cell {
  padding: 12px 10px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lab .tl-cell:last-child { border-right: 0;
}

.lab .tl-min { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .05em;
}

.lab .tl-what { font-size: 13.5px; font-weight: 600; line-height: 1.35;
}

.lab .tl-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.4;
}

.lab .tl-cell.key .tl-sub { color: var(--accent-ink);
}

.lab .tl-cell.key { background: var(--accent-soft);
}

.lab .tl-cell.key .tl-what { color: var(--accent-ink);
}

.lab .checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px;
}

.lab .checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.lab .checklist li:hover { border-color: var(--rule-strong);
}

.lab .checklist input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  flex: 0 0 18px;
  margin-top: 4px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  background: var(--ground);
}

.lab .checklist input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.lab .checklist input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--surface);
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

.lab :root[data-theme="dark"] .checklist input[type="checkbox"]:checked::after, .lab :root:not([data-theme="light"]) .checklist input[type="checkbox"]:checked::after { border-color: #0E1512;
}

.lab .checklist input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px;
}

.lab .checklist .ct { font-size: 15px; line-height: 1.6;
}

.lab .checklist .ct small { display: block; color: var(--ink-2); font-size: 13.5px;
}

.lab .checklist li:has(input:checked) .ct { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--rule-strong);
}

.lab .checklist li:has(input:checked) .ct small { text-decoration: none;
}

.lab .step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 18px;
  align-items: start;
}

.lab .step-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  height: 34px;
  display: grid;
  place-items: center;
  letter-spacing: .02em;
}

.lab .step- .step-title { font-size: 17px; font-weight: 600; margin: 0; line-height: 1.45; padding-top: 3px;
}

.lab .step-body p { font-size: 15.5px; color: var(--ink-2);
}

.lab .step-body p strong { color: var(--ink); font-weight: 600;
}

.lab .mission {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lab .m-head {
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid var(--rule);
}

.lab .m-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.lab .m-tag .mins { color: var(--accent);
}

.lab .m-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; margin: 0;
}

.lab .m-lede { font-size: 15px; color: var(--ink-2); margin: 0;
}

.lab .m- .m-body p { font-size: 15.5px;
}

.lab .m-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lab .prompt {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}

.lab .p-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 7px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.lab .p-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lab .copy {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s ease;
}

.lab .copy:hover { color: var(--accent-ink); border-color: var(--accent);
}

.lab .copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px;
}

.lab .copy.done { color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}

.lab .prompt pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

.lab .gate {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lab .gate-h {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.lab .gate p, .lab .gate li { font-size: 15px; color: var(--ink);
}

.lab .gate ol, .lab .gate ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px;
}

.lab .warn {
  border-left: 3px solid var(--signal);
  background: var(--signal-soft);
  border-radius: 0 10px 10px 0;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lab .warn-h {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
}

.lab .warn p { font-size: 15px; color: var(--ink);
}

.lab .figspec {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}

.lab .figspec-h {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 9px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.lab .figspec- .figspec-body svg { width: 100%; height: auto; max-width: 460px; align-self: center;
}

.lab .figspec-body p { font-size: 14.5px; color: var(--ink-2);
}

.lab .figspec-body p b { color: var(--ink); font-weight: 600;
}

.lab .figspec-body p strong { color: var(--signal); font-weight: 600;
}

.lab .dg line, .lab .dg path { fill: none; stroke: var(--rule-strong); stroke-width: 1.2;
}

.lab .dg .dg-line { stroke: var(--accent); stroke-width: 2;
}

.lab .dg .dg-curve { stroke: var(--signal); stroke-width: 2;
}

.lab .dg .dg-ghost { stroke: var(--rule-strong); stroke-width: 1.2; stroke-dasharray: 3 3;
}

.lab .dg .dg-pt { fill: var(--ink); stroke: none;
}

.lab .dg text { font-family: var(--mono); fill: var(--ink-2);
}

.lab .dg .dg-ax { font-size: 12px; font-weight: 600; fill: var(--ink);
}

.lab .dg .dg-lb { font-size: 10.5px; fill: var(--accent-ink); text-anchor: middle;
}

.lab .dg .dg-warn { fill: var(--signal);
}

.lab .dg .dg-sm { font-size: 10px; text-anchor: middle;
}

.lab .tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
}

.lab table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14.5px;
}

.lab th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.lab td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.55;
}

.lab tr:last-child td { border-bottom: 0;
}

.lab td code, .lab p code, .lab li code, .lab .ct code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1.5px 5px; border-radius: 4px;
}

.lab td:first-child { font-weight: 600;
}

.lab .principles { display: grid; gap: 12px;
}

.lab .pr {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

.lab .pr-n { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent);
}

.lab .pr-t { font-weight: 600; font-size: 15.5px;
}

.lab .pr-d { color: var(--ink-2); font-size: 14.5px; display: block; margin-top: 2px;
}

.lab .closing {
  border-top: 2px solid var(--ink);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lab .closing .big {
  font-size: clamp(21px, 3.6vw, 27px);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -.02em;
  text-wrap: balance;
  max-width: 24ch;
}

.lab .closing p { color: var(--ink-2); font-size: 15.5px;
}

.lab .colophon {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
  line-height: 1.8;
}

@media (max-width: 620px) {
  .lab { gap: 44px;
  }
  .lab .timeline { grid-template-columns: 1fr 1fr;
  }
  .lab .tl-cell { border-bottom: 1px solid var(--rule);
  }
  .lab .step { grid-template-columns: 34px 1fr; gap: 0 12px;
  }
  .lab .m-body, .lab .m-head { padding-left: 16px; padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab * { transition: none !important; animation: none !important; }
}
