/* =========================================================================
   Utkarsh Babbar — personal site
   Modern "3D" dark UI for a senior DevOps / SRE engineer.
   Self-contained; no build step. Pairs with index.html.
   ========================================================================= */

:root {
  --bg-0: #05070e;
  --bg-1: #0a0f1e;
  --bg-2: #0f1629;
  --panel: rgba(18, 26, 48, 0.55);
  --panel-solid: #0d1426;
  --stroke: rgba(120, 160, 220, 0.14);
  --stroke-strong: rgba(120, 160, 220, 0.30);

  --text: #e6edf7;
  --text-dim: #97a6c2;
  --text-faint: #6b7a99;

  --cyan: #22d3ee;
  --violet: #a78bfa;
  --emerald: #34d399;
  --amber: #fbbf24;
  --pink: #f472b6;

  --grad: linear-gradient(120deg, #22d3ee 0%, #818cf8 45%, #c084fc 100%);
  --grad-soft: linear-gradient(120deg, rgba(34,211,238,.16), rgba(168,139,250,.16));

  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px var(--stroke), 0 20px 45px -18px rgba(0, 0, 0, 0.8);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --sidebar-w: 20rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  line-height: 1.7;
  background: var(--bg-0);
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- Backdrop */
/* Layered, fixed 3D-ish backdrop: gradient wash + drifting orbs + grid floor */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(129, 140, 248, 0.20), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(1000px 800px at 60% 110%, rgba(192, 132, 252, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

.orb {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
.orb.a { width: 32rem; height: 32rem; top: -8rem; right: -6rem; background: radial-gradient(circle, rgba(129,140,248,.55), transparent 65%); }
.orb.b { width: 26rem; height: 26rem; bottom: -6rem; left: 10%; background: radial-gradient(circle, rgba(34,211,238,.45), transparent 65%); animation-delay: -6s; }
.orb.c { width: 22rem; height: 22rem; top: 40%; left: 55%; background: radial-gradient(circle, rgba(52,211,153,.30), transparent 65%); animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, -30px, 0) scale(1.08); }
}

/* Synthwave perspective grid floor — reads as depth/3D without heavy JS */
.grid-floor {
  position: fixed;
  left: -25%;
  right: -25%;
  bottom: -10%;
  height: 55vh;
  z-index: -2;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.18) 1px, transparent 1px);
  background-size: 3.4rem 3.4rem;
  transform: perspective(320px) rotateX(64deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 80%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 80%);
  animation: grid-scroll 6s linear infinite;
}
@keyframes grid-scroll {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 3.4rem, 0 0; }
}

/* subtle noise/scanline vignette on top of everything */
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* --------------------------------------------------------------- Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 2.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.85), rgba(8, 12, 24, 0.9));
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
}
.avatar-wrap {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 50%;
  padding: 4px;
  background: var(--grad);
  box-shadow: 0 0 30px rgba(129, 140, 248, 0.45);
  animation: spin-ring 14s linear infinite;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }
.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-1);
  animation: spin-ring 14s linear infinite reverse; /* keep face upright */
}
.brand .name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.2;
}
.brand .name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .role {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--cyan);
  text-transform: uppercase;
}
.status {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.side-nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.side-nav a .idx { color: var(--text-faint); font-size: 0.72rem; }
.side-nav a:hover, .side-nav a.active {
  color: var(--text);
  background: var(--grad-soft);
  border-color: var(--stroke);
  transform: translateX(4px);
}
.side-nav a:hover .idx, .side-nav a.active .idx { color: var(--cyan); }

.side-social { margin-top: auto; display: flex; gap: 0.6rem; justify-content: center; }
.side-social a {
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  border-radius: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.18s ease;
}
.side-social a:hover {
  color: #fff;
  transform: translateY(-3px);
  border-color: var(--stroke-strong);
  box-shadow: 0 8px 20px -6px rgba(34, 211, 238, 0.5);
}
.resume-btn {
  display: block;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.6rem;
  border-radius: 0.6rem;
  color: var(--text);
  text-decoration: none;
  background: var(--grad-soft);
  border: 1px solid var(--stroke-strong);
  transition: all 0.18s ease;
}
.resume-btn:hover { box-shadow: 0 10px 24px -8px rgba(129,140,248,.6); transform: translateY(-2px); }

/* mobile menu toggle */
.menu-btn {
  display: none;
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 60;
  width: 3rem; height: 3rem;
  border-radius: 0.7rem;
  border: 1px solid var(--stroke);
  background: rgba(13, 20, 38, 0.9);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* --------------------------------------------------------------- Content */
.content {
  margin-left: var(--sidebar-w);
  padding: 4rem clamp(1.2rem, 4vw, 5rem);
  max-width: 78rem;
}

.section { padding: 3.5rem 0; scroll-margin-top: 2rem; }
.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.2rem;
}
.section-head h2 {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-head .tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}
.section-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--stroke-strong), transparent);
}

