/* Mission FinOps — Terminal-inspired design system
   Monospace. Dark. Green accent. Shell metaphors.
   Restrained enough for enterprise, distinctive enough to remember. */

:root {
  --bg: #0a0a0a;
  --bg-panel: #0f110f;
  --bg-card: #131613;
  --border: #1f2b1f;
  --border-bright: #2a3d2a;
  --text: #d4d4d4;
  --text-bright: #f0f0f0;
  --text-muted: #6b6b6b;
  --green: #33ff00;
  --green-dim: #1a8a00;
  --green-glow: rgba(51, 255, 0, 0.08);
  --green-border: rgba(51, 255, 0, 0.15);
  --amber: #ffb000;
  --red: #ff3333;
  --mono: "IBM Plex Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 960px;
  --radius: 0px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: #b49aed; text-decoration: none; }
a:hover { color: #d4c0ff; text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
::selection { background: rgba(51, 255, 0, 0.2); color: var(--text-bright); }
:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }

/* ═══════ SKIP LINK ═══════ */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--green); color: var(--bg); padding: 8px 14px;
  font-size: 12px; font-weight: 700;
}
.skip-link:focus { left: 0; top: 0; }

/* ═══════ HEADER ═══════ */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-bottom: 1px solid var(--border);
}
.header-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand {
  color: var(--green);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.place {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--green); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--green); }

/* ═══════ HERO — Baker mountain subtle strip ═══════ */
.hero-strip {
  position: relative;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-strip::before {
  content: "";
  position: absolute; inset: 0;
  background: url('hero-banner-photo.jpg') center 38%/cover no-repeat;
  filter: brightness(0.3) saturate(0.4);
}
.hero-strip::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 30%, transparent 70%, var(--bg) 100%);
}

/* ═══════ MAIN ═══════ */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══════ DOCUMENT LAYOUTS ═══════ */
.document { padding: 48px 0 72px; }
.document-wide { padding: 48px 0 72px; }

/* ═══════ PROMPT — shell-style section label ═══════ */
.prompt {
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.prompt::before { content: "$ "; opacity: 0.5; }

/* ═══════ DOCUMENT META (compat with existing pages) ═══════ */
.document-meta {
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ═══════ TYPOGRAPHY ═══════ */
h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.3;
  margin-bottom: 20px;
}
h2 {
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.35;
  margin-bottom: 14px;
}
h3 {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 8px;
}
p { margin: 0 0 16px; }
.intro {
  font-size: 16px;
  color: var(--text-bright);
  line-height: 1.7;
  max-width: 64ch;
}

/* ═══════ PANEL — terminal pane ═══════ */
.panel {
  margin: 24px 0;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.panel-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header .status {
  color: var(--green);
  font-size: 10px;
}
.panel-body {
  padding: 20px;
}

/* ═══════ PLAIN ENGLISH ═══════ */
.plain-english {
  margin: 24px 0;
  padding: 20px;
  border-left: 2px solid var(--green);
  background: var(--green-glow);
}
.plain-english p { color: var(--text-bright); margin-bottom: 10px; }
.plain-english p:last-child { margin-bottom: 0; }

/* ═══════ INLINE LINKS ═══════ */
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 20px 0;
  font-size: 13px;
}

/* ═══════ SECTIONS ═══════ */
.rule-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

/* ═══════ PRINCIPLE / BLOCKQUOTE ═══════ */
.principle {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
}
.principle blockquote {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  font-style: normal;
}
.principle footer {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════ MARGIN NOTE ═══════ */
.margin-note {
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px dashed var(--border-bright);
  background: var(--bg-panel);
  font-size: 14px;
  color: var(--text);
}
.margin-note strong { color: var(--green); }

/* ═══════ WORK NOTES (grid) ═══════ */
.work-notes {
  margin: 20px 0 0;
}
.work-note {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.work-note:first-child { border-top: 1px solid var(--border); }
.work-note dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-top: 2px;
}
.work-note dd { margin: 0; }
.work-note dd p { margin-bottom: 0; font-size: 14px; }

/* ═══════ TERMINAL BLOCK ═══════ */
.terminal {
  margin: 24px 0;
  border: 1px solid var(--border-bright);
  background: #050705;
  overflow-x: auto;
}
.terminal pre {
  margin: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--green);
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 4px rgba(51, 255, 0, 0.3);
}

/* ═══════ CONTACT BLOCK ═══════ */
.contact-block {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--green-border);
  background: var(--green-glow);
}
.contact-block p { margin-bottom: 6px; font-size: 14px; color: var(--text-bright); }
.contact-block a { font-weight: 600; }

