/* ============================================================
   subashrimal.com.np — amber phosphor terminal
   palette:
     --bg        #0a0806  warm CRT black
     --amber     #ffb454  primary phosphor
     --amber-hi  #ffd28f  bright phosphor
     --amber-lo  #8a6a3b  dim phosphor
     --paper     #e8dcc8  body text
     --ok        #9ece6a  ANSI green
     --link      #6cb6ff  ANSI cyan-blue
     --err       #f07178  ANSI red
   ============================================================ */

:root {
  --bg: #0a0806;
  --bg-raise: #120e09;
  --amber: #ffb454;
  --amber-hi: #ffd28f;
  --amber-lo: #8a6a3b;
  --paper: #e8dcc8;
  --dim: #6f6353;
  --ok: #9ece6a;
  --link: #6cb6ff;
  --err: #f07178;
  --border: #2a2118;
  --glow: 0 0 6px rgba(255, 180, 84, 0.35);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 3.5rem; }

body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'><path d='M4 1 L4 17 L8.5 13.2 L11.4 20 L14.3 18.6 L11.5 12 L17 12 Z' fill='%23ffb454' stroke='%230a0806' stroke-width='1.3'/></svg>") 3 2, default;
}

a, button, summary, label, .win, .btn {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'><path d='M4 1 L4 17 L8.5 13.2 L11.4 20 L14.3 18.6 L11.5 12 L17 12 Z' fill='%23ffe9c4' stroke='%230a0806' stroke-width='1.3'/></svg>") 3 2, pointer;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--amber); color: var(--bg); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

b { color: var(--amber-hi); font-weight: 700; }
.dim { color: var(--dim); }
.ok { color: var(--ok); }

/* ---------------- CRT layers ---------------- */
.crt-scanlines {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0)   0px,
    rgba(0,0,0,0)   2px,
    rgba(0,0,0,.14) 3px
  );
}
.crt-vignette {
  position: fixed; inset: 0; z-index: 59; pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0) 58%, rgba(0,0,0,.42) 100%);
}

/* ---------------- boot overlay ---------------- */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  padding: 2.5rem clamp(1rem, 6vw, 5rem);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: opacity .45s ease;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot-text {
  color: var(--amber);
  font-size: clamp(11px, 1.6vw, 14px);
  line-height: 1.5;
  white-space: pre-wrap;
  text-shadow: var(--glow);
}
#boot-text .b-ok { color: var(--ok); }
#boot-text .b-dim { color: var(--dim); }
.boot-skip { color: var(--dim); font-size: 12px; text-align: center; padding-bottom: 1rem; }

/* ---------------- tmux bar ---------------- */
.tmux-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border);
  padding: .45rem 1rem;
  font-size: 13px;
}
.tmux-session { color: var(--ok); white-space: nowrap; }
.tmux-windows { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.tmux-windows::-webkit-scrollbar { display: none; }
.win {
  color: #c9b48e; padding: .1rem .55rem; white-space: nowrap;
  border-radius: 2px;
}
.win:hover { color: var(--amber-hi); text-decoration: none; }
.win.active { background: var(--amber); color: var(--bg); font-weight: 700; }
.tmux-clock { margin-left: auto; color: var(--amber-lo); white-space: nowrap; }

/* ---------------- layout ---------------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-bottom: 1px dashed var(--border); }
section:last-of-type { border-bottom: none; }

/* multipage: one tmux window (section) on screen at a time.
   :not() keeps the specificity above any per-section display rule */
main > section:not(.page-active) { display: none; }
main > section.page-active { border-bottom: none; min-height: calc(100svh - 8rem); }
main > .hero.page-active { min-height: calc(100svh - 3rem); }

.prompt-line {
  color: var(--paper);
  font-size: 14px;
  margin-bottom: 1.1rem;
  word-break: break-word;
}
.ps1 { color: var(--ok); font-weight: 500; }
.section-cmd { font-size: clamp(14px, 1.8vw, 16px); }

/* ---------------- hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  min-height: calc(100svh - 3rem);
  padding-top: 5rem;
}

.banner {
  color: var(--amber);
  font-size: clamp(5px, 1.05vw, 11px);
  line-height: 1.18;
  font-weight: 700;
  text-shadow: var(--glow);
  margin-bottom: 1.6rem;
  overflow: hidden;
}
.banner-a { color: var(--amber); }
.banner-b { color: var(--amber-lo); display: block; margin-top: .5em; }

.whoami-out { max-width: 58ch; margin-bottom: 1.8rem; }

.hero-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  border: 1px solid var(--amber-lo);
  color: var(--amber-hi);
  padding: .35rem .8rem;
  font-size: 13px;
  border-radius: 2px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--amber); color: var(--bg); border-color: var(--amber); text-decoration: none; }
.btn-solid { background: var(--amber); color: var(--bg); font-weight: 700; border-color: var(--amber); }
.btn-solid:hover { background: var(--amber-hi); border-color: var(--amber-hi); }

/* terminal window chrome */
.term-window {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255,180,84,.05), 0 12px 30px rgba(0,0,0,.5);
}
.term-titlebar {
  display: flex; align-items: center; gap: .8rem;
  padding: .45rem .8rem;
  border-bottom: 1px solid var(--border);
  background: #171208;
}
.term-dots { display: flex; gap: .35rem; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.term-dots i:first-child { background: var(--err); opacity: .7; }
.term-dots i:nth-child(2) { background: var(--amber); opacity: .7; }
.term-dots i:last-child { background: var(--ok); opacity: .7; }
.term-title { color: var(--dim); font-size: 12px; }

#face3d {
  display: block;
  width: 100%;
  min-height: 300px;
  filter: drop-shadow(0 0 5px rgba(255, 180, 84, 0.25));
}

