/* ═══════════════════════════════════════════════
   components.css — Nav, sections, cards, palette
   ═══════════════════════════════════════════════ */

/* ════════════════════════════════════════════════
   NAV
   ════════════════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 2.5rem;
  display: flex;
  align-items: stretch;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-links {
  display: flex;
  flex: 0 0 auto;
}

.nav-right-spacer {
  flex: 1;
  background: var(--bg-surface);
}

.nav-link {
  color: var(--fg-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-right: 1px solid var(--border);
  border-top: 2px solid transparent;
  background: var(--bg-surface);
  transition: color 0.2s, background 0.2s, border-color 0.2s, opacity 0.15s;
  cursor: grab;
  user-select: none;
  position: relative;
}

.nav-link:active {
  cursor: grabbing;
}

.nav-link:hover {
  background: var(--bg-card);
  color: var(--fg);
  text-decoration: none;
}

.nav-link.active {
  background: var(--bg);
  color: var(--fg);
  border-top: 2px solid var(--accent);
}

.nav-link.is-dragging {
  opacity: 0.35;
  background: var(--bg-card);
}

.nav-link.drag-target-left::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  z-index: 20;
}

.nav-link.drag-target-right::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  z-index: 20;
}

.nav-link .dim {
  color: var(--accent-dim);
}

/* Subtle visual feedback when section order changes */
.section-reordered {
  animation: section-pulse 0.7s ease-out;
}

@keyframes section-pulse {
  0%   { outline: 2px solid var(--accent); outline-offset: -2px; }
  100% { outline: 2px solid transparent; outline-offset: -2px; }
}

/* theme cycle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ════════════════════════════════════════════════
   HERO / ABOUT
   ════════════════════════════════════════════════ */
.hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: center;
}

/* Dithered portrait container */
.hero-portrait {
  position: relative;
}

#dither-canvas {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 260 / 320;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px var(--accent-glow);
  transition: box-shadow 0.3s;
}

#dither-canvas:hover {
  box-shadow: 0 0 60px var(--accent-glow), 0 0 120px var(--shadow);
}

/* Hand-drawn look for paper theme */
[data-theme="paper"] #dither-canvas {
  border: none;
  box-shadow: none;
  transform: rotate(-1.5deg);
  mix-blend-mode: multiply;
  transition: transform 0.3s;
}

[data-theme="paper"] #dither-canvas:hover {
  box-shadow: none;
  transform: rotate(-1.5deg) scale(1.02);
}

.hero-label {
  font-size: 0.75rem;
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.25rem;
  position: relative;
  display: inline-block;
}

/* Glitch — triggered by JS (.glitching class) with a cooldown */
.hero-name.glitching {
  animation: glitch 0.55s steps(1) forwards;
}

@keyframes glitch {
  0%   { clip-path: inset(38% 0 55% 0); transform: translateX(-1px); color: var(--accent); }
  18%  { clip-path: inset(12% 0 78% 0); transform: translateX( 1px); color: var(--fg); }
  35%  { clip-path: inset(68% 0 18% 0); transform: translateX(-1px); color: var(--accent); }
  55%  { clip-path: none;               transform: translateX(0);     color: var(--fg); }
  100% { clip-path: none;               transform: translateX(0);     color: var(--fg); }
}

.hero-tagline {
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 2rem;
  min-height: 1.5em;
}

.cursor {
  display: inline-block;
  color: var(--cursor-color);
  animation: blink 1s step-end infinite;
  font-weight: 400;
}

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

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
}

.hero-meta p {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-meta .dim {
  min-width: 5.5rem;
  color: var(--fg-dim);
}

/* ════════════════════════════════════════════════
   SKILLS
   ════════════════════════════════════════════════ */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 680px;
}

.skill-row {
  display: grid;
  grid-template-columns: 11rem 1fr 3.5rem;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.skill-name {
  color: var(--fg);
  white-space: nowrap;
}

.skill-bar-wrap {
  height: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  position: relative;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Block character fill effect */
.skill-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent 5px,
    rgba(0,0,0,0.15) 5px,
    rgba(0,0,0,0.15) 6px
  );
}

.skill-pct {
  color: var(--fg-dim);
  font-size: 0.75rem;
  text-align: right;
}

/* ════════════════════════════════════════════════
   PROJECTS
   ════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-dim);
  min-height: 2.4rem;
}

.project-card-dots {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.project-card-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.project-card-dots span:nth-child(1) { background: #ff5f56; }
.project-card-dots span:nth-child(2) { background: #ffbd2e; }
.project-card-dots span:nth-child(3) { background: #27c93f; }

.project-card-title {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-body {
  padding: 1rem;
}

.project-card-desc {
  font-size: 0.8rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.project-card-links {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
}

.project-card-links a {
  color: var(--fg-dim);
  transition: color 0.2s;
}

.project-card-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* WIP badge */
.wip-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  background: var(--accent);
  color: var(--bg);
  letter-spacing: 0.1em;
  line-height: 1.2;
  flex-shrink: 0;
  border-radius: 2px;
}

/* Fallback if wip-badge is direct child of project-card */
.project-card > .wip-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
}

