/* ============================================================
   Gandhi Madeti — Portfolio
   Modern dark theme, single stylesheet, no framework
   ============================================================ */

:root {
  --bg: #0a0b12;
  --bg-2: #0f1120;
  --card: #14162a;
  --card-2: #191c33;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef1ff;
  --muted: #b6bbd6;
  --muted-2: #7f86a8;

  --brand: #6d8bff;
  --brand-2: #22d3ee;
  --accent: #a78bfa;
  --grad: linear-gradient(100deg, #6d8bff 0%, #22d3ee 55%, #a78bfa 100%);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px var(--border), 0 30px 70px -30px rgba(109, 139, 255, 0.55);

  --maxw: 1160px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: "Sora", var(--font);
}

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

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

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.section { padding: clamp(72px, 10vw, 130px) 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Backdrop ---------- */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(650px 420px at 12% -8%, rgba(109, 139, 255, 0.20), transparent 60%),
    radial-gradient(600px 500px at 100% 0%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(700px 600px at 78% 110%, rgba(167, 139, 250, 0.14), transparent 55%);
}

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 100; transition: width .1s linear;
}

/* ---------- Buttons ---------- */
.btn {
  --pad: 12px 22px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: var(--pad); border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn .ico { transition: transform .2s ease; }
.btn:hover .ico { transform: translateX(3px); }
.btn-lg { --pad: 15px 28px; font-size: 1rem; }
.btn-sm { --pad: 9px 16px; font-size: .85rem; }

.btn-primary { background: var(--grad); color: #05070f; box-shadow: 0 14px 34px -12px rgba(109, 139, 255, 0.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(109, 139, 255, 0.9); }

.btn-ghost { background: rgba(255, 255, 255, 0.03); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand); background: rgba(109, 139, 255, 0.08); }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand-2);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(34, 211, 238, 0.06); margin-bottom: 18px;
}

.section-head { max-width: 640px; margin-bottom: 54px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--muted); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 11, 18, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-head); font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #05070f; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
  box-shadow: 0 8px 22px -8px rgba(109, 139, 255, 0.8);
}
.brand-name { font-size: 1.02rem; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px; font-size: .93rem; font-weight: 500; color: var(--muted);
  transition: color .2s ease, background .2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-cta { color: #05070f !important; margin-left: 8px; }
.nav-cta.active { background: var(--grad) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 150px 0 90px; min-height: 100svh; display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.1rem, 5.2vw, 3.7rem); margin: 14px 0 18px; font-weight: 800; }
.type-caret { color: var(--brand-2); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { font-size: clamp(1rem, 1.4vw, 1.18rem); color: var(--muted); max-width: 560px; }
.lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 26px; }
.hero-trust { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--muted-2); font-size: .92rem; }
.hero-trust b { color: var(--text); }
.hero-trust .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }

.hero-visual { display: grid; place-items: center; }
.avatar-wrap { position: relative; width: min(360px, 78vw); aspect-ratio: 1; }
.avatar-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--brand), var(--brand-2), var(--accent), var(--brand));
  filter: blur(2px); opacity: .55; animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  border-radius: 50%; border: 4px solid var(--bg); box-shadow: var(--shadow);
}
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: rgba(20, 22, 42, 0.92); border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px); box-shadow: var(--shadow); white-space: nowrap;
}
.float-chip .ico { color: var(--brand-2); }
.chip-1 { top: 6%; left: -12%; animation: floaty 6s ease-in-out infinite; }
.chip-2 { bottom: 14%; right: -14%; animation: floaty 6s ease-in-out infinite .8s; }
.chip-3 { bottom: -6%; left: 6%; animation: floaty 6s ease-in-out infinite 1.6s; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22); }
@keyframes floaty { 50% { transform: translateY(-10px); } }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 14px; display: grid; place-items: start center; padding-top: 7px; }
.scroll-cue span { width: 4px; height: 8px; border-radius: 2px; background: var(--brand-2); animation: cue 1.5s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.about-media { position: relative; }
.about-media img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; object-position: 50% 20%; }
.about-badge {
  position: absolute; right: -18px; bottom: -18px; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 14px 18px; box-shadow: var(--shadow);
}
.about-badge .num { font-family: var(--font-head); font-weight: 800; font-size: 1.9rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.about-badge .lbl { font-size: .78rem; color: var(--muted); line-height: 1.25; }

.about-copy h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 12px 0 18px; }
.about-copy p { color: var(--muted); margin-bottom: 16px; }
.fact-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 26px 0; }
.fact-list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--border); }
.fact-list .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); }
.fact-list .v { font-weight: 600; }

