/* ============================================================
   Alvin K Sabu — Interactive Terminal Portfolio
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0e14;
  --bg-2: #0d1117;
  --surface: #0f141c;
  --surface-2: #161d29;
  --border: #1e2632;
  --border-2: #2d3747;
  --text: #c9d4e3;
  --muted: #8b949e;
  --faint: #5c6672;
  --green: #3fb950;
  --green-2: #56d364;
  --cyan: #39c5cf;
  --blue: #58a6ff;
  --amber: #d29922;
  --red: #f85149;
  --str: #a5d6ff;
  --grad: linear-gradient(120deg, var(--green-2), var(--cyan));
  --glow: rgba(63, 185, 80, 0.14);
  --win-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 44px -22px rgba(0, 0, 0, 0.8);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection {
  background: rgba(63, 185, 80, 0.32);
  color: #eafff1;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--green);
  text-decoration: underline;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

/* ---------- Shell frame ---------- */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.win-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }

.win-title {
  margin-left: 6px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-tag {
  margin-left: auto;
  color: var(--green);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

/* ---------- Quick-command chips ---------- */
.shell-chips {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.chip-label {
  color: var(--faint);
  font-size: 0.75rem;
  margin-right: 2px;
}

.chip {
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 4px 11px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip::before {
  content: "$ ";
  color: var(--green);
}

.chip:hover {
  color: var(--green);
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.08);
}

.chip:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---------- Output ---------- */
.shell-output {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 12px;
  font-size: 0.86rem;
  line-height: 1.75;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(63, 185, 80, 0.06), transparent),
    var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

.shell-output::-webkit-scrollbar {
  width: 10px;
}

.shell-output::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 6px;
}

.shell-output::-webkit-scrollbar-track {
  background: transparent;
}

.o {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.05em;
}

.o.p, .o .p { color: var(--green); font-weight: 600; }
.o.out, .o .out { color: var(--muted); }
.o.dim, .o .dim { color: var(--faint); }
.o.ok, .o .ok { color: var(--green-2); }
.o.err, .o .err { color: var(--red); }
.o.amber, .o .amber { color: var(--amber); }
.o.str, .o .str { color: var(--str); }
.o.cyan, .o .cyan { color: var(--cyan); }
.o.blue, .o .blue { color: var(--blue); }
.o.bold, .o .bold { font-weight: 700; }

.o.banner {
  color: var(--green-2);
  font-weight: 700;
}

.o.echo {
  color: var(--text);
}

.o.error-line {
  color: var(--red);
}

.o.block {
  display: block;
  padding-bottom: 10px;
}

/* caret after boot */
.o.caretline {
  color: var(--green);
  display: inline-block;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* ---------- Inline input line (lives at the end of the output stream) ---------- */
.cmdline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 4px;
}

.cmdline .p {
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.shell-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 0.86rem;
  caret-color: var(--green);
}

.shell-input::placeholder {
  color: var(--faint);
}

/* ---------- Focus & a11y ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .shell-chips {
    padding: 8px 12px;
    gap: 6px;
  }

  .chip {
    font-size: 0.72rem;
    padding: 3px 9px;
  }

  .shell-output {
    padding: 14px 14px 8px;
    font-size: 0.78rem;
  }

  .shell-input {
    font-size: 0.78rem;
  }
}