/* Prashant Kumar, personal site.
   The cover is painted in the studio backdrop of his portrait (sampled from the
   photo: darker slate at the top, lighter lilac-grey at the bottom), so the
   photo has no edge. Everything after the cover is quiet: cool paper, the navy
   of the suit for ink, the cobalt of the tie only for links and focus. */

:root {
  --backdrop-top: #6f7590;
  --backdrop-bottom: #b3b6ce;
  --paper: #eeeff4;
  --paper-2: #e3e5ed;
  --ink: #151c33;
  --ink-2: #454b63;
  --ink-3: #6b7089;
  --rule: #cdd0dc;
  --cobalt: #2a55c9;
  --navy: #1b2340;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 38rem;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- cover ---------- */

.cover {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--backdrop-top) 0%, #9397b2 45%, var(--backdrop-bottom) 100%);
  color: var(--ink);
}

.cover-photo img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: auto;
  height: min(96svh, 125vw);
  max-width: none;
  /* the photo's own backdrop matches the cover; fade its left and top edges
     into it so no rectangle shows */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 10%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 10%);
  mask-composite: intersect;
}

.cover-nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) 0;
}

.cover-mark {
  font: 400 22px/1 var(--serif);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #f4f5fa;
}

.cover-nav ul {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cover-nav ul a {
  font-size: 14px;
  color: #eef0f7;
  text-decoration: none;
  opacity: 0.85;
}
.cover-nav ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.cover-text {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(48px, 9vh, 96px);
  z-index: 1;
  max-width: 34rem;
}

.cover-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 10.5vw, 176px);
  line-height: 0.84;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 72;
}
.cover-name span { display: block; }

.cover-role {
  margin-top: 28px;
  font: 400 clamp(20px, 2vw, 26px)/1.25 var(--serif);
  max-width: 22ch;
}

.cover-creds {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.5;
  color: #232a44;
}

/* one orchestrated entrance: the name rises, then the rest settles in */
@media (prefers-reduced-motion: no-preference) {
  .cover-photo img { animation: photo-in 1.4s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
  .cover-name span { animation: rise 1s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
  .cover-name span + span { animation-delay: 0.08s; }
  .cover-role, .cover-creds, .cover-nav { animation: settle 0.9s ease-out 0.45s both; }

  @keyframes photo-in { from { opacity: 0; transform: scale(1.02); } }
  @keyframes rise { from { opacity: 0; transform: translateY(0.25em); } }
  @keyframes settle { from { opacity: 0; } }
}

/* ---------- intro ---------- */

main > section { padding-inline: var(--gutter); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 6vw, 96px);
  padding-block: clamp(72px, 11vw, 150px) clamp(56px, 8vw, 110px);
  max-width: 1320px;
  margin-inline: auto;
}

.intro-title {
  font: 300 clamp(34px, 4.2vw, 60px)/1.06 var(--serif);
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.intro-body {
  display: grid;
  gap: 18px;
  align-content: start;
  max-width: var(--measure);
  color: var(--ink-2);
  padding-top: 8px;
}
.intro-body p:first-child { color: var(--ink); }

.figures {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(24px, 4vw, 48px) 0 0;
  border-top: 1px solid var(--rule);
}

.figures div {
  padding: 26px 24px 0 0;
}
.figures div + div { padding-left: 24px; border-left: 1px solid var(--rule); }

.figures dt {
  font: 300 clamp(32px, 3.4vw, 48px)/1 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}

.figures dd {
  margin: 12px 0 0;
  max-width: 24ch;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ---------- now ---------- */

.now {
  background: var(--navy);
  color: #dfe3f0;
}

.now-inner {
  max-width: 1320px;
  margin-inline: auto;
  padding-block: clamp(64px, 9vw, 120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px clamp(32px, 6vw, 96px);
}

.now h2 {
  font: 300 clamp(28px, 3vw, 40px)/1.1 var(--serif);
  color: #ffffff;
  grid-row: span 2;
}

.now-lede {
  font: 400 clamp(21px, 2vw, 26px)/1.35 var(--serif);
  color: #ffffff;
  max-width: 34ch;
}

.now p:not(.now-lede) { max-width: var(--measure); color: #b9bfd6; }

/* ---------- talks, press and writing ---------- */

.appearances {
  max-width: 1320px;
  margin-inline: auto;
  padding-block: clamp(72px, 10vw, 130px) 0;
}

.appearances-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.appearances h2 {
  font: 300 clamp(30px, 3.4vw, 46px)/1.05 var(--serif);
  letter-spacing: -0.015em;
}

.rail-controls { display: flex; gap: 8px; }

.rail-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}
.rail-btn:hover:not(:disabled) { background: var(--paper-2); border-color: var(--ink-3); }
.rail-btn:disabled { opacity: 0.35; cursor: default; }
.rail-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, calc((100% - 2 * 28px) / 3));
  gap: 28px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.item {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.item-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.item img,
.video {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--paper-2);
}

.item-link img { transition: filter 0.3s; }
.item-link:hover img { filter: brightness(0.92); }
.item-link:hover .item-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.item-meta {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-3);
}

.item-title {
  margin-top: 6px;
  font: 400 22px/1.22 var(--serif);
  letter-spacing: -0.005em;
}

.item-source {
  margin-top: 10px;
  font-size: 14px;
  color: var(--cobalt);
}
a.item-source { text-decoration: none; }
a.item-source:hover { text-decoration: underline; }

.video { position: relative; overflow: hidden; }
.video img { position: absolute; inset: 0; height: 100%; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 245, 250, 0.92);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s;
}
.video-play:hover { transform: scale(1.06); }
.video-play svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }

