/* LinuxLearningLabs — neo-brutalist editorial brand, matching vfrazier-app.
   Cream page, ink borders, hard offset shadows, purple accent, yellow highlight, Inter. */

:root {
  --ink: #1a1209;
  --ink-2: #2a1d10;
  --muted: #5c4a30;
  --page: #ebe9e6;
  --card: #ffffff;
  --accent: #6d28d9;
  --accent-soft: #efe6ff;
  --accent-light: #c4b3ff;
  --accent-deep: #3a1d70;
  --highlight: #ffd60a;
  --highlight-soft: #fffae0;
  --border: #1a1209;
  --footer-text: #d4c9b4;
  --footer-dim: #8a7558;

  --ok: #1f7a3d;
  --term-bg: #17181A;
  --term-fg: #E4E3DE;
  --term-gold: #B4A269;

  --font-sans: 'Inter Variable', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --container-max: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 99px;
  --shadow-card: 4px 4px 0 var(--ink);
  --shadow-hero: 8px 8px 0 var(--ink);
  --shadow-accent: 4px 4px 0 var(--accent);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  background: var(--page);
  color: var(--ink);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }
.hl { background: linear-gradient(transparent 60%, var(--highlight) 60%); padding: 0 2px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Nav ---- */
.nav { display: flex; align-items: center; gap: 20px; padding: 16px 32px; border-bottom: 2px solid var(--ink); background: var(--page); flex-wrap: wrap; }
.nav .brand { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--page); padding: 6px 13px; border-radius: var(--radius-sm); font-weight: 800; letter-spacing: -.02em; font-size: 15px; cursor: pointer; }
.nav .brand .caret { color: var(--highlight); }
.nav .navlinks { display: flex; gap: 18px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; font-weight: 600; font-size: 13.5px; flex-wrap: wrap; }
.nav .navlinks a { text-decoration: none; padding-bottom: 2px; }
.nav .navlinks a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.nav .ghlink { background: var(--accent); color: var(--page); padding: 8px 15px; border-radius: var(--radius-pill); font-weight: 700; font-size: 12.5px; text-decoration: none; }
@media (max-width: 780px) { .nav .navlinks { margin-left: 0; order: 3; flex-basis: 100%; gap: 14px; } }

