/* ── TYPEFACE ─────────────────────────────────────────────────────────────── */
/* Self-hosted so there is no third-party request, no layout shift and nothing
   to break if a CDN does. Courier New was the browser default rather than a
   choice, and it set every character on the page. */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

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

/* Available to screen readers, hidden visually */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Inline SVG icons (replaced Font Awesome — ~100KB of CDN CSS for five glyphs) */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex: none;
}

/* Keyboard focus ring — the site hides the native cursor, so this is the only
   affordance keyboard users get */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* No-JS fallback */
.noscript-fallback {
  position: relative;
  z-index: 9999;
  max-width: 760px;
  margin: 40px auto;
  padding: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  cursor: auto;
}
.noscript-fallback h2 { color: var(--green); margin-bottom: 12px; }
.noscript-fallback ul { margin: 12px 0 12px 20px; }
.noscript-fallback li { margin-bottom: 6px; }
.noscript-fallback p  { margin: 12px 0; line-height: 1.6; }
.noscript-fallback a  { color: var(--blue); }

/* Tokyo Night — the default. Every other theme below redefines this same set,
   so anything that uses var() re-themes for free. */
:root,
:root[data-theme="tokyo-night"] {
  --bg:          #1a1b26;
  --bg2:         #16161e;
  --bg3:         #1f2335;
  --bg4:         #24283b;
  --border:      #292e42;
  --border-soft: #414868;
  --fg:          #a9b1d6;
  --fg-bright:   #c0caf5;
  --fg-dim:      #565f89;
  --blue:        #7dcfff;
  --blue-alt:    #7aa2f7;
  --green:       #9ece6a;
  --red:         #f7768e;
  --yellow:      #e0af68;
  --purple:      #bb9af7;
  --cyan:        #7dcfff;
  --page-bg:     #050508;
  --font:        'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  /* Default easing is what makes motion read as cheap. These are the two
     curves everything on the page now uses. */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);   /* settle: UI arriving      */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);     /* travel: hover, colour    */
}

:root[data-theme="dracula"] {
  --bg: #282a36;  --bg2: #21222c;  --bg3: #343746;  --bg4: #424450;
  --border: #44475a; --border-soft: #6272a4;
  --fg: #f8f8f2;  --fg-bright: #ffffff; --fg-dim: #6272a4;
  --blue: #8be9fd; --blue-alt: #bd93f9; --green: #50fa7b;
  --red: #ff5555;  --yellow: #f1fa8c;   --purple: #bd93f9; --cyan: #8be9fd;
  --page-bg: #15161d;
}

:root[data-theme="gruvbox"] {
  --bg: #282828;  --bg2: #1d2021;  --bg3: #32302f;  --bg4: #3c3836;
  --border: #504945; --border-soft: #665c54;
  --fg: #ebdbb2;  --fg-bright: #fbf1c7; --fg-dim: #928374;
  --blue: #83a598; --blue-alt: #458588; --green: #b8bb26;
  --red: #fb4934;  --yellow: #fabd2f;   --purple: #d3869b; --cyan: #8ec07c;
  --page-bg: #141414;
}

:root[data-theme="nord"] {
  --bg: #2e3440;  --bg2: #272c36;  --bg3: #3b4252;  --bg4: #434c5e;
  --border: #4c566a; --border-soft: #5d6b85;
  --fg: #d8dee9;  --fg-bright: #eceff4; --fg-dim: #7b88a1;
  --blue: #88c0d0; --blue-alt: #81a1c1; --green: #a3be8c;
  --red: #bf616a;  --yellow: #ebcb8b;   --purple: #b48ead; --cyan: #88c0d0;
  --page-bg: #191d24;
}

:root[data-theme="matrix"] {
  --bg: #001200;  --bg2: #000a00;  --bg3: #001a00;  --bg4: #002400;
  --border: #004400; --border-soft: #006600;
  --fg: #00cc33;  --fg-bright: #7dffa0; --fg-dim: #008822;
  --blue: #00ff41; --blue-alt: #00dd66; --green: #00ff41;
  --red: #ff4444;  --yellow: #aaff00;   --purple: #00ffaa; --cyan: #00ffcc;
  --page-bg: #000000;
}

