/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════════════ */
:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface-2:  #1e2530;
  --surface-3:  #252d3a;
  --border:     rgba(255, 255, 255, 0.08);
  --border-h:   rgba(245, 166, 35, 0.38);

  --amber:      #f5a623;
  --amber-dim:  rgba(245, 166, 35, 0.12);
  --amber-text: #ffb84d;

  --ink:        #e6edf3;
  --ink-muted:  #8b949e;
  --ink-faint:  #4a5568;

  --green:  #3fb950;
  --cyan:   #58a6ff;
  --red:    #ff5f57;
  --yellow: #febc2e;

  --mono: "JetBrains Mono", "Fira Code", monospace;
  --sans: "Inter", -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 32px rgba(245, 166, 35, 0.1);

  --navbar-h: 54px;
}

/* ═══════════════════════════════════════════════════
   RESET + BASE (no scroll)
════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ═══════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(13, 17, 23, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-brand {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-bracket { color: var(--amber); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.nav-link:hover {
  border-color: var(--amber);
  color: var(--amber-text);
  background: var(--amber-dim);
}

/* ═══════════════════════════════════════════════════
   MAIN GRID — SINGLE PAGE
════════════════════════════════════════════════════ */
.main-grid {
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 50% 50%;
  overflow: hidden;

  /* ambient grid background */
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Glow orbs (pseudo-elements on main-grid won't work, using ::before on panels) ── */
.panel-left::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 30% 60%, rgba(245,166,35,0.07) 0%, transparent 65%);
  z-index: 0;
}

.panel-right::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 70% 40%, rgba(88,166,255,0.05) 0%, transparent 65%);
  z-index: 0;
}

/* ── LEFT PANEL — identity on top, terminal fills rest ── */
.panel-left {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;               /* tighter gap → terminal gets more height */
  padding: 14px 14px 14px 22px;  /* less padding → terminal moves up */
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* ── RIGHT PANEL — skills + contact only ── */
.panel-right {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 16px 18px;  /* compact → more room for detail panel */
  gap: 0;
  overflow: hidden;
}

/* Terminal grows to fill remaining left-panel height */
.terminal-window {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.025);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.dot-red    { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-green  { background: var(--green); }

.term-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.term-body {
  padding: 18px 20px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  flex: 1;
  overflow: hidden;
}

.term-line {
  display: flex;
  align-items: center;
  gap: 0;
  opacity: 0;
  transform: translateY(3px);
  animation: lineReveal 0.25s ease forwards;
}

.term-prompt { color: var(--green); white-space: nowrap; flex-shrink: 0; }
.term-cmd    { color: var(--ink); }

.term-output {
  display: block;
  opacity: 0;
  color: var(--ink-muted);
  animation: lineReveal 0.25s ease forwards;
}

.term-output .hi  { color: var(--amber-text); font-weight: 700; }
.term-output .ok  { color: var(--green); }
.term-output .val { color: var(--cyan); }
.term-output .dim { color: var(--ink-faint); }

.term-spacer { height: 4px; }

.term-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--amber);
  border-radius: 1px;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
  margin-left: 1px;
}

/* ═══════════════════════════════════════════════════
   IDENTITY BLOCK
════════════════════════════════════════════════════ */
.identity {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.id-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border: 1px solid var(--border-h);
  border-radius: 999px;
  background: var(--amber-dim);
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-text);
  font-family: var(--mono);
  margin-bottom: 6px;   /* was 10px */
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: dotPulse 2s ease-in-out infinite;
}

.badge-mono { letter-spacing: 0.05em; }

.id-name {
  font-size: clamp(24px, 2.6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 6px;
}

.id-name em {
  font-style: normal;
  color: var(--amber);
}

.id-tagline {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-bottom: 8px;   /* was 14px */
}

.tagline-cycle {
  color: var(--amber-text);
  font-weight: 600;
  border-bottom: 1px solid rgba(245,166,35,0.45);
  transition: opacity 0.35s ease;
}

.id-stats {
  display: flex;
  align-items: center;
  padding: 8px 0;       /* was 12px 0 */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.id-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.id-stat strong {
  font-family: var(--mono);
  font-size: 17px;    /* was 20px */
  font-weight: 700;
  color: var(--amber-text);
  letter-spacing: -0.02em;
}

.id-stat span {
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.id-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 16px;
}

/* ═══════════════════════════════════════════════════
   SKILLS PANEL
════════════════════════════════════════════════════ */
.skills-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.panel-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.07em;
  flex-shrink: 0;
}

.skill-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.chip {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
  cursor: pointer;
  white-space: nowrap;
  animation: chipGlow 3s ease-in-out infinite;
}

.chip:nth-child(1) { animation-delay: 0s; }
.chip:nth-child(2) { animation-delay: 0.5s; }
.chip:nth-child(3) { animation-delay: 1.0s; }
.chip:nth-child(4) { animation-delay: 1.5s; }
.chip:nth-child(5) { animation-delay: 2.0s; }
.chip:nth-child(6) { animation-delay: 2.5s; }

.chip:hover,
.chip.active {
  border-color: var(--border-h);
  color: var(--amber-text);
  background: var(--amber-dim);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.1);
  animation: none;
}