/* ═══════ INDEX LIST ═══════ */
.index-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.index-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.index-list li:first-child { border-top: 1px solid var(--border); }

/* ═══════ ARTICLE LIST ═══════ */
.article-list { margin: 24px 0 0; }
.article-item {
  display: block;
  padding: 14px 16px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-decoration: none;
  transition: border-color 0.1s;
}
.article-item:hover { border-color: var(--green-border); text-decoration: none; }
.article-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 2px;
}
.article-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════ BIO LINE ═══════ */
.bio-line {
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-bright);
}

/* ═══════ SMALL ═══════ */
.small { font-size: 12px; color: var(--text-muted); }

/* ═══════ FOOTER ═══════ */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--green); }
.footer-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer-line p { margin: 0; }

/* ═══════ CTA HIGHLIGHT ═══════ */
.cta-blink {
  color: #c084fc;
  font-weight: 700;
  animation: blink-cta 1.2s step-end infinite;
}
@keyframes blink-cta {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.cta-blink:hover {
  animation: none;
  opacity: 1;
  text-decoration: underline;
}

/* ═══════ CLI EFFECTS ═══════ */

/* Blinking cursor after prompts */
.prompt::after {
  content: "█";
  color: var(--green);
  animation: cursor-blink 1s step-end infinite;
  margin-left: 6px;
  font-weight: 400;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Status indicators */
.status-ok { color: var(--green); }
.status-ok::before { content: "✓ "; }
.status-warn { color: var(--amber); }
.status-warn::before { content: "⚠ "; }
.status-err { color: #ff3333; }
.status-err::before { content: "✗ "; }

/* Tag/badge — like [NEW] or [LIVE] in a CLI */
.cli-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--green-border);
  color: var(--green);
  vertical-align: middle;
  margin-left: 8px;
}
.cli-tag--amber {
  border-color: rgba(255, 176, 0, 0.3);
  color: var(--amber);
}
.cli-tag--purple {
  border-color: rgba(192, 132, 252, 0.3);
  color: #c084fc;
}

/* Typing animation for hero headline */
.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--green);
  animation: typing 2.8s steps(60, end), blink-border 0.8s step-end infinite 2.8s;
  max-width: fit-content;
}
@keyframes typing {
  from { max-width: 0; }
  to { max-width: 100%; }
}
@keyframes blink-border {
  0%, 100% { border-color: var(--green); }
  50% { border-color: transparent; }
}

/* Scanline overlay — very subtle */
.scanlines::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
}

/* Highlighted text — like grep match */
.cli-match {
  background: rgba(51, 255, 0, 0.12);
  color: var(--green);
  padding: 1px 4px;
  border-radius: 0;
}

/* Progress bar style for inline stats */
.cli-bar {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0;
}
.cli-bar-fill { color: var(--green); }
.cli-bar-empty { color: var(--border); }

/* Pipe separator for inline items */
.pipe { color: var(--border-bright); margin: 0 8px; }
.pipe::before { content: "|"; }

