@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

/* ─── THEMES ─────────────────────────────────────────────────── */
:root, .theme-spotify {
  --bg:       #121212;   /* Spotify black */
  --primary:  #1DB954;   /* Spotify green — commands, host, items */
  --secondary:#F59B23;   /* warm amber — user, role */
  --bright:   #FFFFFF;
  --text:     #FFFFFF;
  --muted:    #6a6a6a;
  --error:    #E91429;
  --scroll:   #333333;
}
.theme-light {
  --bg:       #EFF3F3;
  --primary:  #027474;
  --secondary:#d97706;
  --bright:   #0f172a;
  --text:     #334155;
  --muted:    #94a3b8;
  --error:    #dc2626;
  --scroll:   #C1C1C1;
}
.theme-dark {
  --bg:       #1a1f2e;
  --primary:  #4ade80;
  --secondary:#fbbf24;
  --bright:   #f1f5f9;
  --text:     #cbd5e1;
  --muted:    #64748b;
  --error:    #f87171;
  --scroll:   #2d3748;
}
.theme-blue-matrix {
  --bg:       #0a0e1a;
  --primary:  #00e5ff;
  --secondary:#00ff9c;
  --bright:   #ffffff;
  --text:     #e2f0ff;
  --muted:    #4a7fa5;
  --error:    #ff5555;
  --scroll:   #1a2a3a;
}

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

blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre { margin: 0; }
h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit; }
img,svg,video,canvas,audio,iframe,embed,object { display: block; }
ul,ol { margin: 0; padding: 0; list-style: none; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.25s, color 0.25s;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scroll); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── TOP-LEVEL LAYOUT ───────────────────────────────────────── */
.layout {
  position: fixed;
  inset: 6px 6px 28px;
  display: flex;
  flex-direction: column;   /* column: view-area on top, bottom-bar at bottom */
  overflow: hidden;
  border: 1px solid var(--scroll);
  border-radius: 8px;
}

/* Large screens: pull in from sides so terminal feels centred, not stretched */
@media (min-width: 1400px) {
  .layout { inset: 20px 8% 40px; border-radius: 10px; }
}
@media (min-width: 1800px) {
  .layout { inset: 28px 14% 48px; border-radius: 12px; }
}

/* ─── LANDING MODE ───────────────────────────────────────────── */
/* Only the terminal output history is hidden — panel, nav, input all stay */
.layout.landing .terminal-history {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
.layout.landing .bottom-bar { border-top: none; }
.layout.landing .input-prompt-wrap { display: none; }
.layout.landing .input-form::before {
  content: '❯';
  color: #5FD700;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.05rem;
  margin-right: 0.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.layout.landing #terminal-input::placeholder {
  color: var(--primary);
  opacity: 1;
  animation: hint-glow 2s ease-in-out infinite;
}
/* hide cursor while hint placeholder is showing — hint IS the visual feedback */
.layout.landing #terminal-input.hint-active {
  caret-color: transparent;
}
@keyframes hint-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Awakening — terminal history drops in from above */
@keyframes terminal-drop-in {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.layout.awakening .terminal-history {
  animation: terminal-drop-in 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ─── VIEW AREA (top, fills remaining space) ─────────────────── */
.view-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ─── TERMINAL FONT ──────────────────────────────────────────── */
.terminal-history, .input-form, .bottom-bar, .post-cmd-echo,
.prompt-wrap, .t-user, .t-at, .t-host, .t-sep, .t-path,
.t-dollar, .t-chevron, .t-cmd, .ghost-suggestion,
input[type=text] { font-family: 'IBM Plex Mono', monospace; }

/* ─── TERMINAL HISTORY ───────────────────────────────────────── */
/* Fills the view-area (was inside terminal-wrapper) */
.terminal-history {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.terminal-history::-webkit-scrollbar { display: none; }

/* ─── BOTTOM BAR (always full-width, never changes) ──────────── */
.bottom-bar {
  flex-shrink: 0;
  padding: 0 1.25rem 0.75rem;
  border-top: 1px solid var(--scroll);
}

/* ─── HINT LABEL ──────────────────────────────────────────────── */
.hint-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 0.3rem 0 0;
  opacity: 0.75;
  transition: opacity 0.4s;
  letter-spacing: 0.02em;
}
.hint-label.hidden { opacity: 0; pointer-events: none; }
/* hide after awakening */
.layout:not(.landing) .hint-label { display: none; }
@media (max-width: 600px) { .hint-label-desk { display: none; } }

/* ─── ASCII PANEL (right, 40%) ───────────────────────────────── */
.ascii-panel {
  width: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* portrait + name sit in top half */
  padding: 2.5rem 1.5rem 0;
  overflow: hidden;
  transition: width 0.35s ease, padding 0.35s ease;
  opacity: 0;
  transition: opacity 1s ease, width 0.35s ease, padding 0.35s ease;
}
.ascii-portrait-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ascii-name-block {
  margin-top: 0.4rem;
  text-align: center;
  width: 100%;
  padding: 0 1.5rem;
  box-sizing: border-box;
}
.ascii-name-rule {
  height: 1px;
  background: var(--primary);
  opacity: 0.35;
  margin: 0.25rem 0;
}
.ascii-name-line {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  display: block;
  cursor: pointer;
}
.ascii-name-line:hover { opacity: 0.75; }
.ascii-name-sub {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
  text-transform: lowercase;
}
@media (max-width: 800px) {
  .ascii-panel { display: none; }
}

/* ─── BOTTOM AREA (hint + terminal bar) ─────────────────────── */
.bottom-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 300px;
  transition: max-height 0.45s ease, opacity 0.45s ease;
}
/* post mode: compact terminal — smaller height and font, always visible */
.view-area.post-mode ~ .bottom-area {
  max-height: 140px;
  font-size: 0.78rem;
}
.view-area.post-mode ~ .bottom-area .out,
.view-area.post-mode ~ .bottom-area #terminal-output { font-size: 0.78rem; }

/* reading mode: collapse to 2px strip — view-area fills the freed space */
.layout.reading-mode .bottom-area {
  max-height: 2px;
  opacity: 0.3;
}
.layout.reading-mode .bottom-area:hover {
  max-height: 300px;
  opacity: 1;
}

/* ─── INPUT HINT / NAV ───────────────────────────────────────── */
.input-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  font-size: 0.92rem;
  color: var(--muted);
  flex-shrink: 0;
  padding: 0.35rem 1.25rem 0.25rem;
}
.input-hint a {
  color: var(--text);
  text-decoration: none;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}
