:root {
  color-scheme: dark;            /* native scrollbars and form controls match the dark page */
  scrollbar-color: #3d444d transparent;
  scrollbar-width: thin;
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --orange: #ffa657;
  --term-bg: #0a0e14;
  --term-text: #b3f7b3;
  --term-prompt: #58a6ff;
  --term-server: #ffa657;
  --term-comment: #6e7681;
  --term-error: #f85149;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.5px;
}
.nav-brand span { color: var(--accent); }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 0.875rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

/* LAB LAYOUT */
.lab-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: 100%;
  height: calc(100vh - 49px);
}

.sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.sidebar-header p {
  font-size: 0.8rem;
  color: var(--muted);
}

.protocol-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  font-family: "Courier New", monospace;
  letter-spacing: 0.05em;
}
.badge-smtp { background: rgba(188,140,255,0.15); color: var(--purple); border: 1px solid rgba(188,140,255,0.3); }
.badge-ftp  { background: rgba(63,185,80,0.12);  color: var(--green);  border: 1px solid rgba(63,185,80,0.25); }
.badge-http { background: rgba(88,166,255,0.12); color: var(--accent); border: 1px solid rgba(88,166,255,0.25); }

/* STEPS */
.steps { padding: 1rem 0; }

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.step-item:hover { background: rgba(255,255,255,0.03); }
.step-item.active {
  background: rgba(88,166,255,0.08);
  border-left-color: var(--accent);
}
.step-item.done .step-num { background: var(--green); color: #000; }

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-item.active .step-num { background: var(--accent); color: #000; }

.step-info { flex: 1; min-width: 0; }
.step-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.step-item:not(.active) .step-title { color: var(--muted); }
.step-item.active .step-title { color: var(--text); }
.step-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* INSTRUCTION PANEL */
.instruction-panel {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.instruction-panel h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
.instruction-panel p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.instruction-panel code {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--orange);
}
.instruction-panel .cmd-hint {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--term-text);
  line-height: 1.6;
}
.instruction-panel .cmd-hint .comment {
  color: var(--term-comment);
}
.hint-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

/* TERMINAL AREA */
.terminal-area {
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.terminal-dots { display: flex; gap: 6px; }
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #28c840; }
.terminal-title {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.5rem;
}
.terminal-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
.btn-sm {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm.primary { border-color: var(--accent); color: var(--accent); }
.btn-sm.primary:hover { background: rgba(88,166,255,0.1); }

#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 0.5rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.term-line { display: flex; flex-wrap: wrap; }
.term-line.server { color: var(--term-server); }
.term-line.client { color: var(--term-text); }
.term-line.info   { color: var(--term-comment); font-style: italic; }
.term-line.error  { color: var(--term-error); }
.term-line.success{ color: var(--green); }
.term-line.spacer { height: 0.4em; }

.term-prefix { margin-right: 0.5em; flex-shrink: 0; }
.term-prefix.s { color: var(--term-server); }
.term-prefix.c { color: var(--term-prompt); }

.input-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem 0.75rem;
  gap: 0.5rem;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.input-prompt {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--term-prompt);
  flex-shrink: 0;
  user-select: none;
}
#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--term-text);
  caret-color: var(--term-text);
}
#cmd-input::placeholder { color: var(--term-comment); }

/* STATUS BAR */
.status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.3rem 1.25rem;
  font-size: 0.72rem;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: "Courier New", monospace;
  flex-shrink: 0;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.status-dot.connected { background: var(--green); }
.status-dot.waiting   { background: var(--yellow); }
.status-dot.error     { background: var(--red); }

.progress-text { margin-left: auto; }

/* LANDING PAGE */
.hero {
  padding: 5rem 2rem 3rem;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-badge-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.tag {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1180px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.lab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
  color: var(--text);
}
.lab-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.lab-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  font-family: "Courier New", monospace;
  font-weight: 700;
  color: var(--accent);
}
/* Longer names get a smaller label so they stay on one line */
.lab-card-icon-long { font-size: 1.3rem; padding-top: 0.3rem; margin-bottom: 0.9rem; }
.lab-card h2,
.lab-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.lab-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.lab-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.lab-card-meta span { display: flex; align-items: center; gap: 0.3rem; }

.lab-group-title {
  scroll-margin-top: 4.5rem;   /* clear the sticky navigation when a card links to a group */
  max-width: 1180px;
  margin: 0 auto 0.25rem;
  padding: 0 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
}
.lab-group-desc {
  max-width: 1180px;
  margin: 0 auto 1rem;
  padding: 0 2rem;
  font-size: 0.82rem;
  color: var(--muted);
}
/* Grouped lab cards keep their column width instead of stretching when a group has only one or two */
.lab-group-desc + .labs-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 2.5rem;
}

