/* ShellLab styles
   Light, low-glare theme: soft warm-gray page, off-white cards, Texas A&M maroon accents.
   The practice terminal stays dark (soft charcoal) so it still reads as a terminal.
   Type: JetBrains Mono for headings and commands, system sans for reading text. */

:root {
  --page:     #e8e3df;   /* page background */
  --surface:  #f7f4f2;   /* cards, header, footer */
  --line:     #cdc3bd;   /* borders and dividers */
  --tint:     #ddd4ce;   /* code backgrounds, hover states */
  --text:     #241c1d;
  --muted:    #51463f;   /* secondary text */
  --maroon:   #500000;   /* primary buttons, strong accents (Texas A&M maroon) */
  --link:     #7a1f24;   /* links, headings marks, active states */
  --select:   #e9cdc8;   /* selected quiz answer */
  --term-bg:  #2a2224;   /* terminal surfaces */
  --term-bar: #382d2f;
  --term-txt: #f3ece8;
  --term-mut: #bcaea8;
  --amber:    #f0b35a;   /* prompt color on the dark terminal */
  --ok:       #1f7a4d;
  --bad:      #b3261e;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
}
::selection { background: var(--select); }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 32px; padding-bottom: 56px; min-height: 70vh; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--maroon); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--maroon); color: #fff; padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--mono); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 800; letter-spacing: -0.02em; color: var(--maroon); }
h2 { font-size: 1.35rem; font-weight: 600; }
h2::before { content: "# "; color: var(--link); opacity: .6; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.15rem; color: #382f2d; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
strong { font-weight: 600; }

code { font-family: var(--mono); font-size: .88em; background: var(--tint); padding: .1em .35em; border-radius: 3px; overflow-wrap: anywhere; }
pre { margin: 0; overflow-x: auto; }
pre code { background: none; padding: 0; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 16px; }
.brand { font-family: var(--mono); font-weight: 800; font-size: 1.15rem; color: var(--maroon); text-decoration: none; }
.prompt { color: var(--link); font-family: var(--mono); }
.cursor { color: var(--link); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; gap: 4px; }
.nav a { font-family: var(--mono); font-size: .9rem; color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 4px; }
.nav a:hover { color: var(--text); background: var(--tint); }
.nav a.active { color: var(--maroon); box-shadow: inset 0 -2px 0 var(--maroon); border-radius: 4px 4px 0 0; }

.nav-toggle { display: none; font: 600 .9rem var(--mono); color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; cursor: pointer; }

/* ---------- Buttons and forms ---------- */
.btn, .copy { font-family: var(--mono); font-weight: 600; cursor: pointer; }
.btn { display: inline-block; font-size: .95rem; text-decoration: none; color: var(--maroon); background: transparent; border: 1px solid var(--maroon); border-radius: 4px; padding: 10px 18px; }
.btn:hover { background: var(--tint); color: var(--maroon); }
.btn.primary { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.btn.primary:hover { background: #6b1d1d; color: #fff; }

.field { margin-bottom: 16px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; font: 1rem var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid #b3a8a2; border-radius: 4px; padding: 10px 12px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #766a65; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 24px 0 12px; }
.filters .field { margin: 0; flex: 1 1 220px; }
.filters .btn { height: 44px; }

.flash { border: 1px solid #c98a2b; background: #fdf3e3; padding: 12px 16px; border-radius: 6px; margin-bottom: 24px; }
.flash ul { margin: 0; padding-left: 1.2em; }
.flash-error { border-color: var(--bad); background: #fdecea; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; padding: 12px 0 40px; }
.typed-line { font-family: var(--mono); font-size: .95rem; min-height: 1.6em; margin-bottom: 1.4em; overflow-wrap: anywhere; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.term { background: var(--term-bg); border: 1px solid #1d1718; border-radius: 10px; overflow: hidden; font-family: var(--mono); font-size: .9rem; color: var(--term-txt); box-shadow: 0 14px 34px rgba(43, 35, 36, .2); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--term-bar); border-bottom: 1px solid #1d1718; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--term-mut); opacity: .7; }
.term-title { margin-left: 8px; color: var(--term-mut); font-size: .8rem; }
.term-body { height: 280px; overflow-y: auto; padding: 14px; }
.term-body > div { margin-bottom: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .muted { color: var(--term-mut); }
.term .prompt { color: var(--amber); }
.term-body .cmdline .prompt { margin-right: 8px; }
.term-in { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid #1d1718; }
.term-in label { margin: 0; color: var(--amber); white-space: nowrap; font-size: .9rem; }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 4px 0; color: var(--term-txt); font: inherit; caret-color: var(--amber); }
.term-in input:focus-visible { outline: none; }
.term:focus-within { border-color: var(--amber); }

/* ---------- Sections and cards ---------- */
.section { margin-top: 44px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile, .card, .cmd-card, .post, .q-review { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
.tile { display: block; color: var(--text); text-decoration: none; }
a.tile:hover { border-color: var(--link); background: #fbf9f8; }
.tile p { margin: 0; color: var(--muted); }
.tile h3 { color: var(--link); }

.cat { margin-top: 36px; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cmd-card h3 { margin: 0; }
.cmd-card h3 code { background: none; padding: 0; font-size: 1.15rem; color: var(--link); }
.cmd-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.cmd-card p { margin-bottom: .7em; }
.cmd-card .syntax { margin-bottom: 12px; }
.cotd { border-color: var(--link); max-width: 720px; }

.badge { display: inline-block; font-family: var(--mono); font-size: .75rem; color: #5a1a1a; background: var(--select); padding: 2px 10px; border-radius: 999px; }
.badge code { background: none; padding: 0; color: #5a1a1a; }

.codeline { display: flex; align-items: center; gap: 10px; background: var(--tint); border-left: 3px solid var(--link); border-radius: 0 4px 4px 0; padding: 8px 8px 8px 12px; }
.codeline code { flex: 1; background: none; padding: 0; font-size: .85rem; }
.copy { font-size: .75rem; color: #fff; background: var(--maroon); border: 0; border-radius: 4px; padding: 6px 10px; flex: none; }
.copy:hover { background: #6b1d1d; }

.codeblock { position: relative; background: var(--tint); border-left: 3px solid var(--link); border-radius: 0 6px 6px 0; padding: 16px 18px; max-width: 760px; margin-bottom: 10px; }
.codeblock .copy { position: absolute; top: 10px; right: 10px; }
.codeblock pre { padding-right: 70px; }

.steps { padding-left: 1.3em; max-width: 68ch; }
.steps li { margin-bottom: .8em; }
ul.plain { max-width: 68ch; padding-left: 1.2em; }
ul.plain li { margin-bottom: .5em; }

.empty { border: 1px dashed #b3a8a2; border-radius: 6px; padding: 18px 20px; margin-top: 20px; }

/* ---------- Quiz, board ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 20px; }
.q { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px 10px; margin: 0 0 18px; background: var(--surface); }
.q legend { font-family: var(--mono); font-weight: 600; padding: 0 8px; font-size: .98rem; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; margin: 0 0 4px; color: var(--text); font-family: var(--sans); font-size: 1rem; }
.opt:hover { background: var(--tint); }
.opt input { margin-top: 5px; accent-color: var(--maroon); }
.opt:has(input:checked) { background: var(--select); }

.q-review { margin-bottom: 14px; border-left-width: 4px; }
.q-review.right { border-left-color: var(--ok); }
.q-review.wrong { border-left-color: var(--bad); }
.q-review h3 { margin-bottom: .5em; }
.q-review p { margin-bottom: .4em; }
.result h2::before { content: ""; }

.board h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-weight: 600; }
.specs { max-width: 760px; }
.specs th { width: 170px; vertical-align: top; }

.form { padding: 20px; }
.post { margin-bottom: 14px; }
.post header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.post p { margin: 0; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .9rem; color: var(--muted); }
.site-footer p { margin: 0 0 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .grid3 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 14px; }
  .nav.open { display: flex; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--maroon); border-radius: 0 4px 4px 0; }
  .cmd-grid { grid-template-columns: 1fr; }
  .term-body { height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
.q { min-width: 0; padding-top: 16px; }
.q legend { float: left; width: 100%; padding: 0 0 12px; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.q legend + * { clear: both; }
