:root {
  --ink: #0f1311;
  --panel: #161c19;
  --line: rgba(232, 236, 230, 0.12);
  --bone: #ecebe6;
  --smoke: #9ba39e;
  --deep: #1f3329;
  --accent: #a8c79a;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background-color: var(--ink);
  color: var(--bone);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a { color: inherit; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--bone);
  color: var(--ink);
}
.skip:focus { left: 0.5rem; }

/* Film grain over everything, very faint */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  background: rgba(15, 19, 17, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  /* Hidden over the landing screen; slides in once the portrait has scrolled away */
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s linear 0.5s;
}
.nav.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.5s var(--ease), visibility 0s;
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.nav-home { font-weight: 600; }
.nav ul {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav ul a { opacity: 0.75; transition: opacity 0.2s; }
.nav ul a:hover { opacity: 1; }

/* Brand icons (GitHub, LinkedIn) */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}
.icon-link { display: inline-flex; align-items: center; gap: 0.5em; }
.nav-icon a { display: inline-flex; padding: 0.2rem; }
.nav-icon .icon { width: 1.05rem; height: 1.05rem; }

/* Hero */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
}

/* Soft daylight behind the portrait */
.hero-bg {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background:
    radial-gradient(ellipse 30% 42% at 58% 55%, rgba(214, 226, 216, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 70% at 58% 60%, #1c2a23, transparent 75%),
    var(--ink);
}
/* Vignette and a fade into the page colour at the bottom */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 58% 50%, transparent 35%, rgba(15, 19, 17, 0.7) 85%),
    linear-gradient(to bottom, transparent 60%, var(--ink));
  pointer-events: none;
}

.hero-name {
  position: absolute;
  z-index: 1;
  left: var(--gutter);
  right: var(--gutter);
  top: clamp(4.5rem, 11vh, 7rem);
  margin: 0;
  font-size: clamp(3.6rem, 13.2vw, 15rem);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  line-height: 0.84;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: var(--bone);
}
/* Four quick facts, bottom left */
.hero-facts {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: clamp(1.75rem, 6vh, 3.5rem);
  width: min(21rem, 30vw);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}
.hero-facts li {
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
  font-weight: 500;
  color: var(--bone);
}
.hero-facts li:first-child { border-top: 0; padding-top: 0; }
.hero-facts span { color: var(--smoke); font-weight: 400; }
.hero-facts li:first-child span { color: var(--accent); }

.name-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}
.name-last { text-align: right; }
.rise { display: inline-block; }

.hero-figure {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 56%;
  height: 76%;
  aspect-ratio: 955 / 854;
  transform: translateX(-50%);
}
.hero-me {
  width: 100%;
  height: 100%;
  max-width: none;
}

/* Load sequence: name rises out of its line, photo settles in */
.js .rise { transform: translateY(105%); }
.js .hero-me,
.js .hero-facts { opacity: 0; }

.is-loaded .rise {
  transform: translateY(0);
  transition: transform 1.2s var(--ease);
}
.is-loaded .name-last .rise { transition-delay: 0.12s; }
.is-loaded .hero-me {
  opacity: 1;
  transition: opacity 1.4s var(--ease) 0.35s;
}
.is-loaded .hero-facts {
  opacity: 1;
  transition: opacity 1s ease 1s;
}


/* Sections */
.section {
  padding: clamp(6rem, 16vh, 11rem) var(--gutter) 0;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 26rem);
  align-items: end;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.section-head h2,
.projects-intro h2 {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 6.5rem);
  font-weight: 700;
  font-variation-settings: "wdth" 104;
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.section-head p {
  margin: 0;
  color: var(--smoke);
}

/* Experience: one block per organisation, roles stacked inside */
.job {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  padding: clamp(2.5rem, 5vh, 3.5rem) 0;
  border-top: 1px solid var(--line);
}
.job:last-of-type { border-bottom: 1px solid var(--line); }

.job-side { align-self: start; position: sticky; top: 6rem; }
.job-logo {
  display: block;
  height: 6.5rem;
  padding: 1rem 1.4rem;
  margin-bottom: 1.25rem;
  background: #fff;
  border-radius: 6px;
}
.job-logo img { width: 100%; height: 100%; object-fit: contain; }
.job-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
.job-logo-mark img { width: auto; height: 78%; }
.job-logo-mark span {
  color: #1d1b4f;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.job-company {
  display: flex;
  flex-direction: column;
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
}
.job-company span { color: var(--smoke); font-weight: 400; font-size: 0.95rem; }
.job-side .text-link { font-size: 0.95rem; justify-self: start; }