.section-label {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  /* Phones and small tablets: the lesson, steps, and instructions flow down the page, and the terminal
     comes after them with a fixed height. Nothing is clipped, and the page is the only thing that scrolls
     except the terminal itself. */
  .lab-layout { display: block; height: auto; }
  .sidebar { max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .instruction-panel { overflow: visible; }
  .lesson .lesson-body { max-height: none; overflow: visible; }
  .terminal-area { height: 80vh; min-height: 420px; }
  .hero h1 { font-size: 1.75rem; }

  .nav { padding: 0.6rem 1rem; gap: 0.35rem 1rem; }
  .nav-links { margin-left: 0; gap: 0.15rem 0.9rem; }
  .nav-links a { font-size: 0.8rem; }

  .sidebar-header, .instruction-panel { padding-left: 1rem; padding-right: 1rem; }
  .lesson .lesson-summary { flex-wrap: wrap; row-gap: 0.35rem; padding: 0.8rem 1rem; }
  .lesson .lesson-title { flex: 1 1 55%; }
  .lesson .lesson-body { padding-left: 1rem; padding-right: 1rem; }
  .step-item { padding: 0.55rem 1rem; }
  .step-desc { display: none; }

  .terminal-toolbar { padding: 0.5rem 0.75rem; }
  .terminal-dots { display: none; }
  .terminal-title { flex: 1; min-width: 0; margin-left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #terminal-output, .input-row, .status-bar { padding-left: 0.85rem; padding-right: 0.85rem; }
  .status-bar { flex-wrap: wrap; gap: 0.25rem 0.75rem; }
}


/* ---------- shell-style labs ---------- */

#terminal-output { tab-size: 8; }

.term-line.pre {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--term-text);
}
.term-line.pre.info    { color: var(--term-comment); font-style: italic; }
.term-line.pre.error   { color: var(--term-error); }
.term-line.pre.success { color: var(--green); }
.term-line.info { white-space: pre-wrap; }

button.cmd-hint {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--term-text);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
button.cmd-hint:hover, button.cmd-hint:focus-visible { border-color: var(--accent); outline: none; }
button.cmd-hint .comment { color: var(--term-comment); }

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

.takeaway {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.instruction-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.instruction-panel th, .instruction-panel td {
  text-align: left;
  vertical-align: top;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.instruction-panel th { color: var(--text); font-weight: 600; }
.instruction-panel ul { margin: 0.25rem 0 0.5rem 1.1rem; font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

.sim-note {
  margin-top: 0.6rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(210,153,34,0.35);
  border-radius: 6px;
  background: rgba(210,153,34,0.08);
  color: var(--yellow);
  font-size: 0.72rem;
  line-height: 1.4;
}

.track-switch {
  display: inline-flex;
  margin: 0.6rem 0 0.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.track-switch a {
  padding: 0.25rem 0.9rem;
  font-size: 0.78rem;
  font-family: "Courier New", monospace;
  color: var(--muted);
}
.track-switch a:hover { text-decoration: none; color: var(--text); }
.track-switch a.active { background: rgba(88,166,255,0.15); color: var(--accent); }

.badge-telnet { background: rgba(248,81,73,0.12);  color: var(--red);    border: 1px solid rgba(248,81,73,0.3); }
.badge-ssh    { background: rgba(63,185,80,0.12);  color: var(--green);  border: 1px solid rgba(63,185,80,0.25); }
.badge-dns    { background: rgba(255,166,87,0.12); color: var(--orange); border: 1px solid rgba(255,166,87,0.3); }

/* telnet wire view */
.wire-panel {
  flex-shrink: 0;
  max-height: 38%;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  padding: 0.6rem 1.25rem;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
}
.wire-panel[hidden] { display: none; }
.wire-panel h4 { font-size: 0.72rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.wire-panel p { color: var(--muted); margin-bottom: 0.5rem; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.wire-stream { color: var(--red); background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.25); border-radius: 4px; padding: 0.4rem 0.6rem; margin-bottom: 0.6rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.wire-table { width: 100%; border-collapse: collapse; }
.wire-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 0.15rem 0.5rem 0.15rem 0; }
.wire-table td { padding: 0.1rem 0.5rem 0.1rem 0; color: var(--term-text); }
.wire-table tr.wire-secret td { color: var(--red); font-weight: 700; }
.wire-table td.dir-c { color: var(--term-prompt); }
.wire-table td.dir-s { color: var(--term-server); }

@media (max-width: 768px) {
  .lab-layout { grid-template-rows: auto minmax(70vh, 1fr); }
  .terminal-area { min-height: 70vh; }
  .nav { padding: 0.6rem 1rem; }
}

/* Let the sidebar scroll as one unit instead of squeezing the instructions into a small box */
.sidebar .instruction-panel {
  flex: 1 0 auto;
  min-height: 16rem;
  overflow-y: visible;
}

.badge-net  { background: rgba(86,212,221,0.12); color: #56d4dd; border: 1px solid rgba(86,212,221,0.3); }
.badge-mail { background: rgba(188,140,255,0.12); color: var(--purple); border: 1px solid rgba(188,140,255,0.3); }

/* HINT CORNER: hints show here instead of in the terminal transcript */
.hint-corner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  max-height: 45vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.65rem 0.85rem 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
}
.hint-corner[hidden] { display: none; }
.hint-corner-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.hint-corner-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hint-corner-close { background: none; border: 0; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.hint-corner-close:hover, .hint-corner-close:focus-visible { color: var(--text); outline: none; }
.hint-corner-body p { color: var(--text); line-height: 1.55; margin: 0 0 0.4rem; }
.hint-corner-body pre {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.65rem;
  font-family: "Courier New", monospace; font-size: 0.78rem; color: var(--term-text); white-space: pre-wrap; overflow-wrap: anywhere;
}
.hint-corner-comment { color: var(--term-comment); }
.hint-corner-actions { margin-top: 0.5rem; }
.hint-corner-actions[hidden] { display: none; }
.hint-corner-use {
  background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px;
  font-size: 0.75rem; padding: 0.25rem 0.65rem; cursor: pointer;
}
.hint-corner-use:hover, .hint-corner-use:focus-visible { background: var(--accent); color: var(--bg); outline: none; }

/* LESSON: short explainer above the steps */
.lesson { border-bottom: 1px solid var(--border); background: rgba(88, 166, 255, 0.05); }
.lesson-summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 0.6rem; padding: 0.8rem 1.5rem; }
.lesson-summary::-webkit-details-marker { display: none; }
.lesson-summary::after { content: "\25BE"; color: var(--muted); }
.lesson:not([open]) .lesson-summary::after { content: "\25B8"; }
.lesson-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lesson-kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.lesson-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.lesson-body { padding: 0 1.5rem 1.1rem; font-size: 0.82rem; color: var(--muted); line-height: 1.65; }
.lesson-body p { margin: 0 0 0.6rem; }
.lesson-lead { color: var(--text); }
.lesson-body h4 { margin: 0.9rem 0 0.35rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.lesson-body ol, .lesson-body ul { margin: 0 0 0.5rem 1.2rem; }
.lesson-body li { margin-bottom: 0.2rem; }
.lesson-note { border-left: 3px solid var(--border); padding-left: 0.6rem; }
.lesson-body dt { color: var(--text); font-weight: 600; margin-top: 0.4rem; }
.lesson-body dd { margin: 0 0 0.1rem; }
.lesson-start { margin-top: 0.8rem; background: var(--accent); color: var(--bg); border: 0; border-radius: 6px; padding: 0.45rem 0.95rem; font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.lesson-start:hover, .lesson-start:focus-visible { filter: brightness(1.12); outline: none; }

.lesson-title { flex: 1; min-width: 0; }
.lesson-start-top { margin: 0 0 0 auto; padding: 0.2rem 0.6rem; font-size: 0.72rem; white-space: nowrap; flex: 0 0 auto; }
.lesson:not([open]) .lesson-start-top { display: none; }

/* Steps open in order: later steps stay locked until the earlier ones are done. */
.step-item.locked { opacity: 0.45; cursor: not-allowed; }
.step-item.locked .step-num { background: transparent; }
.continue-step { margin-top: 1rem; background: var(--accent); color: var(--bg); border: 0; border-radius: 6px; padding: 0.45rem 0.95rem; font: inherit; font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.continue-step:hover, .continue-step:focus-visible { filter: brightness(1.12); outline: none; }

/* NAV GROUPS: one entry per lab group, with the group's labs in a menu that opens on hover or keyboard focus.
   The entry itself is a real link to the group, so touch screens and anyone without hover still get there. */
.nav-links { align-items: center; }
.nav-group { position: relative; }
.nav-group > a { color: var(--muted); font-size: 0.875rem; }
.nav-group > a:hover { color: var(--text); text-decoration: none; }
.nav-group.active > a { color: var(--accent); }
.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -0.75rem;
  min-width: 11rem;
  padding: 0.4rem;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 200;
}
.nav-group:focus-within > .nav-menu { display: flex; }
@media (hover: hover) { .nav-group:hover > .nav-menu { display: flex; } }
.nav-menu a { padding: 0.35rem 0.65rem; border-radius: 6px; white-space: nowrap; font-size: 0.85rem; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--text); }
@media (max-width: 768px) {
  .nav-menu { display: none !important; }   /* phones: the entry links straight to the group */
}