html, body {
  height: 100%;
  background: var(--page-bg);
  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,
body.matrix-mode #nav-links button { color: #00cc33 !important; }
body.matrix-mode #nav-links a:hover,
body.matrix-mode #nav-links button: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); }

/* Hide custom cursor on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
  #cursor-dot, #cursor-outline {
    display: none !important;
  }
  body {
    cursor: auto !important;
  }
}

/* ── 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: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  background-clip: padding-box;
  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 var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/* Animated gradient border */
#terminal-window::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(
    45deg,
    var(--blue),
    var(--cyan),
    var(--blue-alt),
    var(--purple),
    var(--blue)
  );
  background-size: 300% 300%;
  animation: gradientBorder 8s ease infinite;
  opacity: 0.85;
}

@keyframes gradientBorder {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Scanline texture overlay */
#terminal-window::after {
  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: var(--blue);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(125, 207, 255, 0.6);
}
/* line-height:1 keeps the line box an integer (12px). The inherited 1.6 gave
   19.2px, which cannot land on a whole device pixel at 1x, leaving the clock
   and the availability badge ~0.6px out of alignment. */
#title-bar-right { display: flex; align-items: center; gap: 10px; color: var(--yellow); font-size: 12px; font-weight: bold; line-height: 1; }
#nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
}
#nav-hamburger:hover { background: rgba(125,207,255,0.1); color: var(--blue); }

/* ── AVAILABILITY BADGE ───────────────────────────────────────────────────────
   Runs `status` on click. The availability details were previously reachable
   only by typing a command nobody would guess. */
#availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(158,206,106,0.08);
  border: 1px solid rgba(158,206,106,0.3);
  border-radius: 999px;
  color: var(--green);
  font-family: inherit;
  /* Matches the clock's size so the two baselines coincide. Centre-aligning
     different font sizes leaves their baselines ~0.5px apart, which reads as
     misalignment once the page is zoomed. */
  font-size: 12px;
  font-weight: normal;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
#availability:hover {
  background: rgba(158,206,106,0.16);
  border-color: rgba(158,206,106,0.6);
}
.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(158,206,106,0.9);
  animation: availPulse 2.4s ease-in-out infinite;
}
@keyframes availPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

/* ── COPY BUTTON (contact values) ─────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1;
  padding: 3px;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.copy-btn:hover { color: var(--blue); background: rgba(125,207,255,0.12); }
.copy-btn.copied { color: var(--green); }
.copy-btn.failed { color: var(--red); }

/* Both icons ship in the markup; .copied swaps which one shows, so there is no
   innerHTML rewriting on click. */
.copy-btn .check-icon { display: none; }
.copy-btn.copied .copy-icon  { display: none; }
.copy-btn.copied .check-icon { display: inline-block; }

.tb-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  display: inline-block;
  border: 0; padding: 0; cursor: pointer;
  transition: transform 0.15s var(--ease-out), filter 0.15s var(--ease-out);
}
.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.18); filter: brightness(1.15); }
.tb-dot:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── WINDOW STATES ────────────────────────────────────────────────────────── */
#terminal-window.win-max {
  width: 100vw; height: 100vh; height: 100dvh;
  border-radius: 0;
  transition: width .34s var(--ease), height .34s var(--ease), border-radius .34s var(--ease);
}
#terminal-window.win-min {
  height: 38px;
  transition: height .32s var(--ease);
}
#terminal-window.win-min #nav-links,
#terminal-window.win-min #terminal { display: none; }
#terminal-window:not(.win-max):not(.win-min) {
  transition: width .34s var(--ease), height .34s var(--ease),
              border-radius .34s var(--ease),
              border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.win-restore-hint {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: 46px; z-index: 11;
  color: var(--fg-dim); font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  #terminal-window, #terminal-window.win-max, #terminal-window.win-min { transition: none; }
}
.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,
#nav-links button {
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  font-family: inherit;
  background: none;
  border: 0;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
