/* ═══════════════════════════════════════════════
   HARSH VARDHAN — Academic Portfolio
   Aesthetic: Clean editorial, tile-based works
   ═══════════════════════════════════════════════ */

:root {
  --ink: #1a1a2e;
  --ink-light: #3d3d5c;
  --ink-muted: #6b6b8a;
  --paper: #faf9f6;
  --paper-warm: #f5f3ee;
  --cream: #edeae3;
  --gold: #c9a84c;
  --gold-light: #e8d49a;
  --gold-dark: #a07d2e;
  --navy: #1B2A4A;
  --navy-light: #2d4a7a;
  --accent: #b44033;
  --teal: #2a7a6e;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 16px rgba(26,26,46,0.08);
  --shadow-lg: 0 8px 32px rgba(26,26,46,0.12);
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --max-w: 1200px;
  --content-w: 820px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.7; overflow-x: hidden; }
a { color: var(--navy-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-dark); }
img, video, iframe { max-width: 100%; display: block; }

/* ── NAV ── */
.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(250,249,246,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(26,26,46,0.06); }
.site-nav.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.nav-logo span { color: var(--gold-dark); }
.nav-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; }
.nav-links a { font-size: 0.8rem; font-weight: 500; color: var(--ink-muted); padding: 0.35rem 0.75rem; border-radius: 6px; transition: all var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: rgba(26,26,46,0.04); }
.nav-links a.active { color: var(--navy); background: rgba(27,42,74,0.08); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; transition: all var(--transition); }

/* ── HERO (homepage) ── */
.hero { min-height: 90vh; display: flex; align-items: center; padding-top: 60px; position: relative; }
.hero-inner { max-width: var(--max-w); margin: 0 auto; padding: 4rem 2rem; display: grid; grid-template-columns: 1fr auto; gap: 4rem; align-items: center; }
.hero-text { max-width: 600px; }
.hero-eyebrow { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold-dark); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; }
.hero-eyebrow::before { content: ''; width: 28px; height: 1.5px; background: var(--gold); }
.hero h1 { font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.hero-desc { font-size: 1rem; line-height: 1.75; color: var(--ink-light); margin-bottom: 1.75rem; }
.hero-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.3rem; font-family: var(--sans); font-size: 0.82rem; font-weight: 600; border-radius: 7px; border: none; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid rgba(26,26,46,0.15); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-dark); }
.hero-photo { width: 240px; height: 280px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow-lg); }

/* ── STATS BAR ── */
.stats-bar { background: var(--navy); padding: 2rem; }
.stats-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; }
.stat-number { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--gold-light); }
.stat-label { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-top: 0.15rem; }

/* ── SECTIONS ── */
.section { padding: 4.5rem 2rem; }
.section-alt { background: var(--paper-warm); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-eyebrow { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold-dark); margin-bottom: 0.6rem; }
.section-title { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.section-subtitle { font-size: 0.95rem; color: var(--ink-muted); margin-top: 0.6rem; max-width: 560px; }

/* ── PROJECT CARDS (homepage) ── */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 2rem; }
.project-card { background: var(--white); border-radius: 12px; overflow: hidden; transition: all var(--transition); border: 1px solid rgba(26,26,46,0.06); text-decoration: none; color: inherit; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; color: inherit; }
.project-card-img { height: 180px; overflow: hidden; position: relative; }
.project-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .project-card-img img { transform: scale(1.04); }
.project-card-badge { position: absolute; top: 10px; left: 10px; background: var(--navy); color: var(--white); font-size: 0.62rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.project-card-body { padding: 1.25rem; }
.project-card-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; line-height: 1.3; }
.project-card-desc { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.55; }
.project-card-footer { padding: 0 1.25rem 1.25rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tag { font-size: 0.65rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: 3px; background: var(--cream); color: var(--ink-muted); }
.tag-darpa { background: #e8f0fe; color: #1a56db; }
.tag-nist { background: #e8f5e9; color: #2e7d32; }
.tag-nsf { background: #fff3e0; color: #e65100; }

/* ── PAGE HERO ── */
.page-hero { padding: 7rem 2rem 3.5rem; background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%); }
.page-hero-compact { padding-bottom: 2.5rem; }
.page-hero-inner { max-width: var(--content-w); margin: 0 auto; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.page-hero .lead { font-size: 1.05rem; color: var(--ink-light); line-height: 1.7; max-width: 620px; }
.breadcrumb { font-size: 0.82rem; color: var(--ink-muted); display: inline-block; margin-bottom: 1rem; transition: color var(--transition); }
.breadcrumb:hover { color: var(--gold-dark); }
.work-authors-hero { font-size: 0.95rem; color: var(--ink-light); margin-bottom: 0.3rem; }
.work-venue-hero { font-size: 0.88rem; color: var(--ink-muted); font-style: italic; }

/* ── PAGE CONTENT ── */
.page-content { max-width: var(--content-w); margin: 0 auto; padding: 2.5rem 2rem 5rem; }
.page-content h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 0.8rem; }
.page-content h3 { font-size: 1.05rem; font-weight: 600; color: var(--ink-light); margin-top: 1.75rem; margin-bottom: 0.5rem; }
.page-content p { font-size: 0.95rem; line-height: 1.8; color: var(--ink-light); margin-bottom: 1.1rem; }
.page-content ul, .page-content ol { margin: 0.75rem 0 1.25rem 1.5rem; color: var(--ink-light); }
.page-content li { margin-bottom: 0.4rem; font-size: 0.92rem; line-height: 1.7; }

/* ── WORK TILE GRID (dabh.io style) ── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem;
}

.work-tile {
  display: flex;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(26,26,46,0.06);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.work-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-light);
  color: inherit;
}

.work-tile-thumb {
  width: 130px;
  min-height: 130px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--cream);
}

.work-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-tile:hover .work-tile-thumb img {
  transform: scale(1.05);
}

.work-tile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  opacity: 0.3;
}

.work-tile-placeholder svg { width: 36px; height: 36px; }

.work-tile-body {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.work-tile-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.work-tile-authors {
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.work-tile-venue {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.work-tile-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ── WORK LINKS BAR ── */
.work-links-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cream);
}

.work-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(27,42,74,0.06);
  border-radius: 6px;
  transition: all var(--transition);
}

