/* ===========================================================
   ANONDEVX TERMINAL — style.css
   Fully interactive terminal portfolio — black + cyan (#00FFFF)
   =========================================================== */

:root {
  --c-bg:        #000000;
  --c-term:      #020505;
  --c-border:    #0f3a3a;
  --c-border-lt: #176363;

  --c-cyan:      #00ffff;
  --c-cyan-dim:  #00aaaa;
  --c-cyan-deep: #007a7a;

  --c-text:      #d6ffff;
  --c-text-dim:  #6fa8a8;
  --c-text-mute: #3d6363;

  --c-red:       #ff5f56;
  --c-yellow:    #ffbd2e;
  --c-green:     #27c93f;

  --f-mono: 'JetBrains Mono', 'Courier New', monospace;
  --ease: cubic-bezier(.16,.84,.44,1);
}

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

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

html, body {
  height: 100%;
  background: var(--c-bg);
}

body {
  color: var(--c-text);
  font-family: var(--f-mono);
  font-size: 15px;
  line-height: 1.65;
  overflow: hidden;
  cursor: none;
}
body * { cursor: none; }

@media (hover: none) and (pointer: coarse) {
  body, body * { cursor: auto; }
}

a { color: var(--c-cyan); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #fff; }
button { font-family: inherit; border: none; background: none; color: inherit; }

/* ===== Cursor dot ===== */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-cyan);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 0 6px rgba(0,255,255,.8);
  transform: translate(-50%, -50%);
  transition: width .15s ease, height .15s ease, opacity .2s ease;
  will-change: transform;
}
.cursor-dot.is-pointer { width: 15px; height: 15px; background: #fff; }
.cursor-dot.is-hidden { opacity: 0; }
@media (hover: none) and (pointer: coarse) { .cursor-dot { display: none; } }

/* ===== CRT overlay ===== */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,255,0.018) 0px,
    rgba(0,255,255,0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 60%, rgba(0,0,0,0.45) 100%);
}
.crt-overlay::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,255,255,0.05), transparent);
  animation: scan-sweep 7s linear infinite;
}
@keyframes scan-sweep {
  0% { top: -10%; }
  100% { top: 110%; }
}

/* ===== Glitch text ===== */
.glitch-text {
  position: relative;
  animation: glitch-flicker 4.5s steps(1) infinite;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.ascii-banner.glitch-text { text-shadow: 0 0 8px rgba(0,255,255,0.4); }
.glitch-text::before {
  color: #ff2bd6;
  animation: glitch-shift-1 4.5s steps(1) infinite;
  mix-blend-mode: screen;
}
.glitch-text::after {
  color: #00ffff;
  animation: glitch-shift-2 4.5s steps(1) infinite;
  mix-blend-mode: screen;
}
@keyframes glitch-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: .4; }
  94% { opacity: 1; }
  95% { opacity: .6; }
  96% { opacity: 1; }
}
@keyframes glitch-shift-1 {
  0%, 90%, 100% { opacity: 0; transform: translate(0,0); }
  91% { opacity: .7; transform: translate(-2px, 1px); }
  92% { opacity: 0; }
}
@keyframes glitch-shift-2 {
  0%, 90%, 100% { opacity: 0; transform: translate(0,0); }
  91% { opacity: .7; transform: translate(2px, -1px); }
  92% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .glitch-text, .glitch-text::before, .glitch-text::after { animation: none; }
  .crt-overlay::before { animation: none; display: none; }
}

/* ===== Layout ===== */
.terminal-app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  gap: 14px;
}

.terminal-window {
  position: relative;
  width: 100%;
  max-width: 980px;
  height: min(720px, 88vh);
  display: flex;
  flex-direction: column;
  background: var(--c-term);
  border: 1px solid var(--c-border-lt);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,255,255,0.08),
    0 40px 90px -30px rgba(0,255,255,0.25),
    0 0 140px -35px rgba(0,255,255,0.18);
  animation: power-on .8s ease-out;
}
@keyframes power-on {
  0% { opacity: 0; filter: brightness(2.5); transform: scaleY(0.02); }
  6% { opacity: 1; filter: brightness(3); transform: scaleY(1); }
  8% { filter: brightness(0.5); }
  10% { filter: brightness(2); }
  13% { filter: brightness(1); }
  100% { opacity: 1; filter: brightness(1); transform: scaleY(1); }
}

.matrix-rain {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 1;
  transition: opacity .5s ease;
}
.matrix-rain.is-fading { opacity: 0; }
.matrix-rain canvas { display: block; width: 100%; height: 100%; }

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #010202;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.tb-dots { display: flex; gap: 7px; }
.tb-dot { width: 11px; height: 11px; border-radius: 50%; opacity: .85; }
.tb-red { background: var(--c-red); }
.tb-yellow { background: var(--c-yellow); }
.tb-green { background: var(--c-green); }
.tb-title {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  color: var(--c-text-mute);
  letter-spacing: .3px;
}
.tb-logo { width: 20px; height: 20px; object-fit: contain; opacity: .9; }

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 14px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border-lt) transparent;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--c-border-lt); border-radius: 4px; }