/* Panel grid: 5-panel cross layout — 3-column, center spans rows */
.diagram {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  margin: 32px 0;
  border: 1px solid var(--border-bright);
  background: var(--border-bright);
}
.diagram-quad {
  padding: 22px 18px;
  background: var(--bg-panel);
}
.diagram-quad h3 { font-size: 14px; margin-bottom: 6px; }
.offer-stack .diagram-quad h2 { font-size: 14px; margin-bottom: 6px; }
.diagram-quad p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.diagram-quad .dt-label {
  font-size: 10px;
  color: var(--green);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 10px;
  margin-bottom: 2px;
}
.diagram-quad .dt-value {
  font-size: 12px;
  color: var(--text);
}
.diagram-quad .quad-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Center column — spans both rows */
.diagram-center {
  grid-column: 2;
  grid-row: 1 / -1;
  background: var(--bg);
  border-left: 1px solid var(--green-border);
  border-right: 1px solid var(--green-border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.diagram-center h3 {
  color: var(--green);
  font-size: 16px;
  margin-bottom: 10px;
}
.diagram-center p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  max-width: 28ch;
}
.diagram-center .center-muted {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.diagram-center .center-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #c084fc;
  margin-bottom: 12px;
}
.diagram-center .center-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.diagram-center .center-links a {
  padding: 6px 12px;
  border: 1px solid var(--border-bright);
  text-decoration: none;
  transition: border-color 0.1s;
}
.diagram-center .center-links a:hover {
  border-color: var(--green);
}
.diagram-center .center-links .cta-primary {
  border-color: var(--green-border);
  color: var(--green);
}

@media (max-width: 768px) {
  .diagram {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .diagram-center {
    grid-column: 1;
    grid-row: auto;
    order: -1;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--green-border);
  }
}

/* Offer stack: single-column vertical layout for sequential offer blocks */
.offer-stack {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: 1px;
  margin: 32px 0;
  border: 1px solid var(--border-bright);
  background: var(--border-bright);
}

/* ═══════ TUI ELEMENTS ═══════ */

/* Active panel glow border (lazygit-inspired) */
.panel-active {
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(51, 255, 0, 0.08), inset 0 0 8px rgba(51, 255, 0, 0.03);
}
.panel-active .panel-header {
  border-bottom-color: var(--green-border);
  background: rgba(51, 255, 0, 0.03);
}

/* Multi-panel grid (lazygit split-pane) */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0;
}
.panel-grid .panel { margin: 0; }

/* ASCII progress bar (bpytop-inspired) */
.cli-progress {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cli-progress-bar {
  color: var(--green);
  letter-spacing: -1px;
}
.cli-progress-empty {
  color: var(--border);
  letter-spacing: -1px;
}
.cli-progress-label {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 3ch;
  text-align: right;
}

/* Sparkline (gping-inspired) */
.sparkline {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--green);
}
.sparkline-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Breadcrumb path (yazi-inspired) */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }
.breadcrumb .current { color: var(--green); }

/* Score bars — horizontal colored blocks (bpytop-style) */
.score-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.score-row:first-child { border-top: 1px solid var(--border); }
.score-label { color: var(--text-muted); text-transform: uppercase; font-size: 11px; }
.score-bar {
  height: 6px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.score-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--green);
  transition: width 0.6s ease-out;
}
.score-fill--warn { background: var(--amber); }
.score-fill--bad { background: #ff3333; }
.score-value { color: var(--text-bright); text-align: right; font-weight: 700; }

/* Panel footer stats row (lazygit status bar) */
.panel-footer {
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-footer .val { color: var(--green); font-weight: 700; }

/* Inline key-value pairs (dense info) */
.kv-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  margin: 12px 0;
}
.kv-inline dt { color: var(--text-muted); }
.kv-inline dt::after { content: ":"; }
.kv-inline dd { color: var(--text-bright); margin: 0; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 640px) {
  .site-header { padding: 16px; }
  main { padding: 0 16px; }
  .site-footer { padding: 20px 16px 32px; }
  .work-note { grid-template-columns: 1fr; gap: 4px; }
  .hero-strip { height: 80px; }
  h1 { font-size: 20px; }
  .panel-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 80px 1fr 36px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
