/* ============================================================
   TERMINAL PORTFOLIO — style.css
   ============================================================ */

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

:root {
  --bg:              #0a0a0a;
  --term-bg:         #0f0f0f;
  --term-header:     #1c1c1e;
  --border:          #2a2a2a;
  --border-light:    #363636;

  --text:            #c9d1d9;
  --text-dim:        #6e7681;
  --text-bright:     #f0f6fc;

  --green:           #3fb950;
  --green-dim:       #238636;
  --cyan:            #56d4dd;
  --yellow:          #e3b341;
  --orange:          #f0883e;
  --red:             #f85149;
  --blue:            #58a6ff;
  --purple:          #bc8cff;
  --pink:            #ff7b9c;

  --prompt-color:    #3fb950;
  --font:            'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-size:       13.5px;
  --lh:              1.65;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--lh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 100vh;
  overflow: hidden;
}

/* Subtle scanline overlay */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Page layout ── */
.page-wrapper {
  width: 100%;
  max-width: 1080px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Terminal window ── */
.terminal-window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Header ── */
.terminal-header {
  flex-shrink: 0;
  background: var(--term-header);
  border-bottom: 1px solid var(--border);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  user-select: none;
}

.traffic-lights {
  display: flex;
  gap: 7px;
  align-items: center;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: filter 0.15s;
}
.tl.close    { background: #ff5f57; }
.tl.minimize { background: #febc2e; }
.tl.maximize { background: #28c840; }
.tl:hover    { filter: brightness(1.2); }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.terminal-badge {
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

/* ── Terminal body ── */
.terminal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 14px 18px;
  cursor: text;
  scroll-behavior: smooth;
}

.terminal-body::-webkit-scrollbar       { width: 5px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
.terminal-body::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Output lines ── */
.ln {
  line-height: var(--lh);
  white-space: pre-wrap;
  word-break: break-word;
}
.ln-empty   { height: calc(var(--lh) * 1em); }
.ln-dim     { color: var(--text-dim); }
.ln-green   { color: var(--green); }
.ln-cyan    { color: var(--cyan); }
.ln-yellow  { color: var(--yellow); }
.ln-orange  { color: var(--orange); }
.ln-red     { color: var(--red); }
.ln-blue    { color: var(--blue); }
.ln-purple  { color: var(--purple); }
.ln-bright  { color: var(--text-bright); }
.ln-pink    { color: var(--pink); }

/* echoed command line */
.cmd-echo .echo-prompt { color: var(--prompt-color); }
.cmd-echo .echo-cmd    { color: var(--text-bright); }

/* ── Input line ── */
.input-line {
  display: flex;
  align-items: flex-start;
  margin-top: 6px;
}

.prompt {
  color: var(--prompt-color);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.input-display-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

#display-text {
  color: var(--text-bright);
  white-space: pre;
}

.caret {
  color: var(--green);
  animation: blink 1.1s step-end infinite;
  line-height: 1;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Hidden real input — captures keystrokes */
#cmd-input {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0;
  background: transparent;
  border: none;
  outline: none;
  color: transparent;
  caret-color: transparent;
  font-family: var(--font);
  font-size: var(--font-size);
  cursor: text;
  z-index: 10;
}

/* ── Quick access bar ── */
.quick-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 2px;
}

.quick-label {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.quick-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.qbtn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}
.qbtn:hover {
  background: rgba(86, 212, 221, 0.08);
  border-color: var(--cyan);
  color: var(--text-bright);
}
.qbtn:active { transform: scale(0.94); }

/* ── Shared section components ── */

/* Box header */
.box-header {
  color: var(--green);
  padding: 2px 0;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.box-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Skill chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px 22px;
}
.chip {
  font-size: 11.5px;
  padding: 2px 9px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text);
}

/* Project cards */
.proj-card {
  border-left: 3px solid var(--green-dim);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.015);
  border-radius: 0 5px 5px 0;
  transition: border-color 0.15s;
}
.proj-card:hover { border-left-color: var(--green); }

.proj-num   { color: var(--text-dim); font-size: 11px; }
.proj-name  { color: var(--yellow); font-weight: 700; }
.proj-short { color: var(--text-dim); font-size: 12px; margin-top: 1px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.tag {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(86, 212, 221, 0.08);
  border: 1px solid rgba(86, 212, 221, 0.25);
  color: var(--cyan);
}

/* Timeline items */
.timeline-item {
  padding-left: 16px;
  border-left: 2px solid var(--green-dim);
  margin-bottom: 16px;
  position: relative;
}
.timeline-item::before {
  content: '◆';
  position: absolute;
  left: -7px;
  top: 3px;
  font-size: 9px;
  color: var(--green);
}

/* Bullet list */
.bullet-list { margin-top: 5px; }
.bullet-item {
  padding-left: 14px;
  position: relative;
  line-height: var(--lh);
  color: var(--text-dim);
}
.bullet-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--green-dim);
}

/* Help table */
.help-row {
  display: flex;
  line-height: 1.85;
  gap: 0;
}
.help-cmd  { color: var(--cyan);     min-width: 180px; flex-shrink: 0; }
.help-desc { color: var(--text-dim); }

/* Links */
a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(88, 166, 255, 0.4);
  transition: border-color 0.15s;
}
a:hover { border-bottom-color: var(--blue); }