.role + .role {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px dashed var(--line);
}
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}
.role h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 700;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.role-when {
  margin: 0;
  color: var(--smoke);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 199, 154, 0.25);
}
.role ul {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}
.role li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6rem;
  color: #d3d7d1;
}
.role li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.6rem;
  height: 1px;
  background: var(--accent);
}
.tags { margin: 0; color: var(--smoke); font-size: 0.9rem; }

/* Projects: pinned, the track slides sideways as you scroll down */
.projects {
  position: relative;
  margin-top: clamp(6rem, 16vh, 11rem);
}
.projects-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.projects-track {
  display: flex;
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.75rem);
  padding: 0 var(--gutter);
  will-change: transform;
}
.projects-intro {
  flex: 0 0 min(80vw, 30rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-right: 2rem;
}
.projects-intro p { color: var(--smoke); margin: 1.25rem 0 0; max-width: 28ch; }

.card {
  flex: 0 0 min(82vw, 27rem);
  min-height: min(68vh, 34rem);
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color 0.3s, transform 0.5s var(--ease);
}
.card:hover { border-color: rgba(168, 199, 154, 0.6); }
.card:first-of-type {
  background: var(--deep);
  border-color: transparent;
}
.card-kind {
  margin: 0;
  color: var(--smoke);
  font-size: 0.9rem;
}
.card:first-of-type .card-kind { color: #b9cdb0; }
.card h3 {
  margin: auto 0 1rem;
  padding-top: 4rem;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 700;
  font-variation-settings: "wdth" 106;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card p:not(.card-kind) { margin: 0 0 1.25rem; color: #cfd3cd; }
.card .card-stack {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--bone);
  font-size: 0.9rem;
}

/* Recognition: photo-led features */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 6vh, 4rem) 0;
  border-top: 1px solid var(--line);
}
.feature-biomed { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.feature-flip .frame { order: 2; }

.frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel);
  cursor: zoom-in;
}
.frame img {
  width: 100%;
  height: 116%;
  object-fit: cover;
  will-change: transform;
  transition: filter 0.5s var(--ease);
}
.frame:hover img { filter: brightness(1.08); }
.frame-tall { aspect-ratio: 4 / 5; }
.frame-wide { aspect-ratio: 3 / 2; }
/* Certificates are shown whole: no crop, no drift */
.frame-cert { background: transparent; }
.frame-cert img { height: auto; }

.feature-text h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3.6vw, 3.25rem);
  font-weight: 700;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.feature-text p { margin: 0 0 1rem; color: var(--smoke); max-width: 44ch; }
.feature-text .feature-place {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}
.feature-biomed .frame-wide { margin-top: 2.5rem; }
.feature-text .caption { margin-top: 0.75rem; font-size: 0.9rem; }

.text-link {
  color: var(--bone);
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 1px no-repeat;
  padding-bottom: 0.15rem;
  transition: background-size 0.4s var(--ease);
}
.text-link:hover { background-size: 0% 1px; background-position: right bottom; }

/* Off the clock: a loose collage, each photo drifting at its own speed */
.collage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 2vw, 2rem);
  align-items: start;
}
.shot { margin: 0; will-change: transform; }
.shot .frame { aspect-ratio: 4 / 5; }
.shot-sih .frame, .shot-ugc .frame { aspect-ratio: 4 / 3; }
.shot-trek { grid-column: 1 / span 5; }
.shot-sih { grid-column: 7 / span 6; margin-top: 8rem; }
.shot-lab { grid-column: 2 / span 4; margin-top: 3rem; }
.shot-run { grid-column: 8 / span 4; margin-top: 2rem; }
.shot-ugc { grid-column: 1 / span 7; grid-row: 3; align-self: center; }
.shot-afsb { grid-column: 9 / span 3; grid-row: 3; margin-top: 3rem; }
.shot-afsb .frame { aspect-ratio: 2 / 5; }
.shot figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.9rem;
  max-width: 40ch;
  color: var(--smoke);
  font-size: 0.92rem;
}
.shot figcaption strong {
  margin-bottom: 0.2rem;
  color: var(--bone);
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  font-weight: 700;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Lightbox for photos and certificates */
.lightbox {
  width: min(94vw, 1200px);
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bone);
}
.lightbox::backdrop { background: rgba(8, 10, 9, 0.92); }
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  margin: 0 auto;
  border-radius: 4px;
}
.lightbox-close {
  display: block;
  margin: 0 0 0.75rem auto;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--bone);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--bone); }

