/* =========================================================
   ReynaldoRSoul — Personal Portfolio
   Cybersecurity / Terminal aesthetic
   ========================================================= */

:root {
  --bg: #0a0e14;
  --bg-2: #0d1218;
  --surface: #11161d;
  --surface-2: #161c24;
  --border: #1f2731;
  --border-2: #2a3340;
  --text: #e6edf3;
  --muted: #7d8590;
  --dim: #4d5563;

  --accent: #39d353;        /* matrix green */
  --accent-2: #00ffaa;      /* neon cyan-green */
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --danger: #f85149;
  --warn: #f0b429;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-glow: 0 0 0 1px rgba(57, 211, 83, 0.25), 0 0 30px -10px rgba(57, 211, 83, 0.35);

  --maxw: 1200px;
  --pad-x: clamp(20px, 5vw, 60px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(57, 211, 83, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(88, 166, 255, 0.06), transparent);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
ul, ol { list-style: none; }

::selection { background: rgba(57, 211, 83, 0.35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Background FX ---------- */
#matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 3px
  );
  mix-blend-mode: overlay;
}

.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(57, 211, 83, 0.06), transparent 60%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  will-change: transform;
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 20, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 14, 20, 0.85);
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text);
}
.brand-bracket { color: var(--accent); }
.brand-cursor {
  color: var(--accent);
  animation: blink 1s infinite step-end;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13.5px;
}
.nav-links a {
  color: var(--muted);
  transition: color .2s;
  position: relative;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .num { color: var(--accent); margin-right: 4px; font-size: 12px; }

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.resume-btn:hover {
  background: rgba(57, 211, 83, 0.1);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.resume-btn svg { width: 14px; height: 14px; }

.menu-toggle { display: none; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 140px var(--pad-x) 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(57, 211, 83, 0.08);
  border: 1px solid rgba(57, 211, 83, 0.25);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 28px;
}
.hero-tag .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-name {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-name .accent { color: var(--accent); }

/* ---------- Glitch effect ----------
   Name stays crisp & fully readable. Sharp digital RGB-split burst
   every 5s. The cyan/red ghost channels sit BEHIND the text, so they
   only peek out as colored fringes during a burst — the name itself
   is never distorted or hard to read. */
.glitch {
  position: relative;
  display: inline-block;
  isolation: isolate;
  animation: glitch-skew 5s steps(1) infinite;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}
.glitch::before {
  color: #29e7ff;                       /* cyan channel */
  animation: glitch-cyan 5s steps(1) infinite;
}
.glitch::after {
  color: #ff2d6f;                       /* magenta-red channel */
  animation: glitch-red 5s steps(1) infinite;
}

/* Whole-title micro jitter during the burst window */
@keyframes glitch-skew {
  0%, 82%, 96%, 100% { transform: translate(0) skewX(0); }
  84% { transform: translate(-2px, 1px) skewX(-0.6deg); }
  87% { transform: translate(2px, -1px) skewX(0.7deg); }
  90% { transform: translate(-1px, 0) skewX(-0.3deg); }
  93% { transform: translate(1px, 1px) skewX(0.4deg); }
}

/* Cyan channel — sharp horizontal-slice jumps */
@keyframes glitch-cyan {
  0%, 82%, 96%, 100% { opacity: 0; transform: translate(0); clip-path: inset(0 0 0 0); }
  83% { opacity: .9; transform: translate(-5px, -2px); clip-path: inset(0 0 68% 0); }
  86% { opacity: .9; transform: translate(6px, 1px);   clip-path: inset(42% 0 24% 0); }
  89% { opacity: .9; transform: translate(-7px, 2px);  clip-path: inset(74% 0 0 0); }
  92% { opacity: .9; transform: translate(4px, -1px);  clip-path: inset(12% 0 56% 0); }
  95% { opacity: .9; transform: translate(-2px, 1px);  clip-path: inset(0 0 0 0); }
}

/* Red channel — opposite slice jumps */
@keyframes glitch-red {
  0%, 82%, 96%, 100% { opacity: 0; transform: translate(0); clip-path: inset(0 0 0 0); }
  83% { opacity: .9; transform: translate(5px, 2px);   clip-path: inset(58% 0 0 0); }
  86% { opacity: .9; transform: translate(-6px, -1px); clip-path: inset(0 0 72% 0); }
  89% { opacity: .9; transform: translate(7px, -2px);  clip-path: inset(32% 0 32% 0); }
  92% { opacity: .9; transform: translate(-4px, 1px);  clip-path: inset(66% 0 6% 0); }
  95% { opacity: .9; transform: translate(2px, -1px);  clip-path: inset(0 0 0 0); }
}

/* Hover — channels gently split so the title feels "powered on" */
.glitch:hover::before { opacity: .7; transform: translate(-3px, 0); }
.glitch:hover::after  { opacity: .7; transform: translate(3px, 0); }

.hero-role {
  font-family: var(--mono);
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--muted);
  margin-bottom: 22px;
  min-height: 1.6em;
}
.hero-role .prompt { color: var(--accent); margin-right: 10px; }
.hero-role .caret {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s infinite step-end;
  margin-left: 2px;
}

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 36px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  border: 1px solid transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent);
  color: #06140a;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 0 25px rgba(0, 255, 170, 0.4);
  transform: translateY(-2px);
}
.btn-ghost {
  border-color: var(--border-2);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(57, 211, 83, 0.05);
}

