/* FSS Documentation — bd.rodnoy.site
   Style: editorial-technical, dark accent, content-first */

:root {
  --bg: #0c1118;
  --bg-elevated: #131a24;
  --bg-soft: #1a2330;
  --border: #243140;
  --text: #e6edf3;
  --text-muted: #8b9bab;
  --text-dim: #5d6b7a;
  --accent: #6ee7ff;
  --accent-soft: rgba(110, 231, 255, 0.12);
  --accent-warm: #ffb86b;
  --code-bg: #0a0e14;
  --good: #6effa3;
  --warn: #ffd166;
  --bad: #ff6b8a;
  --max-width: 1280px;
  --content-width: 760px;
  --sidebar-width: 280px;
  --radius: 8px;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif Pro", "Source Serif 4", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 32px 96px;
  width: 100%;
}

/* === SIDEBAR === */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--bg);
  font-size: 18px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-tag { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.search-wrap {
  position: relative;
  margin-bottom: 24px;
}
.search-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px 9px 34px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
.search-input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.search-results.visible { display: block; }
.search-result {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: background 0.1s;
}
.search-result:hover { background: var(--bg-soft); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; margin-bottom: 2px; }
.search-result-snippet { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.search-result em { color: var(--accent); font-style: normal; }
.search-empty { padding: 14px; color: var(--text-muted); font-size: 13px; text-align: center; }

.nav-section { margin-bottom: 22px; }
.nav-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding-left: 10px;
}
.nav-list { list-style: none; }
.nav-item a {
  display: block;
  padding: 7px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 6px;
  transition: all 0.12s;
  border-left: 2px solid transparent;
}
.nav-item a:hover { color: var(--text); background: var(--bg-soft); }
.nav-item a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.sidebar-footer a { color: var(--text-muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--accent); }

/* === CONTENT === */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
h1 {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 600;
}
h2 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  color: var(--text);
  font-weight: 600;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
h3 {
  font-size: 19px;
  margin: 32px 0 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.005em;
}
h4 { font-size: 15px; margin: 24px 0 8px; color: var(--accent); font-weight: 600; }

p { margin-bottom: 16px; color: var(--text); }
p.lead { font-size: 18px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.55; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.1s; }
a:hover { border-bottom-color: var(--accent); }

strong { color: var(--text); font-weight: 600; }
em { color: var(--accent-warm); font-style: italic; }

ul, ol { margin: 12px 0 20px 22px; }
li { margin-bottom: 6px; color: var(--text); }
li::marker { color: var(--text-dim); }

/* === CODE === */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-warm);
  border: 1px solid var(--border);
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 18px 0 24px;
  font-size: 13px;
  line-height: 1.6;
}
pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text);
  font-size: inherit;
}

/* === BLOCKS === */
blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text);
}
blockquote p { margin-bottom: 0; }

.callout {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
}
.callout-warn { border-left-color: var(--warn); }
.callout-good { border-left-color: var(--good); }
.callout-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: var(--accent);
}
.callout-warn .callout-title { color: var(--warn); }
.callout-good .callout-title { color: var(--good); }

/* === TABLE === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
th {
  background: var(--bg-soft);
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-soft); }

/* === HERO === */
.hero {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 32px 48px;
  text-align: center;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 { font-size: 52px; max-width: 800px; margin: 0 auto 20px; }
.hero p.lead { max-width: 640px; margin: 0 auto 28px; }
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: #8af0ff; border-bottom-color: transparent; transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); border-bottom-color: var(--accent); }

/* === STATS === */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* === PRINCIPLES GRID === */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.principle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s;
}
.principle:hover { border-color: var(--accent); }
.principle-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
}
.principle-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.principle-body { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

/* === PHASES === */
.phase {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  border-left: 4px solid var(--accent);
}
.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.phase-num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.phase-title { font-size: 20px; font-weight: 600; margin: 4px 0; }
.phase-duration {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 4px;
}
.phase-goal {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.phase h4 { margin-top: 16px; }

/* === STACK LIST === */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.stack-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13.5px;
}
.stack-item strong { display: block; color: var(--accent); font-family: var(--mono); font-size: 12px; margin-bottom: 4px; }

/* === MISC === */
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.meta {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg-soft);
  color: var(--text-muted);
  margin-right: 4px;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-warn { background: rgba(255, 209, 102, 0.15); color: var(--warn); }
.tag-good { background: rgba(110, 255, 163, 0.12); color: var(--good); }

/* === RESPONSIVE === */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .stats, .principles, .stack-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .content { padding: 32px 20px 64px; }
}

/* === SEARCH PAGE === */
.search-page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.search-page-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 16px;
  font-family: var(--sans);
  margin-bottom: 24px;
}
.search-page-input:focus { outline: none; border-color: var(--accent); }
.search-page-results { list-style: none; margin: 0; }
.search-page-result {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.search-page-result a { color: var(--text); font-weight: 600; font-size: 16px; border-bottom: none; }
.search-page-result a:hover { color: var(--accent); }
.search-page-result-snippet { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.search-page-result em { color: var(--accent); font-style: normal; background: var(--accent-soft); padding: 0 2px; }

/* Print-friendly */
@media print {
  .sidebar, .hero-actions { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { background: white; color: black; }
}