#nav-links a:hover,
#nav-links button:hover { color: var(--blue); 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: var(--green); }
.at     { color: var(--fg-dim); }
.host   { color: var(--blue); }
.arrow  { color: var(--purple); margin: 0 6px; }
.cmd    { color: var(--fg); }

/* ── HIDDEN INPUT ─────────────────────────────────────────────────────────── */
/* Real input stays a normal, properly-sized element (just invisible) so
   mobile keyboards track cursor/selection correctly. A degenerate 1x1px
   size is known to confuse some Android keyboards' text-composition
   logic, causing characters to insert at position 0 instead of the
   cursor (e.g. typing "hi" becomes "ih"). */
#command-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
}
#real-prompt { position: relative; }
#real-prompt.hidden { display: none; }
#input-display { color: var(--fg); white-space: pre-wrap; }
/* live command-line highlighting, the way a modern shell colours as you type */
.sx-cmd  { color: var(--green); }
.sx-bad  { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 3px; }
/* Nord and Gruvbox use a desaturated red that falls under 4.5:1 against the
   terminal. Lifting it toward the bright foreground keeps the hue and the
   legibility of the signal that a command is not real. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .sx-bad { color: color-mix(in srgb, var(--red) 64%, var(--fg-bright)); }
}
.sx-flag { color: var(--purple); }
.sx-str  { color: var(--yellow); }
.sx-path { color: var(--blue); }
.sx-arg  { color: var(--fg); }
.sx-pipe { color: var(--cyan); font-weight: bold; }

/* ── 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 var(--ease-out);
}
.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 {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.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: var(--fg); 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 var(--ease-out), border-color 0.12s var(--ease-out);
  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 var(--ease-out);
  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 var(--ease-out), color 0.15s var(--ease-out);
  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); }

/* Inline suggestion shown after the caret while typing (fish-style) */
#input-ghost {
  color: var(--fg-dim);
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
  white-space: pre;
}

