/* ── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #1a1b26;
  --bg2:       #16161e;
  --bg3:       #1f2335;
  --bg4:       #24283b;
  --border:    #292e42;
  --fg:        #a9b1d6;
  --fg-dim:    #565f89;
  --blue:      #7dcfff;
  --green:     #9ece6a;
  --red:       #f7768e;
  --yellow:    #e0af68;
  --purple:    #bb9af7;
  --cyan:      #7dcfff;
  --font:      'Courier New', Courier, monospace;
}

html, body {
  height: 100%;
  /* Deep dark background matching sumitmago.in */
  background: #050508;
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── PARTICLES ────────────────────────────────────────────────────────────── */
#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: all;
}

/* ── MATRIX ───────────────────────────────────────────────────────────────── */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
  pointer-events: none;
}
body.matrix-mode #matrix-canvas { display: block; }
/* Terminal stays visible, content turns green, border glows green */
body.matrix-mode #terminal-window {
  border-color: rgba(0, 255, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(0,255,0,0.1), 0 24px 80px rgba(0,0,0,0.9), 0 0 30px rgba(0,255,0,0.08);
}
body.matrix-mode #terminal { opacity: 1; }
body.matrix-mode #terminal * { color: #00ff41 !important; }
body.matrix-mode #terminal a { color: #00cc33 !important; }
body.matrix-mode #terminal .typing-cursor { background: #00ff41 !important; }
body.matrix-mode #title-bar { background: #001a00; border-bottom-color: rgba(0,255,0,0.3); }
body.matrix-mode #title-bar-center { color: #00ff41 !important; text-shadow: 0 0 8px rgba(0,255,0,0.8); }
body.matrix-mode #nav-links { background: #001a00; border-bottom-color: rgba(0,255,0,0.2); }
body.matrix-mode #nav-links a { color: #00cc33 !important; }
body.matrix-mode #nav-links a:hover { color: #00ff41 !important; background: rgba(0,255,0,0.1); }

/* ── CURSOR ───────────────────────────────────────────────────────────────── */
#cursor-dot, #cursor-outline {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
#cursor-dot     { width: 6px;  height: 6px;  background: var(--blue); }
#cursor-outline { width: 28px; height: 28px; border: 1.5px solid rgba(125,207,255,0.45); }

/* ── TERMINAL WINDOW (floating card) ─────────────────────────────────────── */
#terminal-window {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: min(1100px, 96vw);
  height: min(700px, 92vh);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 80px rgba(0,0,0,0.9);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Scanline texture overlay */
#terminal-window::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
  border-radius: 10px;
}

/* ── TITLE BAR ────────────────────────────────────────────────────────────── */
#title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 38px;
  min-height: 38px;
  background: var(--bg2);
  border-bottom: 1px solid rgba(125,207,255,0.15);
  user-select: none;
  position: relative;
  z-index: 101;
}
#title-bar-left  { display: flex; align-items: center; gap: 8px; }
#title-bar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #7dcfff;
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(125, 207, 255, 0.6);
}
#title-bar-right { color: var(--yellow); font-size: 12px; font-weight: bold; }

.tb-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  display: inline-block;
  transition: transform 0.15s, filter 0.15s;
}
.tb-red    { background: #ff5f57; box-shadow: 0 0 6px rgba(255,95,87,0.7); }
.tb-yellow { background: #febc2e; box-shadow: 0 0 6px rgba(254,188,46,0.7); }
.tb-green  { background: #28c840; box-shadow: 0 0 6px rgba(40,200,64,0.7); }
.tb-dot:hover { transform: scale(1.2); filter: brightness(1.3); }

/* ── NAV TAB BAR ──────────────────────────────────────────────────────────── */
#nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  height: 36px;
  min-height: 36px;
  background: var(--bg3);
  border-bottom: 1px solid rgba(125,207,255,0.1);
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 101;
}
#nav-links::-webkit-scrollbar { display: none; }
#nav-links a {
  color: #a9b1d6;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
#nav-links a:hover { color: #7dcfff; background: var(--bg4); }

/* ── TERMINAL BODY ────────────────────────────────────────────────────────── */
#terminal {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 20px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.07) 3px,
      rgba(0, 0, 0, 0.07) 4px
    ),
    var(--bg);
  position: relative;
  z-index: 101;
}

