/* Sourabh Mahajan portfolio: static, no build step. */

:root {
  --paper: #f6f7fa;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #566074;
  --rule: #dde2ea;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 91, 234, 0.14);

  --font-display: "Bricolage Grotesque", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1623;
    --surface: #17202f;
    --ink: #e8ecf4;
    --muted: #a3adc0;
    --rule: #28344a;
    --accent: #7f9eff;
    --accent-ink: #0f1623;
    --accent-soft: rgba(127, 158, 255, 0.2);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap {
  width: min(100% - 2 * var(--gutter), 66rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { top: 1rem; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.top__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.75rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.nav { display: flex; gap: 1.5rem; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--ink); }

/* Buttons and links */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 2px solid var(--accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--accent-soft); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--small { padding: 0.45rem 0.85rem; font-size: 0.92rem; border-radius: 8px; }
.link { font-weight: 600; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 3rem);
}
.hero h1 {
  font-size: clamp(2.35rem, 5.4vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 15ch;
}
.hero__lead {
  margin-top: 1.4rem;
  max-width: 52ch;
  font-size: 1.15rem;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}
.hero__photo {
  width: 100%;
  max-width: 21rem;
  justify-self: end;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--rule);
}

/* The one page-load moment: the hero settles in. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy, .hero__photo {
    animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero__photo { animation-delay: 0.12s; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Facts */
.facts { padding-bottom: 1rem; }
.facts__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0.2rem 0 0; font-weight: 500; }

/* Sections */
.section {
  padding-block: clamp(2.75rem, 7vw, 4.5rem) 0;
  scroll-margin-top: 4rem;
}
.section > h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 1.75rem;
}

/* Experience as a route */
.route { list-style: none; }
.stop {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 2rem;
}
.stop__when {
  margin: 0;
  padding-top: 0.2rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: right;
}
.stop__body {
  position: relative;
  border-left: 2px solid var(--rule);
  padding: 0 0 2.5rem 2rem;
}
.stop:last-child .stop__body { padding-bottom: 0.25rem; }
.stop__body::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.stop--current .stop__body { border-left-color: var(--accent); }
.stop--current .stop__body::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.stop h3 { font-size: 1.3rem; font-weight: 700; }
.stop__org { margin: 0.15rem 0 0.8rem; color: var(--muted); font-weight: 500; }
.stop ul { padding-left: 1.15rem; max-width: var(--measure); }
.stop li { margin-bottom: 0.45rem; }
.stop li::marker { color: var(--muted); }

/* Projects */
.feature {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  margin-bottom: 1rem;
}
.feature__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}
.feature h3 { font-size: 1.6rem; }
.feature p { max-width: var(--measure); }
.feature .meta { margin: 0; }

.meta { color: var(--muted); font-size: 0.95rem; }

.plist { list-style: none; }
.plist li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.plist h3 { font-size: 1.2rem; }
.plist h3 a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
.plist h3 a:hover { color: var(--accent); }
.plist .meta { margin: 0.1rem 0 0; }
.plist__body p { max-width: var(--measure); margin-bottom: 0.5rem; }
.stack { color: var(--muted); font-size: 0.95rem; }

/* Skills */
.skills { margin: 0; max-width: 52rem; }
.skills > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.skills dt { color: var(--muted); font-weight: 500; }
.skills dd { margin: 0; }

/* Recognition */
.plain { list-style: none; max-width: var(--measure); }
.plain li { padding: 0.7rem 0; border-top: 1px solid var(--rule); }

/* Contact and footer */
.contact p { max-width: var(--measure); }
.contact .hero__actions { margin-top: 1.25rem; }
.foot {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}
.foot p { margin: 0; }

/* Tablet and phone */
@media (max-width: 52rem) {
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero__photo { justify-self: start; max-width: 14rem; order: -1; }
  .facts__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .stop { grid-template-columns: 1fr; }
  .stop__when { text-align: left; padding: 0 0 0.35rem 2.1rem; }
  .stop__body { padding-left: 1.5rem; margin-left: 0.3rem; }

  .plist li, .skills > div { grid-template-columns: 1fr; gap: 0.35rem; }
}

@media (max-width: 30rem) {
  .facts__list { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; text-align: center; }
}