/* Terminal in hero */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 60px -20px rgba(57, 211, 83, 0.2);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.5px;
  min-height: 360px;
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tdot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--dim);
}
.tdot.red { background: #ff5f57; }
.tdot.yellow { background: #febc2e; }
.tdot.green { background: #28c840; }
.terminal-title {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}
.terminal-body {
  padding: 22px;
  min-height: 320px;
  color: var(--text);
  line-height: 1.85;
}
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--muted); }
.terminal-body .key { color: var(--accent-blue); }
.terminal-body .val { color: var(--accent-2); }
.terminal-body .warn { color: var(--warn); }
.terminal-body .blink-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s infinite step-end;
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 38px;
  border: 2px solid var(--border-2);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-down span {
  width: 3px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-anim 1.6s infinite;
}
@keyframes scroll-anim {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ---------- SECTIONS ---------- */
.section {
  position: relative;
  z-index: 2;
  padding: 100px var(--pad-x);
}
.container {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 50px;
  color: var(--text);
}
.section-title .num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.6em;
  font-weight: 500;
}
.section-title .title-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-2), transparent);
  max-width: 300px;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 16.5px;
}
.about-text strong { color: var(--text); font-weight: 600; }

.quickfacts {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
}
.quickfacts > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.qf-label { color: var(--accent); min-width: 80px; }
.qf-val { color: var(--muted); }

.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.cert-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(57, 211, 83, 0.08), transparent 60%);
  pointer-events: none;
}
.cert-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--accent);
}
.cert-head svg { width: 22px; height: 22px; }
.cert-head h3 {
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
}
.cert-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
.cert-item:hover {
  border-left-color: var(--accent-2);
  transform: translateX(3px);
}
.cert-marker {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.cert-info { flex: 1; min-width: 0; }
.cert-name { font-weight: 600; font-size: 15px; }
.cert-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.cert-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--warn);
  background: rgba(240, 180, 41, 0.07);
  border: 1px solid rgba(240, 180, 41, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.cert-foot {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.cert-foot .prompt { color: var(--accent); margin-right: 6px; }

/* ---------- PROJECTS ---------- */
.proj-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
}
.proj-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 100px;
  align-self: start;
}
.proj-tab {
  text-align: left;
  padding: 14px 18px;
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all .2s;
  color: var(--muted);
}
.proj-tab:hover {
  background: var(--surface);
  color: var(--text);
  border-left-color: var(--border-2);
}
.proj-tab.active {
  background: var(--surface);
  color: var(--accent);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 30px rgba(57, 211, 83, 0.05);
}
.t-num {
  font-size: 11px;
  opacity: 0.6;
}
.t-name {
  font-size: 15px;
  font-weight: 600;
}
.t-sub {
  font-size: 11.5px;
  opacity: 0.7;
  font-weight: 400;
}

