@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #060b16;
  --bg-2: #0b1324;
  --bg-3: #111c33;
  --border: #1b2a47;
  --border-hi: #2a3d63;
  --text: #e8edf5;
  --text-secondary: #94a3bd;
  --text-dim: #5d6d8a;
  --accent: #f15a22;
  --accent-hi: #ff7a45;
  --accent-dim: rgba(241, 90, 34, 0.12);
  --blue: #5fb3ff;
  --blue-dim: rgba(95, 179, 255, 0.1);
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --purple: #c4a7ff;
  --accent-purple: var(--purple);
  --accent-orange: var(--accent);
  --accent-red: var(--red);
  --accent-teal: var(--blue);
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 290px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.7; font-size: 16px; }
a { color: var(--blue); text-decoration-color: rgba(95, 179, 255, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }
::selection { background: var(--accent); color: #fff; }

.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(241, 90, 34, 0.13), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(95, 179, 255, 0.08), transparent 60%),
    radial-gradient(rgba(148, 163, 189, 0.07) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
}
.grid-bg::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
}

/* ---------- terminal window (shared) ---------- */
.term-window {
  background: rgba(11, 19, 36, 0.92); border: 1px solid var(--border-hi); border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(241, 90, 34, 0.06);
  overflow: hidden; backdrop-filter: blur(6px);
}
.term-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-3);
  border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: #3a4766; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; margin-right: auto; padding-right: 40px; }
.term-body { padding: 1.4rem 1.6rem; font-family: var(--mono); font-size: 0.95rem; line-height: 1.75; }
.ps1 { color: var(--green); }
.ps1 .path { color: var(--blue); }
.ok { color: var(--green); }
.warn-txt { color: var(--yellow); }
.dim { color: var(--text-dim); }
.orange { color: var(--accent); }