/* ---------- Services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 26px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
  position: relative; overflow: hidden;
}
.service::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.service:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); background: var(--card-2); }
.service:hover::before { transform: scaleX(1); }
.s-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem;
  background: rgba(109, 139, 255, 0.12); color: var(--brand-2); border: 1px solid var(--border); margin-bottom: 18px;
}
.service h3 { font-size: 1.18rem; margin-bottom: 9px; }
.service p { color: var(--muted); font-size: .96rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.skills-copy h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 12px 0 16px; }
.skills-copy p { color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.tag-cloud span {
  padding: 8px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--muted);
  transition: .2s ease;
}
.tag-cloud span:hover { color: var(--text); border-color: var(--brand); background: rgba(109, 139, 255, 0.1); transform: translateY(-2px); }

.skills-bars { display: grid; gap: 20px; }
.skill-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .92rem; font-weight: 500; }
.skill-top b { color: var(--brand-2); }
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--grad); transition: width 1.1s cubic-bezier(.16,1,.3,1); }

/* ---------- CTA band ---------- */
.cta-band { padding: clamp(56px, 8vw, 96px) 0; }
.cta-inner {
  text-align: center; background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 26px; padding: clamp(40px, 6vw, 70px) 26px; box-shadow: var(--shadow-glow);
  background-image: radial-gradient(600px 200px at 50% 0%, rgba(109, 139, 255, 0.16), transparent 70%);
}
.cta-inner h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 12px; }
.cta-inner p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 50px; align-items: start; }
.contact-info h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 12px 0 14px; }
.contact-info > p { color: var(--muted); margin-bottom: 28px; }
.contact-list { list-style: none; display: grid; gap: 16px; margin-bottom: 26px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.c-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(34, 211, 238, 0.1); border: 1px solid var(--border); color: var(--brand-2); font-size: 1.1rem; }
.contact-list b { display: block; font-size: .95rem; }
.contact-list span, .contact-list a { color: var(--muted); font-size: .93rem; }
.contact-list a:hover { color: var(--brand-2); }

.socials { display: flex; gap: 10px; }
.socials a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--muted); font-weight: 700; transition: .2s ease; }
.socials a:hover { color: #05070f; background: var(--grad); border-color: transparent; transform: translateY(-2px); }

.contact-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 139, 255, 0.18); }
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-note { display: none; padding: 12px 15px; border-radius: 10px; font-size: .9rem; }
.form-note.show { display: block; }
.form-note.ok { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.form-note.err { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
#submitBtn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 34px 0; background: var(--bg-2); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot-copy { color: var(--muted-2); font-size: .88rem; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad); color: #05070f; font-weight: 700; font-size: 1.1rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s ease; z-index: 80;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-copy { order: 2; }
  .hero-visual { order: 1; }
  .hero-actions, .hero-trust { justify-content: center; }
  .lead { margin-inline: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 60px; }
  .about-media { max-width: 380px; margin-inline: auto; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(10, 11, 18, 0.97); backdrop-filter: blur(14px); padding: 16px 22px 26px;
    border-bottom: 1px solid var(--border); transform: translateY(-140%); transition: transform .3s ease; box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 14px; }
  .nav-cta { margin: 6px 0 0; text-align: center; justify-content: center; }
  .nav-toggle { display: flex; }
}

@media (max-width: 540px) {
  .service-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .fact-list { grid-template-columns: 1fr; }
  .about-badge { right: 8px; }
  .float-chip { font-size: .74rem; padding: 7px 11px; }
  .chip-1 { left: -4%; } .chip-2 { right: -4%; }
}

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