.proj-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  animation: fade-in .35s ease;
}
.proj-panel.active { display: block; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.proj-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--border);
}
.proj-role {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.proj-header h3 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.proj-when {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 360px;
}
.proj-stack span {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 10px;
  background: rgba(57, 211, 83, 0.08);
  color: var(--accent);
  border: 1px solid rgba(57, 211, 83, 0.2);
  border-radius: 4px;
}

.proj-intro {
  color: var(--muted);
  font-size: 15.5px;
  margin-bottom: 22px;
}

.proj-bullets li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 15px;
}
.proj-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.proj-bullets strong { color: var(--text); font-weight: 600; }

.proj-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}
.stat {
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.stat-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proj-note {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(240, 180, 41, 0.05);
  border: 1px dashed rgba(240, 180, 41, 0.3);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}
.proj-note .tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--warn);
  margin-right: 8px;
  text-transform: uppercase;
}

.roadmap li {
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
  color: var(--muted);
}
.roadmap li:last-child { border: none; }
.rm-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-blue);
  border-radius: 4px;
  margin-right: 12px;
  min-width: 70px;
  text-align: center;
}

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform .25s, border-color .25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(57, 211, 83, 0.45), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
/* Scan-line sweep that runs once on hover */
.skill-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 40%;
  top: -40%;
  background: linear-gradient(to bottom, transparent, rgba(57, 211, 83, 0.07), transparent);
  pointer-events: none;
  opacity: 0;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
}
.skill-card:hover::before { opacity: 1; }
.skill-card:hover::after {
  opacity: 1;
  animation: skill-scan 1.1s ease-in-out;
}
@keyframes skill-scan {
  from { top: -40%; }
  to { top: 100%; }
}