/* ---------- landing ---------- */
.landing-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.landing-term { width: min(820px, 100%); }
.landing-term .term-body { min-height: 430px; }
.boot-line { white-space: pre-wrap; }
.ascii-title {
  font-family: var(--mono); font-weight: 700; font-size: clamp(2.2rem, 6.5vw, 4.2rem); line-height: 1.05;
  margin: 1.2rem 0 0.4rem; letter-spacing: -0.03em; color: var(--text);
}
.ascii-title .hl {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(241, 90, 34, 0.45);
}
.landing-subtitle { color: var(--text-secondary); margin: 0 0 1.6rem; font-size: 0.95rem; }
.start-btn {
  font-family: var(--mono); font-weight: 600; display: inline-flex; gap: 0.6rem; align-items: center;
  padding: 0.75rem 1.4rem; background: var(--accent); color: #fff; text-decoration: none; border-radius: 6px;
  box-shadow: 0 8px 30px rgba(241, 90, 34, 0.35); transition: transform 0.15s, box-shadow 0.15s;
}
.start-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 36px rgba(241, 90, 34, 0.5); }
.start-btn kbd { font-family: var(--mono); font-size: 0.72rem; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 4px; padding: 0 0.35rem; }
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 0.5s, transform 0.5s; }
.reveal.show { opacity: 1; transform: none; }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; background: var(--accent); vertical-align: -0.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: rgba(8, 14, 27, 0.96); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 20; transition: transform 0.25s; font-family: var(--mono);
}
.sidebar-header { padding: 1.3rem 1.25rem 1rem; border-bottom: 1px solid var(--border); }
.sidebar-logo { text-decoration: none; display: block; }
.sidebar-logo .brand { color: var(--text); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }
.sidebar-logo .brand b { color: var(--accent); }
.sidebar-logo .sub { display: block; font-size: 0.72rem; color: var(--text-dim); margin-top: 0.2rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.9rem 0.6rem; font-size: 0.84rem; }
.tree-dir { color: var(--text-secondary); padding: 0.35rem 0.65rem; display: flex; gap: 0.5rem; align-items: center; }
.tree-dir::before { content: '▾'; color: var(--accent); font-size: 0.75rem; }
.sidebar-nav ul { list-style: none; margin: 0 0 0.6rem; padding: 0 0 0 0.9rem; border-left: 1px dashed var(--border-hi); margin-left: 0.95rem; }
.sidebar-nav a {
  display: flex; gap: 0.55rem; align-items: center; padding: 0.38rem 0.65rem; margin: 1px 0;
  color: var(--text-secondary); text-decoration: none; border-radius: 5px;
}
.sidebar-nav a .ext { color: var(--text-dim); }
.sidebar-nav a:hover { color: var(--text); background: var(--bg-3); }
.sidebar-nav a.active { color: #fff; background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar-nav a.active .ext { color: var(--accent-hi); }
.file-ico { width: 1rem; text-align: center; font-size: 0.72rem; color: var(--blue); }
.sidebar-nav a.active .file-ico { color: var(--accent); }
.statusline {
  display: flex; font-size: 0.72rem; border-top: 1px solid var(--border); background: var(--bg-3);
}
.statusline .mode { background: var(--accent); color: #fff; font-weight: 700; padding: 0.45rem 0.7rem; }
.statusline .file { padding: 0.45rem 0.7rem; color: var(--text-secondary); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.statusline .pos { padding: 0.45rem 0.7rem; color: var(--text); background: var(--border); }

.hamburger {
  display: none; position: fixed; top: 1rem; right: 1rem; z-index: 30; background: var(--bg-2);
  border: 1px solid var(--border-hi); color: var(--accent); font-size: 1.4rem; width: 44px; height: 44px; border-radius: 8px; cursor: pointer;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 15; }

.page-content { margin-left: var(--sidebar-w); padding: 3rem 4rem 5rem; max-width: calc(var(--sidebar-w) + 920px); width: 100%; }

/* ---------- typography ---------- */
.prompt-line {
  font-family: var(--mono); font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.9rem;
  display: inline-block; padding: 0.35rem 0.8rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
}
.page-content h1 {
  font-family: var(--mono); font-size: 2.3rem; font-weight: 700; margin: 0 0 0.6rem; letter-spacing: -0.02em; color: var(--text); line-height: 1.2;
}
.page-content h1 .num { color: var(--accent); }
.lead, .page-content h1 + p { color: var(--text-secondary); font-size: 1.12rem; margin-bottom: 2.5rem; max-width: 760px; }
.page-content h2 {
  font-family: var(--mono); font-size: 1.35rem; font-weight: 600; margin: 3.2rem 0 1rem; display: flex; align-items: center; gap: 0.75rem;
}
.page-content h2::before { content: ''; width: 18px; height: 3px; background: var(--accent); border-radius: 2px; flex: none; }
.page-content h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-hi), transparent); }
.page-content h3 { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.7rem; color: var(--blue); }
.page-content h3::before { content: '> '; color: var(--text-dim); }
.page-content h4 { font-family: var(--mono); font-size: 0.95rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.page-content p, .page-content li { color: #cdd5e3; }
code {
  font-family: var(--mono); font-size: 0.86em; background: var(--bg-3); border: 1px solid var(--border);
  padding: 0.1em 0.4em; border-radius: 4px; color: var(--accent-hi);
}
pre {
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.65; background: var(--bg-2); border: 1px solid var(--border);
  padding: 2.4rem 1.3rem 1.1rem; border-radius: 10px; overflow-x: auto; color: var(--text); position: relative;
}
pre::before {
  content: '● ● ●'; position: absolute; top: 0.55rem; left: 0.9rem; font-size: 0.55rem; letter-spacing: 0.15rem;
  color: var(--border-hi);
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.c { color: var(--text-dim); }
.k { color: var(--purple); }
.s { color: var(--green); }
.r { color: var(--red); }

.content-list { padding-left: 1.2rem; }
.content-list li { margin: 0.35rem 0; }
.content-list li::marker { color: var(--accent); }
.section-divider { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border-hi), transparent); margin: 2.8rem 0; }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1rem 0; font-size: 0.92rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th { font-family: var(--mono); text-align: left; color: var(--text); font-weight: 600; background: var(--bg-3); padding: 0.65rem 0.9rem; font-size: 0.82rem; }
td { border-top: 1px solid var(--border); padding: 0.65rem 0.9rem; color: #cdd5e3; vertical-align: top; background: rgba(11, 19, 36, 0.5); }

/* ---------- components ---------- */
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem 1.5rem; margin: 1rem 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.info-card {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.25rem;
}
.info-value { font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.info-label { color: var(--text-secondary); font-size: 0.88rem; }
.callout {
  border: 1px solid rgba(95, 179, 255, 0.25); background: var(--blue-dim); padding: 1rem 1.25rem; border-radius: 10px; margin: 1.5rem 0;
}
.callout.warn { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.06); }
.callout.danger { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.06); }
.callout strong:first-child { font-family: var(--mono); display: block; margin-bottom: 0.25rem; color: var(--blue); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.callout.warn strong:first-child { color: var(--yellow); }
.callout.danger strong:first-child { color: var(--red); }

details { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.5rem 0; color: #cdd5e3; }
details summary { cursor: pointer; font-family: var(--mono); font-size: 0.88rem; color: var(--text); }
details summary::marker { color: var(--accent); }
details[open] summary { margin-bottom: 0.5rem; }

/* whoami terminal */
.whoami-term .term-body { font-size: 0.92rem; }
.whoami-term .cmd { margin-top: 1.1rem; }
.whoami-term .cmd:first-child { margin-top: 0; }
.whoami-term .out { color: #cdd5e3; font-family: var(--sans); font-size: 0.98rem; padding-left: 1.1rem; border-left: 2px solid var(--border-hi); margin: 0.35rem 0 0 0.2rem; }
.whoami-term .out.name { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--text); border-left-color: var(--accent); }
.whoami-term .out.name span { color: var(--accent); font-size: 1rem; font-weight: 500; }
.whoami-term .out ul { margin: 0; padding-left: 1rem; }
.whoami-term .out li::marker { content: '→ '; color: var(--accent); }
.cert-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cert {
  font-family: var(--mono); font-size: 0.85rem; padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid rgba(241, 90, 34, 0.45); color: var(--text); background: var(--accent-dim);
}
.cert small { color: var(--text-dim); margin-left: 0.35rem; }
.placeholder { color: var(--yellow); font-style: italic; }

/* labs */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.lab-card {
  display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.2rem 1.3rem; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden;
}
.lab-card::after {
  content: '↗'; position: absolute; top: 1rem; right: 1.1rem; font-family: var(--mono); color: var(--text-dim); transition: color 0.2s;
}
.lab-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 40px rgba(241, 90, 34, 0.15); }
.lab-card:hover::after { color: var(--accent); }
.lab-number { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); }
.lab-title { font-family: var(--mono); font-size: 1.15rem; font-weight: 600; color: var(--text); }
.lab-desc { color: var(--text-secondary); font-size: 0.92rem; }
.lab-tag {
  align-self: flex-start; font-family: var(--mono); font-size: 0.7rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent-hi); border: 1px solid rgba(241, 90, 34, 0.3);
}
.lab-tag.blue { background: var(--blue-dim); color: var(--blue); border-color: rgba(95, 179, 255, 0.3); }
.lab-tag.green { background: rgba(74, 222, 128, 0.08); color: var(--green); border-color: rgba(74, 222, 128, 0.3); }
.lab-tag.purple { background: rgba(196, 167, 255, 0.08); color: var(--purple); border-color: rgba(196, 167, 255, 0.3); }

