/* Hursh Agrawal — a single page. */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader-latin-opsz-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader-latin-opsz-italic.woff2') format('woff2');
}

:root {
  --paper: #f5f1e9;
  --ink: #1c1b18;
  --ink-soft: #5d5a52;
  --rule: rgba(28, 27, 24, 0.22);

  --bcny: #0055fb;
  --tm: #6b665c;
  --fb: #3a5795;
  --branch: #b7302a;
  --stillpoint: #223829;
  --twitter: #3d8fe0;
  --linkedin: #144984;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171613;
    --ink: #ece7dc;
    --ink-soft: #a9a497;
    --rule: rgba(236, 231, 220, 0.24);
    --bcny: #6d9cff;
    --tm: #b3ada0;
    --fb: #8fa8d8;
    --branch: #e0766f;
    --stillpoint: #9fb8a6;
    --twitter: #7db6f0;
    --linkedin: #7ea3d1;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  font-weight: 300;
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.75rem);
  line-height: 1.28;
  letter-spacing: -0.006em;
  font-variation-settings: 'opsz' 48;
  font-feature-settings: 'kern', 'liga', 'onum';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: 100%;
  max-width: 24em;
  padding: clamp(2rem, 8vh, 7rem) clamp(1.5rem, 7vw, 6rem);
  text-wrap: pretty;
}

p { margin: 0; }
p + p { margin-top: 1.1em; }

.rise--quiet {
  margin-top: 1.7em;
  color: var(--ink-soft);
  font-size: 0.78em;
}

/* Links keep the ink; the underline carries the color, and the word takes it on hover. */
a {
  --c: var(--ink);
  color: inherit;
  white-space: nowrap;
  text-decoration: none;
  background-image: linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 92%;
  transition: color 400ms var(--ease), background-size 500ms var(--ease);
}
a:hover, a:focus-visible {
  color: var(--c);
  background-size: 100% 2px;
}
a:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 4px;
  border-radius: 1px;
}

.bcny { --c: var(--bcny); }
.tm { --c: var(--tm); }
.fb { --c: var(--fb); }
.branch { --c: var(--branch); }
.stillpoint { --c: var(--stillpoint); }
.twitter { --c: var(--twitter); }
.linkedin { --c: var(--linkedin); }

::selection { background: rgba(0, 85, 251, 0.16); }

/* Each line settles into place, one after another. */
.rise {
  opacity: 0;
  transform: translateY(0.45em);
  animation: rise 1300ms var(--ease) both;
  animation-delay: calc(240ms + var(--i, 0) * 170ms);
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
  a { transition: none; }
}