/* ── PROMPT LINE ──────────────────────────────────────────────────────────── */
.prompt-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
  line-height: 1.8;
}
.user   { color: #9ece6a; }
.at     { color: var(--fg-dim); }
.host   { color: var(--blue); }
.arrow  { color: #bb9af7; margin: 0 6px; }
.cmd    { color: var(--fg); }

/* ── HIDDEN INPUT ─────────────────────────────────────────────────────────── */
#command-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px; height: 1px;
}
#real-prompt { position: relative; }
#real-prompt.hidden { display: none; }
#input-display { color: var(--fg); }

/* ── TYPING CURSOR ────────────────────────────────────────────────────────── */
.typing-cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--blue);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── BOOT LINES ───────────────────────────────────────────────────────────── */
.boot-line {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  margin-bottom: 2px;
  max-width: 560px;
  font-size: 13px;
}
.boot-status { color: var(--green); display: none; margin-left: 16px; white-space: nowrap; }

/* ── MOTD ─────────────────────────────────────────────────────────────────── */
.motd-container { color: var(--fg); }
.motd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 24px;
  margin: 10px 0;
  font-size: 13px;
  max-width: 500px;
}
.motd-key { color: var(--fg-dim); }
.motd-val { color: var(--blue); }

/* ── FADE IN ──────────────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(3px)} to{opacity:1;transform:none} }

/* ── HELP ─────────────────────────────────────────────────────────────────── */
.help-header {
  color: var(--fg);
  font-weight: bold;
  margin-bottom: 6px;
}
.help-hint {
  color: var(--fg-dim);
  font-size: 12px;
  margin-bottom: 14px;
}
.help-section-label {
  color: var(--fg-dim);
  font-size: 12px;
  margin: 12px 0 4px;
}
.help-table { border-collapse: collapse; }
.help-table tr { line-height: 1.85; transition: background 0.08s; }
.help-table tr:hover td { background: rgba(125,207,255,0.06); }
.ht-cmd {
  color: var(--cyan);
  text-decoration: underline;
  padding-right: 16px;
  white-space: nowrap;
  min-width: 130px;
  border-radius: 3px;
  padding: 1px 8px 1px 4px;
}
.ht-cmd.clickable-cmd {
  cursor: pointer;
  text-decoration: underline;
  color: var(--cyan);
}
.ht-cmd.clickable-cmd:hover { color: var(--blue); }
.ht-shortcut {
  color: var(--fg-dim);
  padding-right: 16px;
  white-space: nowrap;
  min-width: 130px;
}
.ht-dash { color: var(--fg-dim); padding: 0 10px; }
.ht-desc { color: var(--fg); font-size: 13px; }

