/* ==========================================================================
   DevOps Hub — Design System
   Palette: graphite/panel base, signal amber + glow cyan accents
   Type: IBM Plex Mono (display/code), IBM Plex Sans (body)
   ========================================================================== */

:root {
  --graphite: #14171c;
  --panel: #1b2027;
  --panel-hi: #232a33;
  --hairline: #2b313b;
  --hairline-bright: #3a4250;
  --fog: #8b93a1;
  --fog-dim: #5c6472;
  --paper: #e8ecf1;
  --paper-bright: #f6f8fa;
  --signal: #ffb454;
  --signal-dim: #c98f42;
  --glow: #5fd4d0;
  --glow-dim: #3fa19e;
  --danger: #f2726d;
  --ok: #8ddb8c;

  --gridline: rgba(255,255,255,0.015);
  --shadow: rgba(0,0,0,0.6);
  --selection-fg: var(--graphite);

  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;

  --radius: 3px;
  --maxw: 1160px;
}

/* ---- Light theme : professional, cool-toned, not the cream/serif default ----
   Same hues as dark (amber signal, teal glow) recalibrated for AA contrast
   on a white surface, so the brand reads identically in either mode. */
html[data-theme="light"] {
  --graphite: #f4f5f7;
  --panel: #ffffff;
  --panel-hi: #edeff2;
  --hairline: #dde1e7;
  --hairline-bright: #c7cdd6;
  --fog: #565f6c;
  --fog-dim: #838d99;
  --paper: #1b2027;
  --paper-bright: #0c0f13;
  --signal: #a15c00;
  --signal-dim: #7a4600;
  --glow: #0d7d78;
  --glow-dim: #0a615d;
  --danger: #c2463f;
  --ok: #21823f;
  --gridline: rgba(10,14,20,0.035);
  --shadow: rgba(20,25,32,0.12);
  --selection-fg: #ffffff;
}
html[data-theme="light"] .btn-solid { color: #fff; }
html[data-theme="light"] .btn-solid:hover { background: #8a4f00; border-color: #8a4f00; }
html[data-theme="light"] .term { box-shadow: 0 16px 40px -18px var(--shadow); }
html[data-theme="light"] .topbar { background: rgba(244,245,247,0.9); }
html[data-theme="light"] .tc-ext,
html[data-theme="light"] .badge-ext { background: rgba(13,125,120,0.08); }
html[data-theme="light"] .notice { background: rgba(161,92,0,0.06); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--graphite);
  background-image:
    linear-gradient(180deg, var(--gridline) 1px, transparent 1px);
  background-size: 100% 34px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--signal); color: var(--selection-fg); }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- Topbar : tab-bar / multiplexer chrome ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 23, 28, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--paper-bright);
  white-space: nowrap;
}

.brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  flex: none;
}

.brand .prompt { color: var(--signal); }

.topnav {
  display: flex;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
}

.topnav a {
  text-decoration: none;
  color: var(--fog);
  padding: 8px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--paper-bright); background: var(--panel); }
.topnav a.active { color: var(--signal); }

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--hairline-bright);
  color: var(--fog);
  padding: 6px 11px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .15s;
}
.theme-toggle:hover { color: var(--paper-bright); border-color: var(--signal); }
.theme-toggle .ico { font-size: 13px; line-height: 1; }

/* ---- Hero ---- */

.hero {
  padding: 76px 0 64px;
  border-bottom: 1px solid var(--hairline);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glow);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--glow-dim);
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: var(--paper-bright);
  font-weight: 600;
}
.hero h1 .accent { color: var(--signal); }

.hero p.lead {
  font-size: 17px;
  color: var(--fog);
  max-width: 46ch;
  margin: 0 0 30px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-bright);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, transform .15s, background .15s;
}
.btn:hover { border-color: var(--signal); transform: translateY(-1px); }
.btn-solid {
  background: var(--signal);
  color: var(--graphite);
  border-color: var(--signal);
  font-weight: 600;
}
.btn-solid:hover { background: #ffc678; border-color: #ffc678; }

/* ---- Terminal window chrome (signature element) ---- */

.term {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-hi);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fog-dim);
}
.term-bar .lights { display: flex; gap: 6px; margin-right: 4px; }
.term-bar .lights span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--hairline-bright);
}
.term-bar .lights span:nth-child(1) { background: #4a5162; }
.term-bar .lights span:nth-child(2) { background: #4a5162; }
.term-bar .lights span:nth-child(3) { background: #4a5162; }
.term-title { flex: 1; text-align: left; }

.term-body {
  padding: 20px 18px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.85;
  min-height: 230px;
  color: var(--paper);
}
.term-body .p { color: var(--glow); }
.term-body .out { color: var(--fog); display: block; }
.term-body .ok { color: var(--ok); }
.term-body .comment { color: var(--fog-dim); }
.term-cursor {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--signal);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Section headers ---- */

.section { padding: 68px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--paper-bright);
  margin: 0;
  font-weight: 600;
}
.section-head .sub { color: var(--fog); font-size: 14px; max-width: 40ch; }

/* ---- Filter chips ---- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

.tools-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 20px;
}
.search-box {
  position: relative;
  flex: 0 1 280px;
  min-width: 220px;
}
.search-box input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 9px 12px 9px 30px;
  outline: none;
  transition: border-color .15s;
}
.search-box input:focus { border-color: var(--signal); }
.search-box input::placeholder { color: var(--fog-dim); }
.search-box .sk {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fog-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  pointer-events: none;
}
.no-results {
  display: none;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fog-dim);
  padding: 30px 0;
  text-align: center;
  border: 1px dashed var(--hairline);
  border-radius: 6px;
}
.no-results.show { display: block; }
.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--fog);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--hairline-bright); color: var(--paper); }
.chip.active { background: var(--signal); border-color: var(--signal); color: var(--graphite); font-weight: 600; }

/* ---- Tool grid / cards (mini terminal windows) ---- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  text-decoration: none;
  color: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--signal-dim); transform: translateY(-2px); }

.tool-card .tc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--panel-hi);
}
.tc-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper-bright);
}
.tc-status { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--fog-dim); text-transform: uppercase; letter-spacing: .06em; }
.tc-status .d { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.tool-card .tc-body { padding: 16px 14px; flex: 1; }
.tc-desc { font-size: 13.5px; color: var(--fog); margin: 0 0 14px; line-height: 1.55; }

.tc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-ext {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(95, 212, 208, 0.1);
  color: var(--glow);
  border: 1px solid rgba(95, 212, 208, 0.25);
}
.tc-cat { font-family: var(--font-mono); font-size: 11px; color: var(--fog-dim); }

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fog-dim);
}
.footer-row a { color: var(--fog); text-decoration: none; }
.footer-row a:hover { color: var(--signal); }

/* ---- Tool detail page ---- */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fog-dim);
  padding: 20px 0 0;
}
.breadcrumb a { text-decoration: none; color: var(--fog); }
.breadcrumb a:hover { color: var(--signal); }

