/* ============================================================
   Rajat Abhay Sirsikar — Modern Personal Site
   Clean, academic, responsive, 2026 aesthetic
   ============================================================ */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #059669;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-w: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- Top Navigation (sticky) ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-links a.active {
  background: var(--text);
  color: #fff;
}

/* ---------- Hero / Header ---------- */
.hero {
  padding: 48px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 720px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
}

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px var(--border);
}

.hero h1 {
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  line-height: 1.15;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
  max-width: 440px;
}

@media (max-width: 720px) {
  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 720px) {
  .social-row {
    justify-content: center;
  }
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.social-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

#demail {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.45s ease;
  min-height: 1.4em;
}

/* ---------- Section titles ---------- */
.section {
  padding: 12px 0 8px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 40px 0 18px;
  color: var(--text);
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-intro {
  color: var(--text-secondary);
  margin: -8px 0 24px;
  font-size: 0.98rem;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  margin: 8px 0 32px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 24px 1fr;
  gap: 0 16px;
  margin-bottom: 18px;
  align-items: start;
}

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 20px 1fr;
    gap: 0 14px;
    margin-bottom: 16px;
  }
}

.tl-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  padding-top: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tl-date {
    display: none;
  }
}

/* Marker column: only the vertical line + dot */
.tl-marker {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 18px;
  min-height: 100%;
}

.tl-marker::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.timeline-item:last-child .tl-marker::before {
  display: none;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--text-muted);
  z-index: 1;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.timeline-item:hover .tl-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Modular card – logo sits to the RIGHT of the dot */
.tl-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.timeline-item:hover .tl-card {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.tl-logo {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover .tl-logo {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.tl-body {
  padding: 0;
  margin: 0;
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.6;
  flex: 1;
  min-width: 0;
}

.tl-body a {
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.tl-body a:hover {
  border-bottom-color: var(--accent);
}

.tl-date-mobile {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .tl-date-mobile {
    display: block;
  }
  .tl-logo {
    width: 42px;
    height: 42px;
  }
  .tl-card {
    padding: 12px 14px;
    gap: 12px;
  }
}

/* ---------- Modular box (shared) ---------- */
.modular-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.modular-box:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

/* ---------- About ---------- */
.prose {
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.75;
  margin: 0;
}

.prose.justified {
  text-align: left;
  text-justify: inter-word;
  hyphens: none;
}

.prose a {
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.prose a:hover {
  border-bottom-color: var(--accent);
}

/* ---------- Affiliations (modern card grid) ---------- */
.affil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.affil-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.affil-card:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-2px);
  color: inherit;
}

.affil-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.affil-card:hover .affil-icon {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.affil-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  border: 1px solid #dbeafe;
}

.affil-card:hover .affil-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.affil-meta {
  min-width: 0;
}

.affil-role {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.affil-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* Legacy list kept for safety */
.affil-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- Awards and Honors ---------- */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.award-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.award-item:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-2px);
  color: inherit;
}

.award-year {
  flex-shrink: 0;
  min-width: 52px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbeafe;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.award-item:hover .award-year {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.award-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.award-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.award-org {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}


/* ---------- Publications ---------- */
.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pub-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

@media (max-width: 520px) {
  .pub-card {
    grid-template-columns: 1fr;
  }
}

.pub-thumb {
  width: 100%;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
}

.pub-year {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.4;
}

.pub-title a {
  color: inherit;
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pub-venue {
  font-size: 0.88rem;
  color: var(--success);
  font-style: italic;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: grid;
  grid-template-columns: 200px 1fr;
}

@media (max-width: 640px) {
  .project-card {
    grid-template-columns: 1fr;
  }
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  background: var(--bg);
}

.project-body {
  padding: 20px 22px;
}

.project-body h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-body h3 a {
  color: var(--text);
}

.project-body h3 a:hover {
  color: var(--accent);
}

.project-body p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* ---------- Multi-column image gallery ---------- */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0 40px;
}

.project-gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.project-gallery figure:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-gallery img {
  width: 100%;
  height: 220px;          /* fixed height for consistent cards */
  object-fit: cover;      /* or "contain" if you prefer full drawing visibility */
  display: block;
  border-radius: var(--radius);
  background: var(--bg);
}

.project-gallery figcaption {
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Optional: make the first image span full width if you want a featured image */
.project-gallery figure:first-child {
  grid-column: 1 / -1;   /* full width */
}
.project-gallery figure:first-child img {
  height: 320px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Utilities ---------- */
.note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 24px;
}

/* Focus */
a:focus-visible,
.social-icon:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Hide old hr if any */
hr {
  display: none;
}

/* ---------- Services page ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 12px;
}

.service-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.service-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.service-card p {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
}

.service-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 48px;
  height: 32px;
  padding: 0 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.service-list li {
  margin-bottom: 4px;
}

.service-list li::marker {
  color: var(--accent);
}

/* Why grid */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.why-item {
  padding: 18px 20px;
}

.why-item strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.why-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.15s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}

.faq-item summary:hover {
  color: var(--accent);
}

.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* CTA box */
.cta-box {
  text-align: center;
  padding: 32px 28px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 100%);
  border-color: #bfdbfe;
}

.cta-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cta-box p {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.cta-action {
  margin-top: 16px !important;
  font-weight: 500;
  color: var(--text) !important;
}
