/* Sri Harsha Patallapalli — personal site
   Cool paper ground with a teal signal accent for anything clickable, and a
   separate amber reserved for measured quantities. Two hues, two jobs.
   Condensed sans for headings, a reading serif for prose, mono for data —
   the three roles a spec sheet actually needs.
   Open source and hackathons run as full-bleed bands so they carry the page. */

:root {
  --paper:  #FBFCFD;
  --ink:    #10151C;
  --muted:  #55616D;
  --rule:   #DDE3E9;
  --sunk:   #F1F4F7;
  --sunk2:  #E8EDF2;
  --link:   #0C6A62;
  --metric: #8A5207;

  --display: "IBM Plex Sans Condensed", ui-sans-serif, system-ui, sans-serif;
  --body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 40rem;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --indent:  0rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #0C1116;
    --ink:    #DBE2E9;
    --muted:  #8A98A6;
    --rule:   #212C36;
    --sunk:   #111920;
    --sunk2:  #151E27;
    --link:   #4FC7B6;
    --metric: #E3A85F;
  }
}

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

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

body {
  margin: 0;
  padding: 0 0 4rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}

/* One wrapper controls the measure everywhere, so the bands can go full-bleed
   while their contents stay on the same left edge as the rest of the page. */
.wrap {
  max-width: calc(var(--measure) + var(--indent));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---- links ------------------------------------------------------------- */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  z-index: 10;
}

/* ---- measured quantities ----------------------------------------------- */
/* Every number on this page is a claim. Mark them so they can be scanned. */

.m {
  font-family: var(--mono);
  font-size: 0.86em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--metric);
  white-space: nowrap;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--sunk2);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ---- masthead ---------------------------------------------------------- */

.masthead { padding-top: clamp(3rem, 9vw, 5.5rem); padding-bottom: 2.25rem; }

.masthead__photo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
  border: 1px solid var(--rule);
  filter: saturate(0.9);
  margin-bottom: 1.5rem;
}

.masthead__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1.6rem + 3.2vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

.masthead__lede {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  line-height: 1.42;
  margin: 0 0 0.85rem;
  text-wrap: pretty;
}

.masthead__status {
  color: var(--muted);
  margin: 0 0 1.75rem;
}

/* ---- profile links ----------------------------------------------------- */
/* Boxed, because these are the four things a visitor most likely came for. */

/* Exactly two columns, never auto-fit: four items must tile without a hole. */
.profiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 32rem) {
  .profiles { grid-template-columns: 1fr 1fr; }
}

.profiles__link {
  display: block;
  padding: 0.8rem 1rem;
  background: var(--paper);
  text-decoration: none;
  transition: background 120ms ease;
}
.profiles__link:hover { background: var(--sunk); }
.profiles__link:focus-visible { outline-offset: -2px; }

.profiles__where {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.profiles__who {
  display: block;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--link);
  overflow-wrap: anywhere;
}

/* ---- the timescale axis ------------------------------------------------ */
/* The signature. The work spans microsecond kernels to six-hour batch SLAs,
   so the axis is the honest way to say it in one glance. */

.scale { padding-top: 2.5rem; padding-bottom: 3rem; }

.scale__stops {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scale__stops::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--rule);
  transform-origin: left center;
  animation: draw 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stop { position: relative; padding-top: 1.15rem; }

.stop::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 9px;
  background: var(--link);
  animation: fade 400ms ease both;
  animation-delay: calc(500ms + var(--i, 0) * 90ms);
}

.stop__unit {
  display: block;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--link);
  margin-bottom: 0.35rem;
}

