/* Rithwik Chintapatla. One narrow column, dark by default.
   Sofia Sans for reading, its Extra Condensed cut for the name and numbers. */

:root {
  --paper: #0e121b;
  --paper-2: #161b27;
  --ink: #eceef4;
  --ink-2: #a3a9ba;
  --ink-3: #737a8e;
  --rule: #252b39;
  --blue: #7b93ff;
  --signal: #ffb547;

  --sans: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sofia Sans Extra Condensed", "Arial Narrow", "Sofia Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f6f7fa;
  --paper-2: #eceef4;
  --ink: #10131c;
  --ink-2: #4c5266;
  --ink-3: #7a8093;
  --rule: #dde0e8;
  --blue: #2a3bf5;
  --signal: #ff9f1c;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 1.0625rem / 1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Background: a faint starfield, drawn by the script. Sits behind everything. */
.sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.col { position: relative; }

h1, h2, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--signal); color: #10131c; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 3px; }
.nowrap { white-space: nowrap; }

a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--rule), var(--rule)) 0 100% / 100% 1px no-repeat,
              linear-gradient(var(--blue), var(--blue)) 0 100% / 0% 1px no-repeat;
  transition: color 0.2s, background-size 0.45s var(--ease);
}
a:hover { color: var(--blue); background-size: 100% 1px, 100% 1px; }

/* Column */

.col {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 120px) 24px 64px;
}

.topline { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(40px, 7vh, 72px); }
.handle { font-family: var(--mono); font-weight: 500; font-size: 0.9375rem; color: var(--ink); }
.theme {
  font-size: 0.875rem; color: var(--ink-3); padding: 4px 12px;
  border: 1px solid var(--rule); border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}
.theme:hover { color: var(--ink); border-color: var(--ink-3); }

/* Intro */

.intro { margin-bottom: 36px; }
.name {
  font-family: var(--display); font-weight: 800; color: var(--ink);
  font-size: 4.6rem; /* fitted to the column width by the script */
  line-height: 0.86; text-transform: uppercase; letter-spacing: 0;
  display: inline-block; white-space: nowrap; user-select: none;
}
.name__w { display: inline-block; }
.name__l { display: inline-block; font-weight: var(--w, 800); transition: font-weight 0.4s var(--ease); }
.role { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--ink-2); font-size: 1.0625rem; }
.face {
  flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1px var(--rule);
}

.prose { display: grid; gap: 1.1em; }

.find { margin-top: 40px; border-top: 1px solid var(--rule); }
.find li { position: relative; border-bottom: 1px solid var(--rule); }
.find a, .find__row {
  display: grid; grid-template-columns: 7.5rem 1fr; align-items: baseline; gap: 12px;
  padding: 13px 0; background: none;
}
.find__k { color: var(--ink); font-family: var(--mono); font-size: 0.875rem; font-weight: 500; transition: color 0.2s, transform 0.4s var(--ease); display: inline-block; }
.find__v { color: var(--ink-2); transition: color 0.2s; }
.find a:hover .find__k { color: var(--blue); transform: translateX(6px); }
.find a:hover .find__v { color: var(--ink); }
.find__copy {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 0.8125rem; color: var(--ink-3); padding: 3px 10px;
  border: 1px solid var(--rule); border-radius: 999px; transition: color 0.2s, border-color 0.2s;
}
.find__copy:hover { color: var(--ink); border-color: var(--ink-3); }

/* Sections below the bio */

.part { margin-top: 80px; display: grid; gap: 1.1em; }
.part h2 { font-family: var(--display); color: var(--blue); font-size: 1.875rem; font-weight: 700; line-height: 1; }
.small { font-size: 0.9375rem; color: var(--ink-3); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.stats li { display: grid; gap: 2px; }
.stat__n {
  font-family: var(--display); font-weight: 700; color: var(--ink);
  font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat__l { font-size: 0.875rem; color: var(--ink-3); }

.results li {
  display: grid; grid-template-columns: 3.25rem 1fr; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); color: var(--ink);
}
.results li:first-child { border-top: 1px solid var(--rule); }
.place { color: var(--ink-3); font-family: var(--mono); font-size: 0.8125rem; }
.results .is-podium .place { color: var(--blue); font-weight: 650; }

.off div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.off div:first-child { border-top: 1px solid var(--rule); }
.off dt { font-family: var(--mono); font-size: 0.875rem; font-weight: 500; color: var(--ink); }

.closing { margin-top: 80px; color: var(--ink); }
.foot { margin-top: 48px; text-align: center; }
.signoff {
  display: inline-block; font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; color: var(--ink-3); transition: color 0.3s;
}
.signoff:hover { color: var(--blue); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10;
  padding: 9px 16px; border-radius: 999px; font-size: 0.875rem;
  background: var(--ink); color: var(--paper);
  transform: translate(-50%, calc(100% + 32px)); visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0s 0.45s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform 0.45s var(--ease); }

/* Motion. On load: photo, then the name letter by letter, then the bio.
   Further down, each section rises in once as it comes into view. */

/* Name: each letter slides up from behind its word's baseline, like type being set.
   The word clips it, so nothing shows outside the line while it moves. */
.js .name__w { clip-path: inset(-0.4em -0.2em 0 -0.2em); }
.js .name__l, .js .role, .js [data-in] { opacity: 0; }
.is-ready .name__l { opacity: 1; animation: letter-up 1.05s cubic-bezier(0.16, 1, 0.3, 1) backwards; animation-delay: calc(80ms + var(--i) * 24ms); }
.is-ready .role { opacity: 1; animation: rise 0.8s var(--ease) backwards; animation-delay: 620ms; }
.is-ready .face { animation: face-in 0.8s var(--ease) backwards; animation-delay: 680ms; }
.js [data-in].is-in { opacity: 1; animation: rise 0.8s var(--ease) backwards; animation-delay: var(--d, 0ms); }
.is-in .results li { animation: rise 0.6s var(--ease) backwards; animation-delay: calc(200ms + var(--i, 0) * 40ms); }

@keyframes face-in { from { opacity: 0; transform: scale(0.88); } }
@keyframes letter-up { from { transform: translateY(105%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Theme switch: a lightsaber ignites from below the screen, swings up to vertical,
   then splits in two that race out to the edges, opening the new theme between them.
   Blue going to light, red going to dark. The element only exists during the switch,
   parked off screen; the script moves its snapshot. */
.saber {
  display: none; position: fixed; top: 0; left: calc(100% + 80px); z-index: 20;
  width: 4px; height: var(--len, 100vh); border-radius: 2px; pointer-events: none;
  --c: #3d8bff; background: #fff;
  box-shadow: 0 0 4px 1px #fff, 0 0 12px 3px var(--c), 0 0 26px 7px var(--c), 0 0 48px 12px color-mix(in srgb, var(--c) 40%, transparent);
  view-transition-name: saber;
}
.saber--b { view-transition-name: saber-b; }
.saber[data-side="dark"] { --c: #ff2a2a; }
.saber.is-on { display: block; }
::view-transition-group(saber), ::view-transition-old(saber), ::view-transition-new(saber),
::view-transition-group(saber-b), ::view-transition-old(saber-b), ::view-transition-new(saber-b) { animation: none; }
::view-transition-group(saber) { transform-origin: 50% 100%; }

@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .find a, .find__row, .off div { grid-template-columns: 6.5rem 1fr; }
  .find li:has(.find__copy) .find__v { padding-right: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