#scene {
  display: block;
  color: var(--amber);
  text-shadow: var(--glow);
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0;
  padding: .9rem .7rem;
  min-height: 260px;
  user-select: none;
  overflow-x: auto;
}

/* ---------------- skills ---------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}
.skill-block {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
}
.toml-header { color: var(--amber); font-weight: 700; margin-bottom: .5rem; }
.skill-block ul { list-style: none; }
.skill-block li { white-space: pre; color: var(--paper); font-size: 13.5px; overflow-x: auto; scrollbar-width: none; }
.skill-block li::-webkit-scrollbar { display: none; }
.tval { color: var(--ok); }

/* tiny amber skill sliders */
.lvl {
  display: inline-block; width: 108px; height: 5px;
  background: var(--border); border-radius: 99px;
  vertical-align: middle; margin-left: .2rem;
}
.lvl-fill {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--amber-lo), var(--amber));
  box-shadow: 0 0 6px rgba(255, 180, 84, .45);
  position: relative;
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.lvl-fill::after {
  content: ""; position: absolute; right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber-hi);
  box-shadow: 0 0 8px rgba(255, 210, 143, .8);
}

/* ---------------- automation live ---------------- */
.auto-lede { max-width: 62ch; color: var(--paper); margin-bottom: 1.4rem; }
.auto-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: 1rem;
  padding: 1rem 1.2rem;
}
.auto-feed { font-size: 13px; min-height: 190px; overflow: hidden; }
.feed-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { color: var(--dim); }
.feed-run { color: var(--amber); animation: blink 1s steps(1) infinite; }
.feed-new { color: var(--amber-hi); }
.auto-stats { border-left: 1px dashed var(--border); padding-left: 1.2rem; display: flex; flex-direction: column; gap: 1.2rem; justify-content: center; }
.auto-num {
  display: block; color: var(--amber); font-size: 34px; font-weight: 800;
  text-shadow: var(--glow); line-height: 1.1;
}
.auto-num i { font-style: normal; font-size: 16px; color: var(--amber-lo); margin-left: .2rem; }
.auto-cap { color: var(--dim); font-size: 12px; line-height: 1.4; }

