/* ===================================================
   DESIGN TOKENS
=================================================== */
:root {
  --bg: #0b1120;
  --bg-card: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.07);
  --orange: #fb923c;
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --green: #34d399;
  --pink: #f472b6;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --grid-size: 28px;
}

/* ===================================================
   BASE
=================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ===================================================
   GRID BACKGROUND
=================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(251, 146, 60, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(251, 146, 60, 0.05) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
}

/* ===================================================
   SCROLL REVEAL
=================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }

/* ===================================================
   NAVIGATION
=================================================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--border);
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  text-decoration: none;
}
.nav-link:hover { color: var(--orange); }

/* Mobile nav overlay */
#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.97);
  z-index: 49;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}
#mobile-menu.open { display: flex; }
#mobile-menu .nav-link { font-size: 1.5rem; font-weight: 700; }

/* ===================================================
   HERO — GLITCH NAME
=================================================== */
.glitch-name {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.05;
  position: relative;
}
.glitch-name em {
  font-style: normal;
  color: var(--orange);
}
.glitch-name::before,
.glitch-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: transparent;
  overflow: hidden;
  white-space: nowrap;
}
.glitch-name::before {
  left: 2px;
  text-shadow: -2px 0 var(--cyan);
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
  animation: glitch-top 4s infinite linear;
}
.glitch-name::after {
  left: -2px;
  text-shadow: 2px 0 var(--purple);
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
  animation: glitch-bottom 4.5s infinite linear;
}
@keyframes glitch-top {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92%           { transform: translate(-3px, -1px); opacity: 1; }
  94%           { transform: translate(2px, 0); opacity: 1; }
  96%           { transform: none; opacity: 0; }
}
@keyframes glitch-bottom {
  0%, 87%, 100% { transform: none; opacity: 0; }
  89%           { transform: translate(3px, 1px); opacity: 1; }
  92%           { transform: translate(-2px, 0); opacity: 1; }
  94%           { transform: none; opacity: 0; }
}

/* ===================================================
   HERO — DISCIPLINE TAG
=================================================== */
.discipline-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  border-left: 2px solid var(--orange);
  padding-left: 10px;
  margin-bottom: 1rem;
}

/* ===================================================
   HERO — BUTTONS
=================================================== */
.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: #0b1120;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-outline {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-outline:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-1px); }

/* ===================================================
   HERO — AVATAR + PULSE RINGS
=================================================== */
.pulse-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.75rem;
}
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--orange);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 2.5s ease-out infinite;
}
.pulse-ring:nth-child(1) { width: 100%;  height: 100%;  animation-delay: 0s; }
.pulse-ring:nth-child(2) { width: 145%;  height: 145%;  animation-delay: 0.6s; }
.pulse-ring:nth-child(3) { width: 190%;  height: 190%;  animation-delay: 1.2s; }
@keyframes pulse-ring {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.15); }
}
.avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--orange);
  z-index: 1;
}

/* ===================================================
   HERO — THREE PILLARS
=================================================== */
.pillar {
  border-radius: 10px;
  padding: 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.pillar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.pillar-be::before  { background: var(--orange); }
.pillar-sre::before { background: var(--cyan); }
.pillar-pe::before  { background: var(--purple); }
.pillar-fe::before  { background: var(--green); }

.pillar-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}
.pillar-be .pillar-label  { color: var(--orange); }
.pillar-sre .pillar-label { color: var(--cyan); }
.pillar-pe .pillar-label  { color: var(--purple); }
.pillar-fe .pillar-label  { color: var(--green); }
.pillar-tags { font-size: 0.68rem; color: var(--text-muted); line-height: 1.8; }

/* ===================================================
   HERO — METRICS BAR
=================================================== */
.metric { display: flex; align-items: baseline; gap: 0.5rem; }
.metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ===================================================
   SECTION SHARED
