/* ============================================================
   Kalyan Vadlakonda — personal profile
   Modern, responsive, theme-aware. No build step required.
   ============================================================ */

:root {
  --bg: #0a0b0f;
  --bg-soft: #12141c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-brd: rgba(255, 255, 255, 0.08);
  --text: #eef0f5;
  --text-dim: #9aa1b1;
  --text-faint: #626879;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --ring: rgba(124, 92, 255, 0.4);
  --max: 980px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-soft: #ffffff;
  --surface: rgba(10, 11, 15, 0.03);
  --surface-brd: rgba(10, 11, 15, 0.09);
  --text: #12141c;
  --text-dim: #4a5061;
  --text-faint: #8b91a3;
  --accent: #6b46ff;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --ring: rgba(107, 70, 255, 0.28);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

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

/* ---------- Animated background ---------- */
.bg-mesh {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 40% at 20% 20%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(35% 45% at 80% 15%, rgba(34, 211, 238, 0.20), transparent 60%),
    radial-gradient(45% 40% at 70% 80%, rgba(244, 114, 182, 0.18), transparent 60%);
  filter: blur(30px);
  animation: drift 22s ease-in-out infinite alternate;
}
:root[data-theme="light"] .bg-mesh { opacity: 0.55; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.03); }
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--surface-brd);
}
.nav__brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav__links {
  margin-left: auto;
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav__links a { color: var(--text-dim); position: relative; transition: color 0.2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.theme-toggle:hover { transform: scale(1.08); border-color: var(--ring); }
.theme-toggle__moon { display: none; }
:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }

@media (max-width: 560px) {
  .nav__links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 1.25rem 4rem;
  position: relative;
}
.hero__inner { max-width: 720px; }

.avatar {
  position: relative;
  width: 116px; height: 116px;
  margin: 0 auto 1.75rem;
  display: grid; place-items: center;
}
.avatar__monogram {
  width: 100px; height: 100px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  box-shadow: 0 10px 40px -10px var(--ring);
}
.avatar__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px dashed var(--ring);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero__eyebrow {
  font-size: 0.85rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600; margin-bottom: 0.5rem;
}
.hero__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -1px;
  margin-bottom: 0.6rem;
}
.hero__title {
  font-size: clamp(1.05rem, 3.5vw, 1.4rem);
  font-weight: 600;
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
  margin-bottom: 1rem;
}
@keyframes shimmer { to { background-position: 200% center; } }

.hero__blurb {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 540px; margin: 0 auto 2rem;
}

.hero__cta {
  display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}
.btn--lg { padding: 0.95rem 2rem; font-size: 1.05rem; }
.btn--primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  box-shadow: 0 8px 30px -8px var(--ring);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--ring); }
.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--surface-brd);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--ring); }

.hero__socials {
  display: flex; gap: 0.6rem; justify-content: center;
}
.hero__socials a {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--text-dim);
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s;
}
.hero__socials a:hover { color: var(--text); transform: translateY(-3px); border-color: var(--ring); }

.scroll-hint {
  position: absolute; bottom: 1.75rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px;
  border: 2px solid var(--surface-brd);
  display: grid; justify-items: center; padding-top: 8px;
}
.scroll-hint span {
  width: 4px; height: 8px; border-radius: 2px;
  background: var(--accent-2);
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: 0.3; } }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 5vw, 2rem);
}
.section__head {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin-bottom: 2.5rem;
}
.section__index {
  font-family: "Space Grotesk", sans-serif;
  color: var(--accent); font-weight: 700; font-size: 0.95rem;
  opacity: 0.8;
}
.section__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.5px;
}
.section__title::after {
  content: ""; display: block; width: 46px; height: 3px; margin-top: 0.5rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(1.5rem, 5vw, 3rem);
  align-items: start;
}
.about__text p { color: var(--text-dim); margin-bottom: 1rem; }
.about__text p:last-child { margin-bottom: 0; }
.about__facts {
  list-style: none;
  border: 1px solid var(--surface-brd);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.about__facts li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--surface-brd);
  font-size: 0.92rem;
}
.about__facts li:last-child { border-bottom: none; }
.about__k { color: var(--text-faint); }
.about__v { color: var(--text); font-weight: 600; text-align: right; }

@media (max-width: 720px) { .about { grid-template-columns: 1fr; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent);
  opacity: 0.5;
}
.timeline__item { position: relative; padding-left: 2.4rem; margin-bottom: 1.4rem; }
.timeline__dot {
  position: absolute; left: 0; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.timeline__card {
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.timeline__card:hover { transform: translateX(4px); border-color: var(--ring); }
.timeline__meta {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: baseline;
}
.timeline__role { font-weight: 700; font-size: 1.05rem; }
.timeline__date {
  font-size: 0.8rem; color: var(--accent-2); font-weight: 600;
  white-space: nowrap;
}
.timeline__org { color: var(--text-faint); font-size: 0.9rem; margin: 0.15rem 0 0.5rem; }
.timeline__desc { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.skill-group {
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}
.skill-group h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem; margin-bottom: 0.9rem;
  color: var(--text);
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-size: 0.85rem; font-weight: 500;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid var(--surface-brd);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.chips li:hover { color: var(--text); border-color: var(--ring); transform: translateY(-2px); }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.project-card {
  display: block;
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--ring);
  box-shadow: 0 16px 40px -20px var(--ring);
}
.project-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.project-card__head h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem; font-weight: 700;
}
.project-card__arrow { color: var(--text-faint); transition: transform 0.25s var(--ease), color 0.25s; }
.project-card:hover .project-card__arrow { color: var(--accent-2); transform: translate(2px, -2px); }
.project-card__url {
  color: var(--accent-2); font-size: 0.85rem; font-weight: 600;
  margin: 0.2rem 0 0.7rem;
}
.project-card__desc { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Certifications ---------- */
.certs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.cert-card {
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid var(--surface-brd);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.cert-card:hover { transform: translateY(-3px); border-color: var(--ring); }
.cert-card__badge {
  flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px -10px var(--ring);
}
.cert-card__name { font-weight: 600; line-height: 1.4; }
.cert-card__org { color: var(--text-faint); font-size: 0.85rem; margin-top: 0.15rem; }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { max-width: 560px; margin: 0 auto; }
.contact__alt {
  margin-top: 1.1rem;
  display: flex; gap: 0.75rem; justify-content: center; align-items: center;
  color: var(--text-faint); font-size: 0.95rem;
}
.contact__alt a { color: var(--text-dim); transition: color 0.2s; }
.contact__alt a:hover { color: var(--accent-2); }
.contact__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 7vw, 3rem); font-weight: 700;
  letter-spacing: -1px; margin: 0.4rem 0 0.8rem;
}
.contact__blurb { color: var(--text-dim); margin-bottom: 1.8rem; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--surface-brd);
  padding: 2rem clamp(1.25rem, 5vw, 2rem);
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--text-faint); font-size: 0.88rem;
}
.footer__meta a { color: var(--accent-2); }
.footer__meta a:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

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