.project-card:has(> .wip-badge) .project-card-title {
  padding-right: 2.8rem;
}

/* ════════════════════════════════════════════════
   HOBBIES
   ════════════════════════════════════════════════ */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.hobby-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.hobby-panel:hover {
  border-color: var(--accent-dim);
}

.hobby-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.hobby-body {
  font-size: 0.8rem;
  color: var(--fg-dim);
  line-height: 1.7;
}

.hobby-body strong {
  color: var(--fg);
  font-weight: 400;
}

/* ════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════ */
.contact-block {
  max-width: 560px;
}

.contact-intro {
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.contact-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  align-items: center;
  font-size: 0.82rem;
  gap: 0.5rem;
}

.contact-label {
  color: var(--fg-dim);
}

.contact-label::after {
  content: ' →';
  color: var(--accent-dim);
}

.contact-row a {
  color: var(--fg);
  transition: color 0.2s;
}

.contact-row a:hover {
  color: var(--accent);
  text-decoration: none;
}

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.8rem;
  background: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s;
}

.resume-btn:hover {
  background: var(--accent-glow);
  text-decoration: none;
}

/* ════════════════════════════════════════════════
   COMMAND PALETTE
   ════════════════════════════════════════════════ */
#cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  pointer-events: none;
}

#cmd-overlay:not(.hidden) {
  pointer-events: all;
}

#cmd-panel {
  width: 100%;
  background: var(--cmd-bg);
  border-top: 1px solid var(--accent);
  padding: 1rem 1.5rem 1.25rem;
  max-height: 45vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 0.82rem;
  box-shadow: 0 -10px 40px var(--accent-glow);
  transition: background 0.3s;
}

#cmd-output {
  flex: 1;
  overflow-y: auto;
  color: var(--fg-dim);
  line-height: 1.8;
  min-height: 0;
  white-space: pre-wrap;
  max-height: 30vh;
  margin-bottom: 0.5rem;
  scroll-behavior: smooth;
}

#cmd-output .out-line { color: var(--fg-dim); }
#cmd-output .out-acc  { color: var(--accent); }
#cmd-output .out-err  { color: #ff4444; }
#cmd-output .out-cmd  { color: var(--fg); }

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.cmd-prompt {
  color: var(--accent);
  flex-shrink: 0;
}

#cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.82rem;
  caret-color: var(--cursor-color);
}

#cmd-input::placeholder {
  color: var(--fg-dim);
  opacity: 0.5;
}

/* ════════════════════════════════════════════════
   NEOVIM STATUSLINE
   ════════════════════════════════════════════════ */
#statusline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.8rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  z-index: 100;
}

.stat-left,
.stat-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.stat-left span,
.stat-right span,
.stat-theme {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  height: 100%;
}

.stat-mode {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.stat-file {
  color: var(--fg);
  background: var(--bg-card);
}

.stat-readonly,
.stat-enc,
.stat-pos {
  color: var(--fg-dim);
}

.stat-theme {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.2s;
}

.stat-theme:hover {
  color: var(--accent);
}

/* Adjust main to make room for fixed top/bottom bars */
main {
  padding-bottom: 3rem;
}

/* Adjust command palette so it sits above statusline */
#cmd-panel {
  margin-bottom: 1.8rem;
}

/* ════════════════════════════════════════════════
   SITE FOOTER (Content Footer)
   ════════════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 3.5rem 1.5rem 4.5rem;
  color: var(--fg-dim);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.site-footer a {
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px dotted var(--fg-dim);
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-footer kbd {
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg-card);
  border-radius: 2px;
}

/* ════════════════════════════════════════════════
   NEOVIM CMDLINE POPUP (Noice.nvim style)
   ════════════════════════════════════════════════ */
#nvim-cmdline-popup {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 580px;
  background: var(--cmd-bg);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px var(--accent-glow), 0 0 15px rgba(0,0,0,0.5);
  z-index: 600;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nvim-cmdline-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nvim-cmdline-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
}

#nvim-cmdline-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  caret-color: var(--cursor-color);
}

#nvim-cmdline-input::placeholder {
  color: var(--fg-dim);
  opacity: 0.6;
}

.nvim-cmdline-hint {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--fg-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
}

/* ════════════════════════════════════════════════
   WHICH-KEY POPUP (which-key.nvim style)
   ════════════════════════════════════════════════ */
#which-key-popup {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 860px;
  background: var(--cmd-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -5px 25px var(--shadow), 0 0 20px rgba(0,0,0,0.6);
  z-index: 550;
  border-radius: 4px 4px 0 0;
  padding: 0.75rem 1rem 0.9rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: which-key-up 0.15s ease-out;
}

@keyframes which-key-up {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.which-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.which-key-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.which-key-hint {
  font-size: 0.65rem;
}

.which-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 0.8rem;
}

.which-key-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.which-key-item:hover {
  background: var(--bg-card);
}

.which-key-key {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 1.6rem;
  padding: 0.05rem 0.3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-align: center;
}

