/* === GLOBAL === */
:root {
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.2);
  --green-border: rgba(16, 185, 129, 0.4);
  --blue: #3b82f6;
  --red: #ef4444;
  --yellow: #facc15;
  --bg: #050505;
  --bg-dark: #0d1117;
  --bg-card: rgba(30, 41, 59, 0.5);
  --border: rgba(51, 65, 85, 0.8);
  --border-light: rgba(255, 255, 255, 0.1);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }

/* === TEXT UTILITIES === */
.txt-green  { color: var(--green); }
.txt-blue   { color: var(--blue); }
.txt-red    { color: var(--red); }
.txt-yellow { color: var(--yellow); }
.txt-white  { color: #fff; }
.txt-muted  { color: var(--text-muted); }
.txt-dim    { color: var(--text-dim); }
.txt-xs     { font-size: 0.75rem; }
.txt-sm     { font-size: 0.875rem; }
.bold       { font-weight: 700; }
.mono       { font-family: 'JetBrains Mono', monospace; }

/* === SPACING UTILITIES === */
.mb-xs  { margin-bottom: 0.25rem; }
.mb-sm  { margin-bottom: 0.5rem; }
.mb-md  { margin-bottom: 1rem; }
.mt-xs  { margin-top: 0.25rem; }
.mt-sm  { margin-top: 0.5rem; }
.pl-sm  { padding-left: 0.5rem; }

/* === LAYOUT === */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }
.w-full       { width: 100%; }
.hidden       { display: none !important; }

/* === DOCK === */
.dock-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(40, 40, 45, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  max-width: 90vw;
  overflow-x: auto;
}

.dock-container::-webkit-scrollbar { display: none; }

