/* ============================================================
   Piyush Shah - Portfolio
   Dual-theme (dark default / light) design system
   ============================================================ */

:root {
  --bg: #0a1120;
  --bg-soft: #0d1626;
  --card: #111d33;
  --card-2: #0f1a2e;
  --text: #e8eefb;
  --muted: #9fb2cc;
  --accent: #2dd4bf;
  --accent-2: #60a5fa;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --line: rgba(148, 163, 184, 0.16);
  --shadow: 0 18px 50px rgba(2, 8, 20, 0.45);
  --shadow-sm: 0 6px 22px rgba(2, 8, 20, 0.35);
  --header-bg: rgba(10, 17, 32, 0.85);
  --on-accent: #06241f;
}

html[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-soft: #edf1f8;
  --card: #ffffff;
  --card-2: #fbfcfe;
  --text: #14233c;
  --muted: #4b5d78;
  --accent: #0d9488;
  --accent-2: #2563eb;
  --accent-soft: rgba(13, 148, 136, 0.10);
  --line: #dde5f0;
  --shadow: 0 16px 44px rgba(30, 50, 90, 0.12);
  --shadow-sm: 0 5px 18px rgba(30, 50, 90, 0.10);
  --header-bg: rgba(246, 248, 252, 0.88);
  --on-accent: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
p { color: var(--muted); margin: 0 0 1rem; }
img { max-width: 100%; display: block; }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.section-pad { padding: 96px 0; }
.alt-bg { background: var(--bg-soft); transition: background 0.3s ease; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.navbar {
  width: min(1180px, calc(100% - 36px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { font-weight: 800; letter-spacing: -0.03em; font-size: 1.25rem; white-space: nowrap; }
.brand span { color: var(--accent); }

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

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 0.95rem; color: var(--muted); transition: color 0.2s ease; }
.nav-links a:hover { color: var(--text); }

.nav-resume {
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent) !important;
  font-weight: 600;
}
.nav-resume:hover { background: var(--accent-soft); }

/* ---------- Nav dropdown (Projects) ---------- */
.nav-dropdown { position: relative; }
.nav-dropbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.nav-dropbtn:hover,
.nav-dropdown:hover .nav-dropbtn,
.nav-dropdown:focus-within .nav-dropbtn { color: var(--text); }
.nav-dropbtn .caret {
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.2s ease, margin-top 0.2s ease;
}
.nav-dropdown:hover .nav-dropbtn .caret,
.nav-dropdown.open .nav-dropbtn .caret { transform: rotate(-135deg); margin-top: 1px; }
.nav-dropdown::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 16px; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 15px;
  min-width: 280px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 200;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-menu a:hover { background: var(--accent-soft); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--line); margin: 6px 6px; }
.dropdown-menu .dd-all { color: var(--accent); font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(12deg); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile menu button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 9px;
}
.menu-toggle span { height: 2px; background: var(--text); border-radius: 2px; transition: 0.25s; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: 80px; }
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(640px 320px at 12% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(560px 300px at 92% 18%, rgba(96, 165, 250, 0.10), transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 14px;
}

.hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); line-height: 1.08; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero h1 span { color: var(--accent); }
.hero h2 { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; color: var(--accent-2); margin: 0 0 18px; min-height: 1.6em; }
.hero-text { max-width: 56ch; font-size: 1.04rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.secondary { border: 1px solid var(--line); color: var(--text); background: var(--card); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.social-row { display: flex; gap: 18px; }
.social-row a { color: var(--muted); font-weight: 600; font-size: 0.92rem; border-bottom: 1px solid transparent; }
.social-row a:hover { color: var(--accent); border-color: var(--accent); }

.hero-card { display: flex; justify-content: center; }
.profile-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
  text-align: center;
  width: min(320px, 100%);
  box-shadow: var(--shadow);
}
.profile-photo {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--accent);
}
.profile-card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.profile-card p { margin-bottom: 14px; font-size: 0.92rem; }
.mini-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mini-tags span {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Hero stats strip */
.hero-stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.hero-stats div {
  flex: 1 1 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
}
.hero-stats strong { display: block; color: var(--accent); font-size: 1.05rem; letter-spacing: -0.01em; }
.hero-stats span { color: var(--muted); font-size: 0.84rem; }

/* ---------- Section headings ---------- */
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.section-heading.centered { text-align: center; max-width: 640px; margin: 0 auto 54px; }

.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }

.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.quick-facts div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.quick-facts strong { display: block; font-size: 0.8rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.quick-facts span { font-size: 0.9rem; color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; margin-bottom: 36px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -31px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.item-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.item-header h3 { margin: 0; font-size: 1.12rem; }
.item-header span { color: var(--accent); font-size: 0.84rem; font-weight: 700; }
.company { font-size: 0.92rem; margin: 6px 0 12px; color: var(--accent-2); font-weight: 600; }
.timeline-content ul { list-style: none; }
.timeline-content li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.95rem; margin-bottom: 8px; }
.timeline-content li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 26px;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.project-banner {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}
.project-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s ease;
}
.project-card:hover .project-banner img { transform: scale(1.04); }
.project-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.project-body h3 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.35; color: var(--text); min-height: 2.7em; }
.project-body > p:not(.project-meta) { font-size: 0.93rem; flex: 1; }
.project-meta { color: var(--accent-2); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 10px; white-space: nowrap; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.project-tags li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}
.project-link { color: var(--accent); font-weight: 700; font-size: 0.92rem; margin-top: auto; }
.project-link::after { content: " →"; transition: margin-left 0.2s ease; }
.project-card:hover .project-link::after { margin-left: 5px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.skill-group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.skill-group h3 { margin: 0 0 16px; font-size: 1.02rem; color: var(--accent); }
.skill-list { display: flex; flex-wrap: wrap; gap: 9px; }
.skill-list span {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}
html[data-theme="light"] .skill-list span { background: var(--bg); }

/* ---------- Education ---------- */
.education-list { display: grid; gap: 20px; }
.education-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; box-shadow: var(--shadow-sm); }
.education-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.education-card p:last-child { margin-bottom: 0; font-size: 0.94rem; }

/* ---------- Contact ---------- */
.contact-section { padding-bottom: 110px; }
.contact-card {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 64px 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(480px 200px at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.contact-card h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 14px; }
.contact-card p { max-width: 54ch; margin: 0 auto 28px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer-inner p { margin: 0; font-size: 0.88rem; }
.footer-inner a { color: var(--muted); font-size: 0.88rem; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Project detail pages ---------- */
.project-hero { padding: 72px 0 40px; position: relative; }
.breadcrumb { font-size: 0.88rem; color: var(--muted); margin-bottom: 22px; display: inline-block; }
.breadcrumb:hover { color: var(--accent); }
.project-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; max-width: 24ch; }
.project-hero .lede { font-size: 1.08rem; max-width: 68ch; }

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 30px 0 0;
}
.project-facts div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.project-facts strong { display: block; font-size: 0.76rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px; }
.project-facts span { font-size: 0.9rem; color: var(--muted); }

.project-figure {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 36px 0 0;
}
.project-figure img { width: 100%; display: block; }
.project-figure figcaption { padding: 11px 16px; font-size: 0.84rem; color: var(--muted); background: var(--card); border-top: 1px solid var(--line); }
.project-content .project-figure { margin: 30px 0; }

.project-content { max-width: 820px; margin: 0 auto; }
.project-content h2 {
  font-size: 1.45rem;
  margin: 52px 0 16px;
  letter-spacing: -0.01em;
  padding-left: 16px;
  border-left: 4px solid var(--accent);
}
.project-content h2:first-of-type { margin-top: 0; }
.project-content p { font-size: 1.0rem; }
.project-content ul { list-style: none; margin: 0 0 1rem; }
.project-content li { position: relative; padding-left: 22px; color: var(--muted); margin-bottom: 10px; font-size: 0.98rem; }
.project-content li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.project-content strong { color: var(--text); }

.skill-callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
}
.skill-callout h3 { margin: 0 0 10px; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-2); }
.skill-callout p { margin: 0; font-size: 0.96rem; }

.project-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 64px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.project-pager a {
  flex: 1 1 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-pager a:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-pager .pager-label { display: block; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 6px; }
.project-pager .pager-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.project-pager a.next { text-align: right; }

/* ---------- Reveal animation ---------- */
.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; }
  * { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-card { order: -1; }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .section-pad { padding: 72px 0; }
}

@media (max-width: 760px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1.02rem; }
  .nav-resume { display: inline-block; margin-top: 8px; }
  .nav-dropdown { width: 100%; }
  .nav-dropbtn { width: 100%; justify-content: space-between; padding: 12px 0; font-size: 1.02rem; }
  .nav-dropdown::after { display: none; }
  .dropdown-menu {
    position: static;
    margin-top: 0;
    min-width: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 8px 14px;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
  }
  .nav-dropdown.open .dropdown-menu { display: flex; }
  .dropdown-menu a { padding: 10px 0; font-size: 0.98rem; white-space: normal; }
  .quick-facts { grid-template-columns: 1fr; }
  .timeline { padding-left: 26px; }
  .timeline-dot { left: -25px; }
}