/* ── CASE STUDIES (rendered in-terminal rather than bouncing to a PDF) ───── */
.cs-cmd    { color: var(--fg-dim); margin-bottom: 12px; }
.cs-title  { color: var(--green); font-weight: bold; font-size: 15px; }
.cs-sub    { color: var(--fg-dim); font-size: 12px; margin-bottom: 14px; }
.cs-metrics {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px;
}
.cs-metric {
  flex: 1 1 150px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--blue);
  border-radius: 4px;
  padding: 8px 12px;
  background: var(--bg3);
}
.cs-metric-val   { display: block; color: var(--blue); font-weight: bold; font-size: 17px; }
.cs-metric-label { display: block; color: var(--fg-dim); font-size: 11px; margin-top: 2px; line-height: 1.4; }
.cs-h {
  color: var(--yellow); font-weight: bold; margin: 18px 0 8px;
}
.cs-body   { color: var(--fg); font-size: 13px; line-height: 1.65; }
.cs-arch {
  color: var(--blue); background: var(--bg2);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 12px 14px; margin: 4px 0 6px;
  font-family: var(--font); font-size: 12px; line-height: 1.5;
  overflow-x: auto; white-space: pre;
}
.cs-list   { margin: 4px 0 0 18px; }
.cs-list li { color: var(--fg); font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
.cs-footer {
  margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.cs-pdf { color: var(--blue); }
.cs-sep { color: var(--fg-dim); margin: 0 8px; }

/* ── GREP RESULTS ────────────────────────────────────────────────────────── */
.grep-row { display: flex; gap: 10px; margin-bottom: 6px; font-size: 13px; line-height: 1.5; }
.grep-file { color: var(--purple); flex: none; min-width: 108px; }
.grep-line { color: var(--fg); }
.grep-hit  { color: var(--yellow); font-weight: bold; }
.grep-meta { color: var(--fg-dim); font-size: 12px; margin-top: 10px; }

/* ── PIPES ────────────────────────────────────────────────────────────────── */
.pipe-line { color: var(--fg); font-size: 13px; line-height: 1.6; margin-bottom: 3px; white-space: pre-wrap; }
.pipe-meta { color: var(--fg-dim); font-size: 12px; margin-top: 10px; }

/* ── ASK ──────────────────────────────────────────────────────────────────── */
.ask-answer { font-size: 13px; line-height: 1.65; }
.ask-line   { color: var(--fg); margin-bottom: 6px; }
.ask-note   { color: var(--fg-dim); font-size: 12px; margin-top: 10px; }
.ask-eg     { margin-top: 6px; font-size: 12px; }
.ask-quote {
  color: var(--fg);
  border-left: 2px solid var(--border-soft);
  padding: 2px 0 2px 12px;
  margin-bottom: 8px;
}
.ask-hit { color: var(--yellow); font-weight: bold; }
.ask-yes { color: var(--green); }
.ask-no  { color: var(--red); }

/* evidence rows mirror grep's layout: where it came from, then the line */
.ask-ev {
  display: flex; gap: 10px;
  margin-bottom: 8px; font-size: 12.5px; line-height: 1.6;
  animation: ask-in .26s ease both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.ask-ev-src  { color: var(--purple); flex: none; min-width: 190px; }
.ask-ev-line { color: var(--fg); }
.ask-ev:first-of-type { margin-top: 10px; }
@keyframes ask-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* 380px is too narrow for a source column, and so is a phone */
#chat-panel .ask-ev { flex-direction: column; gap: 1px; }
#chat-panel.chat-wide .ask-ev { flex-direction: row; gap: 10px; }
#chat-panel.chat-wide .ask-ev-src { min-width: 190px; }
@media (max-width: 600px) { .ask-ev { flex-direction: column; gap: 1px; } }
@media (prefers-reduced-motion: reduce) { .ask-ev { animation: none; } }
.ask-src {
  color: var(--fg-dim); font-size: 12px;
  margin-top: 12px; padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── ASK LAUNCHER + PANEL ─────────────────────────────────────────────────── */
#chat-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--green);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  cursor: pointer; z-index: 300;
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
}
#chat-fab:hover { transform: translateY(-2px); border-color: var(--green); }
#chat-fab svg  { width: 24px; height: 24px; }
#chat-fab .chat-ico-close { display: none; }
#chat-fab[aria-expanded="true"] .chat-ico-open  { display: none; }
#chat-fab[aria-expanded="true"] .chat-ico-close { display: block; color: var(--fg-dim); }

/* a quiet pulse so the launcher is noticed once, without nagging */
#chat-fab::after {
  content: ''; position: absolute; inset: -1px; border-radius: 16px;
  border: 1px solid var(--green); opacity: 0;
  animation: chat-ping 3.2s ease-out 2s 3;
}
@keyframes chat-ping {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.35); }
  100% { opacity: 0;   transform: scale(1.35); }
}

#chat-panel {
  position: fixed; right: 24px; bottom: 88px;
  width: var(--chat-w, 380px);  max-width: calc(100vw - 32px);
  height: var(--chat-h, 520px); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px);
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  overflow: hidden; z-index: 301;
  transition: opacity .16s ease, transform .16s ease;
}
/* Frosted, so the terminal reads through the panel instead of being hidden by
   it. Solid background above stays as the fallback where blur is unsupported. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  #chat-panel {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
  #chat-head, #chat-form { background: color-mix(in srgb, var(--bg2) 70%, transparent); }
}

#chat-panel.chat-hidden {
  opacity: 0; transform: translateY(10px) scale(.98);
  pointer-events: none; visibility: hidden;
}

#chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 26px; flex: none;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.chat-dots { display: flex; gap: 6px; }
.chat-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.chat-dots i:nth-child(1) { background: #ff5f57; }
.chat-dots i:nth-child(2) { background: #febc2e; }
.chat-dots i:nth-child(3) { background: #28c840; }
#chat-title { color: var(--blue); font-size: 12px; flex: 1; text-align: center; }
#chat-close {
  background: none; border: 0; color: var(--fg-dim);
  cursor: pointer; font-size: 13px; line-height: 1;
  padding: 4px 6px; border-radius: 4px;
}
#chat-close:hover { color: var(--red); background: var(--border); }

/* The panel is anchored bottom-right, so it grows from the top-left corner —
   the opposite of the browser's own `resize`, which is why this is hand-rolled. */