/* Contact */
.contact {
  padding: clamp(8rem, 22vh, 14rem) var(--gutter) 2rem;
}
.contact-title {
  margin: 0;
  padding-bottom: clamp(2.5rem, 7vh, 4.5rem);
  border-bottom: 1px solid var(--line);
  font-size: clamp(3rem, 10.5vw, 11rem);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.05em;
  line-height: 0.86;
  text-transform: uppercase;
}
.contact-mail {
  display: inline-block;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat;
  padding-bottom: 0.2rem;
  transition: background-size 0.5s var(--ease);
}
.contact-mail:hover { background-size: 0% 2px; background-position: right bottom; }
.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-links a { color: var(--smoke); text-underline-offset: 0.25em; }
.contact-links a:hover { color: var(--bone); }
.contact-grid {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 3rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.contact-lede {
  margin: 0 0 1.75rem;
  max-width: 34ch;
  color: var(--smoke);
}

/* Contact form: quiet underlined fields */
.honeypot { display: none; }
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2rem;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field-wide { grid-column: 1 / -1; }
.field label { color: var(--smoke); font-size: 0.9rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0;
  font: inherit;
  font-size: 1.05rem;
  color: var(--bone);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(232, 236, 230, 0.25);
  border-radius: 0;
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 7rem; }
/* Keep browser autofill on-theme instead of light blue */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--bone);
  caret-color: var(--bone);
  -webkit-box-shadow: 0 0 0 1000px var(--ink) inset;
  box-shadow: 0 0 0 1000px var(--ink) inset;
  transition: background-color 9999s ease 0s;
}
.field select { cursor: pointer; }
.field select option { background: var(--panel); color: var(--bone); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.form-send {
  padding: 0.9rem 1.75rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--bone);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.form-send:hover { background: var(--accent); }
.form-send:active { transform: scale(0.98); }
.form-send:disabled { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; color: var(--smoke); font-size: 0.95rem; }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: #f0a58f; }

.contact-foot {
  margin: clamp(5rem, 14vh, 9rem) 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--smoke);
  font-size: 0.9rem;
}

/* Tablet and phone */
@media (max-width: 900px) {
  .job { grid-template-columns: 1fr; }
  .job-side { position: static; display: grid; grid-template-columns: 9rem 1fr; gap: 0 1.25rem; align-items: center; }
  .job-logo { grid-row: span 2; height: 4.5rem; margin: 0; padding: 0.6rem 0.8rem; }
  .job-logo-mark { gap: 0.4rem; }
  .job-logo-mark span { font-size: 0.95rem; }
  .job-company { margin: 0; }
  .feature, .feature-biomed { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .collage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-trek, .shot-lab, .shot-sih, .shot-ugc, .shot-run, .shot-afsb { grid-column: auto; grid-row: auto; margin-top: 0; align-self: start; }
  .shot-sih, .shot-ugc { grid-column: 1 / -1; }
  .feature-flip .frame { order: 0; }
  .feature-biomed .frame-tall { max-width: 32rem; }
}

@media (max-width: 700px) {
  .nav ul li:nth-child(3) { display: none; }
  .nav-home { display: none; }
  .nav { justify-content: flex-end; }

  .hero-figure { left: 50%; width: 138%; height: auto; bottom: 0; }
  .hero-facts {
    top: calc(5rem + 2 * 0.84 * clamp(2.6rem, 12.6vw, 6rem) + 1.25rem);
    bottom: auto;
    width: auto;
    right: var(--gutter);
    font-size: 0.88rem;
  }
  .hero-facts li { padding: 0.4rem 0; }
  .hero-name {
    z-index: 1;
    font-size: clamp(2.6rem, 12.6vw, 6rem);
    top: 5rem;
    text-shadow: 0 0.04em 0.4em rgba(15, 19, 17, 0.5);
  }

  .section-head { grid-template-columns: 1fr; }

  /* No pinning on phones: swipe sideways instead */
  .projects-pin { position: static; height: auto; display: block; }
  .projects-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    transform: none !important;
  }
  .projects-intro { flex-basis: 100%; display: none; }
  .projects::before {
    content: "Selected projects";
    display: block;
    padding: 0 var(--gutter) 2rem;
    font-size: clamp(2.75rem, 12vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.92;
  }
  .card { scroll-snap-align: center; min-height: 26rem; }

  .contact-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .js .rise { transform: none; transition: none; }
  .js .hero-me, .js .hero-facts { opacity: 1; transition: none; }
}
