/* ==========================================================
   Anjali Gupta Portfolio - style.css
   Edit colors, fonts and spacing in the :root variables below.
   ========================================================== */

/* ---------- Theme variables ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --surface: #ffffff;
  --text: #1e2433;
  --muted: #5b6477;
  --primary: #4f46e5;
  --primary-dark: #3b34c4;
  --accent: #06b6d4;
  --border: #e3e7f0;
  --shadow: 0 8px 24px rgba(30, 36, 51, 0.08);
  --shadow-hover: 0 16px 36px rgba(79, 70, 229, 0.18);
  --radius: 16px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 70px;
}

/* Dark theme: applied when <html data-theme="dark"> */
[data-theme="dark"] {
  --bg: #0f1420;
  --bg-alt: #151b2b;
  --surface: #1a2236;
  --text: #e8ecf5;
  --muted: #a3adc2;
  --primary: #8b83ff;
  --primary-dark: #7a71f5;
  --accent: #22d3ee;
  --border: #29324a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 36px rgba(139, 131, 255, 0.25);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1120px, 92%); margin: 0 auto; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-size: 1.5rem; font-weight: 700; }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 22px; }
.nav-link { font-size: 0.92rem; font-weight: 500; color: var(--muted); padding: 6px 2px; position: relative; transition: color 0.2s; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--primary); transition: width 0.25s;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.1rem; cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
.icon-btn:hover { transform: scale(1.08); border-color: var(--primary); }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 60px;
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 45%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 45%),
    var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 600; letter-spacing: 1px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.15; margin: 6px 0; }
.headline { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 500; color: var(--muted); margin-bottom: 16px; }
.intro { max-width: 560px; color: var(--muted); margin-bottom: 28px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-hover); }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative; width: min(320px, 70vw); aspect-ratio: 1; border-radius: 50%;
  padding: 6px; background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-hover);
  animation: float 6s ease-in-out infinite;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--surface); }
.photo-fallback {
  position: absolute; inset: 6px; border-radius: 50%; background: var(--surface);
  display: none; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 700; color: var(--primary);
}
.photo-frame.no-photo img { display: none; }
.photo-frame.no-photo .photo-fallback { display: flex; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; font-size: clamp(1.8rem, 4vw, 2.3rem); margin-bottom: 40px; position: relative; }
.section-title::after {
  content: ""; display: block; width: 60px; height: 4px; margin: 12px auto 0;
  border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent));
}
.about-box { max-width: 800px; margin: 0 auto; text-align: center; color: var(--muted); display: grid; gap: 16px; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 24px; }
.cards-1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; }

.tag {
  display: inline-block; padding: 3px 12px; margin: 4px 6px 4px 0;
  font-size: 0.8rem; font-weight: 500; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
}

/* Skills */
.skill-card h3 { color: var(--primary); margin-bottom: 12px; }

/* Projects */
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-img {
  height: 190px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
}
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.project-card:hover .project-img img { transform: scale(1.08); }
.project-img .ph { color: #fff; font-size: 2.6rem; font-weight: 700; opacity: 0.9; }
.project-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body p { color: var(--muted); font-size: 0.93rem; flex: 1; }
.project-links { display: flex; gap: 10px; margin-top: 6px; }

/* Timeline */
.timeline { max-width: 800px; margin: 0 auto; position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 3px; background: var(--border); border-radius: 3px; }
.timeline-item { position: relative; }
.timeline-item .dot {
  position: absolute; left: -34px; top: 28px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--primary); border: 4px solid var(--bg);
}
.list { margin-top: 12px; display: grid; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.list li { position: relative; padding-left: 20px; }
.list li::before { content: "▹"; position: absolute; left: 0; color: var(--primary); }

/* Certificates */
.cert-card { display: flex; flex-direction: column; gap: 4px; }
.cert-card .project-links { margin-top: 10px; flex-wrap: wrap; }

/* Contact */
.contact-grid { margin-top: 32px; }
.contact-card { text-align: center; word-break: break-word; }
.contact-card p { color: var(--muted); font-size: 0.9rem; }
.c-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.loc { margin-top: 28px; }

/* Footer */
.footer { text-align: center; padding: 26px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

/* Back to top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%;
  border: none; background: var(--primary); color: #fff; font-size: 1.3rem; cursor: pointer;
  box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.3s; z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 8px 4%;
    max-height: 0; overflow: hidden; visibility: hidden; transition: max-height 0.3s, visibility 0.3s;
  }
  .nav-links.open { max-height: 480px; visibility: visible; }
  .nav-links li a { display: block; padding: 12px 4px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { order: -1; }
  .intro { margin-inline: auto; }
  .btn-row { justify-content: center; }
  .cards-2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .cards-3, .cards-4 { grid-template-columns: 1fr; }
}

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