/* ── NEOFETCH ─────────────────────────────────────────────────────────────── */
.neofetch-wrap {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.neofetch-art { flex-shrink: 0; }
.nf-portrait {
  color: var(--blue);
  font-size: 11px;
  line-height: 1.2;
  margin: 0;
  opacity: 0.85;
}
.neofetch-info { flex: 1; min-width: 220px; padding-top: 4px; }
.nf-row { display: flex; margin-bottom: 5px; line-height: 1.7; }
.nf-key { color: var(--blue); font-weight: bold; min-width: 80px; }
.nf-sep { color: var(--fg-dim); margin: 0 6px; }
.nf-val { color: var(--fg); }
.nf-link { color: var(--fg-dim); text-decoration: none; margin-right: 4px; font-size: 13px; transition: color 0.15s; }
.nf-link:hover { color: var(--blue); }

/* ── GIT LOG ──────────────────────────────────────────────────────────────── */
.git-entry { margin-bottom: 20px; }
.git-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.git-star    { color: var(--yellow); }
.git-hash    { color: var(--yellow); font-size: 12px; }
.git-tag     { color: var(--purple); font-size: 12px; }
.git-msg     { color: var(--fg); }
.git-body    { padding-left: 18px; border-left: 2px solid var(--border); }
.git-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.git-role    { color: var(--green); font-weight: bold; }
.git-sep     { color: var(--fg-dim); }
.git-company { color: var(--blue); }
.git-date    { color: var(--fg-dim); }
.git-bullets { list-style: none; padding: 0; }
.git-bullets li { color: var(--fg); padding: 1px 0; font-size: 13px; }
.git-bullets li::before { content: '+ '; color: var(--green); }

/* ── TREE / SKILLS ────────────────────────────────────────────────────────── */
.tree-root { font-size: 13px; line-height: 1.9; }
.tree-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.tree-indent { padding-left: 24px; }
.tree-branch { color: var(--blue); font-weight: bold; }
.tree-pipe   { color: var(--fg-dim); white-space: nowrap; }
.tree-cat    { color: var(--yellow); font-weight: bold; }
.tree-item {
  color: var(--cyan);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  transition: border-color 0.15s;
}
.tree-item:hover { border-color: var(--blue); }

/* ── PROJECTS ─────────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.proj-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.proj-icon  { font-size: 18px; }
.proj-title { color: var(--green); font-weight: bold; flex: 1; }
.proj-links { display: flex; gap: 10px; }
.proj-links a { color: var(--fg-dim); text-decoration: none; font-size: 14px; transition: color 0.15s; }
.proj-links a:hover { color: var(--blue); }
.proj-desc  { color: #a9b1d6; font-size: 12px; line-height: 1.55; margin-bottom: 10px; }
.proj-tags  { display: flex; flex-wrap: wrap; gap: 5px; }
.ptag {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── CERTS ────────────────────────────────────────────────────────────────── */
.certs-list { display: flex; flex-direction: column; gap: 6px; }
.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}
a.cert-item:hover {
  background: rgba(125, 207, 255, 0.07);
  border-color: rgba(125, 207, 255, 0.3);
}
.edu-item { cursor: default; }
.cert-badge { font-size: 22px; flex-shrink: 0; }
.cert-name  { color: var(--yellow); font-weight: bold; font-size: 13px; }
a.cert-item:hover .cert-name { color: var(--blue); }
.cert-meta  { color: var(--cyan); font-size: 12px; margin-top: 3px; }
/* ── CONTACT ──────────────────────────────────────────────────────────────── */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 640px) { .contact-wrap { grid-template-columns: 1fr; } }
.contact-info { font-size: 13px; }
.cj-row { display: flex; gap: 0; margin-bottom: 5px; flex-wrap: wrap; }
.cj-key { color: var(--blue); }
.cj-sep { color: var(--fg-dim); margin: 0 6px; }
.cj-val { color: var(--green); text-decoration: none; transition: color 0.15s; }
.cj-val:hover { color: var(--blue); }

.contact-form { display: flex; flex-direction: column; gap: 8px; }
.contact-form input,
.contact-form textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--fg-dim); }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--blue); }
.contact-form button {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.contact-form button:hover { background: var(--green); color: var(--bg); }

/* ── STATUS ───────────────────────────────────────────────────────────────── */
.status-block { font-size: 13px; line-height: 1.8; }
.status-dot   { color: var(--green); }
.status-indent { padding-left: 20px; color: var(--fg); }

/* ── LS ───────────────────────────────────────────────────────────────────── */
.ls-row  { display: flex; gap: 16px; margin-bottom: 2px; font-size: 13px; }
.ls-perm { color: var(--fg-dim); }
.ls-size { color: var(--fg-dim); min-width: 36px; text-align: right; }
.ls-name { color: var(--fg); }
.ls-dir  { color: var(--blue); }

/* ── CLICKABLE COMMANDS ───────────────────────────────────────────────────── */
.clickable-cmd {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}
.clickable-cmd:hover { color: var(--purple); }

/* ── SCROLLBAR ────────────────────────────────────────────────────────────── */
#terminal::-webkit-scrollbar { width: 4px; }
#terminal::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
#terminal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
#terminal::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── SELECTION ────────────────────────────────────────────────────────────── */
::selection { background: rgba(125,207,255,0.18); }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #terminal { padding: 14px 16px; }
  .neofetch-art { display: none; }
  .motd-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  #title-bar-center { display: none; }
}
