/* =================================================================
   YASH — Cloud & DevOps Engineer Portfolio
   Premium dark theme · Space Grotesk + Inter
   Only the background animates; content stays stable & readable.
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #07090f;
  --bg-soft: #0b0e16;
  --surface: rgba(18, 22, 33, 0.72);
  --surface-2: rgba(24, 29, 43, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #eef1f7;
  --text-soft: #aab2c5;
  --text-mute: #717a90;

  --blue: #3b82f6;
  --purple: #8b5cf6;
  --cyan: #22d3ee;

  --accent-grad: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple));

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 18px 40px -24px rgba(0, 0, 0, 0.85), 0 2px 8px -4px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 32px 60px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);

  --sidebar-w: 300px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ================================================================
   ANIMATED BACKGROUND — LIVE AURORA (the ONLY moving layer)
   ================================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1400px 800px at 70% -20%, rgba(34,211,238,0.06), transparent 60%),
    radial-gradient(1200px 700px at 10% 120%, rgba(139,92,246,0.06), transparent 60%),
    var(--bg);
}

/* The aurora wraps several soft, overlapping light bands that
   weave, breathe and shift hue for a living, northern-lights feel. */
.aurora {
  position: absolute;
  inset: -20%;
  filter: blur(60px) saturate(140%);
  mix-blend-mode: screen;
  will-change: transform;
  animation: aurora-sway 24s ease-in-out infinite;
}

.aurora__band {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 48%;
  border-radius: 50%;
  opacity: 0.55;
  will-change: transform, opacity;
  background-size: 200% 200%;
}

/* Band 1 — emerald → cyan ribbon high up */
.aurora__band--1 {
  top: 2%;
  background:
    radial-gradient(60% 80% at 30% 50%, rgba(16,185,129,0.55), transparent 70%),
    radial-gradient(55% 80% at 70% 40%, rgba(34,211,238,0.55), transparent 72%);
  transform: rotate(-8deg);
  animation: aurora-flow-1 18s ease-in-out infinite, aurora-hue 26s linear infinite;
}

/* Band 2 — cyan → blue ribbon */
.aurora__band--2 {
  top: 22%;
  background:
    radial-gradient(60% 80% at 55% 50%, rgba(34,211,238,0.5), transparent 70%),
    radial-gradient(55% 80% at 20% 45%, rgba(59,130,246,0.55), transparent 72%);
  transform: rotate(6deg);
  animation: aurora-flow-2 22s ease-in-out infinite, aurora-hue 30s linear infinite reverse;
}

/* Band 3 — blue → violet ribbon */
.aurora__band--3 {
  top: 42%;
  background:
    radial-gradient(60% 80% at 40% 50%, rgba(59,130,246,0.5), transparent 70%),
    radial-gradient(55% 80% at 80% 55%, rgba(139,92,246,0.55), transparent 72%);
  transform: rotate(-5deg);
  animation: aurora-flow-3 20s ease-in-out infinite, aurora-hue 34s linear infinite;
}

/* Band 4 — violet → pink low glow */
.aurora__band--4 {
  top: 60%;
  background:
    radial-gradient(60% 80% at 60% 50%, rgba(139,92,246,0.48), transparent 70%),
    radial-gradient(55% 80% at 25% 50%, rgba(236,72,153,0.4), transparent 74%);
  transform: rotate(9deg);
  animation: aurora-flow-4 26s ease-in-out infinite, aurora-hue 40s linear infinite reverse;
}

/* faint twinkling star field behind the aurora */
.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 75% 20%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 50% 70%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 35% 85%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 65% 45%, rgba(255,255,255,0.45), transparent);
  background-repeat: no-repeat;
  opacity: 0.6;
  animation: stars-twinkle 6s ease-in-out infinite;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}

/* gentle overall sway of the whole aurora canvas */
@keyframes aurora-sway {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(0, -3%, 0) scale(1.12); }
}

/* each band weaves horizontally + breathes for a flowing ribbon look */
@keyframes aurora-flow-1 {
  0%, 100% { transform: rotate(-8deg) translateX(-6%) scaleY(1);   opacity: 0.5; }
  50%      { transform: rotate(-4deg) translateX(8%)  scaleY(1.25); opacity: 0.75; }
}
@keyframes aurora-flow-2 {
  0%, 100% { transform: rotate(6deg)  translateX(7%)  scaleY(1.1);  opacity: 0.45; }
  50%      { transform: rotate(2deg)  translateX(-9%) scaleY(0.9);  opacity: 0.7; }
}
@keyframes aurora-flow-3 {
  0%, 100% { transform: rotate(-5deg) translateX(-9%) scaleY(0.95); opacity: 0.5; }
  50%      { transform: rotate(-9deg) translateX(6%)  scaleY(1.2);  opacity: 0.72; }
}
@keyframes aurora-flow-4 {
  0%, 100% { transform: rotate(9deg)  translateX(6%)  scaleY(1.05); opacity: 0.4; }
  50%      { transform: rotate(5deg)  translateX(-8%) scaleY(1.3);  opacity: 0.68; }
}

/* slow living hue shift gives the shimmering aurora color play */
@keyframes aurora-hue {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes stars-twinkle {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.7; }
}