/* ---------------- ask the AI ---------------- */
.ask-window { max-width: 820px; }
.ask-body { padding: 1rem 1.2rem; max-height: 420px; overflow-y: auto; }
.ask-msg { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; margin-bottom: .8rem; color: var(--paper); font-family: var(--mono); }
.ask-user { color: var(--amber-hi); }
.ask-think { color: var(--dim); animation: blink 1s steps(1) infinite; }
pre.ask-note { color: var(--link); opacity: .75; font-style: italic; font-size: 12px; }
.ask-note { font-size: 11.5px; margin-top: -0.6rem; }
.ask-line { display: flex; gap: .6rem; align-items: baseline; border-top: 1px dashed var(--border); padding-top: .8rem; }
.ask-line label { white-space: nowrap; font-size: 13.5px; }
/* classic block cursor blinking at the prompt until you start typing */
.ask-caret {
  color: var(--amber); font-size: 13.5px; margin-right: -.4rem;
  text-shadow: var(--glow);
  animation: blink 1s steps(1) infinite;
}
.ask-line:focus-within .ask-caret,
.ask-line:has(#ask-in:not(:placeholder-shown)) .ask-caret { display: none; }
#ask-in {
  flex: 1; background: none; border: none; outline: none;
  color: var(--amber-hi); font-family: var(--mono); font-size: 13.5px;
  caret-color: var(--amber);
}
#ask-in::placeholder { color: var(--dim); }

/* ---------------- mode toggle + divider ---------------- */
.mode-toggle {
  margin-left: auto;
  background: none; border: 1px solid var(--border); border-radius: 2px;
  color: var(--dim); font-family: var(--mono); font-size: 12px;
  padding: .1rem .5rem; white-space: nowrap;
}
.mode-toggle b { color: var(--amber); }
.mode-toggle:hover { border-color: var(--amber-lo); color: var(--paper); }
.tmux-clock { margin-left: 0; }

.mode-divider {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
  width: 22px; margin-left: -6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: ew-resize; touch-action: none;
  user-select: none;
}
.mode-divider::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--amber) 30%, var(--amber) 70%, transparent);
  box-shadow: 0 0 12px rgba(255, 180, 84, .6);
}
.divider-grip {
  position: relative; z-index: 1;
  background: var(--amber); color: var(--bg);
  border-radius: 99px; padding: .6rem .25rem;
  font-weight: 800; letter-spacing: -1px;
  box-shadow: 0 0 16px rgba(255, 180, 84, .7);
}
.divider-hint {
  position: relative; z-index: 1;
  margin-top: .6rem; color: var(--amber);
  font-size: 11px; writing-mode: vertical-rl;
  text-shadow: var(--glow);
  animation: hintpulse 2.4s ease-in-out infinite;
}
@keyframes hintpulse { 50% { opacity: .35; } }

.mode-divider.at-end .divider-hint { display: none; }

/* when the 2077 layer is locked full-screen, stop paying for the
   terminal beneath it (also pauses its IntersectionObserver animations) */
body.future-only main,
body.future-only footer,
body.future-only .tmux-bar,
body.future-only .crt-scanlines,
body.future-only .crt-vignette { display: none; }

@media (max-width: 900px) {
  .mode-divider { display: none; }
  .auto-body { grid-template-columns: 1fr; }
  .auto-stats { border-left: none; padding-left: 0; flex-direction: row; }
}

/* ---------------- repos ---------------- */
.repos-status { color: var(--dim); font-size: 13px; margin-bottom: 1.4rem; }
.repos-status.err { color: var(--err); }
.cursor-blink { animation: blink 1s steps(1) infinite; color: var(--amber); }
@keyframes blink { 50% { opacity: 0; } }

.repos-featured {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.repo-card {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .15s, transform .15s;
}
.repo-card:hover { border-color: var(--amber-lo); transform: translateY(-2px); }
.repo-name { font-weight: 700; font-size: 15px; color: var(--amber-hi); word-break: break-all; }
.repo-name:hover { color: var(--amber); }
.repo-desc { color: var(--paper); font-size: 13px; flex: 1; }
.repo-meta { color: var(--dim); font-size: 12px; display: flex; gap: 1rem; flex-wrap: wrap; }
.lang-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; vertical-align: baseline; }

