/* ═══════════════════════════════════════════════════════════
   Portfolio — Koneshka Bandyopadhyay
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0c10;
  --terminal-bg: #0d1117;
  --text: #c9d1d9;
  --text-dim: #484f58;
  --text-muted: #6e7681;
  --accent: #ff0033;
  --accent-dim: rgba(255, 0, 51, 0.15);
  --accent-glow: rgba(255, 0, 51, 0.25);
  --green: #56d364;
  --blue: #58a6ff;
  --cyan: #56d4dd;
  --yellow: #d29922;
  --purple: #bc8cff;
  --orange: #f0883e;
  --border: #21262d;
  --border-light: #30363d;
  --title-bg: #161b22;
  --card-bg: #161b22;
  --card-hover: #1c2333;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --glow: 0 0 80px rgba(255, 0, 51, 0.08);
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --heading-text: #ffffff;
}

/* ── Light Mode ──────────────────────────────────────────── */
body.light-mode {
  --bg: #f5f6fa;
  --terminal-bg: #ffffff;
  --text: #24292f;
  --text-dim: #8b949e;
  --text-muted: #57606a;
  --accent: #d6001c;
  --accent-dim: rgba(214, 0, 28, 0.1);
  --accent-glow: rgba(214, 0, 28, 0.15);
  --green: #1a7f37;
  --blue: #0969da;
  --cyan: #0e7c86;
  --yellow: #9a6700;
  --purple: #8250df;
  --orange: #bc4c00;
  --border: #d0d7de;
  --border-light: #d8dee4;
  --title-bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-hover: #f6f8fa;
  --glow: 0 0 80px rgba(214, 0, 28, 0.04);
  --overlay-bg: rgba(255, 255, 255, 0.75);
  --heading-text: #1a1a2e;
}

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

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   MODE SELECTOR
   ═══════════════════════════════════════════════════════════ */

.mode-selector {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--bg);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mode-bg-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,0,51,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.mode-content {
  position: relative;
  text-align: center;
  max-width: 720px;
  padding: 0 24px;
}

.mode-ascii {
  font-family: var(--mono);
  font-size: clamp(5px, 1.15vw, 11px);
  line-height: 1.2;
  white-space: pre;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 20px;
  user-select: none;
}

.mode-subtitle {
  font-family: var(--sans);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 800;
  color: var(--heading-text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.mode-tagline {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.mode-choose {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.mode-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-card {
  position: relative;
  width: 260px;
  padding: 32px 24px 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-family: var(--sans);
  color: var(--text);
  outline: none;
}

.mode-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(255, 0, 51, 0.12), 0 0 0 1px var(--accent);
}

.mode-card:active {
  transform: translateY(-1px);
}

.mode-card-icon {
  font-size: 36px;
  margin-bottom: 14px;
  line-height: 1;
}

.mode-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading-text);
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.mode-card-desc code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-dim);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}

.mode-card-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   TERMINAL MODE
   ═══════════════════════════════════════════════════════════ */

.terminal-mode {
  position: fixed;
  inset: 0;
  z-index: 10;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 2px,
    rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px
  );
}

.crt-glow {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.25) 100%);
}

.terminal-window {
  position: fixed;
  inset: 16px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--glow), 0 24px 80px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.title-bar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  background: var(--title-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
}

