/* broadview — shared chrome (sticky topbar + fixed bottom statusbar + mobile menu)
   Page-specific palette and layout stay inline in each .html file;
   only the elements that appear on every page live here. */

:root {
  --bg-1: #0c0c0c;
  --bg-2: #131313;
  --amber-dim: rgba(255, 179, 71, 0.2);
  --fg-dim: #4a4842;
  --line-2: #2a2a2a;
}

body { padding-bottom: 28px; }

/* ─── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 44px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 32px;
}
.topbar-brand .logo {
  width: 14px; height: 14px;
  background: var(--amber);
  position: relative;
}
.topbar-brand .logo::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--bg-1);
}
.topbar-brand .name { font-weight: 700; color: var(--fg); }
.topbar-brand .ext { color: var(--fg-mute); }

.tabs {
  display: flex;
  height: 100%;
  list-style: none;
}
.tabs li {
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  height: 100%;
  position: relative;
  cursor: pointer;
  color: var(--fg-mute);
  transition: color 0.15s;
}
.tabs li:hover { color: var(--fg); }
.tabs li a { color: inherit; text-decoration: none; display: flex; align-items: center; height: 100%; padding: 0 4px; }
.tabs li.active { color: var(--fg); background: var(--bg); }
.tabs li::before { content: "·"; color: var(--fg-dim); }
.tabs li.active::before { content: "·"; color: var(--amber); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--fg-mute);
}
.topbar-right .ping { color: var(--green); }

/* ─── Mobile menu toggle (hidden on desktop) ──────────── */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 0 10px;
  height: 28px;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.menu-toggle:hover { background: var(--bg-2); border-color: var(--amber); }
.menu-toggle .glyph { display: inline-block; transition: transform 0.18s ease-out; }
.menu-toggle[aria-expanded="true"] .glyph { transform: rotate(180deg); }

/* ─── Mobile panel (drop-down nav) ────────────────────── */
.mobile-panel {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.mobile-panel a {
  display: block;
  padding: 14px 24px;
  color: var(--fg-mute);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-left-color 0.15s;
}
.mobile-panel a:last-child { border-bottom: none; }
.mobile-panel a:hover,
.mobile-panel a:focus-visible {
  background: var(--bg-2);
  color: var(--fg);
  border-left-color: var(--amber);
}
.mobile-panel a:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: -2px;
}
.mobile-panel a.active {
  color: var(--amber);
  border-left-color: var(--amber);
}

/* ─── Bottom global status bar (fixed) ────────────────── */
.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-mute);
  z-index: 100;
  padding: 0;
}
.statusbar-item {
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid var(--line);
}
.statusbar-item.amber { color: var(--amber); background: var(--amber-dim); }
.statusbar-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.statusbar-spacer { flex: 1; }
.statusbar-right { display: flex; height: 100%; }

/* ─── Mobile breakpoint ───────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; position: relative; }
  .topbar-brand { margin-right: 12px; }
  .tabs { display: none; }
  .topbar-right { margin-left: auto; gap: 0; }
  .topbar-right .ops { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-panel.is-open { display: flex; }
  .statusbar { font-size: 10px; }
  .statusbar-right .statusbar-item { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle .glyph { transition: none; }
  .statusbar-item .dot { animation: none; }
}

/* ─── Loading screen (terminal boot) ──────────────────── */
.boot {
  position: fixed;
  inset: 0;
  background: var(--bg, #050505);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.24s ease-out;
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot-window {
  width: min(440px, calc(100vw - 48px));
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--fg, #e8e6df);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.boot-head {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--fg-mute, #6b6960);
}
.boot-dots { display: inline-flex; gap: 6px; }
.boot-dots span { width: 9px; height: 9px; border-radius: 50%; }
.boot-dots span:nth-child(1) { background: #ff5e5e; }
.boot-dots span:nth-child(2) { background: var(--amber, #ffb347); }
.boot-dots span:nth-child(3) { background: var(--green, #5fff8f); }
.boot-title { letter-spacing: 0.04em; }
.boot-body { padding: 18px 20px 20px; line-height: 1.85; }
.boot-line { white-space: nowrap; overflow: hidden; }
.boot-line .boot-prompt { color: var(--amber, #ffb347); font-weight: 700; }
.boot-line .boot-arrow { color: var(--amber, #ffb347); margin-right: 4px; }
.boot-line .boot-ok { color: var(--green, #5fff8f); margin-left: 4px; }
.boot-line.out { color: var(--fg-mute, #6b6960); opacity: 0; transform: translateX(-4px); transition: opacity 0.16s ease-out, transform 0.16s ease-out, color 0.16s; }
.boot-line.out.is-visible { opacity: 1; transform: translateX(0); color: var(--fg, #e8e6df); }
.boot-line .typed { display: inline-block; }
.boot-line .typed::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--amber, #ffb347);
  vertical-align: -2px;
  margin-left: 3px;
  animation: boot-caret 0.9s steps(2) infinite;
}
@keyframes boot-caret { to { opacity: 0; } }

/* ─── Scroll-triggered reveals ────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.42s ease-out, transform 0.42s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Inline form success state ───────────────────────── */
.form-success {
  font-family: 'JetBrains Mono', monospace;
  padding: 28px 24px;
  border: 1px solid var(--amber, #ffb347);
  background: var(--bg-1);
  color: var(--fg, #e8e6df);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}
.form-success .label {
  color: var(--green, #5fff8f);
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .boot { transition: opacity 0.001s; }
  .boot-line.out { transition: none; opacity: 1; transform: none; color: var(--fg, #e8e6df); }
  .boot-line .typed::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