.next-section {
  display: flex; justify-content: space-between; align-items: center; margin-top: 4rem; padding: 1rem 1.3rem;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-family: var(--mono); color: var(--text); transition: all 0.2s;
}
.next-section::before { content: '$ cd'; color: var(--green); margin-right: 0.75rem; }
.next-section span { color: var(--accent); font-size: 1.2rem; margin-left: auto; }
.next-section:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

/* methodology */
.methodology-checklist { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: step; position: relative; }
.methodology-checklist::before { content: ''; position: absolute; left: 1.05rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: linear-gradient(var(--accent), var(--blue)); opacity: 0.5; }
.methodology-checklist li { counter-increment: step; position: relative; padding: 0.2rem 0 1.4rem 3.3rem; }
.methodology-checklist li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 0.9rem;
  background: var(--bg); border: 2px solid var(--accent); color: var(--accent);
}
.methodology-checklist strong { color: var(--text); display: block; font-family: var(--mono); font-size: 1rem; }
.two-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.3rem; }
.panel-header { font-family: var(--mono); font-weight: 600; margin-bottom: 0.4rem; }
.resource-list a { color: var(--blue); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hamburger { display: block; }
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-overlay { display: block; }
  .page-content { margin-left: 0; padding: 4.5rem 1.4rem 4rem; }
  .two-panel { grid-template-columns: 1fr; }
  .term-body { padding: 1.1rem; font-size: 0.85rem; }
}
