/* parthrana.org
   Full-width, edge to edge. White, near-black and one blue; Libre Franklin throughout,
   heavy for the name and headings. Sizes scale with the screen so big monitors get a big site. */

@font-face {
  font-family: "Libre Franklin";
  src: url("/fonts/libre-franklin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/fonts/libre-franklin-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #111111;
  --text: #2b2b2b;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --band: #111111;
  --band-ink: #ffffff;
  --band-muted: #9b9b9b;
  --accent: #2450e6;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --math: "STIX Two Text", "Cambria Math", Cambria, "Times New Roman", serif;
  --side: clamp(20px, 3.2vw, 64px);          /* the page gutter */
  --gap: clamp(16px, 1.8vw, 36px);           /* the column gap */
  --head: 68px;                              /* header height, for the full-screen hero */
  --small: clamp(14px, .9vw, 17px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: clamp(16px, .5vw + 9px, 19px); line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 40; background: var(--ink); color: var(--bg); padding: 8px 12px; font-size: 14px; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
[id] { scroll-margin-top: calc(var(--head) + 16px); }

.prose a, a.u {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color .2s ease, color .2s ease;
}
.prose a:hover, a.u:hover { text-decoration-color: currentColor; }
.btn {
  display: inline-block; font: 600 clamp(14.5px, .9vw, 17px)/1 var(--sans);
  padding: .95em 1.35em; border-radius: 8px; background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- header: full width, pinned, frosted ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s ease;
}
.site-head.stuck { border-bottom-color: var(--line); }
.head-in { min-height: var(--head); padding: 0 var(--side); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.site-head .home { font-family: var(--sans); font-weight: 800; font-size: clamp(19px, 1.35vw, 26px); letter-spacing: -.025em; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 6px clamp(18px, 2vw, 40px); font-size: clamp(14.5px, .95vw, 18px); }
.site-head nav a { position: relative; padding: 3px 0; }
.site-head nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-head nav a:hover::after, .site-head nav a.on::after { transform: none; }

/* ---------- hero: one full screen. The name across the top, then who I am, with the photo beside it ---------- */
.hero {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr);
  column-gap: var(--gap); row-gap: clamp(18px, 4vh, 56px);
  /* exactly one screen, whatever its proportions: the photo takes the height the name leaves */
  height: calc(100vh - var(--head)); height: calc(100svh - var(--head)); min-height: 520px;
  padding: clamp(14px, 3vh, 48px) var(--side) clamp(20px, 4vh, 56px);
}
.name-wrap { position: relative; grid-column: 1 / -1; grid-row: 1; }
/* "Parth Rana" is about 5 em wide in Libre Franklin 800 at this tracking, so this spans gutter to gutter */
.hero h1 {
  font-family: var(--sans); font-weight: 800; letter-spacing: -.045em; line-height: .8; white-space: nowrap;
  /* as wide as the gutters allow, but never so tall that the intro below loses its room */
  font-size: min(calc((100vw - 2 * var(--side)) / 4.94), calc((100svh - var(--head) - 330px) / .86));
  margin-left: -.05em; padding-top: .06em;
}
.hero-intro { grid-column: 1 / span 7; grid-row: 2; align-self: start; min-width: 0; }
.lede { font-size: clamp(20px, 1.9vw, 40px); line-height: 1.38; letter-spacing: -.01em; color: var(--ink); max-width: 30ch; }
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: 12px clamp(28px, 3vw, 64px);
  margin-top: clamp(22px, 3.6vh, 48px); padding-top: clamp(14px, 1.6vh, 22px); border-top: 1px solid var(--line);
  font-size: clamp(15px, 1vw, 19px); line-height: 1.45;
}
.facts dt { color: var(--muted); font-size: .86em; margin-bottom: .25em; }
.hero-actions { margin-top: clamp(24px, 4vh, 52px); }
@media (max-height: 700px) { .hero-actions { display: none; } }   /* short laptop screens keep the hero to one screen */
.hero .photo { grid-column: 9 / -1; grid-row: 2; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.hero .photo picture { height: 100%; }
.hero .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }

/* ---------- photo band: real photos drifting sideways, never pausing ---------- */
.strip { background: var(--band); padding: clamp(14px, 1.5vw, 28px) 0; overflow: hidden; }
.strip-track { display: flex; width: max-content; animation: drift 120s linear infinite; }
.strip-set { display: flex; gap: clamp(8px, .7vw, 14px); padding-right: clamp(8px, .7vw, 14px); }
.strip figure { flex: none; height: clamp(150px, 15vw, 340px); overflow: hidden; background: #222; }
.strip picture { display: block; height: 100%; }
.strip img { height: 100%; width: auto; max-width: none; }
@keyframes drift { to { transform: translateX(-50%); } }

/* ---------- highlights ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); padding: clamp(56px, 10vh, 130px) var(--side) 0; }
.stats div { border-top: 1.5px solid var(--ink); padding-top: clamp(14px, 1.2vw, 24px); }
.stats b { display: block; font-family: var(--sans); font-weight: 800; font-size: clamp(44px, 5.8vw, 128px); line-height: .95; letter-spacing: -.045em; }
.stats span { display: block; margin-top: .8em; font-size: var(--small); line-height: 1.45; color: var(--muted); max-width: 26ch; }

/* ---------- sections: title pinned on the left, content across the rest ---------- */
.sec { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: clamp(88px, 15vh, 200px) var(--side) 0; }
.sec-head { grid-column: 1 / span 3; align-self: start; position: sticky; top: calc(var(--head) + 24px); border-top: 1.5px solid var(--ink); padding-top: clamp(14px, 1.2vw, 22px); }
.sec-head h2 { font-family: var(--sans); font-weight: 800; font-size: clamp(36px, 3.6vw, 76px); line-height: 1; letter-spacing: -.035em; }
.sec-head p { margin-top: .7em; color: var(--muted); font-size: var(--small); max-width: 22ch; }
.sec-body { grid-column: 4 / -1; border-top: 1.5px solid var(--ink); min-width: 0; }

/* ---------- projects ---------- */
.proj { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); column-gap: clamp(28px, 3.6vw, 80px); align-items: center; padding: clamp(32px, 5vh, 72px) 0; border-bottom: 1px solid var(--line); }
.proj.flip > figure { order: 2; }
.proj figure picture { display: block; overflow: hidden; }
.proj figure img { width: 100%; max-height: 78vh; object-fit: cover; object-position: 50% 35%; transition: transform .9s var(--ease); }
.proj:hover figure img { transform: scale(1.025); }
.proj figcaption { font-size: clamp(13px, .8vw, 15px); color: var(--muted); margin-top: .8em; }
.award { color: var(--accent); font-size: clamp(15px, 1vw, 19px); font-weight: 600; line-height: 1.45; }
.proj h3 { font-family: var(--sans); font-weight: 800; font-size: clamp(42px, 4.8vw, 104px); line-height: .98; letter-spacing: -.04em; margin-top: .25em; }
.proj .desc { font-size: clamp(17px, 1.2vw, 23px); line-height: 1.6; color: var(--text); margin-top: 1em; max-width: 46ch; }
.also { margin-top: 1.2em; display: grid; gap: .35em; font-size: clamp(15px, .95vw, 18px); color: var(--text); }
.also li { padding-left: 18px; position: relative; }
.also li::before { content: ""; position: absolute; left: 0; top: .66em; width: 8px; height: 1.5px; background: var(--accent); }
.proj .actions { margin-top: clamp(22px, 2vw, 36px); }
.proj-mini { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); column-gap: clamp(28px, 3.6vw, 80px); padding: clamp(32px, 5vh, 64px) 0 0; }
.proj-mini h3 { font-family: var(--sans); font-weight: 800; font-size: clamp(30px, 2.6vw, 54px); line-height: 1.05; letter-spacing: -.03em; margin-top: .3em; }
.proj-mini p { font-size: clamp(16px, 1.05vw, 20px); line-height: 1.65; color: var(--text); max-width: 52ch; }

/* ---------- research ---------- */
.roles li { display: grid; grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr); column-gap: var(--gap); padding: clamp(20px, 3vh, 36px) 0; border-bottom: 1px solid var(--line); }
.roles .when { color: var(--muted); font-size: var(--small); padding-top: .45em; font-variant-numeric: tabular-nums; }
.roles .role { font-family: var(--sans); font-weight: 700; font-size: clamp(22px, 1.8vw, 38px); line-height: 1.2; letter-spacing: -.02em; }
.roles .org { color: var(--muted); }
.roles .desc { margin-top: .5em; font-size: clamp(16px, 1.05vw, 20px); line-height: 1.6; color: var(--text); max-width: 68ch; }