=================================================== */
.section-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  border-left: 2px solid var(--orange);
  padding-left: 10px;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* ===================================================
   EXPERIENCE — TIMELINE
=================================================== */
.timeline {
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 8px; bottom: 0; left: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--orange) 60%, transparent);
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
  transform: translateX(-4px);
}
/* Current role — pulsing dot ring */
.timeline-item--current::before {
  box-shadow: 0 0 14px var(--orange);
}
.timeline-item--current::after {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  transform: translateX(-4px) scale(1);
  opacity: 0.8;
  animation: dot-pulse 2s ease-out infinite;
}
@keyframes dot-pulse {
  0%   { transform: translateX(-4px) scale(1);   opacity: 0.8; }
  100% { transform: translateX(-4px) scale(2.8); opacity: 0;   }
}
.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  transition: border-color 0.25s;
}
.exp-card:hover { border-color: rgba(251, 146, 60, 0.3); }
.exp-company { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 0.2rem; }
.exp-role {
  font-size: 0.78rem; color: var(--orange); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem;
}
.exp-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1rem; }
.exp-bullets { list-style: none; padding: 0; margin: 0; }
.exp-bullets li {
  font-size: 0.88rem; color: var(--text-muted);
  padding-left: 1.1rem; position: relative;
  margin-bottom: 0.4rem; line-height: 1.65;
}
.exp-bullets li::before { content: '›'; position: absolute; left: 0; color: var(--orange); font-weight: 700; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem; }
.exp-tag {
  font-size: 0.68rem; padding: 3px 10px; border-radius: 4px;
  background: rgba(251, 146, 60, 0.08); color: var(--orange);
  border: 1px solid rgba(251, 146, 60, 0.2);
}

/* ===================================================
   SKILLS — HEXAGON GRID
=================================================== */
.hex-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  font-size: clamp(13px, 1.6vw, 21px);
  width: max-content;
  margin: 0 auto;
}
.hex-row { display: flex; gap: 4px; }
.hex-row.offset { margin-left: calc(3em + 2px); }

.hex {
  width: 6em; height: 6.72em;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.57em; font-weight: 700; text-align: center; line-height: 1.3;
  cursor: default;
  user-select: none;
}
.hex:hover { transform: scale(1.15); filter: brightness(1.4); position: relative; z-index: 2; }
.hex-be    { background: rgba(251,146,60,0.18);  color: var(--orange); }
.hex-sre   { background: rgba(34,211,238,0.13);  color: var(--cyan); }
.hex-pe    { background: rgba(167,139,250,0.13); color: var(--purple); }
.hex-fe    { background: rgba(52,211,153,0.13);  color: var(--green); }
.hex-tools { background: rgba(244,114,182,0.13); color: var(--pink); }

