/* ============================================================
   Shivam Singh — Personal Website
   Warm, colorful, photo-forward design system
   ============================================================ */

:root {
  --cream: #fff8f0;
  --paper: #fffdf9;
  --ink: #2a2118;
  --ink-soft: #5c4f42;
  --muted: #8a7b6c;
  --coral: #e86a4a;
  --amber: #f4a261;
  --rose: #e07a8a;
  --gold: #d4a853;
  --teal: #2a9d8f;
  --lime: #a7c957;
  --sunset: #e76f51;
  --shadow: 0 8px 32px rgba(42, 33, 24, 0.08);
  --shadow-lg: 0 16px 48px rgba(42, 33, 24, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --nav-h: 64px;
  --max-w: 1100px;
  --transition: 0.25s ease;
  /* colours that differ between light and dark themes */
  --nav-bg: rgba(255, 253, 249, 0.92);
  --line: rgba(42, 33, 24, 0.08);
  --line-strong: rgba(42, 33, 24, 0.1);
  --teaser-bg: #f0e8df;
  color-scheme: light;
}

/* ---- Dark theme (toggled via data-theme on <html>, see assets/js/theme-init.js) ---- */
:root[data-theme="dark"] {
  --cream: #16120e;
  --paper: #221c16;
  --ink: #f3ebe1;
  --ink-soft: #d6c9bb;
  --muted: #a89886;
  --coral: #f08466;
  --sunset: #f6a285;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(22, 18, 14, 0.9);
  --line: rgba(255, 240, 225, 0.1);
  --line-strong: rgba(255, 240, 225, 0.16);
  --teaser-bg: #2c241d;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--coral); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--sunset); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

.container {
  width: min(var(--max-w), 92vw);
  margin: 0 auto;
}

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--nav-h);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  width: min(var(--max-w), 92vw);
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.nav-brand:hover { color: var(--coral); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--coral);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-social a {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.nav-social a:hover { color: var(--coral); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: var(--transition);
}

/* ---- Theme toggle ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 0.9rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.theme-toggle:hover { color: var(--coral); border-color: var(--coral); }
.theme-toggle:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---- Cover photo (home page) ----
   Pinned under the nav; zooms and fades as --cover-p goes 0 -> 1 (set on scroll in main.js)
   while the rest of the page rises over it through a soft fade. */
.cover {
  position: sticky;
  top: var(--nav-h);
  z-index: 0;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 100%;
  opacity: calc(1 - 0.55 * var(--cover-p, 0));
  transform: scale(calc(1 + 0.14 * var(--cover-p, 0)));
  transform-origin: 24% 70%;
  will-change: transform;
}

.cover-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(24, 44, 92, 0.5) 0%, rgba(24, 44, 92, 0.12) 38%, rgba(0, 0, 0, 0) 60%);
}

.cover-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 12vh;
  text-align: center;
  opacity: calc(1 - 1.6 * var(--cover-p, 0));
  transform: translateY(calc(-60px * var(--cover-p, 0)));
}

.cover-kicker {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  text-shadow: 0 1px 12px rgba(20, 35, 70, 0.5);
}

.cover-name {
  color: #fff;
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(20, 35, 70, 0.35);
}

.cover-sub {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  margin-top: 0.8rem;
  text-shadow: 0 1px 12px rgba(20, 35, 70, 0.55);
}

.has-cover .hero,
.has-cover .section,
.has-cover .site-footer {
  position: relative;
  z-index: 1;
  background: var(--cream);
}

.has-cover .hero { padding-top: 1rem; }

.has-cover .hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 26vh;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--cream));
}

.has-cover .section:last-of-type { padding-bottom: 6rem; }
.has-cover .site-footer { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .cover img,
  .cover-text { transform: none; }
}

/* ---- Hero ---- */
.hero {
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
  object-fit: cover;
  width: 100%;
}

.hero-quote {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--coral);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.hero-bio {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 640px;
}

/* ---- Buttons ---- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--amber));
  color: white;
}

.btn-primary:hover { color: white; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line-strong);
}

.btn-secondary:hover { color: var(--coral); border-color: var(--coral); }

.btn-accent {
  background: linear-gradient(135deg, var(--teal), var(--lime));
  color: white;
}

.btn-accent:hover { color: white; }

/* ---- Sections ---- */
.section {
  padding: 3rem 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--amber));
  border-radius: 2px;
}

/* ---- News ---- */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--coral);
  box-shadow: var(--shadow);
}

.news-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--coral);
  white-space: nowrap;
  min-width: 72px;
}

.news-text { color: var(--ink-soft); font-size: 0.95rem; }
.news-text a { font-weight: 500; }

/* ---- Research cards ---- */
.research-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
  transition: box-shadow var(--transition);
}

.research-card:hover { box-shadow: var(--shadow-lg); }

.research-teaser {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: top;
  background: var(--teaser-bg);
}

