/* ============================================================
   ONWUACHI CONTROL PLANE — custom.css
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --bg:            #ffffff;
  --text:          #111111;
  --card-bg:       #f4f4f4;
  --border:        #dcdcdc;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --muted:         #555555;

  /* dark-surface panels — in light mode these are a soft grey */
  --surface:       #e8eaed;
  --surface-border:#d0d3d8;

  --green:   #16a34a;
  --yellow:  #ca8a04;
  --blue:    #2563eb;
  --red:     #dc2626;

  --topbar-bg:     #151823;
  --topbar-border: #2a2f3a;
}

[data-theme="dark"] {
  --bg:            #0f1117;
  --text:          #e5e5e5;
  --card-bg:       #151823;
  --border:        #2a2f3a;
  --accent:        #9cc9ff;
  --accent-hover:  #bdd9ff;
  --muted:         #9ca3af;

  --surface:       #151823;
  --surface-border:#2a2f3a;

  --green:   #4ade80;
  --yellow:  #facc15;
  --blue:    #60a5fa;
  --red:     #f87171;
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin-top: 0; line-height: 1.3; color: var(--text); }
ul { padding-left: 1.4rem; }
ul li { margin-bottom: 0.3rem; }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.topbar-brand { color: #e5e5e5 !important; font-size: 15px; text-decoration: none !important; white-space: nowrap; }
.topbar-brand:hover { color: var(--accent) !important; }

.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: #9ca3af; font-size: 14px; transition: color 0.15s; }
.nav a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--topbar-border);
  color: #9ca3af;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 18px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}
.theme-toggle:hover { transform: scale(1.1); }

/* ---------- LAYOUT ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ---------- HERO ---------- */
.hero-section {
  background: var(--topbar-bg);
  border: 1px solid var(--topbar-border);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
}

.hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: #9ca3af;
  font-size: 15px;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: transparent;
  color: var(--muted) !important;
  border: 1px solid var(--border);
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent) !important; }

/* ---------- CARDS ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  color: var(--text);
}

.side-note {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  margin-bottom: 1rem;
  color: var(--text);
}

.highlight-section { border-left: 4px solid var(--accent); }

/* ---------- GRID ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* ---------- METRIC CARDS ---------- */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.metric-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 28px;
  font-weight: bold;
  margin-top: 0.35rem;
  color: var(--accent);
}

.metric-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- SERVICE CARDS ---------- */
.service-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 1rem;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.service-name { color: var(--text); }
.service-role { font-size: 13px; color: var(--muted); }

