/* ───────────────────────────────────────────
   Rishab Mohandoss — Portfolio
   Monochromatic, light, minimal.
   One accent: charcoal. Air is design.
   ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf9;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #e5e7eb;
  --border-dark: #d1d5db;
  --accent: #1a1a1a;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Menlo', 'Courier New', monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Header / nav ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.site-header nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 200ms ease;
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a.active { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
}

/* ── Layout ── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 9rem 2rem 6rem;
}

section { margin-bottom: 8rem; }
section:last-child { margin-bottom: 0; }

.page-title {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.page-intro {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 0 6rem;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 2.5rem;
}

/* ── Hero ── */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 5rem;
  align-items: center;
  width: 100%;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1.75rem;
}
.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 2.5rem;
  max-width: 480px;
}
.hero-photo {
  width: min(300px, 70vw);
  border-radius: 4px;
  justify-self: end;
  filter: grayscale(20%);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: background 200ms ease, border-color 200ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #000000; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-dark);
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--text-tertiary);
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 3rem 2rem;
  text-align: left;
}
.stat + .stat { border-left: 1px solid var(--border); }
.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Soft section (light gray band) ── */
.band {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 6rem calc(50vw - 50% + 2rem);
}

.prose {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}
.prose p { margin: 0 0 1.5rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }

/* ── Cards ── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color 200ms ease, background 200ms ease;
}
.card:hover {
  border-color: var(--border-dark);
  background: rgba(0, 0, 0, 0.02);
}
.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}
.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}
.card ul {
  color: var(--text-secondary);
  font-size: 0.92rem;
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}
.card li { margin-bottom: 0.5rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid .span-2 { grid-column: span 2; }

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card-meta .role {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ── Tags & badges ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  margin: 0 0.5rem 1rem 0;
}

.card-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.card-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  transition: background 200ms ease, border-color 200ms ease;
}
.card-link.primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.card-link.primary:hover { background: #000000; }
.card-link.secondary {
  border: 1px solid var(--border-dark);
  color: var(--text);
}
.card-link.secondary:hover { background: rgba(0, 0, 0, 0.02); }

/* ── Sticky timeline ── */
.timeline-item {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3rem;
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-of-type { border-top: none; padding-top: 0; }

.timeline-label .sticky-box {
  position: sticky;
  top: 5.5rem;
}
.timeline-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}
.timeline-label h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.4rem;
}
.timeline-label .org {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.timeline-label .loc {
  display: block;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.timeline-body p {
  color: var(--text-secondary);
  margin-top: 0;
}
.timeline-body ul {
  color: var(--text-secondary);
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}
.timeline-body li { margin-bottom: 0.6rem; }

.highlight-box {
  border-left: 2px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Skills ── */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.skill-group {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.skill-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0 0 0.6rem;
}
.skill-group p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Contact ── */
.contact-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
footer p { margin: 0.4rem 0; }
footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 0.75rem;
  transition: color 200ms ease;
}
footer a:hover { color: var(--text); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ── Tablet & mobile ── */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  main { padding: 7rem 1.25rem 4rem; }
  section { margin-bottom: 5rem; }
  .page-intro { margin-bottom: 3.5rem; }

  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { display: block; padding: 0.8rem 0; }

  .hero { min-height: auto; padding-top: 1rem; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: left;
  }
  .hero-photo { order: -1; justify-self: start; width: min(180px, 50vw); }

  .stat { padding: 2rem 1.25rem; }
  .stat-number { font-size: 2rem; }

  .card-grid, .card-grid-3 { grid-template-columns: 1fr; }
  .card-grid .span-2 { grid-column: span 1; }
  .skill-groups { grid-template-columns: 1fr; gap: 1.5rem; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2.5rem 0;
  }
  .timeline-label .sticky-box { position: static; }

  .band { padding-top: 4rem; padding-bottom: 4rem; }
}