.work-link-btn:hover {
  background: rgba(27,42,74,0.12);
  color: var(--navy);
}

/* ── KEY RESULT BOX ── */
.key-result { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); color: var(--white); padding: 1.75rem; border-radius: 10px; margin: 1.5rem 0; }
.key-result h3 { font-family: var(--serif); font-size: 1rem; color: var(--gold-light); margin-bottom: 0.75rem; }
.key-result p { color: rgba(255,255,255,0.85); font-size: 0.88rem; line-height: 1.65; }
.key-result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.kr-stat { text-align: center; }
.kr-stat-val { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--gold-light); }
.kr-stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.55); margin-top: 0.15rem; }

/* ── MEDIA ITEMS ── */
.media-item { background: var(--white); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; border: 1px solid rgba(26,26,46,0.06); transition: all var(--transition); }
.media-item:hover { border-color: var(--gold-light); box-shadow: var(--shadow-sm); }
.media-item-source { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-dark); margin-bottom: 0.35rem; }
.media-item-title { font-family: var(--serif); font-size: 0.98rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.35rem; }
.media-item-title a { color: inherit; }
.media-item-title a:hover { color: var(--navy-light); }
.media-item-desc { font-size: 0.83rem; color: var(--ink-muted); line-height: 1.55; }
.media-item-date { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.35rem; }

/* ── FIGURES & MEDIA ── */
.figure { margin: 1.75rem 0; border-radius: 10px; overflow: hidden; background: var(--cream); }
.figure img, .figure video { width: 100%; display: block; }
.figure-caption { padding: 0.6rem 0.9rem; font-size: 0.78rem; color: var(--ink-muted); font-style: italic; background: var(--cream); }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; margin: 1.75rem 0; box-shadow: var(--shadow-md); }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.gallery-item { border-radius: 8px; overflow: hidden; }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; }

/* ── FOOTER ── */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.6); padding: 2.5rem 2rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-brand { font-family: var(--serif); font-size: 0.95rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.footer-links { display: flex; gap: 1.25rem; list-style: none; }
.footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: 0.72rem; width: 100%; text-align: center; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); }

/* ── ANIMATIONS ── */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-eyebrow { justify-content: center; }
  .hero-links { justify-content: center; }
  .hero-photo { width: 180px; height: 210px; margin: 0 auto 2rem; }
  .project-grid { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--paper); padding: 0.75rem; border-bottom: 1px solid var(--cream); box-shadow: var(--shadow-md); }
  .nav-toggle { display: block; }
  .section { padding: 3rem 1.25rem; }
  .page-hero { padding: 5.5rem 1.25rem 2.5rem; }
  .page-content { padding: 2rem 1.25rem 4rem; }
  .work-tile { flex-direction: column; }
  .work-tile-thumb { width: 100%; min-height: 160px; }
}
