/* ============================================================
   Manish Giri — Portfolio
   ============================================================ */

:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --text: #1c2333;
  --text-soft: #4a5568;
  --text-faint: #718096;
  --accent: #0d7a68;
  --accent-soft: rgba(13, 122, 104, 0.1);
  --accent-2: #6246ea;
  --border: rgba(28, 35, 51, 0.1);
  --shadow: 0 10px 30px -12px rgba(28, 35, 51, 0.18);
  --nav-bg: rgba(247, 248, 252, 0.85);
  --line: rgba(28, 35, 51, 0.14);
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #16203a;
  --text: #e2e8f0;
  --text-soft: #a7b3c8;
  --text-faint: #7c8aa5;
  --accent: #35d0ab;
  --accent-soft: rgba(53, 208, 171, 0.09);
  --accent-2: #9d8cff;
  --border: rgba(226, 232, 240, 0.08);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(11, 17, 32, 0.85);
  --line: rgba(226, 232, 240, 0.14);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; line-height: 1.2; }

a { color: var(--accent); text-decoration: none; }

strong { color: var(--text); font-weight: 600; }

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

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

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px -8px rgba(0,0,0,0.15); }

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: 0.5px;
}
.nav-logo .mono { color: var(--accent); font-weight: 500; }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
.icon-sun { display: none; }

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

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 78% 18%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 45% 40% at 12% 85%, rgba(98, 70, 234, 0.09), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; padding-top: 90px; padding-bottom: 60px; }

.hero-kicker { color: var(--accent); font-size: 0.95rem; margin-bottom: 18px; }

.hero-name {
  font-size: clamp(2.6rem, 7.5vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -1.5px;
}

.hero-tagline {
  font-size: clamp(1.7rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: -1px;
  margin-top: 4px;
}

.hero-blurb {
  max-width: 580px;
  margin-top: 24px;
  color: var(--text-soft);
  font-size: 1.06rem;
}

.hero-cta { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px -6px var(--accent);
}
:root[data-theme="dark"] .btn-primary { color: #0b1120; }

.btn-ghost {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; margin-top: 8px; }

.hero-social { display: flex; gap: 18px; margin-top: 40px; }
.hero-social a {
  color: var(--text-faint);
  transition: color 0.2s ease, transform 0.2s ease;
  display: grid; place-items: center;
}
.hero-social a:hover { color: var(--accent); transform: translateY(-3px); }

.scroll-hint {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 48px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title::after {
  content: "";
  flex: 1;
  max-width: 280px;
  height: 1px;
  background: var(--line);
  margin-left: 8px;
}
.section-num { color: var(--accent); font-size: 0.85em; font-weight: 400; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { color: var(--text-soft); margin-bottom: 18px; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-family: "Sora", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label { font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); }

.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--accent);
}
.skill-head h3 { font-size: 1.02rem; color: var(--text); font-weight: 600; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
  max-width: 820px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  opacity: 0.35;
  border-radius: 2px;
}

.tl-item { position: relative; margin-bottom: 36px; }
.tl-item:last-child { margin-bottom: 0; }

.tl-marker {
  position: absolute;
  left: -36px; top: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 1;
}
.tl-marker.current {
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.tl-marker.edu { border-color: var(--accent-2); }

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.tl-card:hover { transform: translateX(4px); border-color: var(--accent); }

.tl-meta { font-size: 0.78rem; color: var(--accent); margin-bottom: 8px; letter-spacing: 0.3px; }
.tl-card h3 { font-size: 1.15rem; font-weight: 700; }
.tl-sep { color: var(--text-faint); font-weight: 400; }
.tl-org { color: var(--text-soft); font-weight: 600; margin-top: 2px; margin-bottom: 12px; }
.tl-loc { color: var(--text-faint); font-weight: 400; font-size: 0.9em; }

.tl-card ul:not(.chips) {
  list-style: none;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.tl-card ul:not(.chips) li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}
.tl-card ul:not(.chips) li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.tl-tags { margin-top: 14px; }

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent-2);
}
.edu-degree { font-family: "Sora", sans-serif; font-size: 1.15rem; font-weight: 700; }
.edu-school { color: var(--accent); font-weight: 600; margin-top: 2px; }
.edu-meta { font-size: 0.78rem; color: var(--text-faint); margin: 10px 0 14px; }
.edu-card p { color: var(--text-soft); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.section-contact { padding: 130px 0; }
.contact-inner { text-align: center; max-width: 640px; }
.contact-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
.contact-blurb { color: var(--text-soft); margin-bottom: 28px; font-size: 1.05rem; }
.contact-inner .hero-social { margin-top: 36px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}
.footer p { font-size: 0.78rem; color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 61px; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 0; width: 100%; text-align: center; }
  .nav-burger { display: flex; }
  .timeline { padding-left: 30px; }
  .tl-marker { left: -30px; width: 16px; height: 16px; }
  .timeline::before { left: 7px; }
  .tl-card { padding: 20px; }
}