.chat-rz { position: absolute; z-index: 3; }
.chat-rz-l { left: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.chat-rz-t { top: 0; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.chat-rz-tl {
  top: 0; left: 0; width: 20px; height: 20px;
  cursor: nwse-resize; background: none; border: 0; padding: 0;
}
.chat-rz-tl::before {
  content: ''; position: absolute; left: 6px; top: 6px;
  width: 7px; height: 7px; border-radius: 2px 0 0 0;
  border-left: 2px solid var(--fg-dim); border-top: 2px solid var(--fg-dim);
  transition: border-color .15s ease;
}
.chat-rz-tl:hover::before, .chat-rz-tl:focus-visible::before { border-color: var(--green); }
.chat-rz-tl:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
body.chat-resizing, body.chat-resizing * { user-select: none; }
body.chat-resizing #chat-panel { transition: none; }

#chat-log { flex: 1; overflow-y: auto; padding: 14px; position: relative; }
#chat-log::-webkit-scrollbar { width: 4px; }
#chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.chat-msg { margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
.chat-me {
  color: var(--bg); background: var(--blue);
  padding: 7px 11px; border-radius: 10px 10px 2px 10px;
  margin-left: auto; width: fit-content; max-width: 85%;
  word-break: break-word;
}
.chat-bot {
  color: var(--fg); background: var(--bg3);
  padding: 10px 12px; border-radius: 10px 10px 10px 2px;
  border: 1px solid var(--border); max-width: 95%;
}
.chat-bot .ask-src { margin-top: 10px; padding-top: 6px; }
.chat-bot .ask-quote { font-size: 12.5px; }

.chat-chip {
  display: block; width: 100%; text-align: left;
  margin-top: 6px; padding: 7px 10px;
  background: var(--bg3); color: var(--blue);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 12px; cursor: pointer;
}
.chat-chip:hover { border-color: var(--blue); background: var(--border); }
.chat-more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.chat-more-label { color: var(--fg-dim); font-size: 11px; margin-bottom: 2px; }
.chat-kbd {
  color: var(--fg-dim); font-size: 10px; letter-spacing: .5px;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 5px; margin-left: 6px; flex: none;
}

#chat-form {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; flex: none;
  border-top: 1px solid var(--border); background: var(--bg2);
}
.chat-prompt { color: var(--green); font-size: 13px; }
#chat-input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--fg); font-family: inherit; font-size: 13px;
}
#chat-input::placeholder { color: var(--fg-dim); opacity: .7; }
#chat-form button[type="submit"] {
  background: none; border: 0; color: var(--fg-dim);
  cursor: pointer; padding: 4px; display: flex; border-radius: 4px;
}
#chat-form button[type="submit"] svg { width: 16px; height: 16px; }
#chat-form button[type="submit"]:hover { color: var(--green); }

@media (max-width: 600px) {
  #chat-fab { right: 16px; bottom: 16px; width: 48px; height: 48px; }
  #chat-panel {
    right: 12px; left: 12px; bottom: 76px;
    width: auto; max-width: none;
    height: auto; top: 12px;
  }
  .chat-rz { display: none; }
  #chat-head { padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #chat-fab, #chat-panel { transition: none; }
  #chat-fab::after { animation: none; }
}

/* ── 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; }
  .cs-metrics { flex-direction: column; }
  .grep-row { flex-direction: column; gap: 2px; }
  #title-bar-center { display: none; }

  /* Title bar is tight on phones — keep the badge, drop its label */
  .avail-text { display: none; }
  #availability { padding: 5px; gap: 0; }

  #terminal-window { height: 94vh; height: 94dvh; }

  #nav-hamburger { display: block; }
  #nav-links {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
    max-height: calc(94vh - 38px);
    max-height: calc(94dvh - 38px);
    overflow-y: auto;
    padding: 6px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  }
  #nav-links.mobile-open { display: flex; z-index: 200; }
  #nav-links a,
  #nav-links button {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 6px;
    text-align: left;
  }
}

