/* ============================================================
   labs.css — styles for interactive labs.
   ============================================================ */

.lab { max-width: 880px; margin: 0 auto; padding: var(--sp-7) var(--sp-5) var(--sp-8); }
.lab-head { margin-bottom: var(--sp-5); }
.lab-eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.16em; color: var(--signal); margin: 0 0 var(--sp-3); text-transform: uppercase; }
.lab-head h1 { font-size: var(--t-2xl); margin: 0 0 var(--sp-2); }
.lab-head p { color: var(--ink-dim); margin: 0; }

/* ---- stat bar ---- */
.stat-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: var(--sp-2); margin-bottom: var(--sp-5); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); text-align: center; }
.stat-val { font-family: var(--font-mono); font-size: var(--t-xl); font-weight: 700; color: var(--signal); line-height: 1; }
.stat-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.stat.streak .stat-val { color: var(--status-learn); }
.stat.best .stat-val { color: var(--status-strong); }

/* ---- level selector ---- */
.level-select { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.level-btn { flex: 1; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-dim); font-family: var(--font-display); font-weight: 600; font-size: var(--t-sm); cursor: pointer; transition: all .15s; }
.level-btn:hover { border-color: var(--line-bright); color: var(--ink); }
.level-btn.active { background: var(--signal); color: #06231f; border-color: var(--signal); }

/* ---- problem card ---- */
.drill-card { background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--radius-lg); padding: var(--sp-6); margin-bottom: var(--sp-4); }
.drill-given { text-align: center; margin-bottom: var(--sp-5); }
.drill-cidr { font-family: var(--font-mono); font-size: var(--t-3xl); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.drill-prompt { color: var(--ink-dim); font-size: var(--t-md); margin-top: var(--sp-2); }
.drill-timer { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--ink-faint); text-align: center; margin-bottom: var(--sp-4); }
.drill-input-row { display: flex; gap: var(--sp-3); }
.drill-input { flex: 1; background: var(--surface-3); border: 1px solid var(--line-bright); border-radius: var(--radius); padding: var(--sp-4); font-family: var(--font-mono); font-size: var(--t-lg); color: var(--ink); text-align: center; }
.drill-input:focus { outline: none; border-color: var(--signal); }
.drill-submit { padding: 0 var(--sp-6); background: var(--signal); color: #06231f; border: none; border-radius: var(--radius); font-family: var(--font-display); font-weight: 700; cursor: pointer; font-size: var(--t-md); transition: background .15s; }
.drill-submit:hover { background: #4ff0d6; }

/* ---- feedback ---- */
.drill-feedback { margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--radius); display: none; }
.drill-feedback.show { display: block; animation: fbIn .25s ease; }
@keyframes fbIn { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform:none;} }
.drill-feedback.correct { background: color-mix(in srgb, var(--status-strong) 12%, transparent); border: 1px solid var(--status-strong); }
.drill-feedback.wrong { background: color-mix(in srgb, var(--status-weak) 12%, transparent); border: 1px solid var(--status-weak); }
.fb-title { font-family: var(--font-display); font-weight: 700; margin-bottom: var(--sp-2); }
.drill-feedback.correct .fb-title { color: var(--status-strong); }
.drill-feedback.wrong .fb-title { color: var(--status-weak); }
.fb-detail { font-size: var(--t-sm); color: var(--ink-dim); }
.fb-answer { font-family: var(--font-mono); color: var(--ink); font-weight: 700; }
.drill-bits { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; margin: var(--sp-4) 0; }
.fb-legend { display: flex; gap: var(--sp-4); justify-content: center; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-faint); }
.fb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fb-swatch { width: 12px; height: 12px; border-radius: 2px; }
.fb-swatch.net { background: var(--signal); }
.fb-swatch.host { background: var(--surface-3); border: 1px solid var(--line-bright); }
.drill-next { margin-top: var(--sp-4); width: 100%; padding: var(--sp-4); background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: var(--radius); color: var(--ink); font-family: var(--font-display); font-weight: 600; cursor: pointer; }
.drill-next:hover { border-color: var(--signal); color: var(--signal); }

/* ---- reset link ---- */
.lab-reset { text-align: center; margin-top: var(--sp-5); }
.lab-reset button { background: none; border: none; color: var(--ink-faint); font-size: var(--t-xs); cursor: pointer; text-decoration: underline; }

