:root {
  --font-pixel: "Press Start 2P", monospace;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg: #0c0c0e;
  --surface: #141417;
  --surface-2: #1a1a1f;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.16);
  --text: #f0eee9;
  --muted: #a49f99;
  --muted-2: #78726c;
  --accent: #8a9a5b;
  --accent-bright: #a3b88c;
  --accent-dim: rgba(138, 154, 91, 0.35);

  /* CRT Terminal Phosphor Green */
  --ph-dark: #070a05;
  --ph-screen: #0a0d07;
  --ph-panel: #14180d;
  --ph-dim: #55632f;
  --ph-mid: #8a9a5b;
  --ph: #a3b88c;
  --ph-bright: #d3e3b8;
  --ph-glow: rgba(163, 184, 140, 0.4);
  --ph-wash: rgba(163, 184, 140, 0.1);
  --ph-scan: rgba(0, 0, 0, 0.22);
  --ph-vignette: rgba(0, 0, 0, 0.55);
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* 28px Dot Grid Matrix from thomascheng.dev */
.grid-bg {
  pointer-events: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Top Navigation Bar: Name, LinkedIn, Contact Form Button */
.nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
  display: inline-block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--accent-bright);
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border-radius: 4px;
  background: rgba(138, 154, 91, 0.15);
  border: 1px solid var(--accent-dim);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-contact:hover {
  background: var(--accent);
  color: #0c0c0e;
  border-color: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-dim);
  transform: translateY(-1px);
}

/* Main Container (Centered Chatbox) */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* THE PHOSPHOR CRT TERMINAL CHATBOX */
.terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(680px, calc(100vh - 120px));
  border-radius: 4px;
  border: 1px solid var(--ph-dim);
  background: var(--ph-screen);
  color: var(--ph);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55),
              inset 0 0 40px rgba(0, 0, 0, 0.7),
              0 20px 60px rgba(0, 0, 0, 0.65),
              0 0 24px rgba(163, 184, 140, 0.08);
  overflow: hidden;
}

/* CRT Vignette Overlay */
.terminal::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, var(--ph-vignette) 100%);
}

/* CRT Scanlines */
.terminal::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--ph-scan) 2px 3px);
}

/* Terminal Hardware Top Bar */
.terminal-bar {
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.85rem;
  background: var(--ph-panel);
  border-bottom: 1px solid var(--ph-dim);
}

.panel-lamps {
  display: flex;
  gap: 6px;
}

.lamp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--ph-dim);
  border-radius: 2px;
  background: var(--ph-dark);
  color: var(--ph-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.lamp:hover {
  color: var(--ph-dark);
  background: var(--ph);
  border-color: var(--ph-bright);
  box-shadow: 0 0 8px var(--ph-glow);
}

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ph);
  text-shadow: 0 0 6px var(--ph-glow);
}

.terminal-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ph-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.terminal-status-bulb {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ph-bright);
  box-shadow: 0 0 6px var(--ph-bright);
}

/* Scrollable Output Stream */
.terminal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: relative;
  z-index: 2;
}

.terminal-scroll::-webkit-scrollbar {
  width: 6px;
}

.terminal-scroll::-webkit-scrollbar-thumb {
  background: var(--ph-dim);
  border-radius: 2px;
}

/* System Reception Banner */
.neofetch-banner {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed rgba(85, 99, 47, 0.45);
  color: var(--ph);
}

.nf-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ph-bright);
  text-shadow: 0 0 8px var(--ph-glow);
  margin-bottom: 0.4rem;
}

.nf-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.nf-key {
  color: var(--ph-dim);
  width: 5.5rem;
  flex-shrink: 0;
}

.nf-val {
  color: var(--ph);
}

/* Messages */
.chat-msg {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.chat-msg-user {
  display: flex;
  gap: 0.5rem;
  color: var(--ph-bright);
  text-shadow: 0 0 7px var(--ph-glow);
}

.chat-msg-user .prompt-sym {
  color: var(--ph-dim);
  user-select: none;
}

.chat-msg-bot {
  color: var(--ph-mid);
  text-shadow: 0 0 6px var(--ph-glow);
  padding-left: 0.85rem;
  border-left: 2px solid rgba(85, 99, 47, 0.4);
}

.chat-msg-bot strong {
  color: var(--ph-bright);
}

.chat-msg-bot code {
  background: rgba(85, 99, 47, 0.25);
  color: var(--ph-bright);
  padding: 1px 4px;
  border-radius: 2px;
  font-family: inherit;
}

.chat-msg-bot ul {
  margin: 0.4rem 0 0.4rem 1.25rem;
}

.chat-msg-bot li {
  margin-bottom: 0.2rem;
}

.loading-pulse {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ph-dim);
  font-size: 0.75rem;
  padding-left: 0.85rem;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--ph-bright);
  box-shadow: 0 0 8px var(--ph-glow);
  animation: loading-pulse-anim 0.9s ease-in-out infinite alternate;
}

@keyframes loading-pulse-anim {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* Fixed Terminal Footer */
.terminal-fixed-footer {
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--ph-dim);
  background: var(--ph-panel);
}

/* Screening Chips */
.terminal-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-chip {
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--ph-dim);
  border-radius: 2px;
  background: transparent;
  color: var(--ph-mid);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.prompt-chip:hover {
  color: var(--ph-bright);
  border-color: var(--ph-bright);
  background: var(--ph-wash);
  box-shadow: 0 0 10px var(--ph-glow);
  transform: translateY(-1px);
}

/* Terminal Input Form */
.terminal-ask {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--ph-dim);
  background: var(--ph-screen);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.terminal-ask:focus-within {
  border-color: var(--ph-bright);
  box-shadow: 0 0 12px var(--ph-glow);
}

.ask-arrow {
  flex-shrink: 0;
  color: var(--ph-bright);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  text-shadow: 0 0 7px var(--ph-glow);
  user-select: none;
}

.ask-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ph-bright);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
}

.ask-input::placeholder {
  color: var(--ph-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ask-send {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--ph-dim);
  border-radius: 2px;
  background: transparent;
  color: var(--ph-mid);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.ask-send:hover {
  color: var(--ph-dark);
  background: var(--ph);
  border-color: var(--ph-bright);
  box-shadow: 0 0 10px var(--ph-glow);
}

/* LEAD CAPTURE MODAL (Contact Form) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(138, 154, 91, 0.1);
  overflow: hidden;
}

.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-mono);
}

.close-btn:hover {
  color: var(--accent-bright);
}

.modal-form {
  padding: 1.4rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent-bright);
  color: #0c0c0e;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-dim);
}

.btn-primary:hover {
  background: var(--accent-bright);
}

.dossier-card {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre;
  overflow-x: auto;
  color: var(--ph-bright);
  text-shadow: 0 0 6px var(--ph-glow);
  margin: 0.25rem 0 0.5rem;
  padding: 0.25rem 0;
}

@media (max-width: 640px) {
  .nav {
    padding: 0.75rem 1rem 0.5rem;
  }
  .main-container {
    padding: 0.5rem 0.75rem 1rem;
    min-height: 0;
  }
  .terminal {
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    max-height: 100%;
  }
  .terminal-scroll {
    padding: 0.75rem;
  }
  .terminal-fixed-footer {
    padding: 8px 10px 10px;
  }
  .terminal-prompts {
    gap: 4px;
  }
  .prompt-chip {
    font-size: 0.62rem;
    padding: 0.28rem 0.5rem;
  }
  .dossier-card {
    font-size: 0.55rem;
    line-height: 1.25;
  }
  .ask-input {
    font-size: 0.75rem;
  }
}
