/* ============================================================
   Juan Raphael Dilag, portfolio
   coursework.css, page-specific styles for coursework.html
   (Academic software: machine problems + capstone).
   Uses the shared design tokens from styles.css (:root +
   [data-theme="light"]). Only NEW components live here.
   ============================================================ */

/* ---------------- document header ---------------- */
.doc-hero { position: relative; padding: 72px 0 52px; }
.doc-kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 22px;
}
.doc-hero h1 {
  font-size: clamp(36px, 6vw, 62px); line-height: 1.02; font-weight: 800;
  letter-spacing: -0.03em; margin: 0; max-width: 18ch;
}
.doc-lead {
  font-size: clamp(18px, 2.3vw, 23px); line-height: 1.45; color: var(--text);
  font-weight: 600; max-width: 44ch; margin: 26px 0 0;
}
.doc-sub { font-size: 16.5px; line-height: 1.65; color: var(--muted); max-width: 66ch; margin: 18px 0 0; }
.doc-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* ---------------- table of contents ---------------- */
.toc {
  border: 1px solid var(--line); border-radius: 5px; background: var(--bg2);
  padding: 26px 28px; margin: 40px 0 8px;
}
.toc .eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 18px;
}
.toc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; }
.toc-group h3 {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px; font-weight: 600;
}
.toc-group ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-group a {
  display: flex; gap: 10px; align-items: baseline; text-decoration: none;
  font-size: 14.5px; color: var(--muted); padding: 6px 8px; border-radius: 3px;
  transition: color .16s, background .16s;
}
.toc-group a:hover { color: var(--text); background: var(--bg3); }
.toc-group a .n { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--faint); min-width: 42px; }

/* ---------------- machine-problem article ---------------- */
.mp { padding: 52px 0; border-top: 1px solid var(--line); }
.mp:first-of-type { border-top: none; padding-top: 8px; }
.mp-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 16px; }
.mp-num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent); }
.mp-head h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.mp-meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint);
  margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
}
.mp-meta .dot { color: var(--line2); }
.mp-meta a { color: var(--accent); text-decoration: none; }
.mp-meta a:hover { text-decoration: underline; }
.mp-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--line2);
  padding: 3px 8px; border-radius: 3px;
}

/* labeled subsection within a project (Discussion / Screenshots / Software / Hardware) */
.subblock { margin-top: 34px; }
.subblock-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.subblock-label::before {
  content: ""; width: 14px; height: 1px; background: var(--accent); opacity: .6; display: inline-block;
}
.subblock p { font-size: 16px; line-height: 1.7; color: var(--text); margin: 0 0 14px; max-width: 74ch; }
.subblock p:last-child { margin-bottom: 0; }
.subblock p .em { color: var(--accent); font-weight: 600; }

/* feature bullets */
.feat-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 74ch; }
.feat-list li { font-size: 15.5px; line-height: 1.6; color: var(--muted); padding-left: 24px; position: relative; }
.feat-list li::before { content: "→"; position: absolute; left: 0; top: 0; color: var(--accent); }
.feat-list li b { color: var(--text); font-weight: 600; }

/* ---------------- screenshot gallery (placeholder-ready) ---------------- */
.shot-grid { display: grid; gap: 18px; margin-top: 4px; }
.shot-grid--web { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.shot-grid--mobile { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot-frame {
  position: relative; width: 100%; border: 1px solid var(--line2); border-radius: 6px;
  overflow: hidden; background: var(--bg3);
}
.shot--web .shot-frame { aspect-ratio: 16 / 10; }
.shot--mobile .shot-frame { aspect-ratio: 9 / 18; }
/* dropped-in screenshots: full, uncropped, centered on the frame bg */
.shot-frame img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--bg); }
.shot-frame:has(img) { cursor: zoom-in; }
.shot-frame:has(img):hover { border-color: var(--accent); }