/* ---- packet journey ---- */
.pj-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); margin-bottom: var(--sp-4); }
.pj-controls { display: flex; gap: var(--sp-3); justify-content: center; margin-bottom: var(--sp-5); }
.pj-controls button { padding: var(--sp-3) var(--sp-5); border-radius: var(--radius); font-family: var(--font-display); font-weight: 600; cursor: pointer; border: 1px solid var(--line-bright); background: var(--surface); color: var(--ink); transition: all .15s; }
.pj-controls button:hover { border-color: var(--signal); color: var(--signal); }
.pj-controls button.primary { background: var(--signal); color: #06231f; border-color: var(--signal); }
.pj-scenario { display: flex; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-5); flex-wrap: wrap; }
.pj-scenario button { padding: var(--sp-2) var(--sp-4); font-size: var(--t-sm); border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-dim); cursor: pointer; }
.pj-scenario button.active { background: var(--signal); color: #06231f; border-color: var(--signal); }
.pj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.pj-col-title { text-align: center; font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-3); }
.pj-layer { display: grid; grid-template-columns: 36px 1fr; gap: var(--sp-3); align-items: center; padding: var(--sp-3); margin-bottom: 4px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--ph, var(--line-bright)); border-radius: var(--radius); opacity: 0.35; transition: opacity .3s, transform .3s, box-shadow .3s; }
.pj-layer.active { opacity: 1; transform: scale(1.02); box-shadow: var(--shadow); }
.pj-layer.done { opacity: 0.8; }
.pj-n { font-family: var(--font-mono); font-weight: 700; color: var(--ph, var(--signal)); text-align: center; }
.pj-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: var(--t-sm); }
.pj-pdu { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-faint); }
.pj-packet { margin: var(--sp-4) 0; padding: var(--sp-3); background: var(--bg); border: 1px dashed var(--line-bright); border-radius: var(--radius); text-align: center; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.pj-header { font-family: var(--font-mono); font-size: var(--t-xs); padding: 4px var(--sp-2); border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink); animation: hdrIn .3s ease; }
.pj-header.data { background: var(--signal); color: #06231f; font-weight: 700; }
@keyframes hdrIn { from { opacity:0; transform: scale(.8);} to {opacity:1; transform:none;} }
.pj-caption { text-align: center; color: var(--ink-dim); font-size: var(--t-sm); margin-top: var(--sp-3); min-height: 2.4em; }

@media (max-width: 640px) {
  .drill-cidr { font-size: var(--t-2xl); }
  .pj-cols { grid-template-columns: 1fr; }
  .drill-input-row { flex-direction: column; }
}

/* ---- identify the layer ---- */
.lc-item-card { background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--radius-lg); padding: var(--sp-6) var(--sp-5); margin-bottom: var(--sp-4); text-align: center; }
.lc-instruction { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-3); }
.lc-item { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; color: var(--ink); line-height: 1.2; }
.lc-layers { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.lc-layer-btn { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--lh, var(--line-bright)); border-radius: var(--radius); cursor: pointer; transition: all .12s; text-align: left; font-family: var(--font-body); }
.lc-layer-btn:hover:not(:disabled) { background: var(--surface-2); transform: translateX(3px); border-left-color: var(--lh, var(--signal)); }
.lc-layer-btn:disabled { cursor: default; }
.lc-ln { font-family: var(--font-mono); font-weight: 700; color: var(--lh, var(--signal)); text-align: center; }
.lc-lname { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: var(--t-sm); }
.lc-layer-btn.correct { background: color-mix(in srgb, var(--status-strong) 18%, transparent); border-color: var(--status-strong); border-left-color: var(--status-strong); }
.lc-layer-btn.wrong { background: color-mix(in srgb, var(--status-weak) 16%, transparent); border-color: var(--status-weak); border-left-color: var(--status-weak); }
.lc-feedback { padding: var(--sp-4); border-radius: var(--radius); display: none; margin-bottom: var(--sp-4); }
.lc-feedback.show { display: block; animation: fbIn .25s ease; }
.lc-feedback.correct { background: color-mix(in srgb, var(--status-strong) 12%, transparent); border: 1px solid var(--status-strong); }
.lc-feedback.wrong { background: color-mix(in srgb, var(--status-weak) 12%, transparent); border: 1px solid var(--status-weak); }
.lc-fb-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.lc-feedback.correct .lc-fb-title { color: var(--status-strong); }
.lc-feedback.wrong .lc-fb-title { color: var(--status-weak); }
.lc-fb-why { font-size: var(--t-sm); color: var(--ink-dim); }
.lc-fb-why strong { color: var(--ink); }
.lc-next { width: 100%; margin-top: var(--sp-3); padding: var(--sp-3); background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: var(--radius); color: var(--ink); font-family: var(--font-display); font-weight: 600; cursor: pointer; }
.lc-next:hover { border-color: var(--signal); color: var(--signal); }

/* ---- ports trainer ---- */
.pt-mastery { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-5); }
.pt-mastery-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-3); }
.pt-mastery-label { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.pt-mastery-val { font-family: var(--font-mono); font-size: var(--t-md); font-weight: 700; color: var(--signal); }
.pt-card { background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--radius-lg); padding: var(--sp-6) var(--sp-5); margin-bottom: var(--sp-4); text-align: center; }
.pt-ask { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-3); }
.pt-prompt { font-family: var(--font-mono); font-size: var(--t-3xl); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.pt-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.pt-opt { padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-family: var(--font-mono); font-size: var(--t-md); cursor: pointer; transition: all .12s; }
.pt-opt:hover:not(:disabled) { border-color: var(--signal); background: var(--surface-2); }
.pt-opt:disabled { cursor: default; }
.pt-opt.correct { background: color-mix(in srgb, var(--status-strong) 18%, transparent); border-color: var(--status-strong); color: var(--ink); }
.pt-opt.wrong { background: color-mix(in srgb, var(--status-weak) 16%, transparent); border-color: var(--status-weak); }
.pt-feedback { padding: var(--sp-4); border-radius: var(--radius); display: none; margin-bottom: var(--sp-4); }
.pt-feedback.show { display: block; animation: fbIn .25s ease; }
.pt-feedback.correct { background: color-mix(in srgb, var(--status-strong) 12%, transparent); border: 1px solid var(--status-strong); }
.pt-feedback.wrong { background: color-mix(in srgb, var(--status-weak) 12%, transparent); border: 1px solid var(--status-weak); }
.pt-fb-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.pt-feedback.correct .pt-fb-title { color: var(--status-strong); }
.pt-feedback.wrong .pt-fb-title { color: var(--status-weak); }
.pt-fb-note { font-size: var(--t-sm); color: var(--ink-dim); }
.pt-fb-note .mono { color: var(--ink); }
.pt-next { width: 100%; margin-top: var(--sp-3); padding: var(--sp-3); background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: var(--radius); color: var(--ink); font-family: var(--font-display); font-weight: 600; cursor: pointer; }
.pt-next:hover { border-color: var(--signal); color: var(--signal); }

@media (max-width: 600px) { .pt-prompt { font-size: var(--t-2xl); } .pt-options { grid-template-columns: 1fr; } }