/* ── REDUCED MOTION ───────────────────────────────────────────────────────────
   The site leans on constant motion: particles, a typing animation, matrix
   rain and a trailing cursor. Users who ask for reduced motion get the same
   content, statically. JS also reads this query to skip the typing animation
   and to not start particles at all. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Decorative, permanently in motion — remove rather than slow down */
  #particles-js,
  #matrix-canvas,
  #cursor-dot,
  #cursor-outline { display: none !important; }

  /* The native cursor is hidden in favour of the custom one; give it back */
  html, body { cursor: auto !important; }

  /* The blinking caret is the one animation worth keeping, but slow it right
     down so it reads as a caret rather than a strobe */
  .typing-cursor { animation-duration: 1.5s !important; }
}


/* ── THEME TRANSITION ─────────────────────────────────────────────────────── */
/* Scoped to the ~350ms a switch takes. A permanent global transition would
   fight every other animation on the page. */
:root.theme-switching,
:root.theme-switching *:not(#particles-js):not(#particles-js *) {
  transition: background-color .34s var(--ease-out),
              border-color     .34s var(--ease-out),
              color            .34s var(--ease-out),
              box-shadow       .34s var(--ease-out) !important;
}
@media (prefers-reduced-motion: reduce) {
  :root.theme-switching, :root.theme-switching * { transition: none !important; }
}


/* ── COMMAND PALETTE ──────────────────────────────────────────────────────── */
#palette {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: min(14vh, 120px);
  background: rgba(0,0,0,0.5);
  transition: opacity .18s var(--ease-out);
}
@supports (backdrop-filter: blur(1px)) {
  #palette { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
}
#palette.pal-hidden { opacity: 0; pointer-events: none; visibility: hidden; }

#pal-box {
  width: min(620px, 92vw);
  max-height: min(60vh, 520px);
  display: flex; flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.65);
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition: transform .2s var(--ease);
}
#palette.pal-hidden #pal-box { transform: translateY(-8px) scale(.985); }
@supports (backdrop-filter: blur(1px)) {
  #pal-box {
    background: color-mix(in srgb, var(--bg2) 86%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }
}

#pal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; flex: none;
  border-bottom: 1px solid var(--border);
}
#pal-prompt { color: var(--green); font-size: 15px; }
#pal-input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--fg-bright); font-family: var(--font); font-size: 14px;
}
#pal-input::placeholder { color: var(--fg-dim); }
.pal-kbd {
  color: var(--fg-dim); font-size: 10px; letter-spacing: .5px;
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex: none;
}

#pal-list { flex: 1; overflow-y: auto; padding: 6px; }
#pal-list::-webkit-scrollbar { width: 4px; }
#pal-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.pal-group {
  /* --fg-dim alone lands at 2.97:1 on tokyo-night; nudged toward --fg */
  color: var(--fg-dim); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; padding: 10px 10px 5px;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .pal-group { color: color-mix(in srgb, var(--fg-dim) 55%, var(--fg)); }
}
.pal-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 7px; cursor: pointer;
  color: var(--fg); font-size: 13px;
}
.pal-item[aria-selected="true"] { background: var(--bg4, var(--border)); color: var(--fg-bright); }
.pal-item[aria-selected="true"] .pal-run { opacity: 1; }
.pal-ico   { flex: none; width: 17px; text-align: center; opacity: .85; }
.pal-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub   { color: var(--fg-dim); font-size: 11px; flex: none; }
.pal-run   { color: var(--green); font-size: 11px; opacity: 0; flex: none; }
.pal-hit   { color: var(--yellow); font-weight: bold; }
.pal-empty { color: var(--fg-dim); font-size: 13px; padding: 22px 12px; text-align: center; }