.research-body { padding: 1.75rem 2rem 2rem; }

.research-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.research-title a { color: var(--ink); }
.research-title a:hover { color: var(--coral); }

.venue-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.badge-icra { background: #fde8e0; color: #c0392b; }
.badge-iros { background: #d6f0ee; color: #0f766e; }
.badge-ecmr { background: #e0f0fd; color: #2471a3; }
.badge-arxiv { background: #f0e6ff; color: #7d3c98; }
.badge-workshop { background: #e8f5e9; color: #2e7d32; }
.badge-ongoing { background: #fff3e0; color: #e65100; }
.badge-patent { background: #fdf3d8; color: #8a6514; }

[data-theme="dark"] .badge-icra { background: rgba(240, 132, 102, 0.16); color: #f5a48c; }
[data-theme="dark"] .badge-iros { background: rgba(42, 157, 143, 0.2); color: #6fd3c6; }
[data-theme="dark"] .badge-ecmr { background: rgba(84, 153, 214, 0.2); color: #8cc2ef; }
[data-theme="dark"] .badge-arxiv { background: rgba(170, 110, 210, 0.2); color: #cfa6ec; }
[data-theme="dark"] .badge-workshop { background: rgba(102, 187, 106, 0.18); color: #9ad49d; }
[data-theme="dark"] .badge-ongoing { background: rgba(255, 152, 0, 0.18); color: #ffb866; }
[data-theme="dark"] .badge-patent { background: rgba(212, 168, 83, 0.18); color: #e6c47e; }

.research-authors {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.research-authors strong { color: var(--ink); }

.research-abstract {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.research-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.link-pill {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(232, 106, 74, 0.1);
  color: var(--coral);
  transition: background var(--transition);
}

.link-pill:hover {
  background: var(--coral);
  color: white;
}

.workshop-card {
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.workshop-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.workshop-card p { font-size: 0.9rem; color: var(--ink-soft); }
.workshop-card .research-links { margin-top: 0.75rem; }

/* ---- Interests landing ---- */
.interest-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.interest-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: white;
  transition: transform var(--transition);
}

.interest-card:hover { transform: translateY(-6px); color: white; }

.interest-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.interest-card:hover img { transform: scale(1.05); }

.interest-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.interest-card-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.interest-card-content h2 {
  color: white;
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.interest-card-content p {
  font-size: 0.92rem;
  opacity: 0.9;
}

.grad-photo {
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.3) 0%, rgba(42, 33, 24, 0.75) 100%);
}

.grad-monkey {
  background: linear-gradient(180deg, rgba(42, 157, 143, 0.3) 0%, rgba(42, 33, 24, 0.8) 100%);
}

.grad-moto {
  background: linear-gradient(180deg, rgba(231, 111, 81, 0.3) 0%, rgba(42, 33, 24, 0.8) 100%);
}

.grad-blog {
  background: linear-gradient(180deg, rgba(155, 89, 182, 0.35) 0%, rgba(42, 33, 24, 0.8) 100%);
}

/* ---- Interest subpages ---- */
.interest-hero {
  padding: 3rem 0;
  text-align: center;
  color: white;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 2.5rem;
}

.interest-hero.photo { background: linear-gradient(135deg, #d4a853, #e86a4a); }
.interest-hero.monkey { background: linear-gradient(135deg, #2a9d8f, #a7c957); }
.interest-hero.moto { background: linear-gradient(135deg, #e76f51, #f4a261); }
.interest-hero.blog { background: linear-gradient(135deg, #6a4c93, #c77dff); }
.interest-hero.blog_makalidurga { background: linear-gradient(135deg, #344e41, #588157); }

.interest-hero h1 { color: white; margin-bottom: 0.5rem; }
.interest-hero p { opacity: 0.92; max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

.interest-intro {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-links {
  justify-content: center;
  margin-top: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
  justify-content: center;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.gallery-item:hover { transform: scale(1.02); }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: var(--muted);
}

.back-link:hover { color: var(--coral); }

/* ---- Lightbox ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(42, 33, 24, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ---- Footer ---- */
.site-footer {
  padding: 2.5rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--coral); }

/* ---- Page header (inner pages) ---- */
.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.page-header h1 { margin-bottom: 0.5rem; }

.page-header p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-portrait {
    max-width: 240px;
    margin: 0 auto;
  }

  .hero-bio { margin: 0 auto; }

  .btn-row { justify-content: center; }

  .nav-links,
  .nav-social {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .nav-links.open,
  .nav-social.open { display: flex; }

  .nav-social { top: calc(var(--nav-h) + 140px); border-top: none; }

  .nav-toggle { display: block; order: 2; }

  .theme-toggle { margin-left: auto; margin-right: 0.5rem; }

  .nav-inner { position: relative; }

  .research-body { padding: 1.25rem; }

  .news-item { flex-direction: column; gap: 0.3rem; }

  .interest-card { min-height: 280px; }
}