.input-hint a:hover {
  color: var(--primary);
  background: rgba(0,0,0,0.05);
}
.theme-dark .input-hint a:hover,
.theme-spotify .input-hint a:hover { background: rgba(255,255,255,0.06); }
.hint-sep { color: var(--muted); opacity: 0.4; font-size: 0.8rem; }
.input-hint a.nav-active { color: var(--primary); }

.theme-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}
.theme-icon-btn:hover { color: var(--primary); background: rgba(0,0,0,0.05); }
.theme-dark .theme-icon-btn:hover,
.theme-spotify .theme-icon-btn:hover { background: rgba(255,255,255,0.06); }

/* ─── OVERLAY NAV ─────────────────────────────────────────────── */
.overlay-nav { display: flex; align-items: center; gap: 0.75rem; }
.overlay-nav-link {
  color: var(--muted); font-size: 0.8rem; text-decoration: none;
  border-bottom: 1px dashed var(--muted); font-family: inherit;
}
.overlay-nav-link:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── INPUT FORM ─────────────────────────────────────────────── */
.input-form {
  display: flex;
  align-items: center;
  padding-top: 0.2rem;
}

.input-prompt-wrap {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

input[type=text] {
  flex: 0 0 auto;
  width: 1ch;
  min-width: 1ch;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  caret-color: var(--primary);
}
input[type=text]:focus-visible { outline: none; }
input[type=text]::placeholder { color: var(--muted); opacity: 0.6; font-style: italic; }

/* ─── MOBILE SUBMIT BUTTON ───────────────────────────────────── */
.mobile-submit {
  display: none; /* hidden on desktop */
}
@media (max-width: 768px) {
  .mobile-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--scroll);
    border-radius: 4px;
    color: var(--primary);
    font-family: inherit;
    font-size: 1.1rem;
    padding: 0 0.75rem;
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    margin-left: 0.4rem;
    line-height: 1;
  }
  .mobile-submit:active { background: rgba(74,222,128,0.12); }
  /* Hide @host on mobile — keep username only: babubhai ~ ❯ */
  .t-at, .t-host { display: none; }
}

/* ─── GHOST SUGGESTION ───────────────────────────────────────── */
.ghost-suggestion {
  color: var(--muted);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
  white-space: pre;
}

/* ─── OUTPUT / HISTORY (moved up near layout section) ───────── */

/* each command block */
.cmd-block { margin-bottom: 0.25rem; }

