:root {
  --bg: #0b0f14;
  --bg-elev: #121820;
  --bg-card: #161d27;
  --text: #e7ecf2;
  --muted: #93a0ad;
  --accent: #4fd1c5;
  --accent-soft: rgba(79, 209, 197, 0.14);
  --accent2: #8b5cf6;
  --accent2-soft: rgba(139, 92, 246, 0.12);
  --accent3: #f6ad55;
  --accent3-soft: rgba(246, 173, 85, 0.12);
  --border: #232b36;
  --max-width: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
}
.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 22px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0b0f14;
}
.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero {
  position: relative;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(79, 209, 197, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 209, 197, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 800px 400px at 30% 10%, black 40%, transparent 80%);
  animation: gridDrift 30s linear infinite;
}

.hero-glow {
  position: absolute;
  top: -160px;
  left: 8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  border-radius: 50%;
  filter: blur(10px);
  animation: glowPulse 7s ease-in-out infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 42px 42px, 42px 42px; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-text { max-width: 640px; }

.hero-photo { flex-shrink: 0; }

.hero-photo-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  padding: 5px;
  background: conic-gradient(from 0deg, var(--accent), transparent 60%, var(--accent));
}

.hero-photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 4px solid var(--bg);
  background: var(--bg);
}

/* Typewriter effect on the role line */
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation:
    typing 2.4s steps(40, end) 1,
    blinkCaret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCaret {
  50% { border-color: transparent; }
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.role {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 16px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 640px;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

/* Sections */
.section {
  padding: 56px 24px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.5rem;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

.about-text {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 760px;
}
.about-text strong { color: var(--text); }

/* Grid & Cards */
.grid {
  display: grid;
  gap: 18px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.stat-card { text-align: left; }
.stat {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 6px;
}
.stat-label {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-head h3 { margin: 0; font-size: 1.1rem; }

.timeline-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.timeline-org {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.timeline-content li { margin-bottom: 8px; font-size: 0.94rem; }

/* Skills */
.skill-group-title {
  margin: 0 0 16px;
  font-size: 1rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(79, 209, 197, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Pipeline diagram */
.pipeline-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 20px 20px;
}

.pipeline-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* Lane color coding: CI = teal, CD/IaC = violet, Observability = amber */
.lane-band.lane-ci   { fill: var(--accent-soft); stroke: rgba(79, 209, 197, 0.3); }
.lane-band.lane-cd   { fill: var(--accent2-soft); stroke: rgba(139, 92, 246, 0.3); }
.lane-band.lane-obs  { fill: var(--accent3-soft); stroke: rgba(246, 173, 85, 0.3); }
.lane-band { stroke-width: 1; }

.lane-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.lane-label.lane-ci  { fill: var(--accent); }
.lane-label.lane-cd  { fill: var(--accent2); }
.lane-label.lane-obs { fill: var(--accent3); }

.pipeline-flow, .pipeline-connector {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 10 8;
  animation: flowMove 1.5s linear infinite;
  opacity: 0.9;
}
.pipeline-flow.lane-ci, .pipeline-connector.lane-ci   { stroke: var(--accent); }
.pipeline-flow.lane-cd, .pipeline-connector.lane-cd   { stroke: var(--accent2); }
.pipeline-flow.lane-obs, .pipeline-connector.lane-obs { stroke: var(--accent3); }

.pipeline-loop {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 6 8;
  opacity: 0.5;
  animation: flowMove 2.4s linear infinite reverse;
}

@keyframes flowMove {
  to { stroke-dashoffset: -36; }
}

.pipeline-node rect {
  fill: var(--bg-elev);
  stroke-width: 2;
  animation: nodePulse 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.pipeline-node.lane-ci rect  { stroke: var(--accent);  --glow: rgba(79, 209, 197, 0.65); }
.pipeline-node.lane-cd rect  { stroke: var(--accent2); --glow: rgba(139, 92, 246, 0.65); }
.pipeline-node.lane-obs rect { stroke: var(--accent3); --glow: rgba(246, 173, 85, 0.65); }

.pipeline-node .node-title {
  fill: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}
.pipeline-node .node-sub {
  fill: var(--muted);
  font-size: 10px;
}

@keyframes nodePulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 8px var(--glow, rgba(79, 209, 197, 0.65))); }
}

.pipeline-conn-label,
.pipeline-loop-label {
  fill: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.pipeline-caption {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 760px;
  margin: 20px auto 4px;
  text-align: center;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-grid, .hero-glow, .typewriter,
  .pipeline-flow, .pipeline-loop, .pipeline-node rect {
    animation: none !important;
  }
}

/* Certifications */
.cert-card {
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Projects */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.project-card h3 { margin: 0; font-size: 1.05rem; }
.project-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.project-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.more-projects {
  margin-top: 20px;
  text-align: center;
}
.more-projects a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Footer */
footer.section { border-bottom: none; text-align: center; }
.contact-text { color: var(--muted); margin-bottom: 24px; }
footer .hero-actions { justify-content: center; }
.footer-note {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 800px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero-inner { flex-direction: column-reverse; text-align: center; gap: 28px; }
  .hero-text { max-width: 100%; }
  .hero-actions, .hero-badges { justify-content: center; }
  .hero-photo-ring { width: 150px; height: 150px; }
  .typewriter { white-space: normal; border-right: none; animation: none; width: 100%; }
  .pipeline-svg { min-width: 760px; }
  .pipeline-wrap { overflow-x: auto; }
}
