:root {
  --bg: #0a0e13;
  --surface: #12171f;
  --surface-2: #1a212b;
  --border: #232b36;
  --text: #e7ecf1;
  --text-dim: #8b96a3;
  --accent: #f2a93c;
  --accent-2: #6ee7c0;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* subtle scanline overlay for CRT feel */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.terminal {
  max-width: 880px;
  margin: 4vh auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
  overflow: hidden;
}

/* Title bar */
.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.dots { display: flex; gap: 7px; }
.dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #3a4250;
}
.dots span:nth-child(1) { background: #e0605a; }
.dots span:nth-child(2) { background: #e0b04d; }
.dots span:nth-child(3) { background: #5cb87a; }

.titlebar-label { flex: 1; text-align: center; }

.status {
  display: flex; align-items: center; gap: 6px;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Nav tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  overflow-x: auto;
}
.tabs a {
  text-decoration: none;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a::before { content: "#"; color: var(--accent); margin-right: 2px; }

main { padding: 8px 16px 16px; }

.pane {
  padding: 40px 8px 16px;
  border-bottom: 1px dashed var(--border);
}
.pane:last-of-type { border-bottom: none; }

.prompt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.prompt::before { content: "$ "; color: var(--accent); }

/* Hero */
.hero { padding-top: 24px; }
.typed-line {
  font-family: var(--mono);
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.role {
  font-size: 18px;
  color: var(--text);
  margin: 0 0 8px;
  max-width: 60ch;
}
.hero-sub {
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 0 24px;
}
.hero-sub a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #12171f;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(242,169,60,0.5); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); box-shadow: none; }

/* Output blocks */
.output { font-size: 15px; color: var(--text); }
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card p { margin: 0 0 12px; color: var(--text-dim); }
.card p:last-child { margin-bottom: 0; }

/* Project listing */
.listing {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.5px;
}
.listing-row {
  display: grid;
  grid-template-columns: 100px 110px 1fr 70px;
  gap: 16px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.12s;
}
.listing-row:last-child { border-bottom: none; }
.listing-row:not(.listing-head):hover { background: var(--surface-2); }
.listing-head {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-2);
}
.col-perm { color: var(--text-dim); }
.col-name { color: var(--accent-2); font-weight: 500; }
.col-desc { color: var(--text-dim); font-family: var(--sans); font-size: 13.5px; }
.col-link { color: var(--accent); text-align: right; opacity: 0; transition: opacity 0.12s; }
.listing-row:hover .col-link { opacity: 1; }
.listing-footer {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin: 10px 4px 0;
}
.listing-footer code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Skills */
.skills-group { margin-bottom: 18px; }
.skills-group:last-child { margin-bottom: 0; }
.skills-key {
  display: block;
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 13px;
  margin-bottom: 10px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Contact */
.contact-card p { color: var(--text-dim); font-family: var(--mono); font-size: 13px; }
.dots-anim::after { content: ""; }
.contact-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.contact-list li {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.contact-list li:last-child { border-bottom: none; }
.contact-key {
  font-family: var(--mono);
  color: var(--text-dim);
  width: 80px;
  flex-shrink: 0;
  font-size: 13px;
  padding-top: 2px;
}
.contact-list a { text-decoration: none; color: var(--accent-2); }
.contact-list a:hover { text-decoration: underline; }
.exit-code {
  font-family: var(--mono);
  font-size: 12px;
  color: #5cb87a;
  margin: 8px 0 0;
}

/* Interactive REPL */
.repl-pane { padding-bottom: 24px; }
.repl-hint {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
}
.repl-hint kbd {
  color: var(--accent-2);
  font-family: var(--mono);
  background: none;
  border: none;
  padding: 0;
}
.repl-history {
  font-family: var(--mono);
  font-size: 13px;
  min-height: 0;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.repl-entry { display: contents; }
.repl-cmd-line {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.repl-cmd-line::before {
  content: "visitor@site:~$ ";
  color: var(--accent);
}
.repl-output {
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
  padding: 2px 0 6px 18px;
  border-left: 2px solid var(--border);
  margin-left: 2px;
  line-height: 1.7;
}
.repl-output.repl-error { color: #e06060; }
.repl-output.repl-success { color: var(--accent-2); }
.repl-output a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.repl-output .tag { display: inline-block; margin: 1px 3px; }

.repl-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color 0.15s;
}
.repl-input-row:focus-within { border-color: var(--accent); }
.repl-ps1 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.repl-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  caret-color: var(--accent);
  min-width: 0;
}
.repl-input::placeholder { color: var(--text-dim); opacity: 0.5; }

.footer {
  padding: 20px 24px 28px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* Focus visibility */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .terminal { margin: 0; border-radius: 0; border: none; }
  .listing-row { grid-template-columns: 1fr; gap: 4px; }
  .col-link { display: none; }
  .pane { padding: 28px 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot, .cursor { animation: none; }
  html { scroll-behavior: auto; }
}