/* ---------- honors on an ink band ---------- */
.band { background: var(--band); color: var(--band-ink); margin-top: clamp(88px, 15vh, 200px); padding-bottom: clamp(72px, 12vh, 160px); }
.band.sec { padding-top: clamp(72px, 12vh, 160px); }
.band ::selection { background: var(--band-ink); color: var(--band); }
.band :focus-visible { outline-color: var(--band-ink); }
.band .sec-head, .band .sec-body { border-top-color: var(--band-ink); }
.band .sec-head p { color: var(--band-muted); }
.honor-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 var(--gap); }
.hg h3 { font-family: var(--sans); font-weight: 700; font-size: clamp(22px, 1.6vw, 34px); margin: 1.2em 0 .3em; }
.hg li { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 14px; padding: .75em 0; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: clamp(15px, 1vw, 19px); }
.hg .y { color: var(--band-muted); font-size: .9em; padding-top: .1em; font-variant-numeric: tabular-nums; }
.hg .t { line-height: 1.4; }
.hg .org { display: block; color: var(--band-muted); font-size: .86em; margin-top: 2px; }

/* ---------- about ---------- */
.about { padding-top: clamp(20px, 2vw, 36px); }
.about p { font-size: clamp(19px, 1.65vw, 34px); line-height: 1.5; color: var(--text); max-width: 46ch; }
.about p + p { margin-top: 1em; }