/* Skill Detail Panel */
.skill-detail {
  flex: 1;
  min-height: 0;          /* critical: lets this shrink inside flex column */
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 14px 16px;
  overflow: hidden;       /* clip injected content so it never grows the panel */
  transition: border-color 0.25s;
}

.skill-detail.has-content {
  border-color: rgba(245,166,35,0.3);
}

.detail-hint {
  font-size: 13px;
  color: var(--ink-faint);
  font-family: var(--mono);
  height: 100%;
  display: flex;
  align-items: center;
}

/* Detail content injected by JS */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.detail-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-h);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--amber-dim);
}

.detail-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.detail-code {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.85;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  margin-bottom: 10px;
}

.code-comment { color: var(--ink-faint); font-style: italic; }
.code-key     { color: var(--cyan); }
.code-op      { color: var(--ink-faint); }
.code-val     { color: var(--amber-text); }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-2);
}

/* ═══════════════════════════════════════════════════
   CONTACT ROW
════════════════════════════════════════════════════ */
.contact-row {
  display: flex;
  gap: 12px;
  flex-shrink: 0;         /* never collapse — always visible */
  flex-grow: 0;
  position: relative;
  z-index: 1;
  margin-top: 14px;
}

.contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: border-color 0.2s, color 0.2s, transform 0.18s, box-shadow 0.2s;
}

.contact-btn:hover {
  border-color: var(--border-h);
  color: var(--amber-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.contact-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(145deg, #1f6fe5, #1256b9);
}

.contact-btn-icon.gh {
  background: linear-gradient(145deg, #2f3946, #11161e);
}

.contact-arrow {
  margin-left: auto;
  font-size: 15px;
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}

.contact-btn:hover .contact-arrow {
  transform: translate(2px, -2px);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════
   KEYFRAMES
════════════════════════════════════════════════════ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px var(--amber); }
  50%       { box-shadow: 0 0 10px var(--amber), 0 0 20px rgba(245,166,35,0.4); }
}

@keyframes lineReveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes chipGlow {
  0%, 100% {
    border-color: rgba(255,255,255,0.08);
    box-shadow: none;
  }
  50% {
    border-color: rgba(245, 166, 35, 0.28);
    box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.08);
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET (portrait + landscape)
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 52% 48%;
  }

  .panel-left  { padding: 12px 12px 12px 18px; gap: 8px; }
  .panel-right { padding: 14px 18px 14px 14px; }

  .id-name { font-size: clamp(20px, 2.4vw, 36px); }
  .id-stat strong { font-size: 15px; }
  .id-stat-divider { margin: 0 10px; }

  .chip { font-size: 11.5px; padding: 7px 8px; }

  .contact-btn { padding: 9px 12px; font-size: 12px; }
  .contact-btn-icon { width: 26px; height: 26px; font-size: 10px; }

  .term-body { padding: 14px 16px 16px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — STACKED (tablet portrait / large mobile)
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* switch to vertical scroll on small screens */
  html, body {
    overflow: auto;
    height: auto;
  }

  .main-grid {
    position: static;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background-image: none; /* remove grid pattern — too busy on mobile */
  }

  /* LEFT panel: identity + compact terminal */
  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 56px 16px 16px; /* account for fixed navbar */
    gap: 12px;
    overflow: visible;
    min-height: unset;
  }

  /* Constrain terminal height on stacked layout */
  .terminal-window {
    flex: unset;
    height: 220px;
    min-height: unset;
  }

  /* RIGHT panel: full width, auto height */
  .panel-right {
    padding: 20px 16px 24px;
    overflow: visible;
    min-height: unset;
  }

  /* Skills panel — release fixed flex constraints */
  .skills-panel {
    flex: unset;
    min-height: unset;
    overflow: visible;
    margin-bottom: 0;
  }

  /* Skill detail — auto height, no clipping */
  .skill-detail {
    flex: unset;
    min-height: unset;
    overflow: visible;
    height: auto;
  }

  .skill-chips {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Identity — horizontal stats row stays readable */
  .id-name { font-size: clamp(26px, 6vw, 40px); }
  .id-stat strong { font-size: 18px; }
  .id-stat-divider { margin: 0 14px; }
  .id-tagline { margin-bottom: 10px; }
  .id-badge { margin-bottom: 8px; }

  .contact-row { margin-top: 16px; }

  .navbar { padding: 0 16px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE (small phones)
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .id-name { font-size: 26px; }
  .id-stats { padding: 6px 0; }
  .id-stat strong { font-size: 16px; }
  .id-stat-divider { margin: 0 8px; }

  .skill-chips {
    grid-template-columns: repeat(2, 1fr);
  }

  .chip { font-size: 12px; padding: 8px 6px; }

  .contact-btn { padding: 10px 12px; font-size: 12px; }

  .term-body { font-size: 11.5px; line-height: 1.7; }

  .terminal-window { height: 190px; }

  .navbar { padding: 0 12px; }
  .nav-brand { font-size: 15px; }
  .nav-link { padding: 5px 10px; font-size: 11px; }
}