/* ---------- experience ---------- */

.experience {
  max-width: 1320px;
  margin-inline: auto;
  padding-block: clamp(80px, 11vw, 150px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 32px clamp(32px, 6vw, 96px);
}

.experience h2 {
  font: 300 clamp(30px, 3.4vw, 46px)/1.05 var(--serif);
  letter-spacing: -0.015em;
}

.roles { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.roles li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 8px 24px;
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--rule);
}

.role-when {
  padding-top: 5px;
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.roles h3 {
  font: 400 22px/1.25 var(--serif);
}
.roles h3 span { color: var(--ink-3); }

.roles li p:not(.role-when) {
  margin-top: 8px;
  max-width: var(--measure);
  font-size: 16px;
  color: var(--ink-2);
}

/* ---------- teaching and education ---------- */

.learning {
  max-width: 1320px;
  margin-inline: auto;
  padding-block: clamp(80px, 10vw, 130px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(28px, 4vw, 64px);
}

.learning h3 {
  font: 300 26px/1.1 var(--serif);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.learning h3 + ul,
.learning h3 + p { margin-top: 16px; }
.learning ul + h3 { margin-top: 40px; }

.learning ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }

.learning li,
.learning-col > p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.learning strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- contact ---------- */

.contact {
  background: linear-gradient(180deg, var(--backdrop-top) 0%, var(--backdrop-bottom) 100%);
  padding-block: clamp(80px, 11vw, 150px) calc(clamp(80px, 11vw, 150px) + 40px);
}

.contact > * { max-width: 1320px; margin-inline: auto; }

.contact-kicker {
  font: 400 18px/1.45 var(--serif);
  color: #1f2640;
  max-width: 44ch;
  margin-left: 0;
}

.contact h2 {
  margin-top: 22px;
  font: 300 clamp(36px, 5vw, 76px)/1.02 var(--serif);
  letter-spacing: -0.025em;
  max-width: 20ch;
  margin-left: 0;
}

.contact-links {
  margin-top: clamp(40px, 5vw, 64px);
  margin-left: 0;
  max-width: 44rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(21, 28, 51, 0.25);
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  border-bottom: 1px solid rgba(21, 28, 51, 0.25);
  text-decoration: none;
  font-size: 16px;
}
.contact-links a span:first-child { color: #2b3250; }
.contact-links a span:last-child { text-align: right; overflow-wrap: anywhere; }
.contact-links a:hover span:last-child { text-decoration: underline; text-underline-offset: 4px; }

.contact-note {
  margin-top: 28px;
  margin-left: 0;
  font-size: 14px;
  color: #262d47;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--backdrop-bottom);
  border-top: 1px solid rgba(21, 28, 51, 0.18);
  font-size: 13px;
  color: #2b3250;
}

/* ---------- dock: save and share, where the thumb is ---------- */

/* the dock is for phones, where people land from the NFC card; on a desktop
   the contact section carries the same actions */
.dock {
  display: none;
  position: fixed;
  right: var(--gutter);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  gap: 8px;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: rgba(238, 239, 244, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.dock-btn--solid { background: var(--ink); color: #f4f5fa; }
.dock-btn:hover { filter: brightness(1.15); }

@media (prefers-reduced-motion: no-preference) {
  .dock { animation: settle 0.9s ease-out 0.9s both; }
}

/* ---------- smaller screens ---------- */

@media (max-width: 1000px) {
  .rail { grid-auto-columns: minmax(260px, calc((100% - 28px) / 2)); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(3) { padding-left: 0; border-left: 0; }
  .figures div:nth-child(n + 3) { margin-top: 28px; }
  .experience { grid-template-columns: 1fr; }
  .learning { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .cover-nav ul { display: none; }

  .cover {
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 0;
  }

  .cover-photo img {
    position: relative;
    height: auto;
    width: 118%;
    margin-left: auto;
    margin-right: -9%;
    -webkit-mask-image: linear-gradient(180deg, #000 52%, transparent 88%);
    mask-image: linear-gradient(180deg, #000 52%, transparent 88%);
  }

  .cover-text {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: -30vw;
    padding: 0 var(--gutter) 44px;
  }

  /* where the name still crosses the suit, cut each letter out of it */
  .cover-name span {
    -webkit-text-stroke: 0.06em #a9acc4;
    paint-order: stroke fill;
  }

  .cover-name { font-size: clamp(58px, 19vw, 96px); }
  .cover-role { margin-top: 20px; }

  .intro,
  .now-inner { grid-template-columns: 1fr; }
  .now h2 { grid-row: auto; }

  .figures div { padding-right: 12px; }
  .figures div + div { padding-left: 14px; }
  .figures dt { font-size: 32px; }

  .rail { grid-auto-columns: 82%; gap: 18px; }
  .rail-controls { display: none; }

  .roles li { grid-template-columns: 1fr; gap: 2px; }
  .role-when { padding-top: 0; }

  .learning { grid-template-columns: 1fr; }

  .contact-links a { flex-direction: column; gap: 2px; }
  .contact-links a span:last-child { text-align: left; }

  .dock {
    display: flex;
    left: 16px;
    right: 16px;
  }
  .dock-btn { flex: 1; }

  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