.title-bar-buttons { display: flex; gap: 8px; margin-right: 16px; }
.title-bar-buttons span { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; }
.btn-close { background: #ff5f57; }
.btn-minimize { background: #febc2e; }
.btn-maximize { background: #28c840; }

.title-bar-text {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.title-bar-spacer { width: 68px; }

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--terminal-bg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

#output { white-space: pre-wrap; word-wrap: break-word; }
#output .line { min-height: 1.65em; }
#output .prompt-echo { color: var(--text); }
#output .prompt-echo .prompt-text { color: var(--green); font-weight: 500; text-shadow: 0 0 8px rgba(86, 211, 100, 0.4); }
#output .prompt-echo .cmd-text { color: var(--text); }

/* Color classes */
.c-accent { color: var(--accent) !important; }
.c-green { color: var(--green) !important; text-shadow: 0 0 8px rgba(86, 211, 100, 0.4); }
.c-blue { color: var(--blue) !important; }
.c-cyan { color: var(--cyan) !important; }
.c-yellow { color: var(--yellow) !important; }
.c-purple { color: var(--purple) !important; }
.c-orange { color: var(--orange) !important; }
.c-dim { color: var(--text-dim) !important; }
.c-muted { color: var(--text-muted) !important; }
.c-text { color: var(--text) !important; }
.c-bold { font-weight: 700 !important; }
.c-white { color: var(--heading-text) !important; }

.ls-dir { color: var(--blue); font-weight: 600; }
.ls-file { color: var(--text); }
.ls-exec { color: var(--green); font-weight: 500; }

/* ── Clickable links ─────────────────────────────────────── */
.term-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(88, 166, 255, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: pre-wrap;
}

.term-link:hover {
  color: #79c0ff;
  text-decoration-color: var(--blue);
  background: rgba(88, 166, 255, 0.08);
  border-radius: 3px;
}

.input-line { display: flex; align-items: center; min-height: 1.65em; }
.prompt { color: var(--green); font-weight: 500; white-space: nowrap; flex-shrink: 0; font-family: var(--mono); text-shadow: 0 0 8px rgba(86, 211, 100, 0.4); }
.input-wrapper { position: relative; flex: 1; display: flex; align-items: center; }

#command-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  caret-color: transparent;
  padding: 0;
}

.cursor-block {
  position: absolute;
  width: 8px;
  height: 1.25em;
  background: var(--accent);
  opacity: 0.85;
  animation: blink 1s step-end infinite;
  pointer-events: none;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0; }
}

.legend-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--title-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  user-select: none;
}

.legend-item {
  font-size: 12px;
  color: var(--text);
  padding: 3px 10px;
  font-family: var(--mono);
}

.legend-item kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 0, 51, 0.12);
  border: 1px solid rgba(255, 0, 51, 0.3);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  margin-right: 5px;
}

.banner-center {
  text-align: center;
  white-space: pre;
}

/* ═══════════════════════════════════════════════════════════
   EXPLORER MODE
   ═══════════════════════════════════════════════════════════ */

.explorer-mode {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: slideUp 0.4s ease;
}

/* ── Explorer Nav ────────────────────────────────────────── */
.explorer-nav {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 20px;
  background: var(--title-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.explorer-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.explorer-back-btn:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--border-light);
}

.explorer-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-segment {
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  user-select: none;
}

.breadcrumb-segment:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.breadcrumb-segment.active {
  color: var(--text);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--text-dim);
  font-size: 11px;
  user-select: none;
}

.explorer-nav-right {
  display: flex;
  gap: 8px;
}

.explorer-view-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.explorer-view-toggle:hover {
  background: var(--card-hover);
  color: var(--text);
}

/* ── Explorer Body ───────────────────────────────────────── */
.explorer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.explorer-body::-webkit-scrollbar { width: 6px; }
.explorer-body::-webkit-scrollbar-track { background: transparent; }
.explorer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Grid View ───────────────────────────────────────────── */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.explorer-grid.list-view {
  grid-template-columns: 1fr;
  gap: 4px;
}

/* ── File/Folder Cards ───────────────────────────────────── */
.explorer-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
  min-height: 140px;
  justify-content: center;
}

.explorer-item:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 0, 51, 0.1), 0 0 0 1px rgba(255, 0, 51, 0.15);
}

.explorer-item:active {
  transform: translateY(0);
}

.explorer-item.is-dir:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(255, 0, 51, 0.12), 0 0 0 1px rgba(255, 0, 51, 0.2);
}

.explorer-item.is-exec:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(255, 0, 51, 0.1);
}

.explorer-item.is-file:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(255, 0, 51, 0.1);
}

.explorer-item-icon {
  margin-bottom: 12px;
  line-height: 1;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explorer-item:hover .explorer-item-icon {
  transform: scale(1.08);
}

.explorer-item-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.3;
}