.page-head { padding: 22px 0 36px; border-bottom: 1px solid var(--hairline); }
.page-head-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 42px);
  margin: 0;
  color: var(--paper-bright);
  font-weight: 600;
}
.badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline-bright);
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-ext { color: var(--glow); border-color: rgba(95,212,208,.3); background: rgba(95,212,208,.08); }
.page-head .lead { color: var(--fog); font-size: 16px; max-width: 68ch; margin: 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  padding: 44px 0;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: 76px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-left: 1px solid var(--hairline);
  padding-left: 16px;
}
.side-nav a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  color: var(--fog);
}
.side-nav a:hover { color: var(--signal); }
.side-nav .snlabel { color: var(--fog-dim); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; margin: 18px 0 6px; }
.side-nav .snlabel:first-child { margin-top: 0; }

.dsection { margin-bottom: 48px; scroll-margin-top: 76px; }
.dsection h2 {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--paper-bright);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.dsection h2 .num { color: var(--signal-dim); font-size: 15px; }
.dsection p { color: var(--fog); font-size: 15px; max-width: 72ch; }

/* OS tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline); margin-bottom: 0; }
.tab-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: none;
  border: none;
  color: var(--fog);
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tab-btn:hover { color: var(--paper); }
.tab-btn.active { color: var(--signal); border-bottom-color: var(--signal); }
.tab-panels { border: 1px solid var(--hairline); border-top: none; border-radius: 0 0 6px 6px; overflow: hidden; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Code blocks */
.code-block {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}
.tab-panels .code-block { border: none; border-radius: 0; }
.code-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--panel-hi);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fog-dim);
}
.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--hairline-bright);
  color: var(--fog);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { color: var(--signal); border-color: var(--signal); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

pre.code {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--paper);
  overflow-x: auto;
}
pre.code .c1 { color: var(--fog-dim); }
pre.code .s1 { color: var(--glow); }

/* Cheatsheet table */
.cheat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cheat-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fog-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-bright);
}
.cheat-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--fog);
  vertical-align: top;
}
.cheat-table td:first-child {
  font-family: var(--font-mono);
  color: var(--paper-bright);
  white-space: nowrap;
}
.cheat-table tr:hover td { background: rgba(255,255,255,0.015); }

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 20px 22px;
}
.download-card .dl-name { font-family: var(--font-mono); color: var(--paper-bright); font-size: 14.5px; margin-bottom: 4px; }
.download-card .dl-desc { font-size: 13px; color: var(--fog); }

.notice {
  border-left: 2px solid var(--signal);
  background: rgba(255,180,84,0.06);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--fog);
  border-radius: 0 4px 4px 0;
  margin-top: 14px;
}
.notice strong { color: var(--signal); }

.docs-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--glow);
  text-decoration: none;
}
.docs-link:hover { text-decoration: underline; }

/* Category strip on homepage */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 40px;
}
.stat-cell {
  padding: 18px 20px;
  border-right: 1px solid var(--hairline);
}
.stat-cell:last-child { border-right: none; }
.stat-num { font-family: var(--font-mono); font-size: 26px; color: var(--signal); font-weight: 600; }
.stat-label { font-family: var(--font-mono); font-size: 11px; color: var(--fog-dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* Mobile */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .detail-grid { grid-template-columns: 1fr; }
  .side-nav { position: static; border-left: none; padding-left: 0; border-top: 1px solid var(--hairline); padding-top: 16px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(2) { border-right: none; }
  .topnav { display: none; }
  .topnav.open { display: flex; position: absolute; top: 56px; left: 0; right: 0; background: var(--graphite); border-bottom: 1px solid var(--hairline); flex-direction: column; padding: 8px; }
  .nav-toggle { display: block !important; }
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline-bright);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}