.dock-item {
  position: relative;
  min-width: 3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

@media (min-width: 768px) {
  .dock-container { gap: 1rem; padding: 0.75rem 1.5rem; }
  .dock-item { min-width: 3.5rem; width: 3.5rem; height: 3.5rem; font-size: 1.25rem; }
}

.dock-item:hover {
  transform: translateY(-8px) scale(1.1);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.dock-item.active {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-border);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.dock-item::after {
  content: attr(data-label);
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dock-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  top: -3rem;
}

/* === APP WINDOWS === */
.app-window {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: 7rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.app-window.active-app {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

/* === LOGO === */
.logo-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--green);
  transition: color 0.2s;
}

.logo-btn:hover { color: #34d399; }

.logo-ascii {
  font-size: 0.3rem;
  line-height: 0.35rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: border-color 0.2s;
  display: block;
  white-space: pre;
}

.logo-btn:hover .logo-ascii { border-color: rgba(16, 185, 129, 0.5); }

@media (min-width: 768px) {
  .logo-ascii { font-size: 0.4rem; line-height: 0.45rem; }
}

/* === TERMINAL === */
#terminal-view {
  background-color: var(--bg-dark);
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
}

@media (min-width: 768px) { #terminal-view { padding: 2rem; } }

.terminal-inner {
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) { .terminal-inner { padding-top: 2.5rem; } }

.terminal-ascii {
  color: var(--green);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.terminal-ascii pre {
  font-size: 0.6rem;
  line-height: 1;
  font-weight: 700;
}

@media (min-width: 768px) { .terminal-ascii pre { font-size: 0.875rem; } }

.terminal-line { margin-bottom: 0.5rem; line-height: 1.6; word-break: break-word; }

.terminal-prompt {
  display: flex;
  align-items: center;
  color: #34d399;
  margin-top: 0.5rem;
}

.terminal-prompt-label {
  margin-right: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd-input {
  background: transparent;
  border: none;
  color: white;
  outline: none;
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit;
}

/* === KEYCAPS === */
.keycap {
  background: linear-gradient(to bottom, #334155, #1e293b);
  border: 1px solid #475569;
  box-shadow: 0 4px 0 #0f172a;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.1s;
}

.keycap.pressed, .keycap:active {
  transform: translateY(4px);
  box-shadow: none;
}

/* === ABOUT === */
.about-view-inner {
  max-width: 48rem;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  text-align: center;
  padding-top: 5rem;
}

.about-avatar {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1.5rem;
  background: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(16, 185, 129, 0.3);
  font-size: 3rem;
  color: #34d399;
}

.about-name {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.about-title {
  font-size: 1.25rem;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1.5rem;
}

.about-bio {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 9999px;
  color: white;
  transition: background 0.2s;
  font-size: 0.95rem;
}

.about-link:hover { background: #293548; }

.about-link.primary {
  background: #059669;
  border-color: #059669;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.about-link.primary:hover { background: #10b981; }

/* === PROJECTS === */
.projects-inner {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
  padding-top: 5rem;
  padding-bottom: 8rem;
}

@media (min-width: 768px) { .projects-inner { padding: 2rem; padding-top: 3rem; padding-bottom: 8rem; } }

.projects-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; color: white; margin-bottom: 0.5rem; }
.projects-subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.projects-list {
  display: flex;
  flex-direction: column;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #1a2332;
  cursor: pointer;
  transition: border-left-color 0.2s, background 0.15s;
}

.project-row:first-child { border-top: 1px solid #1a2332; }
.project-row:hover { border-left-color: var(--accent, var(--green)); background: rgba(255,255,255,0.02); }

.project-row-body { flex: 1; min-width: 0; }

.project-row-name {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.25rem;
}

.project-row-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 0;
}

.project-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
}

.project-arrow {
  color: #334155;
  font-size: 0.8rem;
  transition: color 0.2s, transform 0.2s;
}

.project-row:hover .project-arrow { color: var(--accent, var(--green)); transform: translateX(3px); }

.project-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.project-tag {
  padding: 0.15rem 0.45rem;
  background: #1e293b;
  border-radius: 0.2rem;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
}

.project-tag.purple { color: #c084fc; }
.project-tag.pink   { color: #f472b6; }
.project-tag.orange { color: #fb923c; }
.project-tag.green  { color: #34d399; }

.btn-visit {
  padding: 0.375rem 0.75rem;
  background: #059669;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
  transition: background 0.2s, transform 0.1s;
}

.btn-visit:hover { background: var(--green); }
.btn-visit:active { transform: scale(0.95); }

/* === SPEED TEST (WPM) === */
.speedtest-inner {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  padding-top: 4rem;
}

@media (min-width: 768px) { .speedtest-inner { padding: 2.5rem; } }

.speedtest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.speedtest-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.speedtest-keys { display: none; gap: 0.75rem; }
@media (min-width: 768px) { .speedtest-keys { display: flex; } }

.keycap-group { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.keycap-label { font-size: 0.625rem; color: var(--text-dim); text-transform: uppercase; }

.speedtest-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) { .speedtest-stats { gap: 1rem; } }

.stat-box {
  text-align: center;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.stat-label { font-size: 0.625rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
@media (min-width: 768px) { .stat-label { font-size: 0.75rem; } }

.stat-value {
  font-size: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

@media (min-width: 768px) { .stat-value { font-size: 2rem; } }

.stat-value.green  { color: var(--green); }
.stat-value.blue   { color: var(--blue); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.red    { color: var(--red); }

.word-container {
  width: 100%;
  height: 8rem;
  background: var(--bg-dark);
  border-radius: 0.5rem;
  border: 1px solid #334155;
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  color: var(--text-dim);
  overflow: hidden;
  position: relative;
  cursor: text;
  margin-bottom: 2rem;
}

@media (min-width: 768px) { .word-container { font-size: 1.5rem; } }

.blur-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, 0.8);
  z-index: 10;
  transition: opacity 0.2s;
}

.blur-overlay span { color: var(--green); font-size: 0.875rem; animation: pulse 2s infinite; }
@media (min-width: 768px) { .blur-overlay span { font-size: 1rem; } }

.hidden-input {
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

.st-word { display: inline-block; margin-right: 0.75rem; margin-bottom: 0.5rem; padding: 0 0.25rem; border-radius: 0.25rem; transition: color 0.1s; color: var(--text-dim); }
.st-word.correct  { color: #10b981; }
.st-word.wrong    { color: var(--red); text-decoration: line-through; }
.st-word-active   { background: rgba(51, 65, 85, 0.5); }

.chart-wrapper {
  height: 12rem;
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Typing highlights */
.char-correct { color: #34d399; }
.char-wrong   { color: #f87171; border-bottom: 2px solid var(--red); }
.char-cursor  { background-color: rgba(51, 65, 85, 0.8); color: white; border-bottom: 2px solid #34d399; border-radius: 2px; }
.char-extra   { color: var(--red); opacity: 0.7; }

/* === GAME (FLAPPY) === */
.game-inner {
  position: relative;
  width: 100%;
  max-width: 28rem;
}

.flappy-canvas {
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: #0f172a;
  cursor: pointer;
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  image-rendering: pixelated;
}

.game-start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0.5rem;
  z-index: 20;
}

.game-start-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  letter-spacing: 0.15em;
  font-family: 'JetBrains Mono', monospace;
}

.game-controls { display: flex; flex-direction: column; gap: 0.75rem; text-align: center; }

.game-control-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.kbd {
  padding: 0.25rem 0.5rem;
  background: #334155;
  border-radius: 0.25rem;
  border: 1px solid #475569;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.game-tidbit {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translate(-50%, 0) scale(0.95);
  padding: 0.75rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 0.75rem;
  color: #6ee7b7;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
  z-index: 10;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.game-score {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  z-index: 10;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.game-hint {
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: pulse 2s infinite;
}

@media (min-width: 768px) { .game-hint { font-size: 0.875rem; } }

/* === TIC TAC TOE === */
.tictactoe-inner {
  width: 100%;
  max-width: 32rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

@media (min-width: 768px) { .tictactoe-inner { padding: 2rem; } }

.ttt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

.ttt-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) { .ttt-title { font-size: 1.5rem; } }

.ttt-controls { display: flex; gap: 0.5rem; }

.btn-sm {
  padding: 0.25rem 0.75rem;
  background: #334155;
  color: white;
  font-size: 0.75rem;
  border: 1px solid #475569;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-sm:hover { background: #475569; }

.ttt-status {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  min-height: 2rem;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
  aspect-ratio: 1;
}

.ttt-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
}

.ttt-cell:hover { background: rgba(255,255,255,0.05); }

/* === NET SPEED === */
.nettest-inner { text-align: center; }

.net-speed-label {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

@media (min-width: 768px) { .net-speed-label { font-size: 1.5rem; } }

.net-speed-number {
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  color: #64748b;
  letter-spacing: -0.05em;
  transition: color 0.2s, font-size 0.2s;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.net-speed-number.done  { color: var(--green); }
.net-speed-number.error { color: var(--red); }

.net-speed-unit {
  font-size: 1.25rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2rem;
}

.net-run-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid #334155;
  background: none;
  color: var(--green);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s;
}

.net-run-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* === QUICK TOOLS === */
.tools-inner {
  width: 100%;
  max-width: 80rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  position: relative;
  padding-top: 4rem;
}

@media (min-width: 768px) {
  .tools-inner { flex-direction: row; height: 80vh; }
}

.tools-mobile-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: var(--green);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tools-mobile-toggle:hover { background: #293548; }

@media (min-width: 768px) { .tools-mobile-toggle { display: none; } }

.tools-sidebar {
  position: fixed;
  inset-y: 0;
  left: 0;
  z-index: 50;
  width: 18rem;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px);
  border-right: 1px solid #334155;
  transform: translateX(-100%);
  transition: transform 0.3s;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  height: 100%;
}

.tools-sidebar.sidebar-open { transform: translateX(0); }

@media (min-width: 768px) {
  .tools-sidebar {
    position: static;
    width: 16rem;
    background: var(--bg-card);
    backdrop-filter: none;
    border: 1px solid #334155;
    border-radius: var(--radius);
    transform: none;
    height: 100%;
  }
}

.tools-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

@media (min-width: 768px) { .tools-sidebar-header { display: none; } }

.tools-sidebar-title { color: var(--green); font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.tools-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.25rem 0.5rem;
}

.tools-close-btn:hover { color: white; }

.tools-section-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.tool-btn {
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-muted);
  transition: all 0.2s;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  width: 100%;
  font-size: 0.875rem;
}

.tool-btn:hover { background: rgba(255,255,255,0.05); color: white; }

.tool-btn.active {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.tools-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: 3rem;
}

@media (min-width: 768px) { .tools-main { margin-top: 0; } }

.tool-panel {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

.tool-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }

.tool-panel-label { font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.tool-panel-label.input  { color: var(--green); }
.tool-panel-label.output { color: var(--blue); }

.tool-clear-btn, .tool-copy-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.tool-clear-btn:hover, .tool-copy-btn:hover { color: white; }

.tool-config-panel {
  margin-bottom: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #334155;
  display: flex;
  gap: 0.5rem;
}

.tool-io {
  flex-grow: 1;
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  resize: none;
  padding: 0.75rem;
}

.tool-io:focus { outline: none; border-color: var(--green); }
.tool-output { color: var(--green); }

.tool-param-input {
  width: 100%;
  background: transparent;
  border: none;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  outline: none;
}

.tool-param-input::placeholder { color: #334155; }

.dork-select {
  width: 100%;
  background: #1e293b;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.tool-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.btn-primary {
  padding: 0.5rem 1.5rem;
  background: #059669;
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover { background: var(--green); }
.btn-primary:active { transform: scale(0.95); }

.btn-secondary {
  padding: 0.5rem 1.5rem;
  background: #334155;
  color: white;
  font-weight: 700;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover { background: #475569; }
.btn-secondary:active { transform: scale(0.95); }

.btn-tertiary {
  padding: 0.5rem 1.5rem;
  background: #1d4ed8;
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tertiary:hover { background: var(--blue); }
.btn-tertiary:active { transform: scale(0.95); }

.tool-visual-output {
  flex-grow: 1;
  width: 100%;
  background: #0d1117;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Terminal inline styles for network output */
.geoip-result {
  border-left: 2px solid var(--green);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  background: rgba(30, 41, 59, 0.3);
  border-radius: 0 0.25rem 0.25rem 0;
  margin-top: 0.25rem;
}

.geoip-row { display: flex; gap: 0.5rem; margin-bottom: 0.25rem; }

.whois-result {
  border-left: 2px solid var(--blue);
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

/* === ANIMATIONS === */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === OVERLAY (mobile sidebar backdrop) === */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 45;
  display: none;
}

.sidebar-backdrop.active { display: block; }