#pal-foot {
  display: flex; gap: 16px; flex: none;
  padding: 9px 16px; border-top: 1px solid var(--border);
  color: var(--fg-dim); font-size: 11px;
}
#pal-foot b { color: var(--fg); font-weight: normal; }

@media (max-width: 600px) {
  #palette { padding-top: 8vh; }
  #pal-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #palette, #pal-box { transition: none; }
}


/* ── SPLIT PANES ──────────────────────────────────────────────────────────── */
.split-wrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--bg2);
}
.split-pane { display: flex; flex-direction: column; min-width: 0; }
.split-head {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; flex: none;
  background: var(--bg3); border-bottom: 1px solid var(--border);
  color: var(--purple); font-size: 11px; letter-spacing: .5px;
}
.split-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.split-body { padding: 14px; overflow: auto; max-height: 440px; font-size: 12.5px; }
.split-body::-webkit-scrollbar { width: 4px; }
.split-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.split-bar {
  flex: none; width: 5px; cursor: col-resize; background: var(--border);
  transition: background .15s var(--ease-out);
}
.split-bar:hover, .split-bar:focus-visible { background: var(--green); outline: none; }
body.split-dragging, body.split-dragging * { user-select: none; cursor: col-resize !important; }

@media (max-width: 700px) {
  .split-wrap { flex-direction: column; }
  .split-pane { flex: 1 1 auto !important; }
  .split-bar  { width: auto; height: 5px; cursor: default; }
  .split-body { max-height: 300px; }
}

/* ── SHARE ────────────────────────────────────────────────────────────────── */
.share-url {
  margin-top: 8px; padding: 9px 12px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--blue); font-size: 12px; word-break: break-all;
}

/* ── TOUR ─────────────────────────────────────────────────────────────────── */
.tour-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 7px;
  background: var(--bg3); border: 1px solid var(--border-soft);
  color: var(--fg); font-size: 13px;
}
.tour-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none;
  animation: tour-pulse 1.6s var(--ease-out) infinite;
}
@keyframes tour-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.tour-skip {
  margin-left: auto; flex: none; cursor: pointer;
  background: none; border: 1px solid var(--border-soft); border-radius: 5px;
  color: var(--fg-dim); font-family: inherit; font-size: 11px; padding: 3px 10px;
}
.tour-skip:hover { color: var(--red); border-color: var(--red); }
.tour-step { display: flex; gap: 10px; color: var(--fg-dim); font-size: 12.5px; }
.tour-num  { color: var(--green); flex: none; }
.tour-hint {
  color: var(--fg-dim); font-size: 12.5px;
  padding: 9px 13px; border-radius: 7px;
  background: var(--bg3); border: 1px dashed var(--border-soft);
}
.tour-hint b { color: var(--fg); font-weight: normal; }
@media (prefers-reduced-motion: reduce) { .tour-dot { animation: none; } }

/* ── TABS ─────────────────────────────────────────────────────────────────── */
#tab-bar {
  display: flex; align-items: stretch; gap: 2px; flex: none;
  padding: 0 6px; height: 30px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
#tab-bar::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px; flex: none; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--fg-dim); font-family: inherit; font-size: 11.5px;
  transition: color .15s var(--ease-out), border-color .15s var(--ease-out);
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg-bright); border-bottom-color: var(--green); }
.tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.tab-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 3px;
  color: var(--fg-dim); font-size: 13px; line-height: 1;
}
.tab-x:hover { background: var(--border); color: var(--red); }
#tab-new {
  flex: none; margin-left: 2px; padding: 0 11px; cursor: pointer;
  background: none; border: 0; color: var(--fg-dim);
  font-family: inherit; font-size: 15px; line-height: 1;
  transition: color .15s var(--ease-out);
}
#tab-new:hover { color: var(--green); }
#tab-new:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
#terminal-window.win-min #tab-bar { display: none; }

/* The boot sequence types into #history for a few seconds; swapping sessions
   mid-flight would cut it in half, so the bar is inert until it finishes. */
#terminal-window.booting #tab-bar { pointer-events: none; }