/* ================================================================
   LAYOUT
   ================================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 32px 26px;
}

.sidebar__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.profile { text-align: center; }

.profile__photo {
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 3px;
  background: var(--accent-grad);
}
.profile__photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--bg-soft);
}

.profile__name {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.profile__role {
  margin-top: 2px;
  font-size: 0.92rem;
  font-weight: 500;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile__meta {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile__meta li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.profile__meta svg { width: 16px; height: 16px; color: var(--cyan); flex: none; }
.profile__meta a:hover { color: var(--text); }

/* ---------------- NAV ---------------- */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  overflow: hidden;
  transition: color 0.25s ease, background 0.25s ease;
}
/* hover slide animation */
.nav__link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(59,130,246,0.14), rgba(139,92,246,0.14));
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.nav__link:hover::before { transform: translateX(0); }
.nav__link:hover { color: var(--text); }

.nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
  z-index: 1;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.nav__label { z-index: 1; }

.nav__link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav__link.is-active .nav__dot {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
  transform: scale(1.1);
}

.sidebar__footer {
  margin-top: auto;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-align: center;
}

/* ================================================================
   CONTENT
   ================================================================ */
.content {
  padding: 64px clamp(24px, 5vw, 80px) 96px;
  max-width: 1100px;
}

.section { padding: 56px 0; scroll-margin-top: 32px; }
.section--hero { padding-top: 24px; }

.eyebrow {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section__head { margin-bottom: 38px; }
.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
/* typewriter headings: reserve height + soft blinking caret */
.section__title.type-heading {
  min-height: 1.15em;
}
.section__title.type-heading::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
  opacity: 0;
}
.section__title.type-heading.is-typing::after {
  opacity: 1;
  animation: heading-caret 0.9s steps(1) infinite;
}
@keyframes heading-caret {
  50% { opacity: 0; }
}
.section__sub { margin-top: 12px; color: var(--text-soft); max-width: 540px; }

/* ---------------- HERO ---------------- */
.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.hero__accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent-line {
  width: 96px;
  height: 4px;
  border-radius: 4px;
  background: var(--accent-grad);
  margin: 26px 0;
}
.hero__lead {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  color: var(--text-soft);
  max-width: 680px;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}
.stat {
  flex: 1 1 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
}
.stat__num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 600;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { font-size: 0.82rem; color: var(--text-mute); }

/* ---------------- EXPERTISE CARDS ---------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.cat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
/* cursor-following spotlight sheen (driven by --mx / --my set in JS) */
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    rgba(34, 211, 238, 0.14),
    rgba(139, 92, 246, 0.08) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
/* gradient accent line that sweeps across the top on hover */
.cat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}
.cat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.cat-card:hover::before { opacity: 1; }
.cat-card:hover::after { transform: scaleX(1); }
/* keep inner content above the sheen */
.cat-card__head, .badges { position: relative; z-index: 1; }

.cat-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.cat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease, box-shadow 0.4s ease;
}
.cat-card:hover .cat-card__icon {
  transform: scale(1.12) rotate(-6deg);
  background: rgba(34, 211, 238, 0.18);
  box-shadow: 0 0 22px -6px rgba(34, 211, 238, 0.6);
}
.cat-card__title {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 600;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-size: 0.8rem;
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.cat-card.is-in .badge {
  animation: badge-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.badge:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-2px) scale(1.05);
}
@keyframes badge-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- PROJECTS (3D FLIP) ---------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.flip {
  perspective: 1400px;
  height: 240px;
}
.flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.flip:hover .flip__inner,
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }

.flip__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 26px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.flip__face--front {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.flip:hover .flip__face--front {
  box-shadow: var(--shadow-lift), 0 0 38px -10px rgba(59, 130, 246, 0.45);
  border-color: rgba(59, 130, 246, 0.4);
}
.flip__index {
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin-bottom: 12px;
}
.flip__name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.flip__hint {
  margin-top: 16px;
  font-size: 0.74rem;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flip__face--back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  background: var(--surface-2);
  border-color: rgba(139, 92, 246, 0.35);
}
.flip:hover .flip__face--back {
  box-shadow: var(--shadow-lift), 0 0 40px -10px rgba(139, 92, 246, 0.5);
}
.flip__back-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.flip__type {
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.55;
  overflow-y: auto;
}
.flip__type::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--cyan);
  animation: caret 1s steps(1) infinite;
  opacity: 0;
}
.flip.is-typing .flip__type::after { opacity: 1; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------------- CONTACT ---------------- */
.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.contact-item:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}
.contact-item__icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--border);
  color: var(--cyan);
  flex: none;
}
.contact-item__icon svg { width: 22px; height: 22px; }
.contact-item__body { display: flex; flex-direction: column; }
.contact-item__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.contact-item__value { font-weight: 500; }

.footer-note {
  margin-top: 40px;
  font-size: 0.82rem;
  color: var(--text-mute);
}

/* ================================================================
   SCROLL REVEAL
   ================================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }
  .sidebar__inner {
    flex-direction: column;
    padding: 24px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav__link { padding: 9px 14px; }
  .content { padding: 40px clamp(20px, 5vw, 48px) 80px; }
  .section { padding: 44px 0; }
}

@media (max-width: 520px) {
  .nav__link { font-size: 0.85rem; }
  .flip { height: 230px; }
  .hero__stats .stat { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .aurora__band, .bg-stars { animation: none; }
  html { scroll-behavior: auto; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
}
