/* ==========================================================
   Madhukar Gumanju – Portfolio
   Pure CSS, mobile-first, light/dark themes
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #7c3aed;
  --success: #047857;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-hover: 0 4px 10px rgba(15, 23, 42, .06), 0 16px 40px rgba(37, 99, 235, .12);
  --radius: 14px;
  --header-h: 68px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --text: #e2e8f0;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --border: #1e293b;
  --primary: #60a5fa;
  --primary-strong: #93c5fd;
  --accent: #a78bfa;
  --success: #34d399;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-hover: 0 4px 10px rgba(0, 0, 0, .35), 0 16px 40px rgba(96, 165, 250, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.65;
  color: var(--text); background: var(--bg);
  transition: background-color .3s ease, color .3s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
ul { margin: 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); font-weight: 500; }
.accent { color: var(--primary); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff; padding: .5rem 1rem; z-index: 1000; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(15, 23, 42, .05); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  display: flex; flex-direction: column; gap: .25rem; list-style: none; margin: 0; padding: 1rem 1.25rem 1.5rem;
  background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s ease;
}
.nav-menu.open { transform: none; opacity: 1; visibility: visible; }
.nav-menu a { display: block; padding: .6rem .25rem; color: var(--text-soft); font-weight: 500; }
.nav-menu a:hover, .nav-menu a.active { color: var(--primary); text-decoration: none; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-top: .25rem;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--primary); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none !important; }
[data-theme="dark"] .icon-sun { display: none !important; }
[data-theme="dark"] .icon-moon { display: block !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; border: 2px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background-color .2s, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .3); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(37, 99, 235, .4); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 3.5rem 0 4rem; overflow: hidden; }
.hero {
  background:
    radial-gradient(ellipse 45% 55% at 88% 20%, rgba(124, 58, 237, .14), transparent 70%),
    radial-gradient(ellipse 40% 50% at 5% 75%, rgba(37, 99, 235, .12), transparent 70%);
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; margin-bottom: .5rem; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.75rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.hero-title { font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 600; color: var(--text-soft); }
.hero-summary { max-width: 560px; color: var(--text-soft); font-size: 1.05rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.hero-meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--muted); font-size: .95rem; }
.hero-meta li { display: flex; align-items: center; gap: .45rem; }
.hero-meta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.hero-visual { display: flex; justify-content: center; }
.avatar-wrap {
  position: relative; width: min(280px, 72vw); aspect-ratio: 1; border-radius: 50%; padding: 6px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 20px 60px rgba(37, 99, 235, .25);
  animation: float 6s ease-in-out infinite;
}
.avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 6px solid var(--bg); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title { display: flex; align-items: center; gap: .75rem; font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 2rem; }
.section-title span { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7em; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); max-width: 260px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.card h3 { font-size: 1.1rem; }
.company { color: var(--primary); font-weight: 600; font-size: .95rem; margin-bottom: .75rem; }

/* About */
.about-grid { display: grid; gap: 2rem; }
.about-text p { color: var(--text-soft); font-size: 1.05rem; }
.about-highlights { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.about-highlights li { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.about-highlights h3 { font-size: 1rem; color: var(--primary); margin-bottom: .25rem; }
.about-highlights p { font-size: .9rem; color: var(--text-soft); margin: 0; }

/* Skills */
.skills-grid { display: grid; gap: 1.25rem; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.tags li {
  padding: .35rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary-strong);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Timeline */
.timeline { list-style: none; padding: 0 0 0 1.75rem; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--primary), var(--accent)); border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: calc(-1.75rem + 1px); top: 1.6rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.timeline-head h3 { margin: 0; }
.timeline-content ul { padding-left: 1.1rem; color: var(--text-soft); }
.timeline-content li { margin-bottom: .35rem; }
.timeline-content li::marker { color: var(--primary); }
.badge {
  display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg-alt); color: var(--text-soft); border: 1px solid var(--border); white-space: nowrap;
}
.badge-current { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }

.additional { margin-top: 2.5rem; }
.additional > h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.additional-grid { display: grid; gap: 1rem; }
.additional-grid h4 { font-size: 1.02rem; margin-bottom: .2rem; }
.additional-grid p:last-child { margin: 0; color: var(--text-soft); }

/* Education / Training */
.edu-grid { display: grid; gap: 1.25rem; }
.edu .badge { margin-bottom: .75rem; }
.edu .company, .edu-grid .company { margin-bottom: 0; }
.edu-grid p { color: var(--text-soft); }
.icon-circle {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(124, 58, 237, .12)); color: var(--primary);
}
.icon-circle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Contact */
.contact-intro { max-width: 600px; color: var(--text-soft); font-size: 1.05rem; }
.contact-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.contact-card { color: var(--text); display: block; }
.contact-card:hover { text-decoration: none; }
.contact-card h3 { font-size: 1rem; margin-bottom: .2rem; }
.contact-card p { margin: 0; color: var(--text-soft); word-break: break-word; }
.contact-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.75rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.footer-inner p { margin: 0; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .skills-grid, .edu-grid, .additional-grid, .contact-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-menu {
    position: static; flex-direction: row; align-items: center; gap: 1.5rem; padding: 0;
    background: none; border: 0; box-shadow: none; transform: none; opacity: 1; visibility: visible;
  }
  .nav-menu a { padding: .25rem 0; position: relative; }
  .nav-menu a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--primary); transition: width .25s; }
  .nav-menu a:hover::after, .nav-menu a.active::after { width: 100%; }
  .theme-toggle { margin-top: 0; }
  .hero { padding: 6rem 0 6.5rem; }
  .hero-grid { grid-template-columns: 1.35fr 1fr; }
  .avatar-wrap { width: 340px; }
  .about-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .edu-grid { grid-template-columns: repeat(3, 1fr); }
  .edu-grid.two { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(4, 1fr); }
  .timeline { padding-left: 2.5rem; }
  .timeline-dot { left: calc(-2.5rem + 1px); }
  .section { padding: 6rem 0; }
}

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

@media print {
  .site-header, .hero-cta, .contact-cta, .theme-toggle, .back-top { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