/* ---------- contact ---------- */
.contact .sec-body { padding-top: clamp(20px, 2vw, 36px); }
.mail {
  display: inline-block; font-family: var(--sans); font-weight: 700; line-height: 1.05; letter-spacing: -.035em;
  font-size: calc((100vw - 2 * var(--side)) * .7 / 12.6);
  border-bottom: .05em solid currentColor; transition: color .2s ease; overflow-wrap: anywhere;
}
.mail:hover { color: var(--accent); }
.contact .actions { margin-top: clamp(24px, 2.4vw, 44px); }

/* ---------- footer ---------- */
.foot {
  margin-top: clamp(96px, 16vh, 200px); padding: 22px var(--side) 40px;
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-size: var(--small); color: var(--muted);
  border-top: 1px solid var(--line);
}
.foot a:hover { color: var(--ink); }

/* ---------- inner pages ---------- */
.page-title { padding: clamp(40px, 7vh, 96px) var(--side) 0; text-align: center; }
.page-title h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(48px, 7.5vw, 150px); line-height: 1; letter-spacing: -.045em; }
.page-title p { font-size: clamp(18px, 1.3vw, 24px); color: var(--text); margin-top: .5em; }
.page-title p.award { margin-top: 1em; font-size: clamp(15px, 1vw, 19px); color: var(--accent); }
.prose-c { max-width: 760px; margin: 0 auto; padding: 0 var(--side); }
.prose-c h2 { font-family: var(--sans); font-weight: 800; font-size: clamp(28px, 2.2vw, 40px); line-height: 1.15; margin: 72px 0 16px; }
.prose-c p { font-size: clamp(17px, 1.1vw, 20px); line-height: 1.75; color: var(--text); }
.prose-c p + p { margin-top: 18px; }
.prose-c figure { margin: 36px 0 0; }
.prose-c figure img { width: 100%; }
.prose-c figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.timeline p { display: grid; grid-template-columns: 70px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px !important; line-height: 1.55 !important; margin: 0 !important; }
.timeline p:first-child { border-top: 1px solid var(--line); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.next { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 18px; font-family: var(--sans); font-weight: 700; font-size: 19px; }

/* ---------- legal + 404 ---------- */
.legal { max-width: 800px; margin: 0 auto; padding: 48px var(--side) 0; }
.legal-text h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(38px, 4vw, 64px); line-height: 1.05; margin-bottom: 14px; }
.legal-text .last-updated { font-size: 14px; color: var(--muted); margin-bottom: 36px; }
.legal-text h2 { font-family: var(--sans); font-size: 23px; font-weight: 600; margin: 40px 0 10px; }
.legal-text p, .legal-text li { font-size: 16.5px; line-height: 1.7; color: var(--text); }
.legal-text p + p { margin-top: 12px; }
.legal-text ul { list-style: disc; padding-left: 22px; margin-top: 10px; }
.legal-text li + li { margin-top: 8px; }
.legal-text a { text-decoration: underline; text-underline-offset: 3px; }
.legal-text .footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.not-found { padding: clamp(40px, 10vh, 120px) var(--side) 4vh; min-height: calc(100svh - var(--head) - 120px); display: flex; flex-direction: column; justify-content: flex-end; }
.not-found h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(120px, 30vw, 560px); line-height: .8; letter-spacing: -.06em; margin-left: -.05em; }
.not-found p { margin-top: 24px; font-size: clamp(18px, 1.3vw, 24px); color: var(--text); }
.not-found .actions { margin-top: 28px; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
  :root { --head: 92px; }
  .head-in { padding: 12px var(--side); flex-wrap: wrap; row-gap: 6px; }
  .hero {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); grid-template-rows: auto; column-gap: 18px; row-gap: 22px;
    height: auto; min-height: 0; padding-top: 18px; padding-bottom: 28px;
  }
  .name-wrap { grid-column: 1 / -1; grid-row: 1; }
  .hero h1 { white-space: normal; font-size: min(24vw, 140px); line-height: .86; padding-top: 0; margin-left: -.04em; }
  .hero-intro { display: contents; }
  .hero-actions { display: none; }
  .lede { grid-column: 1 / -1; grid-row: 2; }
  .lede { font-size: clamp(17px, 4.6vw, 21px); }
  .hero h1 { font-size: min(24vw, 140px, 13.5svh); }
  .hero .photo { grid-column: 1; grid-row: 3; height: auto; max-width: 300px; }
  .hero .photo img { height: auto; aspect-ratio: 4 / 5; }
  .facts { grid-column: 2; grid-row: 3; grid-template-columns: 1fr; gap: 12px; margin-top: 0; padding-top: 0; border-top: 0; align-content: start; font-size: 15px; min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .sec { display: block; }
  .sec-head { position: static; }
  .sec-body { border-top: 0; margin-top: 8px; }
  .proj, .proj-mini { grid-template-columns: 1fr; row-gap: 24px; padding: 36px 0; }
  .proj.flip > figure { order: 0; }
  .proj figure img { max-height: none; }
  .proj-mini { padding-bottom: 0; }
  .roles li { grid-template-columns: 1fr; row-gap: 4px; }
  .roles .when { padding-top: 0; }
  .mail { font-size: calc((100vw - 2 * var(--side)) / 13.2); }
  .foot { flex-direction: column; }
  .prose-c h2 { margin-top: 56px; }
}

