/* base.css — amber phosphor tokens, terminal frame, bars, tooltips */
:root {
  --bg-void: #090604;
  --bg-window: #0d0a06;
  --bg-bar: #140f08;
  --bg-titlebar: #1a1209;
  --bg-card: #120e08;
  --bg-btn: #1c150a;
  --phosphor: #ffb000;
  --phosphor-dim: rgba(255, 176, 0, 0.12);
  --hot: #ffd447;
  --red: #ff5f45;
  --text-primary: #f7f1e3;
  --text-secondary: #a89f8b;
  --text-muted: #6f6553;
  --border-subtle: 1px solid #2c241a;
  --border-accent: 1px solid #40341f;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", Courier, monospace;
}

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

html,
body {
  height: 100%;
}

body.terminal-body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.6;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--phosphor);
  color: #000;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* The page IS the terminal: titlebar + statusbar fixed, port scrolls */
.terminal-window {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-window);
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-titlebar);
  border-bottom: var(--border-subtle);
  font-size: 13px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.term-status-badge {
  color: var(--phosphor);
}
.term-status-dim {
  color: var(--text-muted);
}
.window-title {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.term-status-online {
  color: var(--phosphor);
  animation: blink-soft 3s ease-in-out infinite;
}
@keyframes blink-soft {
  50% {
    opacity: 0.35;
  }
}

.scroll-port {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: #40341f var(--bg-void);
}
.scroll-port::-webkit-scrollbar {
  width: 8px;
}
.scroll-port::-webkit-scrollbar-thumb {
  background: #40341f;
}
.scroll-port::-webkit-scrollbar-track {
  background: var(--bg-void);
}

.window-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg-titlebar);
  border-top: var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--phosphor);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

code {
  color: var(--hot);
  font-family: var(--font-mono);
}

.term-btn {
  display: inline-block;
  padding: 10px 16px;
  background: var(--bg-btn);
  border: 1px solid var(--phosphor);
  border-radius: 4px;
  color: var(--phosphor);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.term-btn:hover {
  background: var(--phosphor-dim);
  transform: translateY(-1px);
}
.term-btn-dim {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}
.term-btn-dim:hover {
  background: rgba(168, 159, 139, 0.08);
}

/* Tooltips — phosphor man-page glosses. CSS-only: hover + focus. */
.t {
  color: var(--hot);
  border-bottom: 1px dotted var(--hot);
  cursor: help;
  position: relative;
  outline-offset: 2px;
}
.t::after {
  content: "> " attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: max-content;
  max-width: min(300px, 78vw);
  padding: 10px 12px;
  background: var(--bg-titlebar);
  border: 1px solid var(--phosphor);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: normal;
  line-height: 1.5;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.t::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 12px;
  z-index: 51;
  border: 4px solid transparent;
  border-top-color: var(--phosphor);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.t:hover::after,
.t:focus::after {
  opacity: 1;
  transform: translateY(0);
}
.t:hover::before,
.t:focus::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-port {
    scroll-snap-type: none;
  }
}