/* placeholder shown until a real <img> replaces it */
.shot-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 14px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 22px 22px; background-position: center;
}
.shot-ph-ico { font-size: 26px; color: var(--line2); line-height: 1; }
.shot-ph-cap { font-size: 13.5px; color: var(--muted); font-weight: 600; max-width: 90%; line-height: 1.35; }
.shot-ph-note {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}
.shot figcaption { font-size: 13px; line-height: 1.5; color: var(--muted); }
.shot figcaption b { color: var(--text); font-weight: 600; }

/* grouped sub-heading inside a screenshot block (used by the capstone's per-app groups) */
.shot-group-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin: 26px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.shot-group-title:first-child { margin-top: 0; }
.shot-group-title .badge {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--accent); border: 1px solid var(--line2); border-radius: 3px; padding: 2px 7px; font-weight: 500;
}

/* ---------------- software / hardware chips ---------------- */
.stack-groups { display: flex; flex-direction: column; gap: 18px; }
.stack-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.stack-group .k {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint); min-width: 108px;
}
.stack-group .chips { flex: 1; min-width: 240px; }
.chip--hw { border-style: dashed; }

/* ---------------- capstone block ---------------- */
.capstone-hero { margin-bottom: 6px; }
.capstone-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.08; }
.capstone-sub { font-size: 16px; color: var(--muted); margin: 0 0 20px; max-width: 70ch; line-height: 1.6; }
.authorcard {
  border: 1px solid var(--line); border-radius: 5px; background: var(--bg2);
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; max-width: 720px; margin-top: 4px;
}
.authorcard .row { display: grid; grid-template-columns: 150px 1fr; border-bottom: 1px solid var(--line); }
.authorcard .row:last-child { border-bottom: none; }
.authorcard .k { padding: 12px 18px; color: var(--faint); border-right: 1px solid var(--line); }
.authorcard .v { padding: 12px 18px; color: var(--text); }
.authorcard .v.accent { color: var(--accent); }

/* an inner "interface" card grouping the capstone's three apps in Discussion */
.iface { border-left: 2px solid var(--line2); padding-left: 22px; margin-top: 26px; }
.iface:first-child { margin-top: 8px; }
.iface h4 { font-size: 17px; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iface h4 .badge {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--accent); border: 1px solid var(--line2); border-radius: 3px; padding: 2px 7px; font-weight: 500;
}
.iface > p { font-size: 15.5px; line-height: 1.65; color: var(--muted); margin: 6px 0 0; max-width: 74ch; }

/* callout (security / methodology notes) */
.callout {
  border: 1px dashed var(--line2); border-radius: 5px; background: var(--bg2);
  padding: 22px 24px; margin-top: 26px;
}
.callout .eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px;
}
.callout p { font-size: 15px; line-height: 1.66; color: var(--muted); margin: 0; max-width: 78ch; }
.callout p + p { margin-top: 12px; }

/* ---------------- screenshot lightbox ---------------- */
.lb {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 8, 0.82); backdrop-filter: blur(4px); padding: 40px 24px;
}
.lb img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); }
.lb-cap {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: #cdd6cb; text-align: center; max-width: 80ch;
}
.lb-close {
  position: absolute; top: 18px; right: 20px; width: 38px; height: 38px; border-radius: 4px;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.28); color: #e8ece7;
  font-size: 20px; cursor: pointer; line-height: 1;
}
.lb-close:hover { border-color: var(--accent); }

/* ---------------- seminars & workshops ---------------- */
.sem-list { display: flex; flex-direction: column; }
.sem { padding: 32px 0; border-top: 1px solid var(--line); }
.sem:first-child { border-top: none; padding-top: 8px; }
.sem .mp-head h3 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 700; }
.topic-eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}
.sem-win { color: var(--accent); font-weight: 600; }
.sem-body { font-size: 15.5px; line-height: 1.7; color: var(--muted); margin: 16px 0 0; max-width: 76ch; }
.sem-take {
  margin: 14px 0 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent);
  font-size: 15px; line-height: 1.62; color: var(--text); max-width: 76ch;
}
.sem-take b { color: var(--accent); font-weight: 600; }

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  .authorcard .row, .toc-groups { grid-template-columns: 1fr; }
  .authorcard .k { border-right: none; border-bottom: 1px solid var(--line); }
  .stack-group .k { min-width: 100%; }
}