/* ─── PROMPT ─────────────────────────────────────────────────── */
.prompt-wrap {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.t-user   { color: var(--secondary); }
.t-at     { color: var(--muted); opacity: 0.6; }
.t-host   { color: var(--secondary); opacity: 0.75; }
.t-sep    { color: var(--muted); }
.t-path   { color: #00AFFF; }
.t-dollar { color: var(--text); }
.t-chevron{ color: #5FD700; }
.t-cmd    { color: var(--text); }

/* Light theme overrides for hardcoded fish colors */
.theme-light .t-path   { color: #0077aa; }
.theme-light .t-chevron{ color: #2e8b00; }
.theme-light .sl-av    { background: #d1d9e0; }
.theme-light #char-hover-card { background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.12); }
.theme-light .char-card-name  { color: #1e293b; }
.theme-light .char-card-quote { color: rgba(50,65,85,0.85); }
/* ─── OUTPUT LINES ───────────────────────────────────────────── */
.out        { line-height: 1.5rem; }
.out.primary{ color: var(--primary); }
.out.secondary{ color: var(--secondary); }
.out.muted  { color: var(--muted); }
.out.error  { color: var(--error); }
.out.bright { font-weight: 600; }
.out-link   { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); line-height: 1.5rem; }
.out-link:hover { border-bottom-style: solid; }

/* ─── SEPARATOR ──────────────────────────────────────────────── */
.sep { margin-top: 0.3rem; margin-bottom: 0.3rem; }

/* ─── HERO / ABOUT LAYOUT ────────────────────────────────────── */
/* mirrors HeroContainer from terminal-portfolio */
.hero {
  display: flex;
  flex-wrap: wrap-reverse;
}
.hero-text {
  flex: 1;
  min-width: 280px;
  padding-right: 2rem;
}
.hero-img {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@media (max-width: 932px) {
  .hero { margin-bottom: 1.5rem; }
}
@media (max-width: 549px) {
  .hero-img { width: 100%; margin-bottom: 1rem; }
  .hero-text { padding-right: 0; }
}

/* name ASCII art */
.name-art {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 1rem;
  white-space: pre;
}
@media (max-width: 549px) { .name-art { display: none; } }

/* Profile photo portrait */
.portrait-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.1);
  transform-origin: center 20%;
  border-radius: 0;
  opacity: 0.9;
  display: block;
}
.ascii-portrait-wrap {
  width: 160px;
  height: 160px;
  min-height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
}
/* portrait-photo mobile sizing handled in main mobile block below */

/* ─── ABOUT BLOCK ────────────────────────────────────────────── */
.about-block  { }
.about-para   { margin-top: 0.5rem; line-height: 1.7; white-space: normal; word-break: break-word; font-family: 'Inter', sans-serif; }
.out.about-para { color: var(--text); font-size: 1rem; font-weight: 400; }
.out.about-name { color: var(--bright); font-size: 1.1rem; font-weight: 600; letter-spacing: 0.03em; font-family: 'Inter', sans-serif; }
@keyframes char-zoom {
  0%   { opacity: 0; transform: scale(1.6); }
  40%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
.char-zoom { display: inline-block; animation: char-zoom 0.18s ease-out forwards; }

.out.welcome-header { color: var(--primary); font-size: 1rem; font-weight: 500; opacity: 0.8; }
.welcome-para { line-height: 1.7; white-space: normal; word-break: break-word; }
.out.welcome-para { color: var(--text); font-size: 1rem; }

/* ─── SOCIAL ICON BUTTONS ────────────────────────────────────── */
.social-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.social-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.65rem; border: 1px solid var(--scroll); border-radius: 4px;
  color: var(--muted); font-size: 0.8rem; text-decoration: none;
  font-family: inherit; line-height: 1.6;
  transition: border-color 0.15s, color 0.15s;
}
.social-btn:hover { border-color: var(--primary); color: var(--primary); }
.social-btn svg { flex-shrink: 0; }

/* ─── HELP TABLE ─────────────────────────────────────────────── */
.help-row { display: flex; line-height: 1.5rem; gap: 0.5rem; }
.h-cmd    { color: var(--text); min-width: 22ch; flex-shrink: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-style: dashed; cursor: pointer; }
.h-cmd:hover { text-decoration-style: solid; opacity: 0.75; }
.h-key    { text-decoration: none; cursor: default; color: var(--secondary); }
.h-key:hover { text-decoration: none; opacity: 1; }
.h-section { color: var(--primary); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.1rem; opacity: 0.7; }
.h-sep    { color: var(--muted); flex-shrink: 0; opacity: 0.5; }
.h-desc   { color: var(--muted); font-size: 0.9rem; }

/* ─── BOOK LIST (simple bullets + shelf image) ───────────────── */
.bk-list { padding: 0.25rem 0; }
.bk-shelf-img { margin-bottom: 1.25rem; }
.bk-shelf-img img { width: 100%; max-width: 480px; border-radius: 4px; opacity: 0.92; display: block; }
.bk-section-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 1rem 0 0.35rem;
}
.bk-layout { display: flex; gap: 1.5rem; align-items: stretch; margin-top: 0.75rem; }
.bk-left { flex-shrink: 0; width: 42%; display: flex; }
.bk-left img { width: 100%; border-radius: 4px; opacity: 0.92; object-fit: cover; object-position: top; }
.bk-right { flex: 1; min-width: 0; overflow: hidden; }
.bk-row { display: grid; grid-template-columns: 1rem 1fr auto auto; gap: 0 0.6rem; align-items: baseline; line-height: 1.65; }
.bk-bullet { color: var(--primary); opacity: 0.5; font-size: 0.8rem; }
.bk-rtitle { color: var(--bright); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-rauthor { color: var(--muted); font-size: 0.75rem; opacity: 0.7; white-space: nowrap; }
.bk-rdate { color: var(--muted); font-size: 0.68rem; opacity: 0.5; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
@media (max-width: 600px) { .bk-layout { flex-direction: column; } .bk-left { width: 100%; } }

/* ─── BOOK COVERS STACK ──────────────────────────────────────── */
.book-covers-section { margin-bottom: 2rem; }
.bc-header {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  opacity: 0.8;
}
.book-stack {
  position: relative;
  width: 110px;
  height: 165px;
  margin: 0 auto 0.75rem;
  cursor: default;
}
.bc-book {
  position: absolute;
  width: 100px;
  height: 150px;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.6);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  top: 0;
  left: 0;
}
.bc-book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Stack offsets — bc-1 is on top (most recent), bc-5 is bottom */
.bc-book.bc-5 { transform: translate(16px, 10px) rotate(5deg); z-index: 1; }
.bc-book.bc-4 { transform: translate(12px, 7px) rotate(3.5deg); z-index: 2; }
.bc-book.bc-3 { transform: translate(8px, 4px) rotate(2deg); z-index: 3; }
.bc-book.bc-2 { transform: translate(4px, 2px) rotate(1deg); z-index: 4; }
.bc-book.bc-1 { transform: translate(0, 0) rotate(0deg); z-index: 5; }

/* Hover: fan out the stack */
.book-stack:hover .bc-book.bc-5 { transform: translate(80px, 8px) rotate(6deg); box-shadow: 4px 4px 14px rgba(0,0,0,0.7); }
.book-stack:hover .bc-book.bc-4 { transform: translate(44px, 3px) rotate(3deg); box-shadow: 4px 4px 14px rgba(0,0,0,0.7); }
.book-stack:hover .bc-book.bc-3 { transform: translate(0, 0) rotate(0deg); box-shadow: 4px 4px 14px rgba(0,0,0,0.7); }
.book-stack:hover .bc-book.bc-2 { transform: translate(-44px, 3px) rotate(-3deg); box-shadow: 4px 4px 14px rgba(0,0,0,0.7); }
.book-stack:hover .bc-book.bc-1 { transform: translate(-80px, 8px) rotate(-6deg); box-shadow: 4px 4px 14px rgba(0,0,0,0.7); }

/* Tooltip */
.bc-book::after {
  content: attr(data-tip);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: #eee;
  font-size: 0.65rem;
  font-family: inherit;
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 30;
}
.bc-book:hover::after { opacity: 1; }
.bc-hint {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  opacity: 0.5;
  margin-top: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── BOOKSHELF ──────────────────────────────────────────────── */
.bookshelf { padding: 0.5rem 0 0.25rem; }
.bs-shelf {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0.75rem 0.5rem 0;
  border-bottom: 10px solid #4a2e1a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  margin-bottom: 1.75rem;
  position: relative;
}
.bs-shelf-reading { border-bottom-color: #2a4a2a; margin-bottom: 0.5rem; }
.bs-reading-label {
  position: absolute;
  top: -1.1rem;
  left: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  color: var(--primary);
  letter-spacing: 0.08em;
  opacity: 0.6;
  text-transform: uppercase;
}
.bs-spine {
  border-radius: 2px 0 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.18s ease;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.45), inset -1px 0 0 rgba(255,255,255,0.07);
}
.bs-spine:hover { transform: translateY(-10px); z-index: 5; }
.bs-spine-reading { transform: translateY(-5px); }
.bs-spine-reading:hover { transform: translateY(-14px); }
.bs-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.48rem;
  color: rgba(255,255,255,0.88);
  font-family: inherit;
  font-weight: 500;
  padding: 4px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-height: 90%;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
}
.bs-spine::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,15,0.95);
  color: #e8e8e8;
  font-size: 0.7rem;
  font-family: inherit;
  white-space: nowrap;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-spine:hover::after { opacity: 1; }

/* ─── BLOG LIST ──────────────────────────────────────────────── */
.blog-row  { display: flex; align-items: baseline; line-height: 1.8rem; gap: 0.75rem; font-family: inherit; flex-wrap: nowrap; min-width: 0; }
.b-n       { color: var(--muted); min-width: 2ch; opacity: 0.5; flex-shrink: 0; }
.b-title   { color: var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-style: dashed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.b-title:hover { opacity: 0.75; text-decoration-style: solid; }
.b-date    { color: var(--muted); font-size: 0.85rem; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; flex-shrink: 0; }

/* ─── LS OUTPUT ──────────────────────────────────────────────── */
.ls-row  { display: flex; align-items: baseline; line-height: 1.8rem; gap: 0.75rem; }
.ls-n    { color: var(--muted); min-width: 2ch; }

/* ─── POST MODE ──────────────────────────────────────────────── */
/* hide terminal-history; reading-pane fills full width */
.view-area.post-mode .terminal-history { display: none; }

/* command echo in bottom bar — only visible when reading a post */
.post-cmd-echo {
  display: none;
  padding: 0.15rem 0 0.1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─── POST READING PANE (center) ─────────────────────────────── */
.post-reading-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 2rem 2rem 4rem;
  display: flex;
  justify-content: center;   /* center the inner block horizontally */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.post-reading-pane::-webkit-scrollbar { display: none; }
.post-reading-pane:focus { outline: none; }
/* inner wrapper — gives the content a max-width and centers it */
.post-inner {
  width: 100%;
  max-width: 680px;
}
.post-inner .post-meta {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  font-size: 0.78rem;
}
.post-inner .post-content {
  margin-top: 0.25rem;
}
.post-back-link {
  margin-bottom: 1rem;
}
.post-back-link a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}
.post-back-link a:hover { color: var(--primary); }

/* ─── READING BAR ────────────────────────────────────────────── */
.reading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s;
  z-index: 50;
}

/* ─── PANEL TOGGLE ───────────────────────────────────────────── */
.panel-toggle {
  background: none;
  border: 1px solid var(--scroll);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 1px 6px;
  line-height: 1.5;
  cursor: pointer;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
.panel-toggle:hover { border-color: var(--primary); color: var(--primary); }

.ascii-panel.collapsed {
  width: 28px;
  padding: 0.75rem 0;
  overflow: hidden;
  align-items: center;
}
.ascii-panel.collapsed .ascii-portrait-wrap,
.ascii-panel.collapsed .ascii-name-block { display: none; }
.ascii-panel.collapsed .panel-toggle { align-self: center; margin-bottom: 0; }
.ascii-panel.collapsed .panel-socials { display: none; }
.ascii-panel.collapsed .panel-divider { display: none; }
.ascii-panel.collapsed .panel-keys-row { display: none; }
.ascii-panel.collapsed .panel-characters { display: none; }

/* ─── UNIVERSE CONNECTED STATUS (in terminal output) ─────────── */
.universe-conn-line {
  font-size: 0.7rem;
  color: #4ade80;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 0 6px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.universe-conn-line.uc-visible { opacity: 1; }

/* ─── PANEL KEYBINDINGS ──────────────────────────────────────── */
.panel-keys {
  margin-top: 0.35rem;
  width: fit-content;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.25rem;
}
.pk-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.72rem;
  line-height: 1.55;
}
.pk-heading {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 0.4rem;
  margin-bottom: 0.1rem;
  text-align: left;
  width: 100%;
}
.pk-heading:first-child { margin-top: 0; }
.pk-key  { color: var(--primary); min-width: 8ch; flex-shrink: 0; }
.pk-sep  { color: var(--muted); opacity: 0.4; flex-shrink: 0; }
.pk-desc { color: var(--muted); white-space: nowrap; overflow: hidden; }
.pk-cmd  { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-style: dashed; }
.pk-cmd:hover { opacity: 0.75; text-decoration-style: solid; }
.pk-row-link { cursor: pointer; border-radius: 3px; transition: opacity 0.15s; }
.pk-row-link:hover { opacity: 0.7; }
.pk-row-link:active { opacity: 0.4; }
/* ─── UNIVERSE THREAD (Slack-style) ─────────────────────────── */
.sl-thread     { display:block; font-family: 'Inter', sans-serif; }
.sl-msg        { display:flex; gap:10px; padding:4px 0; align-items:stretch; }
.sl-reply      { padding-left:12px; }
.sl-avcol      { display:flex; flex-direction:column; align-items:center; flex-shrink:0; width:36px; }
.sl-av         { width:36px; height:36px; border-radius:6px; flex-shrink:0; background:#2c2f33; object-fit:cover; transition: opacity 0.4s ease; }
.sl-av-sm      { width:28px; height:28px; border-radius:5px; margin-top:4px; }
.sl-vline      { width:2px; flex:1; background:#3f4147; margin-top:4px; min-height:14px; border-radius:1px; }
.sl-body       { flex:1; min-width:0; padding-bottom:6px; }
.sl-header     { display:flex; align-items:baseline; gap:6px; margin-bottom:2px; flex-wrap:nowrap; overflow:hidden; }
.sl-name       { font-weight:700; font-size:1em; color:var(--bright); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex-shrink:1; }
.sl-time       { font-size:0.75em; color:var(--muted); font-weight:400; white-space:nowrap; flex-shrink:0; margin-left:auto; }
.sl-text       { color:var(--text); line-height:1.5; word-break:break-word; font-size:0.9em; font-weight:400; }
.sl-main-text  { font-size:0.9em; color:var(--bright); font-weight:400; }
.sl-reply-hint { font-size:0.78em; color:#4a9eff; font-weight:600; margin-top:5px; }
.theme-light .sl-vline { background:#c8d0d8; }
.sl-universe-tag { font-size:0.72em; font-family:'IBM Plex Mono',monospace; color:#4ade80; letter-spacing:0.04em; margin-bottom:4px; opacity:0.85; }
.sl-alok-status { opacity:0.75; margin-bottom:6px; }
.sl-alok-status-text { font-size:0.78em; color:#4ade80; font-family:'IBM Plex Mono',monospace; letter-spacing:0.02em; }

/* ─── UNIVERSE TREE: winner / loser / grudge reply ───────────── */
.sl-winner {
  border-left: 2px solid rgba(250,204,21,0.45);
  padding-left: 6px;
  margin-left: -8px;
  border-radius: 0 6px 6px 0;
}
.sl-crown {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.52rem;
  color: #facc15;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.9;
  white-space: nowrap;
  flex-shrink: 0;
}

.sl-nested-reply {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.035);
  border-radius: 6px;
  border-left: 2px solid rgba(255,255,255,0.08);
}
.sl-av-xs {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}
img[src*="baburao"].sl-av-xs { object-position: 5% center; }
.sl-nested-body {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.sl-nested-text { opacity: 0.88; }

/* ─── UNIVERSE USER REPLY ────────────────────────────────────── */
.sl-user-reply-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sl-user-reply-inner { flex: 1; }
.sl-user-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.sl-user-input:focus {
  border-color: rgba(74,222,128,0.4);
  background: rgba(255,255,255,0.07);
}
.sl-user-input::placeholder { color: var(--muted); font-size: 0.78rem; }
.sl-reply-btn {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  margin-top: 3px;
  letter-spacing: 0.02em;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.sl-reply:hover .sl-reply-btn { display: inline-block; }
.sl-reply-btn:hover { opacity: 1; color: #4ade80; }
.theme-light .sl-user-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: var(--text);
}
.theme-light .sl-user-input:focus { border-color: rgba(22,163,74,0.4); }
.theme-light .sl-user-reply-wrap { border-top-color: rgba(0,0,0,0.08); }

/* ─── UNIVERSE ACTION BAR ────────────────────────────────────── */
.sl-action-bar {
  display: flex;
  gap: 4px;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sl-action-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.sl-action-btn:hover { border-color: rgba(74,222,128,0.35); color: var(--text); }
.sl-action-btn.sl-action-active { color: #4ade80; border-color: rgba(74,222,128,0.5); }
.theme-light .sl-action-bar { border-top-color: rgba(0,0,0,0.08); }
.theme-light .sl-action-btn { border-color: rgba(0,0,0,0.12); color: var(--muted); }
.theme-light .sl-action-btn:hover { border-color: rgba(22,163,74,0.4); color: var(--text); }

/* ─── UNIVERSE DEV LOG (panel, below flash) ──────────────────── */
.universe-devlog {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: #4ade80;
  opacity: 0.7;
  padding-left: 2px;
  min-height: 0;
  overflow: hidden;
  line-height: 1.6;
}
.universe-devlog .udl-line {
  display: block;
  animation: udl-in 0.4s ease forwards;
  opacity: 0;
}
@keyframes udl-in {
  0%   { opacity: 0; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ─── HITCHHIKERS TICKER ─────────────────────────────────────── */
.hh-section {
  width: 100%;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hh-ticker-wrap {
  height: 420px;
  width: 100%;
  overflow: hidden;
  padding-right: 80px;
  -webkit-mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
  margin-top: 4px;
}
.hh-ticker {
  animation: hh-scroll 75s linear infinite;
}
.hh-ticker:hover {
  animation-play-state: paused;
}
@keyframes hh-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.hh-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  width: 100%;
}
.hh-name {
  font-size: 0.58rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--bright);
  letter-spacing: 0.01em;
}
.hh-desc {
  font-size: 0.56rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  text-align: right;
}
/* hide hitchhikers when panel is collapsed or viewport too narrow */
.ascii-panel.collapsed .hh-section { display: none; }
@media (max-width: 800px) { .hh-section { display: none; } }

/* ─── PANEL CHARACTERS GRID ─────────────────────────────────── */
.panel-characters {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.panel-chars-heading {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.panel-chars-count {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 0.55rem;
  color: var(--text);
}
.panel-chars-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 5px;
}
.panel-char-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.1);
  transition: border-color 0.15s, transform 0.15s;
  cursor: default;
}
.panel-char-av:hover {
  border-color: var(--host);
  transform: scale(1.12);
}
img[src*="baburao"] { object-position: 5% center; }

/* ─── CHARACTER HOVER CARD ──────────────────────────────────── */
#char-hover-card {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  background: rgba(14, 18, 28, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 12px;
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.65);
}
#char-hover-card.visible { opacity: 1; visibility: visible; }
.char-card-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.char-card-img[src*="baburao"] { object-position: 5% center; }
.char-card-body { text-align: center; }
.char-card-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.char-card-quote {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.57rem;
  color: rgba(160,170,185,0.9);
  line-height: 1.6;
}

/* ─── UNIVERSE STATUS (top-right overlay on desktop, inline bar on mobile) ── */
/* ─── MOBILE INTRO PHOTO BANNER ──────────────────────────────── */
.mobile-intro {
  display: none; /* hidden on desktop */
}
@media (max-width: 800px) {
  .mobile-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--scroll);
    flex-shrink: 0;
    z-index: 10;
  }
  .mobile-intro-photo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    flex-shrink: 0;
  }
  .mobile-intro-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-intro-name {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: 'Inter', sans-serif;
  }
  .mobile-intro-sub {
    color: var(--muted);
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
  }
  .mobile-intro-socials {
    display: flex;
    gap: 10px;
    margin-top: 4px;
  }
  /* show characters + hitchhikers on mobile */
}

.universe-flash-wrap { display: none; }

/* Desktop: absolute overlay over the right panel */
.us-mobile-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
}
.us-mobile-bar .us-av { display: none; }
.us-mobile-bar.uf-active { animation: uf-flash 1.1s ease forwards; }

@keyframes uf-flash {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Mobile: stack vertically — bar sits ABOVE terminal history, no overlap */
@media (max-width: 800px) {
  .view-area { flex-direction: column; }

  .us-mobile-bar {
    position: static;
    display: none;
    opacity: 1;
    transform: none;
    animation: none;
    flex-shrink: 0;
    padding: 5px 12px 4px;
    border-bottom: 1px solid rgba(96,165,250,0.12);
    background: rgba(96,165,250,0.05);
    text-align: left;
    gap: 8px;
    order: -1;
  }
  .us-mobile-bar.uf-active {
    display: flex;
    animation: none;
    opacity: 1;
  }
  .us-mobile-bar .us-av {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(96,165,250,0.3);
  }
}

.pk-social-link { color: var(--muted); font-size: 0.72rem; text-decoration: none; }
.pk-social-link:hover { color: var(--primary); }
.ascii-panel.collapsed .panel-keys { display: none; }

/* ─── PANEL SOCIAL ICONS ─────────────────────────────────────── */
.panel-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.3rem;
  margin-bottom: 0.4rem;
  justify-content: center;
}
.panel-divider { display: none; }
.panel-keys-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  margin-top: 0.4rem;
}
.panel-keys-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.panel-social-link {
  color: var(--muted);
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.15s;
}
.panel-social-link:hover { color: var(--primary); }

/* ─── POST CONTENT (inline in terminal) ─────────────────────── */
.post-content {
  max-width: 100%;
  margin-top: 0.5rem;
  font-family: 'Overpass', Georgia, ui-serif, serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
}
.post-content h1 { font-size: 1.45rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; margin-top: 0.5rem; line-height: 1.25; }
.post-content h2 { font-size: 1.05rem; font-weight: 500; color: var(--primary); margin-top: 1.75rem; margin-bottom: 0.35rem; }
.post-content h3 { font-size: 0.97rem; font-weight: 500; color: var(--secondary); margin-top: 1rem; margin-bottom: 0.25rem; }
.post-content p  { margin-top: 0.65rem; }
.post-content a  { color: var(--primary); }
/* mermaid diagrams */
.mermaid-diagram { margin: 1.25rem 0; display: flex; justify-content: center; }
.mermaid-diagram svg { max-width: 100%; height: auto; }
/* inline code stays monospace */
.post-content code { font-family: 'IBM Plex Mono', monospace; font-size: 0.82em; color: var(--primary); background: rgba(0,0,0,0.07); padding: 1px 5px; border-radius: 3px; }
.theme-dark .post-content code { background: rgba(255,255,255,0.08); }
/* code blocks — transparent bg, hljs controls colors */
.post-content pre { font-family: 'IBM Plex Mono', monospace; background: transparent; border: none; padding: 0.75rem 0; overflow-x: auto; margin: 1rem 0; font-size: 0.875em; line-height: 1.55; font-variant-ligatures: none; font-feature-settings: "liga" 0; }
.post-content pre code { background: none; padding: 0; font-size: 1em; color: unset; }
/* strip hljs-injected background so the page bg shows through */
.post-content pre .hljs { background: transparent !important; }
.post-content blockquote { border-left: 3px solid var(--secondary); padding: 0.25rem 1rem; color: var(--muted); margin: 1rem 0; font-style: italic; }
.post-content ul,
.post-content ol { padding-left: 1.5rem; margin-top: 0.6rem; list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin: 0.3rem 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.9rem; }
.post-content th { background: rgba(0,0,0,0.08); color: var(--primary); padding: 0.5rem 0.75rem; text-align: left; border: 1px solid var(--scroll); font-weight: 600; }
.post-content td { padding: 0.5rem 0.75rem; border: 1px solid var(--scroll); }
.post-content strong { font-weight: 700; }
.post-meta { font-family: 'IBM Plex Mono', monospace; color: var(--muted); font-size: 0.8rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--scroll); padding-bottom: 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.post-esc-hint { font-size: 0.72rem; opacity: 0.4; white-space: nowrap; letter-spacing: 0.03em; }

/* ─── NON-TERMINAL PAGES (blog.html, bookshelf.html, post pages) ── */
.page-body {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-y: auto;
}
.page-inner { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.page-nav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2.5rem; font-size: 0.875rem; }
.page-nav .brand { color: var(--secondary); margin-right: 0.75rem; font-weight: 600; }
.page-nav a { color: var(--muted); padding: 2px 8px; }
.page-nav a:hover { color: var(--primary); text-decoration: none; }
.page-nav .active { color: var(--primary); }

.post-list-item { padding: 1.25rem 0; border-bottom: 1px solid var(--scroll); }
.post-list-item .date { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.post-list-item .title a { font-size: 1rem; font-weight: 600; color: var(--primary); }
.post-list-item .title a:hover { text-decoration: underline; }
.post-list-item .excerpt { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.5; }

.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.bk-card { padding: 1rem; border: 1px solid var(--scroll); border-radius: 4px; }
.bk-card:hover { border-color: var(--primary); }
.bk-card .bk-title { color: var(--primary); font-weight: 600; display: block; margin-bottom: 0.15rem; font-size: 0.9rem; }
.bk-card .bk-author { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.35rem; }
.bk-card .bk-stars { color: var(--secondary); font-size: 0.85rem; margin-bottom: 0.35rem; }
.bk-card .bk-review { color: var(--text); font-size: 0.8rem; line-height: 1.5; }
@media (max-width: 600px) { .bk-grid { grid-template-columns: 1fr; } }

.page-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--scroll); display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; gap: 0.5rem; }
.page-footer a { color: var(--muted); margin-right: 0.75rem; }
.page-footer a:hover { color: var(--primary); }
.term-btn { color: var(--primary); border: 1px solid var(--scroll); padding: 3px 10px; font-family: inherit; font-size: 0.8rem; background: none; cursor: pointer; }
.term-btn:hover { border-color: var(--primary); }

/* ─── READING PROGRESS (post pages) ─────────────────────────── */
.reading-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--primary); z-index: 999; transition: width 0.1s; }

/* ─── SLASH COMMAND MENU ────────────────────────────────────── */
.slash-menu {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--scroll);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  z-index: 9999;
  min-width: 280px;
  max-width: 440px;
}
.sm-item {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.45rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}
.sm-item:last-child { border-bottom: none; }
.sm-item:hover, .sm-item.sm-active { background: rgba(74,222,128,0.08); }
.sm-name {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.82rem;
  color: var(--primary);
  white-space: nowrap;
  min-width: 6rem;
}
.sm-desc {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ─── BLOG FINDER OVERLAY ────────────────────────────────────── */
.blog-finder {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.blog-finder.open { display: flex; }

.bf-box {
  width: calc(100% - 2rem);
  max-width: 540px;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: 6px;
  overflow: hidden;
}

#bf-input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--scroll);
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: inherit;
  caret-color: var(--primary);
  padding: 0.75rem 1rem;
}
#bf-input::placeholder { color: var(--muted); opacity: 0.7; }

.bf-list { max-height: 320px; overflow-y: auto; }
.bf-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--scroll);
  gap: 1rem;
}
.bf-item:last-child { border-bottom: none; }
.bf-item:hover, .bf-item.bf-selected { background: rgba(0,0,0,0.08); }
.theme-dark .bf-item:hover,
.theme-dark .bf-item.bf-selected,
.theme-spotify .bf-item:hover,
.theme-spotify .bf-item.bf-selected { background: rgba(255,255,255,0.07); }
.bf-item-title { color: var(--primary); font-size: 0.9rem; }
.bf-item-date  { color: var(--muted); font-size: 0.78rem; flex-shrink: 0; }

/* nudge hint in blogs output */
.bf-nudge { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.bf-nudge-right { text-align: right; }
.bf-nudge-cmd {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-style: dashed;
  cursor: pointer;
}
.bf-nudge-cmd:hover { text-decoration-style: solid; }

/* ─── WELCOME HINT (click-to-start) ─────────────────────────── */
.welcome-hint {
  font-size: 1.1rem;
  margin-top: 0.25rem;
  opacity: 0.55;
}

/* ─── FEATURE SHOWCASE (Razorpay-style) ──────────────────────── */
.feat-showcase {
  padding: 0.5rem 0 0.25rem 0.25rem;
  animation: feat-in 0.45s ease both;
}
@keyframes feat-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feat-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3rem;
  padding: 1rem 0 1.5rem;
  max-width: 700px;
}
.feat-left { flex: 1; min-width: 0; }
.feat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.feat-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--bright);
  line-height: 1.1;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
}
.feat-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 320px;
}
/* Terminal button — right side */
.feat-terminal-btn {
  flex-shrink: 0;
  width: 200px;
  background: rgba(10, 14, 22, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 0.85rem 1rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
  position: relative;
}
.feat-terminal-btn:hover {
  border-color: var(--ft-accent, #4ade80);
  box-shadow: 0 0 20px color-mix(in srgb, var(--ft-accent, #4ade80) 20%, transparent);
  transform: translateY(-3px);
}
.ftb-dots {
  display: flex; gap: 4px; margin-bottom: 0.65rem;
}
.ftb-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.ftb-prompt {
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  white-space: nowrap;
}
.ftb-user  { color: #e5c07b; }
.ftb-at    { color: var(--muted); }
.ftb-host  { color: #56b6c2; }
.ftb-tilde { color: var(--muted); }
.ftb-chev  { color: #5FD700; }
.ftb-cmd {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ft-accent, #4ade80);
  letter-spacing: 0.01em;
  margin-bottom: 0.15rem;
}
.ftb-cursor {
  font-size: 0.9rem;
  color: var(--ft-accent, #4ade80);
  opacity: 0.7;
  animation: cursor-blink 1.1s step-end infinite;
}
@keyframes cursor-blink { 0%,100% { opacity: 0.7; } 50% { opacity: 0; } }
/* Phone mockup — iPhone 17 Pro style (edge-to-edge, Dynamic Island) */
.feat-phone {
  flex-shrink: 0;
  width: 210px;
  height: 455px;
  background: #2a2a2c; /* titanium frame */
  border-radius: 46px;
  border: 1.5px solid rgba(255,255,255,0.22);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 4px 6px rgba(0,0,0,0.18),
    0 8px 16px rgba(0,0,0,0.18),
    0 20px 40px rgba(0,0,0,0.22),
    0 40px 80px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  padding: 4px;
  display: flex;
  flex-direction: column;
}
/* Volume buttons */
.feat-phone::before {
  content: '';
  position: absolute;
  left: -4px; top: 100px;
  width: 3px; height: 28px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 36px 0 rgba(255,255,255,0.18);
}
/* Power button */
.feat-phone::after {
  content: '';
  position: absolute;
  right: -4px; top: 120px;
  width: 3px; height: 56px;
  background: rgba(255,255,255,0.18);
  border-radius: 0 2px 2px 0;
}
/* Edge-to-edge screen */
.feat-phone-screen-wrap {
  flex: 1;
  background: #080c14;
  border-radius: 43px;
  overflow: hidden;
  padding: 46px 11px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* Dynamic Island pill */
.feat-phone-di {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 86px; height: 26px;
  background: #000;
  border-radius: 20px;
  flex-shrink: 0;
}
.feat-phone-screen {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #abb2bf;
  flex: 1;
  overflow: hidden;
}
.feat-phone-home {
  width: 80px; height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
/* Clickable title/desc */
.feat-clickable { cursor: pointer; }
/* Phone screen terminal content */
.fp-prompt { white-space: nowrap; overflow: hidden; margin-bottom: 4px; }
.fp-user   { color: #e5c07b; }
.fp-muted  { color: #5c6370; }
.fp-host   { color: #56b6c2; }
.fp-chev   { color: #5FD700; }
.fp-cmd    { color: #4ade80; }
.fp-cur    { color: #4ade80; animation: cursor-blink 1.1s step-end infinite; }
.fp-line   { padding-left: 2px; white-space: pre-wrap; margin-bottom: 3px; }
.fp-bright { color: #e2f0ff; }
.fp-muted2 { color: #6b7890; }
.fp-char   { margin-top: 8px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.fp-char-av { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.fp-judge  { color: #abb2bf; margin-top: 8px; }
.fp-judge-name { color: #e5c07b; }
@media (max-width: 800px) {
  .feat-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.25rem 0 0.5rem;
  }
  .feat-left { flex: 1; min-width: 0; }
  .feat-phone {
    width: 138px; height: 292px; border-radius: 32px; padding: 3px;
    flex-shrink: 0;
    margin-top: -0.25rem;
    box-shadow:
      0 0 0 1px rgba(0,0,0,0.4),
      0 4px 8px rgba(0,0,0,0.15),
      0 12px 24px rgba(0,0,0,0.18),
      inset 0 1px 0 rgba(255,255,255,0.08);
  }
  .feat-phone-screen-wrap { border-radius: 30px; padding: 38px 8px 10px; }
  .feat-phone-di { width: 56px; height: 17px; top: 10px; }
  .feat-phone-screen { font-size: 0.5rem; }
  .feat-phone-home { width: 50px; height: 3px; }
  .ascii-panel { display: none !important; }
}
@media (max-width: 480px) {
  .feat-phone { width: 120px; height: 256px; border-radius: 28px; }
  .feat-phone-screen-wrap { border-radius: 26px; padding: 34px 7px 8px; }
  .feat-phone-di { width: 48px; height: 15px; top: 9px; }
  .feat-phone-screen { font-size: 0.44rem; }
  .feat-phone-home { width: 42px; }
}
/* Light mode phone */
.theme-light .feat-phone {
  background: #e2e5ea;
  border-color: rgba(0,0,0,0.15);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.08),
    0 4px 6px rgba(0,0,0,0.06),
    0 8px 16px rgba(0,0,0,0.07),
    0 20px 40px rgba(0,0,0,0.09),
    0 40px 80px rgba(0,0,0,0.1);
}
.theme-light .feat-phone::before,
.theme-light .feat-phone::after { background: rgba(0,0,0,0.2); }
.theme-light .feat-phone-home { background: rgba(0,0,0,0.2); }
.theme-light .feat-phone-screen-wrap { background: #f5f7fa; }
.theme-light .feat-phone-screen { color: #1a1f2e; }
.theme-light .fp-muted  { color: #8899aa; }
.theme-light .fp-muted2 { color: #7a8898; }
.theme-light .fp-bright { color: #0f1623; }
.feat-rule {
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
}
.feat-links {
  display: flex; gap: 0.5rem; align-items: center;
  padding: 1.2rem 0 0.3rem;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem;
}
.feat-link { color: var(--muted); cursor: pointer; }
.feat-link:hover { color: var(--text); text-decoration: underline; }
.feat-dot { color: var(--scroll); }
/* CTA row */
.feat-cta {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.6rem 0 0.4rem;
}
.feat-try-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #0a0f1a;
  background: #4ade80;
  border: none;
  border-radius: 5px;
  white-space: nowrap;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  font-weight: 600;
  margin-top: 1rem;
  display: inline-block;
  transition: background 0.15s, transform 0.12s;
}
.feat-try-btn:hover { background: #6ee7a0; transform: translateY(-1px); }
.feat-cta-nudge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  animation: nudge-blink 1.6s ease-in-out infinite;
}
@keyframes nudge-blink {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50%       { opacity: 1;    transform: translateY(3px); }
}

/* ─── NEWS CARD ──────────────────────────────────────────────── */
.news-card {
  font-family: 'IBM Plex Mono', monospace;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 0.9rem 1.1rem;
  max-width: 600px;
  margin: 0.35rem 0;
  animation: fg-appear 0.35s ease both;
}
.nc-badge {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 3px;
  margin-bottom: 0.55rem;
}
.nc-headline {
  font-size: 0.9rem;
  color: var(--bright);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.nc-reactions { display: flex; flex-direction: column; gap: 0.55rem; }
.nc-row { display: flex; gap: 0.6rem; align-items: flex-start; }
.nc-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }
.nc-body { font-size: 0.78rem; line-height: 1.45; }
.nc-name { font-weight: 600; margin-right: 0.35rem; }
.nc-text { color: var(--text); opacity: 0.85; }

/* ─── FEAT ECHO AREA + RELEASE LINES ────────────────────────── */
.feat-echo-area {
  margin-top: 1rem;
  max-height: 340px;
  overflow: hidden;
}
.feat-echo-area:empty { display: none; }
.release-line {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  font-weight: 400;
  color: #abb2bf;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.release-quote {
  color: #4ade80;
}

/* ─── ABOUT CMD LINKS ────────────────────────────────────────── */
.about-cmds { font-size: 0.78rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.about-cmds .h-cmd { min-width: 0; }
.about-cmd-label { color: var(--muted); }
.about-cmd-sep { color: var(--scroll); }

/* ─── KEYSTROKE DISPLAY ──────────────────────────────────────── */
.key-display {
  position: absolute;
  bottom: 90px;
  left: 16px;
  pointer-events: none;
  z-index: 60;
}
.key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 18, 0.93);
  color: #efefef;
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: 2px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 6px 14px;
  min-width: 2.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
/* light theme: still dark badge — good contrast, tooltip style */
.theme-light .key-badge {
  background: rgba(25, 25, 35, 0.88);
  color: #f0f0f0;
  border-color: rgba(255,255,255,0.08);
}
.key-badge.key-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}
@media (max-width: 800px) { .key-display { bottom: 70px; } }

/* ─── MEDIUM WIDTH — adapt layout when panel too narrow ───────── */
@media (max-width: 1100px) {
  .panel-keys-row { display: none; }
  /* Hide date columns — title + author have enough room */
  .b-date { display: none; }
  .bk-rdate { display: none; }
  .bk-row { grid-template-columns: 1rem 1fr auto; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 549px) {
  .post-scroll { padding: 1rem; }
}

/* ─── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout { inset: 0; border-radius: 0; border: none; }

  /* view-area stacks: ascii-panel on top, terminal-history below */
  .view-area { flex-direction: column; }

  .ascii-panel {
    display: flex;
    order: -1;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--scroll);
    opacity: 1;
    transition: none;
    flex-shrink: 0;
  }

  .panel-toggle { display: none; }

  /* Photo on the right */
  .ascii-portrait-wrap { order: 2; flex-shrink: 0; width: 76px; height: 76px; overflow: hidden; border-radius: 6px; }
  .portrait-photo { width: 76px; height: 76px; object-fit: cover; object-position: center 18%; border-radius: 0; opacity: 0.9; }

  /* Name block on the left */
  .ascii-name-block { order: 1; flex: 1; margin-top: 0; text-align: left; width: auto; }
  .ascii-name-rule { display: none; }
  .ascii-name-line { font-size: 1.25rem; letter-spacing: 0.02em; display: block; margin-bottom: 0.2rem; }
  .ascii-name-sub { display: block; font-size: 0.72rem; opacity: 0.7; margin-bottom: 0.55rem; text-transform: lowercase; }

  /* Show socials below name */
  .panel-socials { display: flex; justify-content: flex-start; gap: 1rem; margin: 0; }
  .panel-social-link { font-size: 1rem; }

  .panel-keys { display: none; }
  .panel-keys-row { display: none; }
  .panel-divider { display: none; }
  .post-esc-hint { display: none; }

  /* Post mode on mobile: hide command strip, reading pane full width */
  .command-strip { display: none; }
  .post-reading-pane { padding: 1rem 1.25rem 2rem; }

  /* Prevent iOS zoom on input focus */
  input[type=text] { font-size: 16px; }

  .h-cmd { min-width: 0; }
  .blog-row { flex-wrap: nowrap; }
  .b-date { display: none; }
  .bf-nudge { display: none; }
  .input-form { overflow: hidden; width: 100%; }
  input[type=text] { flex: 1; min-width: 0; }
  .ghost-suggestion { display: none; }

  /* Nav bar: horizontally scrollable on mobile */
  .input-hint {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 1rem 0.25rem;
    gap: 0;
  }
  .input-hint::-webkit-scrollbar { display: none; }
  .input-hint a, .input-hint .hint-sep, .input-hint .theme-icon-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ─── MOBILE: characters + hitchhikers section below terminal ──── */
.mobile-chars-hh { display: none; }
.mobile-chars-toggle { display: none; }
@media (max-width: 800px) {
  .mobile-chars-hh {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    height: 130px;
    transition: height 0.3s ease;
    border-top: 1px solid var(--scroll);
    padding: 0.5rem 0;
    position: relative;
  }
  .mobile-chars-hh.mch-collapsed {
    height: 26px;
    padding: 0;
    overflow: hidden;
  }
  .mobile-chars-toggle {
    display: block;
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: 1px solid var(--scroll);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.7rem;
    padding: 1px 6px;
    cursor: pointer;
    z-index: 2;
    line-height: 1.4;
  }
  .mobile-chars-toggle:hover { color: var(--primary); border-color: var(--primary); }
  .mobile-chars-hh .hh-section { display: flex !important; margin-top: 4px; }
  .mobile-chars-hh .panel-characters { display: flex !important; }
  .mobile-chars-hh .hh-ticker-wrap { height: 160px; }
}