.explorer-item.is-dir .explorer-item-name {
  color: var(--accent);
  font-weight: 600;
}

.explorer-item.is-exec .explorer-item-name {
  color: var(--accent);
  font-weight: 500;
}

.explorer-item-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── List View Items ─────────────────────────────────────── */
.list-view .explorer-item {
  flex-direction: row;
  align-items: center;
  padding: 12px 18px;
  border-radius: 10px;
  text-align: left;
  gap: 16px;
  min-height: auto;
}

.list-view .explorer-item-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.list-view .explorer-item-icon svg,
.list-view .explorer-item-icon img {
  width: 28px;
  height: 28px;
}

.list-view .explorer-item:hover .explorer-item-icon {
  transform: none;
}

.list-view .explorer-item-name {
  font-size: 13px;
  flex: 1;
}

.list-view .explorer-item-meta {
  margin-top: 0;
  flex-shrink: 0;
}

/* ── Back card ───────────────────────────────────────────── */
.explorer-item.back-item {
  border-style: dashed;
  border-color: rgba(255, 0, 51, 0.2);
  opacity: 0.65;
  min-height: 100px;
}

.explorer-item.back-item:hover {
  opacity: 1;
  border-color: var(--accent);
  border-style: solid;
  background: rgba(255, 0, 51, 0.04);
}

/* ═══════════════════════════════════════════════════════════
   FILE VIEWER (full-stage overlay)
   ═══════════════════════════════════════════════════════════ */

.file-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.file-viewer {
  width: min(94vw, 960px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--terminal-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 0, 51, 0.06);
  animation: viewerIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes viewerIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.file-viewer-title {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-viewer-title .fv-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
}

.file-viewer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.file-viewer-close:hover {
  background: rgba(255, 0, 51, 0.15);
  color: var(--accent);
}

.file-viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  font-family: var(--mono);
  font-size: 15.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.file-viewer-body::-webkit-scrollbar { width: 6px; }
.file-viewer-body::-webkit-scrollbar-track { background: transparent; }
.file-viewer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.file-viewer-body .line {
  min-height: 1.8em;
}

/* ── Full-width file headers ─────────────────────────────── */
.file-viewer-body .fv-header {
  display: block;
  width: 100%;
  padding: 16px 20px;
  margin: 0 0 16px 0;
  border: 1px solid rgba(255, 0, 51, 0.25);
  border-radius: 10px;
  background: rgba(255, 0, 51, 0.04);
  white-space: normal;
  line-height: 1.5;
}

.file-viewer-body .fv-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading-text);
  margin-bottom: 4px;
}

.file-viewer-body .fv-header-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.file-viewer-body .fv-header-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Color variants for headers */
.file-viewer-body .fv-header.fv-blue {
  border-color: rgba(88, 166, 255, 0.3);
  background: rgba(88, 166, 255, 0.04);
}

.file-viewer-body .fv-header.fv-purple {
  border-color: rgba(188, 140, 255, 0.3);
  background: rgba(188, 140, 255, 0.04);
}

.file-viewer-body .fv-header.fv-yellow {
  border-color: rgba(210, 153, 34, 0.3);
  background: rgba(210, 153, 34, 0.04);
}

.file-viewer-body .fv-header.fv-green {
  border-color: rgba(63, 185, 80, 0.3);
  background: rgba(63, 185, 80, 0.04);
}

.file-viewer-body .fv-header.fv-orange {
  border-color: rgba(240, 136, 62, 0.3);
  background: rgba(240, 136, 62, 0.04);
}

.file-viewer-body .fv-header.fv-cyan {
  border-color: rgba(86, 212, 221, 0.3);
  background: rgba(86, 212, 221, 0.04);
}

.file-viewer-body .fv-header.fv-red {
  border-color: rgba(255, 0, 51, 0.3);
  background: rgba(255, 0, 51, 0.04);
}

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════ */