/* ---- Hero ---- */
.main { flex: 1 1 auto; animation: fade 160ms ease; }
.hero { border-bottom: 2px solid var(--ink); background: var(--page); }
.hero .container { padding-top: 56px; padding-bottom: 52px; }
.hero .kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: 58px; max-width: 16ch; }
.hero .lede { font-size: 20px; color: var(--muted); max-width: 60ch; margin-top: 18px; font-weight: 500; }
.hero .stats { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero .stat { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 12px 20px; }
.hero .stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.hero .stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero .stat.accent b { color: var(--accent); }
@media (max-width: 720px) { .hero h1 { font-size: 40px; } .hero .lede { font-size: 17px; } }

/* ---- Sections + cards ---- */
.sections { padding: 20px 0 72px; }
.section { padding-top: 52px; scroll-margin-top: 12px; }
.sechead { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.sechead .badge { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; font-weight: 800; background: var(--ink); color: var(--page); padding: 4px 10px; border-radius: 4px; }
.sechead h2 { font-size: 34px; }
.sechead .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.sec-blurb { color: var(--muted); max-width: 70ch; margin: 8px 0 24px; font-size: 15.5px; line-height: 1.5; }
.sec-progress { height: 8px; background: #dcd8d2; border: 2px solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; max-width: 70ch; margin-bottom: 26px; }
.sec-progress > i { display: block; height: 100%; background: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: transform 120ms ease, box-shadow 120ms ease; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.card .topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .topic { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
.card .done-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--highlight); color: var(--ink); border: 2px solid var(--ink); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.card h3 { font-size: 20px; letter-spacing: -.02em; }
.card .obj { font-size: 14.5px; color: var(--muted); line-height: 1.45; flex: 1 1 auto; }
.card .meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.card .meta .dot { opacity: .5; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-sans); font-weight: 800; letter-spacing: -.01em; cursor: pointer; border: 2px solid var(--ink); border-radius: var(--radius-sm); transition: transform 100ms ease, box-shadow 100ms ease, background 120ms ease; text-decoration: none; }
.btn.sm { font-size: 13px; padding: 7px 13px; }
.btn.md { font-size: 15px; padding: 10px 16px; }
.btn.full { width: 100%; }
.btn.ink { background: var(--ink); color: var(--page); }
.btn.ink:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--accent); }
.btn.accent { background: var(--accent); color: var(--page); }
.btn.accent:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.btn.plain { background: var(--card); color: var(--ink); }
.btn.plain:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Exercise view ---- */
.ex { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; animation: fade 160ms ease; }
.subbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 32px; border-bottom: 2px solid var(--ink); background: var(--page); }
.subbar .left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.subbar .topic { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
.subbar .extitle { font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subbar .right { display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 5px; }
.dots span { width: 11px; height: 11px; border: 2px solid var(--ink); border-radius: 3px; background: var(--page); }
.dots span.done { background: var(--highlight); }
.proglabel { font-size: 12.5px; font-weight: 700; color: var(--muted); }

.body { flex: 1 1 auto; display: flex; min-height: 0; }
.aside { flex: 0 0 440px; max-width: 46%; overflow: auto; border-right: 2px solid var(--ink); padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 18px; background: var(--page); }
.taskcard { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 20px; }
.taskcard .tasklabel { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.taskcard .tasktext { font-size: 17.5px; font-weight: 600; line-height: 1.4; }
.taskcard .taskdetail { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.taskcard code, .hints code, .card .obj code, .taskrow .txt code { font-family: var(--mono); font-size: .9em; font-weight: 600; background: var(--accent-soft); color: var(--accent-deep); padding: 1px 6px; border-radius: 5px; }
.hints { margin-top: 14px; background: var(--highlight-soft); border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.hints .h { font-size: 14px; line-height: 1.45; }
.solution { margin-top: 12px; }
.solution .lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.solution code { display: block; font-family: var(--mono); font-size: 13.5px; background: var(--ink); color: var(--term-gold); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.help { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---- Lesson panel ---- */
.panetabs { display: flex; gap: 8px; }
.ptab { flex: 1; font-family: var(--font-sans); font-weight: 800; font-size: 13px; letter-spacing: -.01em; padding: 9px; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; }
.ptab.on { background: var(--ink); color: var(--page); }
.taskcard.lesson .why { font-size: 15px; line-height: 1.55; }
.lcap { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin: 18px 0 8px; }
.concepts, .pits { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; line-height: 1.5; }
.anat { margin-bottom: 12px; }
.anat .cmd { display: block; font-family: var(--mono); font-size: 13.5px; background: var(--ink); color: var(--highlight); padding: 9px 11px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; overflow-x: auto; }
.anat table { width: 100%; border-collapse: collapse; border: 2px solid var(--ink); border-top: none; font-size: 13px; }
.anat td { padding: 6px 9px; border-top: 1px solid var(--border-strong, #ccc); vertical-align: top; line-height: 1.45; }
.anat td:first-child { white-space: nowrap; }
.anat tr:first-child td { border-top: none; }
.tryit { margin-top: 16px; font-size: 14.5px; font-weight: 600; background: var(--highlight-soft); border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 11px 13px; line-height: 1.5; }
#start-lab { margin-top: 16px; }

.complete { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-accent); padding: 26px; text-align: center; }
.complete .kick { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
.complete .big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0; }
.complete .big .check { display: inline-block; background: var(--highlight); border: 2px solid var(--ink); border-radius: var(--radius-pill); width: 54px; height: 54px; line-height: 50px; }
.complete .note { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.complete .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.tasklist .cap { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.tasklist .rows { display: flex; flex-direction: column; gap: 4px; }
.taskrow { display: flex; align-items: flex-start; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); border: 2px solid transparent; }
.taskrow.current { background: var(--accent-soft); border-color: var(--ink); }
.taskrow .num { flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: var(--card); }
.taskrow.done .num { background: var(--highlight); }
.taskrow.current .num { background: var(--accent); color: var(--page); }
.taskrow .txt { font-size: 14px; line-height: 1.4; padding-top: 1px; }
.taskrow.done .txt { color: var(--muted); }

/* ---- Terminal pane ---- */
.termpane { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; background: var(--term-bg); }
.termchrome { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; background: #0F1012; border-bottom: 1px solid #2A2B2E; }
.termchrome .lights { display: flex; gap: 8px; }
.termchrome .lights span { width: 11px; height: 11px; border-radius: 50%; }
.termchrome .cap { font-family: var(--mono); font-size: 12px; color: #8A8C90; }
.term { flex: 1 1 auto; min-height: 0; }
.term .terminal, .term .cmd, .term .terminal .cmd textarea { font-family: var(--mono) !important; }
.term .terminal { --size: 1.12; background: var(--term-bg); color: var(--term-fg); padding: 18px 20px; height: 100%; border-radius: 0; box-sizing: border-box; }
.term .terminal .terminal-output div span { white-space: pre-wrap; }
.term .cmd .prompt { color: var(--term-gold); }
.term .terminal a { color: var(--term-gold); }

/* ---- Footer ---- */
.footer { background: var(--ink); color: var(--footer-text); border-top: 2px solid var(--ink); }
.footer .container { padding-top: 40px; padding-bottom: 40px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer .fbrand { font-weight: 800; font-size: 18px; color: var(--page); letter-spacing: -.02em; }
.footer .fbrand .caret { color: var(--highlight); }
.footer p { color: var(--footer-dim); font-size: 13.5px; max-width: 46ch; margin-top: 8px; }
.footer a { color: var(--accent-light); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.footer .fcol h5 { color: var(--page); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.footer .fcol ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }

@media (max-width: 860px) {
  .body { flex-direction: column; }
  .aside { flex: 0 0 auto; max-width: none; border-right: none; border-bottom: 2px solid var(--ink); }
  .termpane { min-height: 380px; }
}

/* ---- Hero animation ---- */
.hero-flex { display: flex; align-items: center; gap: 48px; }
.hero-copy { flex: 1 1 auto; min-width: 0; }
.hero-anim { flex: 0 0 400px; max-width: 38%; margin: -24px 0; }
.hero-anim svg { display: block; width: 100%; height: auto; }
@media (max-width: 940px) { .hero-anim { display: none; } }