.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--accent);
}
.skill-head svg { width: 20px; height: 20px; flex-shrink: 0; }
.skill-head h3 {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}
.skill-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(57, 211, 83, 0.08);
  border: 1px solid rgba(57, 211, 83, 0.25);
  padding: 2px 9px;
  border-radius: 999px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.chips li {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease,
              color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.skills-grid.in .chips li { opacity: 1; transform: translateY(0); }
.chips li:nth-child(1)  { transition-delay: .04s; }
.chips li:nth-child(2)  { transition-delay: .09s; }
.chips li:nth-child(3)  { transition-delay: .14s; }
.chips li:nth-child(4)  { transition-delay: .19s; }
.chips li:nth-child(5)  { transition-delay: .24s; }
.chips li:nth-child(6)  { transition-delay: .29s; }
.chips li:nth-child(7)  { transition-delay: .34s; }
.chips li:nth-child(8)  { transition-delay: .39s; }
.chips li:nth-child(9)  { transition-delay: .44s; }
.chips li:nth-child(10) { transition-delay: .49s; }
.skills-grid.in .chips li:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(57, 211, 83, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px -5px rgba(57, 211, 83, 0.55);
}
.skill-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.skill-foot .prompt { color: var(--accent); margin-right: 6px; }
.skill-foot b { color: var(--text); font-weight: 700; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
.timeline > li {
  position: relative;
  margin-bottom: 30px;
}
.tl-dot {
  position: absolute;
  left: -30px; top: 22px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: border-color .2s;
}
.tl-card:hover { border-color: var(--border-2); }
.tl-when {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.tl-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
}
.tl-co {
  font-weight: 500;
  color: var(--muted);
  font-size: 16px;
}
.tl-card ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14.5px;
}
.tl-card ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- CONTACT ---------- */
.contact-wrap { max-width: 780px; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.5),
    0 0 60px -20px rgba(57, 211, 83, 0.15);
}
.contact-term-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.contact-body { padding: 32px; }
.contact-lead {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 16px;
}
.contact-rows { display: flex; flex-direction: column; }
.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr 20px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 14px;
  transition: all .2s;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:not(.static):hover {
  color: var(--accent);
  padding-left: 8px;
}
.contact-row:not(.static):hover .cr-val { color: var(--accent); }
.cr-key {
  color: var(--accent);
  text-transform: lowercase;
}
.cr-val { color: var(--text); transition: color .2s; }
.contact-row svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- FOOTER ---------- */
.footer {
  position: relative;
  z-index: 2;
  padding: 30px var(--pad-x);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer .prompt { color: var(--accent); }
.footer-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dot-sep { color: var(--dim); }
.footer kbd {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
  font-size: 11px;
}

/* ---------- EASTER EGG TERMINAL ---------- */
.ee-terminal {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: min(560px, calc(100vw - 60px));
  height: min(420px, 70vh);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 60px -10px rgba(57, 211, 83, 0.4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  animation: ee-pop .25s ease;
  transition: width .28s ease, height .28s ease;
}
/* Minimized — collapsed to just the title bar */
.ee-terminal.minimized { height: auto; }
.ee-terminal.minimized .ee-body,
.ee-terminal.minimized .ee-input-row { display: none; }
.ee-terminal.minimized .ee-head {
  border-bottom: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
}
/* Maximized — larger working window */
.ee-terminal.maximized {
  width: min(1000px, calc(100vw - 48px));
  height: min(680px, calc(100vh - 48px));
}
@keyframes ee-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ee-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
/* Functional traffic-light window controls */
.ee-lights {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ee-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  line-height: 1;
  transition: filter .15s, transform .12s;
}
.ee-dot.red { background: #ff5f57; }
.ee-dot.yellow { background: #febc2e; }
.ee-dot.green { background: #28c840; }
.ee-dot:hover { filter: brightness(1.15); }
.ee-dot:active { transform: scale(0.86); }
.ee-dot span {
  font-size: 10px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.ee-lights:hover .ee-dot span,
.ee-dot:focus-visible span { opacity: 1; }

/* Floating launch button */
.terminal-launch {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(57, 211, 83, 0.08);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .25s ease;
}
.terminal-launch svg { width: 17px; height: 17px; }
.terminal-launch:hover {
  transform: translateY(-2px);
  background: rgba(57, 211, 83, 0.12);
  box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.8), var(--shadow-glow);
}
.terminal-launch:active { transform: translateY(0); }
.terminal-launch.launch-off {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.92);
}
.ee-body {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}
.ee-body .prompt { color: var(--accent); margin-right: 6px; }
.ee-body .out { color: var(--muted); }
.ee-body .err { color: var(--danger); }
.ee-body .ok { color: var(--accent); }
.ee-body .key { color: var(--accent-blue); }
.ee-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.ee-input-row .prompt { color: var(--accent); }
#ee-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}

/* ---------- REVEAL ANIMATIONS ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .terminal { min-height: 280px; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-layout { grid-template-columns: 1fr; }
  .proj-tabs {
    position: relative;
    top: auto;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .proj-tabs::-webkit-scrollbar { display: none; }
  .proj-tab {
    border-left: none;
    border-bottom: 2px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    min-width: 150px;
    flex-shrink: 0;
  }
  .proj-tab.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 720px) {
  .nav { padding: 14px 18px; gap: 12px; }
  .brand { font-size: 14px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    padding: 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
  }
  .menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: .2s;
  }
  .resume-btn { padding: 8px 13px; font-size: 12.5px; }
  .hero { padding: 110px 20px 60px; }
  .section { padding: 70px 20px; }
  .proj-panel { padding: 24px; }
  .proj-header h3 { font-size: 22px; }
  .contact-row {
    grid-template-columns: 80px 1fr;
  }
  .contact-row svg { display: none; }
  .cr-val { font-size: 12.5px; word-break: break-all; }
  .ee-terminal {
    bottom: 10px; right: 10px; left: 10px;
    width: auto;
  }
  .ee-terminal.maximized {
    top: 10px; bottom: 10px; left: 10px; right: 10px;
    width: auto; height: auto;
  }
  #ee-input { font-size: 16px; }            /* prevents iOS zoom-on-focus */
  .terminal-launch {
    bottom: 16px; right: 16px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Small phones */
@media (max-width: 560px) {
  .quickfacts { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-tag { font-size: 11.5px; }
  .proj-stack { max-width: 100%; }
}

@media (max-width: 440px) {
  .hero { padding: 100px 16px 54px; }
  .section { padding: 58px 16px; }
  .hero-name { font-size: clamp(40px, 13vw, 96px); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .proj-panel { padding: 20px; }
  .quickfacts { padding: 18px; }
  .terminal-body { padding: 16px; font-size: 12.5px; }
  .section-title { gap: 10px; }
  .terminal-launch span { display: none; }   /* icon-only on tiny screens */
  .terminal-launch { padding: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #matrix { display: none; }
}