.theme-toggle {
  position: fixed;
  z-index: 9999;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(255, 0, 51, 0.15);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* Hide the wrong icon based on mode */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body.light-mode .theme-toggle .icon-sun { display: block; }
body.light-mode .theme-toggle .icon-moon { display: none; }

/* ═══════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

body.light-mode .mode-bg-glow {
  background: radial-gradient(circle, rgba(214, 0, 28, 0.04) 0%, transparent 65%);
}

body.light-mode .mode-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.light-mode .mode-card:hover {
  box-shadow: 0 12px 40px rgba(214, 0, 28, 0.08), 0 0 0 1px var(--accent);
}

body.light-mode .breadcrumb-segment:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Terminal in light: softer scanlines and CRT */
body.light-mode .scanlines {
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 2px,
    rgba(0, 0, 0, 0.015) 2px, rgba(0, 0, 0, 0.015) 4px
  );
}

body.light-mode .crt-glow {
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.06) 100%);
}

body.light-mode .terminal-window {
  box-shadow: var(--glow), 0 24px 80px rgba(0, 0, 0, 0.12);
}

body.light-mode .file-viewer {
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.15), 0 0 60px rgba(214, 0, 28, 0.03);
}

body.light-mode .explorer-item {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-mode .explorer-item:hover {
  box-shadow: 0 10px 30px rgba(214, 0, 28, 0.06), 0 0 0 1px rgba(214, 0, 28, 0.12);
}

body.light-mode .explorer-item.is-dir:hover {
  box-shadow: 0 10px 30px rgba(214, 0, 28, 0.08), 0 0 0 1px rgba(214, 0, 28, 0.15);
}

body.light-mode .explorer-item.back-item {
  border-color: rgba(214, 0, 28, 0.15);
}

body.light-mode .explorer-item.back-item:hover {
  background: rgba(214, 0, 28, 0.03);
}

body.light-mode .btn-close { background: #ff5f57; }
body.light-mode .btn-minimize { background: #febc2e; }
body.light-mode .btn-maximize { background: #28c840; }

body.light-mode .legend-item kbd {
  background: rgba(214, 0, 28, 0.08);
  border-color: rgba(214, 0, 28, 0.2);
}

body.light-mode .term-link {
  text-decoration-color: rgba(9, 105, 218, 0.3);
}

body.light-mode .term-link:hover {
  color: #0550ae;
  text-decoration-color: var(--blue);
  background: rgba(9, 105, 218, 0.06);
}

body.light-mode .theme-toggle {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.light-mode .c-green,
body.light-mode .prompt,
body.light-mode #output .prompt-echo .prompt-text {
  text-shadow: none;
}

/* Light mode header color variants */
body.light-mode .file-viewer-body .fv-header {
  border-color: rgba(214, 0, 28, 0.2);
  background: rgba(214, 0, 28, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-blue {
  border-color: rgba(9, 105, 218, 0.25);
  background: rgba(9, 105, 218, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-purple {
  border-color: rgba(130, 80, 223, 0.25);
  background: rgba(130, 80, 223, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-yellow {
  border-color: rgba(154, 103, 0, 0.25);
  background: rgba(154, 103, 0, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-green {
  border-color: rgba(26, 127, 55, 0.25);
  background: rgba(26, 127, 55, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-orange {
  border-color: rgba(188, 76, 0, 0.25);
  background: rgba(188, 76, 0, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-cyan {
  border-color: rgba(14, 124, 134, 0.25);
  background: rgba(14, 124, 134, 0.03);
}
body.light-mode .file-viewer-body .fv-header.fv-red {
  border-color: rgba(214, 0, 28, 0.25);
  background: rgba(214, 0, 28, 0.03);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* ── Mode Selector ─────────────────────────────────────── */
  .mode-selector { overflow-y: auto; align-items: flex-start; padding-top: 10vh; }
  .mode-content { padding: 0 16px; max-width: 100%; }
  .mode-ascii { font-size: clamp(3.5px, 1.8vw, 8px); margin-bottom: 12px; overflow-x: auto; }
  .mode-subtitle { font-size: clamp(20px, 5vw, 32px); }
  .mode-tagline { font-size: 12px; margin-bottom: 32px; }
  .mode-choose { font-size: 12px; margin-bottom: 18px; }
  .mode-cards { flex-direction: column; align-items: center; gap: 14px; }
  .mode-card { width: 100%; max-width: 320px; padding: 24px 20px 22px; }
  .mode-bg-glow { width: 400px; height: 400px; }

  /* ── Terminal ──────────────────────────────────────────── */
  .terminal-mode { overflow: hidden; }
  .terminal-window { inset: 0; border-radius: 0; border: none; }
  .terminal-body { padding: 12px 10px; font-size: 13px; line-height: 1.6; }
  #command-input { font-size: 13px; }
  .title-bar { height: 36px; padding: 0 10px; }
  .title-bar-text { font-size: 11px; }
  .title-bar-spacer { width: 52px; }
  .legend-bar { gap: 2px; padding: 6px 8px; }
  .legend-item { font-size: 10px; padding: 2px 4px; }
  .legend-item kbd { font-size: 10px; padding: 1px 4px; }
  .prompt { font-size: 13px; }
  .cursor-block { height: 1.1em; }
  .banner-center { font-size: 12px; }

  /* ── Explorer ──────────────────────────────────────────── */
  .explorer-nav { height: 46px; padding: 0 12px; gap: 8px; }
  .explorer-breadcrumb { font-size: 12px; }
  .explorer-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .explorer-item { padding: 20px 12px 16px; min-height: 110px; border-radius: 12px; }
  .explorer-item-name { font-size: 12px; }
  .explorer-item-icon svg,
  .explorer-item-icon img { width: 38px; height: 38px; }
  .explorer-body { padding: 14px; }

  /* ── File Viewer ───────────────────────────────────────── */
  .file-viewer { width: 100vw; max-height: 100vh; border-radius: 0; max-width: 100%; }
  .file-viewer-body { padding: 16px 14px; font-size: 13px; line-height: 1.7; }
  .file-viewer-header { padding: 12px 14px; }
  .file-viewer-title { font-size: 14px; gap: 8px; }
  .file-viewer-title .fv-icon { font-size: 18px; }
  .file-viewer-close { width: 34px; height: 34px; font-size: 22px; }
  .file-viewer-body .fv-header { padding: 12px 14px; margin: 0 0 12px 0; }
  .file-viewer-body .fv-header-title { font-size: 16px; }
  .file-viewer-body .fv-header-sub { font-size: 12px; }
  .file-viewer-body .fv-header-meta { font-size: 11px; }
  .file-viewer-overlay { padding: 0; }

  /* ── Theme Toggle ──────────────────────────────────────── */
  .theme-toggle { width: 40px; height: 40px; bottom: 16px; right: 16px; }
}

@media (max-width: 480px) {
  .mode-selector { padding-top: 6vh; }
  .mode-ascii { display: none; }
  .mode-subtitle { font-size: 22px; }
  .mode-tagline { font-size: 11px; margin-bottom: 28px; }
  .mode-card { padding: 20px 16px 18px; }
  .mode-card-title { font-size: 17px; }
  .mode-card-desc { font-size: 12px; }

  .terminal-body { padding: 10px 8px; font-size: 12px; }
  #command-input { font-size: 12px; }
  .prompt { font-size: 12px; }

  .explorer-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .explorer-item { padding: 16px 10px 12px; min-height: 100px; }
  .explorer-item-icon svg,
  .explorer-item-icon img { width: 32px; height: 32px; }

  .file-viewer-body { padding: 14px 12px; font-size: 12.5px; }

  .theme-toggle { width: 38px; height: 38px; bottom: 12px; right: 12px; }
  .theme-toggle svg { width: 17px; height: 17px; }
}

/* ── Touch-friendly improvements ─────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .mode-card { min-height: 120px; }
  .mode-card:hover { transform: none; }
  .mode-card:active { transform: scale(0.98); }
  .explorer-item:hover { transform: none; }
  .explorer-item:active { transform: scale(0.97); }
  .explorer-item:hover .explorer-item-icon { transform: none; }
}