.terminal-output { display: flex; flex-direction: column; gap: 2px; }

/* ===== Output line types ===== */
.line { white-space: pre-wrap; word-break: break-word; }
.line-cmd { color: var(--c-text-dim); }
.line-cmd .prompt-echo { color: var(--c-cyan); }
.line-out { color: var(--c-text); }
.line-dim { color: var(--c-text-mute); }
.line-accent { color: var(--c-cyan); }
.line-error { color: #ff6b7a; }
.line-success { color: var(--c-green); }
.line-heading {
  color: var(--c-cyan);
  font-weight: 700;
  margin-top: 6px;
}
.line-gap { height: 8px; }
.line-link { color: var(--c-cyan); }
.line-link:hover { color: #fff; }

.ascii-banner {
  color: var(--c-cyan);
  font-size: 11px;
  line-height: 1.25;
  white-space: pre;
  overflow-x: auto;
  text-shadow: 0 0 8px rgba(0,255,255,0.4);
}

.kv-row { display: flex; gap: 10px; }
.kv-key { color: var(--c-text-mute); min-width: 90px; flex-shrink: 0; }
.kv-val { color: var(--c-text); }

.tag-pill {
  display: inline-block;
  border: 1px solid var(--c-border-lt);
  color: var(--c-cyan-dim);
  border-radius: 100px;
  padding: 1px 9px;
  font-size: 12.5px;
  margin: 2px 4px 2px 0;
}

.proj-img-wrap {
  margin: 6px 0 4px;
  border: 1px solid var(--c-border-lt);
  border-radius: 6px;
  overflow: hidden;
  max-width: 360px;
  background: radial-gradient(circle at 50% 50%, #061515 0%, #020505 70%);
}
.proj-img-wrap img { display: block; width: 100%; height: auto; }

.whoami-logo-wrap {
  margin: 4px 0 10px;
  width: 120px;
  border: 1px solid var(--c-border-lt);
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #061515 0%, #020505 70%);
  box-shadow: 0 0 24px -8px rgba(0,255,255,0.25);
}
.whoami-logo-wrap img { display: block; width: 100%; height: auto; }

/* ===== Input line ===== */
.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  position: relative;
}
.prompt {
  flex-shrink: 0;
  font-weight: 500;
  white-space: nowrap;
}
.prompt-user { color: var(--c-green); }
.prompt-at, .prompt-sep { color: var(--c-text-mute); }
.prompt-host { color: var(--c-cyan); }
.prompt-path { color: var(--c-text-dim); margin-right: 4px; }
.prompt-dollar { color: var(--c-text-dim); margin-left: 2px; }

.input-wrap {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  white-space: pre-wrap;
}
.input-text { color: var(--c-text); }
.input-caret {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--c-cyan);
  vertical-align: middle;
  margin-left: 1px;
  animation: caret-blink 1s steps(1) infinite;
}
.input-caret.is-typing { animation: none; opacity: 1; }
@keyframes caret-blink { 50% { opacity: 0; } }

.hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* ===== Status bar ===== */
.terminal-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: #010202;
  border-top: 1px solid var(--c-border);
  font-size: 11.5px;
  color: var(--c-text-mute);
  flex-shrink: 0;
}
.status-cmd {
  color: var(--c-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.status-cmd:hover { color: #fff; }
#clock { font-variant-numeric: tabular-nums; }

/* ===== Quick command bar (mobile-friendly) ===== */
.quick-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 980px;
  width: 100%;
}
.qb-btn {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--c-cyan-dim);
  background: var(--c-term);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  padding: 7px 14px;
  transition: border-color .2s ease, color .2s ease, transform .2s var(--ease), background .2s ease;
}
.qb-btn:hover {
  border-color: rgba(0,255,255,0.5);
  color: var(--c-cyan);
  background: rgba(0,255,255,0.06);
  transform: translateY(-2px);
}
.qb-btn:active { transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .terminal-app { padding: 12px; gap: 10px; }
  .terminal-window { height: min(640px, 82vh); border-radius: 10px; }
  .terminal-body { padding: 14px 14px 10px; font-size: 13.5px; }
  body { font-size: 13.5px; }
  .tb-title { font-size: 11px; }
  .ascii-banner { font-size: 8px; }
  .kv-key { min-width: 76px; }
  .quick-bar { gap: 6px; }
  .qb-btn { font-size: 11.5px; padding: 6px 11px; }
  .status-left { display: none; }
  .whoami-logo-wrap { width: 92px; }
}

@media (max-width: 420px) {
  .ascii-banner { font-size: 6.5px; }
  .kv-row { flex-direction: column; gap: 0; }
  .kv-key { min-width: 0; }
}