.which-key-desc {
  color: var(--fg);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════
   NVIM NOTIFICATIONS (nvim-notify style)
   ════════════════════════════════════════════════ */
#nvim-notify-container {
  position: fixed;
  top: 3.2rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.nvim-notification {
  background: var(--cmd-bg);
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  border-radius: 3px;
  box-shadow: 0 4px 15px var(--shadow), 0 0 10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: all;
  animation: nvim-slide-in 0.2s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-width: 220px;
  max-width: 380px;
}

.nvim-notification.fading {
  opacity: 0;
  transform: translateY(-8px);
}

@keyframes nvim-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nvim-notify-icon {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.nvim-notify-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.nvim-notify-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nvim-notify-msg {
  color: var(--fg);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════
   PAPER THEME — NOTEBOOK LINES
   ════════════════════════════════════════════════ */

/* Override dot-grid with college-ruled lines + red margin */
[data-theme="paper"] body::before {
  background-image:
    /* red left margin */
    linear-gradient(
      to right,
      transparent 76px,
      var(--margin-color) 76px,
      var(--margin-color) 78px,
      transparent 78px
    ),
    /* college-ruled horizontal lines */
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--rule-height) - 1px),
      var(--rule-color) calc(var(--rule-height) - 1px),
      var(--rule-color) var(--rule-height)
    );
  background-size: 100% 100%, 100% var(--rule-height);
  opacity: 1;
}

/* Make section backgrounds slightly see-through so lines bleed through */
[data-theme="paper"] .section,
[data-theme="paper"] .project-card,
[data-theme="paper"] .hobby-panel {
  background: transparent;
}

[data-theme="paper"] .project-card {
  background: rgba(237, 229, 212, 0.55);
  border-color: var(--border);
}

[data-theme="paper"] .project-card-header {
  background: rgba(227, 218, 200, 0.7);
}

[data-theme="paper"] .hobby-panel {
  background: rgba(237, 229, 212, 0.45);
}

/* Nav: faint top ruled line for paper */
[data-theme="paper"] #nav {
  border-bottom-color: var(--rule-color);
}

/* Skill bars: look like pencil marks */
[data-theme="paper"] .skill-bar {
  background: var(--accent);
  opacity: 0.75;
}

[data-theme="paper"] .skill-bar-wrap {
  background: rgba(200, 184, 154, 0.35);
}

/* Command palette: looks like a sticky note */
[data-theme="paper"] #cmd-panel {
  border-top: 2px solid var(--accent);
  border-left: 4px solid var(--rule-color);
}

/* ════════════════════════════════════════════════
   ASCII DRAGON SCROLLBAR
   ════════════════════════════════════════════════ */
#dragon-track {
  position: fixed;
  right: 0;
  top: 2.5rem;          /* below nav tabline */
  bottom: 1.8rem;       /* above statusline */
  width: 68px;
  z-index: 95;          /* interactive scrollbar thumb & track */
  pointer-events: auto;
  overflow: visible;
  user-select: none;
  touch-action: none;
}

/* The pole / vine the dragon clings to */
.dragon-pole {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--border);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

#dragon-track:hover .dragon-pole {
  opacity: 0.85;
  background: var(--accent-dim);
}

/* Tick marks on the pole */
.dragon-pole::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 19px,
    var(--fg-dim) 19px,
    var(--fg-dim) 20px
  );
  opacity: 0.3;
}

/* Dragon scrollbar thumb */
#dragon-ascii {
  position: absolute;
  top: 0px;
  left: 0;
  right: 0;
  font-size: 0.48rem;
  line-height: 1.25;
  text-align: center;
  color: var(--accent);
  opacity: 0.55;
  white-space: pre;
  font-family: 'JetBrains Mono', monospace;
  /* smooth scroll tracking when gliding */
  transition: top 0.15s ease-out, opacity 0.2s, transform 0.2s;
  will-change: top;
  user-select: none;
  cursor: grab;
  touch-action: none;
}

#dragon-ascii:hover {
  opacity: 0.95;
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

#dragon-ascii.is-dragging {
  cursor: grabbing !important;
  opacity: 1 !important;
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px var(--accent-glow));
  transition: opacity 0.2s, transform 0.2s !important; /* no top lag while dragging */
}

/* Fade out when palette is open */
#cmd-overlay:not(.hidden) ~ #dragon-track #dragon-ascii {
  opacity: 0.1;
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  #dither-canvas {
    max-width: 180px;
    margin: 0 auto;
    display: block;
  }

  .hero-name { font-size: 2.5rem; }

  .skill-row {
    grid-template-columns: 8rem 1fr 2.5rem;
    gap: 0.5rem;
  }

  .skill-name { font-size: 0.72rem; }

  .nav-links {
    gap: 1rem;
  }

  .nav-prompt {
    display: none;
  }

  .projects-grid,
  .hobbies-grid {
    grid-template-columns: 1fr;
  }

  #cmd-panel {
    padding: 0.75rem 1rem 1rem;
  }

  /* Hide dragon on small screens — no room */
  #dragon-track {
    display: none;
  }
  .stat-hint {
    display: none !important;
  }
  
  .stat-file {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .hero-meta .dim {
    min-width: 4.5rem;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

