@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --bg: #05070A;
  --panel: #0B1119;
  --panel-alt: #0F1720;
  --border: #1B2A33;
  --grid: rgba(0, 240, 255, 0.05);

  --text: #D9E6EA;
  --muted: #5C7488;

  --cyan: #00F0FF;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --green: #39FF88;
  --green-dim: rgba(57, 255, 136, 0.12);
  --magenta: #FF2E9A;
  --magenta-dim: rgba(255, 46, 154, 0.12);

  --display: 'Orbitron', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --ui: 'Rajdhani', sans-serif;

  --max: 900px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 20% 0%, rgba(0,240,255,0.06), transparent 55%),
              radial-gradient(ellipse at 90% 100%, rgba(255,46,154,0.05), transparent 55%);
  pointer-events: none;
}

a { color: inherit; }
::selection { background: var(--cyan-dim); color: var(--cyan); }

:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

h1 {
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

p { max-width: 68ch; color: var(--text); }

code, .glow-cyan { color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,0.5); }
.glow-green { color: var(--green); text-shadow: 0 0 8px rgba(57,255,136,0.5); }
.glow-magenta { color: var(--magenta); text-shadow: 0 0 8px rgba(255,46,154,0.5); }

.term-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 25, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.term-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.term-brand {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-transform: uppercase;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

.blink-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 2px var(--green);
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

nav.term-nav {
  display: flex;
  gap: 1.6rem;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

nav.term-nav a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, text-shadow 0.15s;
}

nav.term-nav a:hover,
nav.term-nav a[aria-current="page"] {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,240,255,0.5);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

.prompt-line {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--green);
  display: block;
  margin-bottom: 0.9rem;
}

.prompt-line::before { content: "$ "; color: var(--muted); }

.page-intro { margin-bottom: 3rem; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 2rem 0 3rem;
}

.stat {
  background: var(--panel);
  padding: 1.1rem 1rem;
  text-align: center;
}

.stat .num {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,240,255,0.4);
  display: block;
}

.stat .label {
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

.log {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.6rem;
  padding: 1.7rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  margin-bottom: 1.1rem;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.log[data-status="active"] { border-left-color: var(--cyan); }
.log[data-status="active"]:hover { box-shadow: -2px 0 16px -4px rgba(0,240,255,0.35); }
.log[data-status="resolved"] { border-left-color: var(--green); }
.log[data-status="resolved"]:hover { box-shadow: -2px 0 16px -4px rgba(57,255,136,0.25); }
.log[data-status="featured"] { border-left-color: var(--magenta); }
.log[data-status="featured"]:hover { box-shadow: -2px 0 16px -4px rgba(255,46,154,0.3); }

.log-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.8;
}

.log-meta .id { color: var(--text); display: block; font-weight: 600; }

.badge {
  display: inline-block;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  margin-top: 0.4rem;
  border: 1px solid;
  text-transform: uppercase;
}

.badge.active { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }
.badge.resolved { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.badge.featured { color: var(--magenta); border-color: var(--magenta); background: var(--magenta-dim); }

.log-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: #fff;
}

.log-body .role-meta {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.log-body p { margin: 0.5rem 0; font-size: 0.94rem; }
.log-body ul { margin: 0.7rem 0 0; padding-left: 1.2rem; font-size: 0.92rem; }
.log-body li { margin-bottom: 0.35rem; }

@media (max-width: 620px) {
  .log { grid-template-columns: 1fr; }
}

.btn {
  display: inline-block;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  text-decoration: none;
  background: var(--cyan-dim);
  transition: background 0.15s, box-shadow 0.15s;
}

.btn:hover { background: rgba(0,240,255,0.2); box-shadow: 0 0 16px rgba(0,240,255,0.35); }

.btn.alt { border-color: var(--muted); color: var(--text); background: transparent; }
.btn.alt:hover { border-color: var(--text); box-shadow: none; }

.btn.magenta { border-color: var(--magenta); color: var(--magenta); background: var(--magenta-dim); }
.btn.magenta:hover { background: rgba(255,46,154,0.2); box-shadow: 0 0 16px rgba(255,46,154,0.35); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
  margin: 3.5rem 0 1.5rem;
}

.section-head:first-of-type { margin-top: 0; }

.section-head h2 {
  font-size: 0.95rem;
  margin: 0;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-head h2::before { content: "// "; color: var(--muted); }

.section-head span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.cred-list { border-top: 1px solid var(--border); }

.cred-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.cred-row .name { font-family: var(--ui); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.cred-row .issuer { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.cred-row .date { font-family: var(--mono); font-size: 0.75rem; color: var(--green); white-space: nowrap; }

@media (max-width: 560px) {
  .cred-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

.tag-group { margin-bottom: 1.6rem; }
.tag-group h4 {
  font-family: var(--ui);
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.7rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel-alt);
}

.entry {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
}

.entry:first-child { padding-top: 0; }

.entry-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 0.6rem;
}

.entry h3 { font-size: 1.2rem; margin-bottom: 0.6rem; color: #fff; }
.entry p { font-size: 0.98rem; }

footer { border-top: 1px solid var(--border); margin-top: 4rem; }

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.footer-links { display: flex; gap: 1.3rem; }
.footer-inner a { text-decoration: none; color: var(--muted); transition: color 0.15s; }
.footer-inner a:hover { color: var(--cyan); text-shadow: 0 0 6px rgba(0,240,255,0.5); }

@media print {
  body { background: #fff; color: #111; font-size: 12pt; }
  body::before, body::after { display: none; }
  .term-header, footer, .no-print { display: none; }
  .log, .cred-list, .stat-strip { background: none; border-color: #999; box-shadow: none !important; }
  h1, h3 { color: #111 !important; text-shadow: none !important; }
  main { padding: 0; max-width: 100%; }
  a { color: #111; text-decoration: none; }
}

/* ---------- CV download gate modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 30px rgba(0,240,255,0.15);
  padding: 1.5rem;
  max-width: 300px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--cyan); }

.modal-box h3 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

#cv-email-input {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
}

#cv-email-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.gate-error {
  color: var(--magenta);
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-top: 0.6rem;
}

/* ---------- Floating chat widget ---------- */

.chat-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--ink);
  border: none;
  font-family: var(--display);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,240,255,0.4);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.chat-toggle:hover { transform: scale(1.06); }

.chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  width: 320px;
  max-width: calc(100vw - 3rem);
  height: 420px;
  max-height: calc(100vh - 8rem);
  background: var(--panel);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 30px rgba(0,240,255,0.18);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel[hidden] { display: none; }

.chat-header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.chat-header button:hover { color: var(--cyan); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-msg {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.55rem 0.7rem;
  max-width: 85%;
  word-wrap: break-word;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--panel-alt);
  border-left: 2px solid var(--cyan);
  color: var(--text);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--cyan-dim);
  border-right: 2px solid var(--cyan);
  color: var(--bone);
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  background: var(--panel-alt);
  border: none;
  padding: 0.7rem 0.8rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}

#chat-input:focus { outline: none; }

#chat-send {
  background: var(--cyan);
  color: var(--ink);
  border: none;
  padding: 0 1rem;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
}

#chat-send:hover { background: #4df3ff; }
#chat-send:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 480px) {
  .chat-panel { right: 1rem; left: 1rem; width: auto; }
  .chat-toggle { right: 1rem; }
}