/* ------------------------------------------------------------------- Hero */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0 2rem;
}
.hero .kicker {
  font-family: var(--mono);
  color: var(--cyan);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero .lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 46rem;
  margin: 0 0 2rem;
}
.hero .lead strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.8rem 1.4rem;
  border-radius: 0.7rem;
  text-decoration: none;
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  transition: all 0.18s ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn.primary { background: var(--grad); color: #06101f; font-weight: 600; border-color: transparent; }
.btn.primary:hover { box-shadow: 0 14px 30px -10px rgba(129,140,248,.7); transform: translateY(-2px); }
.btn.ghost:hover { background: var(--grad-soft); transform: translateY(-2px); border-color: var(--stroke-strong); }

/* Terminal card in hero */
.terminal {
  margin-top: 2.6rem;
  max-width: 40rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
}
.terminal .bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--stroke);
}
.terminal .bar i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.terminal .bar .r { background: #ff5f56; }
.terminal .bar .y { background: #ffbd2e; }
.terminal .bar .g { background: #27c93f; }
.terminal .bar span { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); }
.terminal .body { padding: 1.1rem 1.2rem; font-family: var(--mono); font-size: 0.83rem; line-height: 1.9; }
.terminal .body .p { color: var(--emerald); }
.terminal .body .c { color: var(--cyan); }
.terminal .body .o { color: var(--text-dim); }
.terminal .body .cursor {
  display: inline-block; width: 9px; height: 1.1em;
  background: var(--cyan); vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------- 3D cards */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  padding: 1.6rem 1.7rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glow);
  transform-style: preserve-3d;
  transition: border-color 0.2s ease;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 0.9; }
.card > * { transform: translateZ(20px); }

/* --------------------------------------------------------- Experience */
.timeline { display: flex; flex-direction: column; gap: 1.4rem; }
.xp { }
.xp-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 0.7rem;
}
.xp-role { font-family: var(--sans); font-size: 1.15rem; font-weight: 600; margin: 0; }
.xp-co { color: var(--cyan); font-family: var(--mono); font-size: 0.85rem; }
.xp-date {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint);
  border: 1px solid var(--stroke); border-radius: 2rem; padding: 0.2rem 0.75rem; white-space: nowrap;
}
.xp ul { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--text-dim); }
.xp ul li { margin-bottom: 0.35rem; }
.xp ul li::marker { color: var(--violet); }

/* ---------------------------------------------------------- Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.1rem;
}
.skill-card h3 {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.skill-card h3 i { color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 0.5rem;
  padding: 0.28rem 0.6rem;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--stroke-strong); color: #fff; background: var(--grad-soft); transform: translateY(-2px); }

/* --------------------------------------------------------- Education */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.1rem; }
.edu-card h3 { font-family: var(--sans); font-size: 1.05rem; margin: 0 0 0.3rem; }
.edu-card .sub { color: var(--cyan); font-family: var(--mono); font-size: 0.8rem; margin-bottom: 0.5rem; }
.edu-card .meta { display: flex; justify-content: space-between; color: var(--text-faint); font-family: var(--mono); font-size: 0.76rem; }

/* --------------------------------------------------------- Achievements */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.award {
  display: flex; gap: 0.9rem; align-items: flex-start;
  padding: 1.1rem 1.2rem;
}
.award .ico {
  flex: none;
  width: 2.6rem; height: 2.6rem; border-radius: 0.6rem;
  display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--stroke);
  color: var(--amber); font-size: 1.1rem;
}
.award .yr { font-family: var(--mono); font-size: 0.7rem; color: var(--cyan); }
.award p { margin: 0.15rem 0 0; color: var(--text-dim); font-size: 0.92rem; }

/* ------------------------------------------------------------- Contact */
.contact-card { text-align: center; padding: 3rem 2rem; }
.contact-card h2 { font-family: var(--sans); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 0.8rem; }
.contact-card p { color: var(--text-dim); max-width: 34rem; margin: 0 auto 1.8rem; }

/* -------------------------------------------------------------- Footer */
.footer {
  margin-left: var(--sidebar-w);
  padding: 2rem clamp(1.2rem, 4vw, 5rem) 3rem;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  border-top: 1px solid var(--stroke);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem;
}
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--cyan); }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    width: min(20rem, 84vw);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-btn { display: block; }
  .content, .footer { margin-left: 0; }
  .content { padding-top: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: rgba(129, 140, 248, 0.4); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, 0.7); }