.hex.glow-be    { animation: glow-be    3.5s ease-in-out infinite; }
.hex.glow-sre   { animation: glow-sre   3.5s ease-in-out infinite 1.2s; }
.hex.glow-pe    { animation: glow-pe    3.5s ease-in-out infinite 2.4s; }
.hex.glow-fe    { animation: glow-fe    3.5s ease-in-out infinite 0.6s; }
.hex.glow-tools { animation: glow-tools 3.5s ease-in-out infinite 1.8s; }
@keyframes glow-be    { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7) drop-shadow(0 0 10px #fb923c)} }
@keyframes glow-sre   { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7) drop-shadow(0 0 10px #22d3ee)} }
@keyframes glow-pe    { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7) drop-shadow(0 0 10px #a78bfa)} }
@keyframes glow-fe    { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7) drop-shadow(0 0 10px #34d399)} }
@keyframes glow-tools { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7) drop-shadow(0 0 10px #f472b6)} }

.hex-legend { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; margin-top: 1.2rem; justify-content: center; }
.legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; color: var(--text-muted);
  cursor: pointer; user-select: none;
  transition: opacity 0.2s, color 0.2s;
}
.legend-item:hover { color: var(--text); }
.legend-item.active { color: var(--text); }
.legend-item.inactive { opacity: 0.3; }
.hex { transition: transform 0.2s, filter 0.2s, opacity 0.25s; }
.hex.dimmed { opacity: 0.1; filter: grayscale(1) brightness(0.5); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ===================================================
   SKILLS — TERMINAL GREP PANEL
=================================================== */
.term-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #020609;
}
.term-titlebar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: #0d1117;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot-r { background: #ff5f56; }
.term-dot-y { background: #ffbd2e; }
.term-dot-g { background: #27c93f; }
.term-wintitle { font-size: 0.68rem; color: #4a5568; margin-left: 6px; font-family: 'Courier New', monospace; }

.term-body {
  padding: 1.25rem 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  position: relative;
  overflow: hidden;
  min-height: 420px;
}

.t-prompt { color: #4ade80; margin-bottom: 12px; }
.t-group { margin-bottom: 14px; }
.t-group-label {
  font-size: 0.68rem; color: #2d5a45;
  text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 1px solid #1a3a2a; padding-bottom: 3px; margin-bottom: 6px;
}
.t-line { margin: 3px 0; line-height: 1.7; }
.t-file-be    { color: rgba(251,146,60,0.9); }
.t-file-sre   { color: rgba(34,211,238,0.9); }
.t-file-pe    { color: rgba(167,139,250,0.9); }
.t-file-fe    { color: rgba(52,211,153,0.9); }
.t-file-tools { color: rgba(244,114,182,0.9); }
.t-sep { color: #1e293b; }
.t-match-be    { color: #fde68a; }
.t-match-sre   { color: #67e8f9; }
.t-match-pe    { color: #c4b5fd; }
.t-match-fe    { color: #a7f3d0; }
.t-match-tools { color: #fbcfe8; }
.t-summary { color: #4a5568; margin-top: 10px; }
.t-cursor {
  display: inline-block; width: 7px; height: 13px;
  background: #4ade80; vertical-align: middle;
  animation: blink-cursor 0.8s step-end infinite;
}
@keyframes blink-cursor { 50% { opacity: 0; } }

/* Lines hidden until typewriter reveals them */
.t-line, .t-group-label, .t-prompt, .t-summary { opacity: 0; transition: opacity 0.05s; }
.t-line.revealed, .t-group-label.revealed, .t-prompt.revealed, .t-summary.revealed { opacity: 1; }

/* ===================================================
   EDUCATION
=================================================== */
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  transition: border-color 0.25s;
}
.edu-card:hover { border-color: rgba(251,146,60,0.3); }
.edu-school { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 0.2rem; }
.edu-degree { font-size: 0.85rem; color: var(--orange); margin-bottom: 0.2rem; font-weight: 600; }
.edu-date { font-size: 0.78rem; color: var(--text-muted); }

/* ===================================================
   FOOTER / CONTACT
=================================================== */
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 8px; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1rem; text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-link:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }

/* ===================================================
   MOBILE RESPONSIVE
=================================================== */
@media (max-width: 768px) {
  .hex-grid { font-size: 10px; }
  .term-body { min-height: 320px; font-size: 0.72rem; }
  .glitch-name { font-size: clamp(2rem, 10vw, 3rem); }
  .pulse-wrapper { width: 100px; height: 100px; }
  .metric-val { font-size: 0.9rem; }
  .section-tag { font-size: 0.62rem; }
  .exp-card { padding: 1rem 1.1rem; }
  .edu-card { padding: 1.1rem 1.2rem; }
}

@media (max-width: 480px) {
  .hex-grid { font-size: 9px; }
  .section-title { font-size: 1.5rem; }
  .glitch-name { font-size: clamp(1.8rem, 12vw, 2.5rem); }
  .pillar { padding: 0.65rem; }
  .pillar-tags { font-size: 0.6rem; }
}