/* Info grid (contact / about) */
.info-row {
  display: flex;
  align-items: baseline;
  line-height: 1.9;
}
.info-key {
  color: var(--cyan);
  min-width: 90px;
  flex-shrink: 0;
}
.info-sep { color: var(--border-light); margin: 0 8px; }
.info-val { color: var(--text); }

/* Hire-me ascii */
.hire-ascii { color: var(--yellow); white-space: pre; font-size: 11px; line-height: 1.2; }

/* ── Responsive ── */

/* Tablet */
@media (max-width: 768px) {
  :root { --font-size: 13px; }

  body { padding: 10px; }

  .page-wrapper { height: calc(100vh - 20px); }

  .ascii-art { font-size: 9px; }

  .help-cmd { min-width: 150px; }

  .quick-btns { gap: 4px; }
  .qbtn { font-size: 10.5px; padding: 3px 8px; }
}

/* Mobile */
@media (max-width: 600px) {
  :root { --font-size: 12px; --lh: 1.6; }

  /* Layout */
  html, body { height: 100%; overflow: hidden; }
  body { padding: 0; align-items: stretch; }

  .page-wrapper {
    height: 100vh;
    height: 100dvh;          /* dynamic viewport — accounts for browser chrome */
    gap: 0;
    border-radius: 0;
  }

  /* Terminal window fills screen */
  .terminal-window {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  /* Tighter header */
  .terminal-header { padding: 9px 12px; }
  .terminal-title  { font-size: 10px; }
  .terminal-badge  { display: none; }

  /* Body padding */
  .terminal-body { padding: 10px 12px 10px 12px; }

  /* Prompt shortening on small screens */
  .prompt { font-size: 11px; }

  /* ASCII art — scale down significantly */
  .ln.c-green:has(+ .ln.c-green) { font-size: 7px; line-height: 1.15; }

  /* Help table: stack on very narrow screens */
  .help-row     { flex-direction: column; margin-bottom: 4px; }
  .help-cmd     { min-width: unset; color: var(--cyan); }
  .help-desc    { padding-left: 10px; font-size: 11px; margin-bottom: 2px; }

  /* Info card rows */
  .info-row     { flex-wrap: wrap; line-height: 2; }
  .info-key     { min-width: 80px; font-size: 11px; }
  .info-sep     { margin: 0 4px; }

  /* Chips wrap tightly */
  .chips        { margin-left: 10px; gap: 4px; }
  .chip         { font-size: 11px; padding: 2px 7px; }

  /* Tags */
  .tag          { font-size: 10px; }

  /* Project cards */
  .proj-card    { padding: 7px 10px; }
  .proj-name    { font-size: 12.5px; }

  /* Quick bar — scrollable row, no wrapping */
  .quick-bar {
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    background: var(--term-header);
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .quick-label  { display: none; }
  .quick-btns   { flex-wrap: nowrap; gap: 5px; }
  .qbtn {
    font-size: 11px;
    padding: 5px 12px;
    white-space: nowrap;
    flex-shrink: 0;
    /* larger tap target */
    min-height: 30px;
  }

  /* Hire-me ascii block */
  .hire-ascii   { font-size: 6.5px; line-height: 1.1; }

  /* Timeline */
  .timeline-item { padding-left: 12px; }
}

/* Very small phones (≤ 380px) */
@media (max-width: 380px) {
  :root { --font-size: 11px; }
  .terminal-body { padding: 8px 10px; }
  .prompt { font-size: 10.5px; }
  .qbtn   { font-size: 10.5px; padding: 5px 10px; }
}