.stop__what {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.scale__caption {
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.stop:nth-child(1) { --i: 0; }
.stop:nth-child(2) { --i: 1; }
.stop:nth-child(3) { --i: 2; }
.stop:nth-child(4) { --i: 3; }

@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- feature bands ----------------------------------------------------- */

.band {
  background: var(--sunk);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(3rem, 7vw, 4.5rem) 0;
}
.band--alt { background: var(--sunk2); border-top: 0; }

.band__head { margin-bottom: clamp(2rem, 5vw, 3rem); }

.band__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.band__intro {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  text-wrap: pretty;
}

/* ---- open source projects ---------------------------------------------- */

.projects { margin: 0; padding: 0; list-style: none; }

.project {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.project:last-child { padding-bottom: 0; }

.project__name {
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 0.2rem;
}
.project__name a { text-decoration-color: transparent; }
.project__name a:hover { text-decoration-color: currentColor; }

/* the one-line "what is it", set apart from the explanation */
.project__what {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--muted);
  text-wrap: pretty;
}

.project__body { margin: 0 0 0.9rem; text-wrap: pretty; }

.project__foot,
.entry__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.project__tags {
  color: var(--muted);
  margin-right: auto;
}

/* The tail of a section: everything that didn't earn a full entry. */
.more {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.row__body .more { margin-top: 0; }

/* ---- awards ------------------------------------------------------------ */

.awards { margin: 0; padding: 0; list-style: none; }

.award {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.award:last-child { padding-bottom: 0; }

.award__place {
  margin: 0 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
}

.award__event {
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

.award__body {
  margin: 0.8rem 0 0;
  text-wrap: pretty;
}

.award__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin: 1.1rem 0 0;
}
.award__stats div { margin: 0; }

.award__stats dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.award__stats dd {
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
}
.award__stats dd a { font-size: 1rem; font-weight: 600; }

/* ---- quiet section rows ------------------------------------------------ */

.row {
  max-width: calc(var(--measure) + var(--indent));
  margin: 3rem auto 0;
  padding: 3rem var(--gutter) 0;
  border-top: 1px solid var(--rule);
}
/* A band already draws its own bottom rule; don't double it up. */
.band + .row { margin-top: 0; border-top: 0; }

.row__label {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.row__intro { margin: 0 0 2rem; color: var(--muted); }

/* Spec-sheet layout: labels move into the left margin once there's room. */
@media (min-width: 62rem) {
  :root { --measure: 46rem; --indent: 11.5rem; }

  .row {
    display: grid;
    grid-template-columns: 9rem 1fr;
    column-gap: 2.5rem;
  }
  .row__label { margin-bottom: 0; padding-top: 0.4rem; }

  .masthead, .scale, .band .wrap, .colophon { padding-left: calc(var(--gutter) + 11.5rem); }
}

/* ---- entries ----------------------------------------------------------- */

.entry { margin-bottom: 2.5rem; }
.entry:last-child { margin-bottom: 0; }
.entry--tight { margin-bottom: 1.75rem; }

.entry__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.6rem;
  row-gap: 0.1rem;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 0 0 0.3rem;
}

.entry__role { font-weight: 600; color: var(--muted); }
.entry__role::before { content: "· "; color: var(--rule); }

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1rem;
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.entry__meta time { margin-left: auto; }

.entry__blurb { margin: 0 0 0.7rem; text-wrap: pretty; }
.entry--tight .entry__blurb { margin-bottom: 0; }

/* ---- facts, skills ----------------------------------------------------- */

.facts { margin: 0; padding: 0; list-style: none; }

.facts li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  text-wrap: pretty;
}
.facts li:first-child { padding-top: 0; }
.facts li:last-child { border-bottom: 0; }

.sub-note {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.sub {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 2.25rem 0 0.9rem;
}
.row__body > .sub:first-child { margin-top: 0; }

.skills {
  margin: 0;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.55rem 1.25rem;
}

.skills dt {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  padding-top: 0.22em;
}

.skills dd { margin: 0; font-size: 0.95rem; }

@media (max-width: 30rem) {
  .skills { grid-template-columns: 1fr; gap: 0.15rem; }
  .skills dd { margin-bottom: 0.6rem; }
}

/* ---- footer ------------------------------------------------------------ */

.colophon {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}
.colophon p { margin: 0; }

/* ---- narrow screens: the axis rotates ---------------------------------- */

@media (max-width: 46rem) {
  .scale__stops { grid-template-columns: 1fr; gap: 1.25rem; }
  .scale__stops::before {
    inset: 0 auto 0 0;
    width: 1px;
    height: auto;
    transform-origin: top center;
    animation-name: drawv;
  }
  .stop { padding-top: 0; padding-left: 1.25rem; }
  .stop::before { top: 0.55em; width: 9px; height: 1px; }
  @keyframes drawv { from { transform: scaleY(0); } to { transform: scaleY(1); } }

  .award__stats { gap: 1.25rem 2rem; }
  .award__stats dd { font-size: 1.3rem; }
}

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

@media print {
  body { padding: 0; font-size: 10pt; }
  .scale, .skip, .colophon, .profiles { display: none; }
  .band { background: none; padding: 1rem 0; }
  a { color: inherit; text-decoration: none; }
}