/* short phones (iPhone SE and similar): tighten the intro so it still fits one screen */
@media (max-width: 900px) and (max-height: 760px) {
  .hero { row-gap: 14px; padding-top: 10px; padding-bottom: 18px; grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); }
  .hero h1 { font-size: min(22vw, 12svh); }
  .lede { font-size: 16px; line-height: 1.4; }
  .facts { font-size: 14px; gap: 8px; }
}

/* ---------- motion: the name is made of particles on the home page ---------- */
html.js [data-denoise] { opacity: 0; animation: show .01s linear 3s forwards; }   /* shows the name even if JS dies */
html.js.name-animating [data-denoise] { animation: none; }
html.js.name-settled [data-denoise] { opacity: 1; transition: opacity .5s ease; animation: none; }
@keyframes show { to { opacity: 1; } }
.denoise { position: absolute; max-width: none; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .35s ease; }
html.name-live .denoise { opacity: 1; }
html.js.name-live [data-denoise] { opacity: 0 !important; transition: opacity .2s ease; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-denoise] { opacity: 1 !important; animation: none !important; }
  .strip-track { animation: none; width: auto; }
  .strip-set[aria-hidden] { display: none; }
  .strip { overflow-x: auto; }
  .proj figure img { transition: none !important; transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print {
  .site-head nav, .skip, canvas, .strip { display: none !important; }
  .site-head, .sec-head { position: static; }
  html.js [data-denoise] { opacity: 1 !important; }
  .band { background: #fff; color: #000; }
}