.status-badge {
  font-size: 11px;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-healthy  { background: rgba(22,163,74,0.15);  color: var(--green);  border: 1px solid rgba(22,163,74,0.3); }
.status-rebuilding { background: rgba(202,138,4,0.15); color: var(--yellow); border: 1px solid rgba(202,138,4,0.3); }
.status-degraded { background: rgba(220,38,38,0.15);  color: var(--red);    border: 1px solid rgba(220,38,38,0.3); }

/* ---------- BADGES ---------- */
.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.badge {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- BUILD META ---------- */
.build-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---------- PIPELINE ---------- */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.pipeline-step {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.pipeline-icon { font-size: 22px; }
.pipeline-label { font-size: 13px; font-weight: 600; margin-top: 0.3rem; color: var(--text); }
.pipeline-sub { font-size: 11px; color: var(--muted); margin-top: 0.2rem; }
.pipeline-arrow { color: var(--muted); font-size: 18px; }

/* ---------- ROADMAP ---------- */
.roadmap-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.roadmap-item:last-child { border-bottom: none; }
.roadmap-check { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.roadmap-item p { margin: 0.25rem 0 0; font-size: 13px; color: var(--muted); }
.roadmap-item.done   strong { color: var(--green); }
.roadmap-item.active strong { color: var(--yellow); }
.roadmap-item.pending strong { color: var(--muted); }

/* ---------- SIGNALS ---------- */
.signal-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 14px;
  color: var(--text);
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.signal-dot.healthy    { background: var(--green);  box-shadow: 0 0 6px rgba(22,163,74,0.5); }
.signal-dot.validating { background: var(--yellow); box-shadow: 0 0 6px rgba(202,138,4,0.5); }
.signal-dot.building   { background: var(--blue);   box-shadow: 0 0 6px rgba(37,99,235,0.5); }
.signal-dot.degraded   { background: var(--red);    box-shadow: 0 0 6px rgba(220,38,38,0.5); }

.signal-name  { flex: 1; }
.signal-state { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- RECIPES ---------- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.recipe-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none !important;
  transition: transform 0.15s, border-color 0.15s;
  color: var(--text);
}

.recipe-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none !important;
}

.recipe-thumb {
  height: 160px;
  background-size: cover;
  background-position: center top;
  background-color: var(--surface);
  background-repeat: no-repeat;
}

.recipe-body {
  padding: 0.9rem 1rem;
}

.recipe-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.recipe-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ---------- PORTAL (homepage) ---------- */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.portal-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-decoration: none !important;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none !important;
}

.portal-icon { font-size: 26px; margin-bottom: 0.5rem; }

.portal-card h3 { margin-bottom: 0.4rem; font-size: 16px; }

.portal-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.portal-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- SYNTAX HIGHLIGHTING (chroma) ----------
   noClasses=false in hugo.toml means Chroma emits these classes
   instead of hardcoded inline hex colors, so code blocks now use
   our own theme variables and flip correctly with light/dark. */
.highlight { margin: 0; }

.chroma .c, .chroma .c1, .chroma .cm, .chroma .cs, .chroma .cp { color: var(--muted); font-style: italic; }
.chroma .k, .chroma .kn, .chroma .kw, .chroma .kd, .chroma .kt, .chroma .kc { color: var(--accent); font-weight: 600; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sc { color: var(--green); }
.chroma .n, .chroma .nb, .chroma .nf, .chroma .nv, .chroma .nt { color: var(--text); }
.chroma .o, .chroma .p { color: var(--muted); }
.chroma .m, .chroma .mi, .chroma .mf { color: var(--yellow); }
.chroma .gp { color: var(--accent); font-weight: 600; }
.chroma .err, .chroma .gr { color: var(--red); }

/* ---------- CONTENT (single pages) ---------- */
.content-body { line-height: 1.8; color: var(--text); }

.content-body h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-top: 1.5rem;
  color: var(--text);
}

.content-body code {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
}

.content-body pre {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.content-body pre code { background: none; border: none; padding: 0; }

.content-body img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1rem 0;
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- POST DATE ---------- */
.post-date { font-size: 13px; color: var(--muted); margin-top: 0.25rem; }

/* ---------- LIST ITEMS ---------- */
.list-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-date { font-size: 12px; color: var(--muted); float: right; margin-left: 1rem; }
.list-summary { margin: 0.3rem 0 0; font-size: 13px; color: var(--muted); }

/* ---------- FOOTER ---------- */
.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: var(--bg);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 13px; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-copy { font-size: 12px; color: var(--muted); }

/* ---------- ARCHITECTURE ---------- */
.architecture-diagram { text-align: center; margin-top: 1rem; }

.architecture-diagram img {
  max-width: 900px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---------- FLAVOR MAP ---------- */
.flavor-map {
  position: relative;
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 20px;
  background: var(--card-bg);
}

.axis.horizontal { position: absolute; top: 50%; width: 100%; height: 1px; background: var(--border); }
.axis.vertical   { position: absolute; left: 50%; height: 100%; width: 1px; background: var(--border); }
.label { position: absolute; font-size: 12px; color: var(--muted); }
.label.top    { top: 5px;    left: 50%; transform: translateX(-50%); }
.label.bottom { bottom: 5px; left: 50%; transform: translateX(-50%); }
.label.left   { left: 5px;   top: 50%;  transform: translateY(-50%); }
.label.right  { right: 5px;  top: 50%;  transform: translateY(-50%); }
.point { position: absolute; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; transform: translate(-50%, -50%); }
.point:hover { background: var(--red); cursor: pointer; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; padding: 0.75rem 1rem; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--topbar-border);
  }
  .nav.nav-open { display: flex; }
  .nav a { padding: 0.4rem 0; font-size: 15px; }

  .container { padding: 1.25rem 1rem; }
  .hero-section { padding: 1.5rem 1.25rem; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { text-align: center; }

  .pipeline-flow { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }

  .footer-inner { flex-direction: column; }
  .theme-toggle { bottom: 1rem; right: 1rem; }
  .list-date { float: none; display: block; margin: 0; }

  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- SIGNALS ---------- */
.signal-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 14px;
  color: var(--text);
}

/* ---------- HERO IMAGE FIX ---------- */
.hero-image {
  display: block;
  width: 100%;
  max-width: 700px;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

