/*
 * KrisEnigma shared page chrome — shell + common UI.
 * Requires: kris-tokens.css (load tokens first).
 *
 * Path:  ubuntu@vps:~/docs/site/assets/kris-chrome.css
 * URL:   https://docs.krisenigma.com/assets/kris-chrome.css
 *
 * Layout-specific rules stay in each site’s own CSS.
 */

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: var(--kris-font);
  letter-spacing: var(--kris-letter-spacing);
  color: var(--kris-text);
  line-height: 1.55;
  background: var(--kris-bg-color);
  padding: 32px 18px 56px;
}

/* Fixed layers ABOVE body color (positive z-index). Negative z-index
   pseudos sit under body's opaque background and never show. */
.kris-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--kris-bg-image) center / cover no-repeat;
  filter: var(--kris-bg-filter);
  transform: scale(var(--kris-bg-scale));
}

.kris-wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--kris-wash);
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(800px, 100%);
  margin: 0 auto;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/*
 * Site header — one layout for docs / VPS hub / ISB.
 * Markup:
 *   <header class="site-header">
 *     <a class="brand">…</a>
 *     <div class="header-meta">
 *       <span class="tag">…</span>
 *       <!-- optional nav -->
 *     </div>
 *   </header>
 */
.site-header,
header.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}

.site-header::after,
header.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent 50%, var(--accent));
  opacity: 0.75;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand:hover { text-decoration: none; }

.brand img {
  height: 38px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--text);
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-left: auto;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 225, 175, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Ops section labels (hub / ISB). Docs content h2 stays in style.css. */
body.ops section > h2 {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Shared subsection title (docs + cards + project rows) */
h3 {
  margin: 1.25rem 0 0.4rem;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.card h3 {
  margin: 0;
}

.project-row h3 {
  margin: 0 0 3px;
}

/*
 * Clickables:
 *  .btn       — primary CTA
 *  .btn.ghost — copy / secondary
 *  a.link     — text navigation
 */
.btn {
  border: 0;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:visited { color: var(--ink); }

.btn.ghost {
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--glass-border-hover);
  filter: none;
}

.btn.ghost:hover {
  border-color: rgba(0, 225, 175, 0.5);
  color: var(--primary);
  background: rgba(0, 225, 175, 0.08);
  filter: none;
}

.btn.ghost:visited { color: var(--text); }

a.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(0, 225, 175, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}

a.link:visited { color: var(--primary); }

a.link:hover {
  color: #5ff0cd;
  border-bottom-color: #5ff0cd;
  text-decoration: none;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(0, 225, 175, 0.4);
}

.pill.bad {
  color: var(--bad);
  border-color: rgba(224, 122, 122, 0.4);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 225, 175, 0.05), rgba(122, 83, 221, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover { border-color: var(--glass-border-hover); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .header-meta {
    align-items: flex-start;
    width: 100%;
    margin-left: 0;
  }
}