.repos-all summary {
  cursor: pointer; color: var(--amber); font-size: 14px;
  padding: .45rem .8rem; display: inline-block;
  border: 1px solid var(--amber-lo); border-radius: 4px;
  background: var(--bg-raise);
}
.repos-all summary::after {
  content: " ▸ click to expand █";
  color: var(--ok); font-size: 12px;
  animation: blink 1.1s steps(1) infinite;
}
.repos-all[open] summary::after { content: " ▾ click to collapse"; animation: none; }
.repos-all summary:hover { color: var(--bg); background: var(--amber); border-color: var(--amber); }
.repos-all summary:hover .dim, .repos-all summary:hover::after { color: var(--bg); }
@media (prefers-reduced-motion: reduce) { .repos-all summary::after { animation: none; } }
.repos-list { padding-top: 1rem; overflow-x: auto; }
.repo-row {
  display: grid;
  grid-template-columns: 7.5rem 11rem minmax(14rem, 1fr) 4.5rem 7rem;
  gap: 1rem;
  padding: .28rem .4rem;
  font-size: 13px;
  border-radius: 2px;
  min-width: 720px;
  align-items: baseline;
}
.repo-row:hover { background: var(--bg-raise); }
.repo-row .r-lang { color: var(--dim); white-space: nowrap; }
.repo-row .r-desc { color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-row .r-stars { color: var(--amber); text-align: right; }
.repo-row .r-date { color: var(--dim); white-space: nowrap; }

/* ---------------- experience log ---------------- */
.log-entries { display: flex; flex-direction: column; gap: 2rem; }
.log-entry {
  border-left: 2px solid var(--border);
  padding-left: 1.4rem;
  position: relative;
}
.log-entry::before {
  content: "▚";
  position: absolute; left: -.55rem; top: 0;
  color: var(--amber); background: var(--bg);
  font-size: 14px; line-height: 1;
}
.log-meta { font-size: 14px; margin-bottom: .6rem; }
.log-date { color: var(--amber); }
.log-level { font-weight: 700; font-size: 12px; }
.log-level.ok { color: var(--ok); }
.log-level.info { color: var(--link); }
.log-body { list-style: none; }
.log-body li { padding-left: 1.2rem; position: relative; font-size: 14px; color: var(--paper); margin-bottom: .3rem; }
.log-body li::before { content: ">"; position: absolute; left: 0; color: var(--amber-lo); }

/* ---------------- projects ---------------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
}
.proj {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  transition: border-color .15s;
}
.proj:hover { border-color: var(--amber-lo); }
.proj-head { margin-bottom: .5rem; font-size: 14px; }
.proj-perm { color: var(--ok); margin-right: .6rem; font-size: 12.5px; }
.proj-head a { color: var(--amber-hi); font-weight: 700; }
.proj-live { color: var(--amber-hi); font-weight: 700; }
.proj-desc { font-size: 13.5px; margin-bottom: .6rem; }
.proj-tags { color: var(--dim); font-size: 12px; }

/* ---------------- contact ---------------- */
.contact-wrap {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.portrait-window { max-width: 340px; }
.finger-pre {
  color: var(--paper);
  font-size: 13.5px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  overflow-x: auto;
}
.contact-list { list-style: none; font-size: 14.5px; }
.contact-list li { padding: .3rem 0; white-space: pre; }
.ckey { color: var(--amber); }

/* ---------------- terminal AI bubble ---------------- */
.tty-chat-fab {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 55;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raise); border: 1px solid var(--amber); color: var(--amber);
  box-shadow: 0 0 18px rgba(255, 180, 84, .35), 0 6px 18px rgba(0, 0, 0, .5);
  transition: background .15s, color .15s, box-shadow .2s, transform .2s;
}
.tty-chat-fab svg { width: 24px; height: 24px; }
.tty-chat-fab:hover {
  background: var(--amber); color: var(--bg); transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(255, 180, 84, .6), 0 8px 22px rgba(0, 0, 0, .5);
}
body.future-only .tty-chat-fab { display: none; }

/* ---------------- statusline footer ---------------- */
.statusline {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-raise);
  border-top: 1px solid var(--border);
  padding: .5rem 1rem;
  font-size: 12.5px;
  color: var(--dim);
}
.statusline .mode { color: var(--bg); background: var(--amber); padding: 0 .5rem; font-weight: 700; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: calc(100svh - 3rem); padding-top: 4.5rem; }
  .hero-right { order: -1; margin-top: 1rem; }
  #face3d { min-height: 220px; }
  .contact-wrap { grid-template-columns: 1fr; }
  .tmux-clock { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .repo-row { min-width: 640px; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor-blink { animation: none; }
  .repo-card:hover { transform: none; }
  #boot { display: none; }
}
