/* pranavgarg.in: the home page and the blog. The app pages keep their own styles. */
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/familjen-grotesk-latin.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/spectral-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/spectral-400-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("fonts/spectral-500-latin.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400-latin.woff2") format("woff2"); }

:root {
  /* The studio's night ink, ivory and orange, so this site reads as the studio's sibling. */
  --paper: #0f141c; --paper-2: #17202a; --ink: #ece8dc; --ink-2: #a9b0b5; --rule: #26313b;
  --orange: #ff6a2b; --orange-hot: #ff8a57; --mint: #c0f79e;
  --link: var(--ink); --link-hot: var(--orange-hot);
  --sans: "Familjen Grotesk", system-ui, sans-serif;
  --serif: "Spectral", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; scrollbar-color: #2e3a45 var(--paper); }
body { margin: 0; font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; }
::selection { background: var(--orange); color: var(--paper); }
a { color: var(--link); text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 0.2em; transition: color 160ms ease-out, text-decoration-thickness 160ms ease-out; }
a:hover { color: var(--link-hot); text-decoration-thickness: 3px; }
:focus-visible { outline: 2px solid var(--orange-hot); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }

/* Home: the text sits over a living background. */
canvas.life { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
.scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgb(15 20 28 / .97) 0%, rgb(15 20 28 / .9) 34%, rgb(15 20 28 / .35) 58%, rgb(15 20 28 / 0) 76%); }
.has-life .home { position: relative; z-index: 2; margin: 0; max-width: 40rem; padding-left: clamp(1.25rem, 7vw, 7rem); }
.home { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: clamp(3rem, 10vh, 6rem); padding-bottom: 5rem; }
.home h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(3rem, 1.9rem + 4.6vw, 5.4rem); letter-spacing: -0.04em; line-height: 0.98; margin: 0 0 1.4rem; }
.lede { font-family: var(--sans); font-weight: 500; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 1rem; max-width: 22ch; text-wrap: balance; }
.sub { margin: 0 0 1.8rem; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }
.sub a { color: var(--ink); }
.go { list-style: none; padding: 0; margin: 0 0 2.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.55rem 1.1rem; border-radius: 999px; font: 600 1rem/1.1 var(--sans); text-decoration: none; color: var(--ink);
  border: 1.5px solid rgb(236 232 220 / .35); background: rgb(15 20 28 / .55); transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out, transform 220ms cubic-bezier(.16,1,.3,1); }
.pill:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.pill.main { background: var(--orange); border-color: var(--orange); color: #120a05; }
.pill.main:hover { background: var(--orange-hot); border-color: var(--orange-hot); color: #120a05; }
.more { margin: 0; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.55rem 1.4rem; font-size: 1.02rem; }
.more dt { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; color: var(--ink-2); padding-top: 0.12rem; }
.more dd { margin: 0; text-wrap: pretty; }
.elsewhere { list-style: none; padding: 0; margin: 2.2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-family: var(--sans); font-size: 1rem; }
.life-note { position: fixed; z-index: 2; right: clamp(1rem, 3vw, 2rem); bottom: 1.1rem; margin: 0; max-width: 27rem; display: flex; gap: 0.8rem; align-items: center;
  font: 400 0.9rem/1.4 var(--sans); color: var(--ink-2); background: rgb(15 20 28 / .82); border: 1px solid var(--rule); border-radius: 14px; padding: 0.5rem 0.9rem 0.5rem 0.5rem; }
.life-toggle { flex: none; font: 600 0.92rem/1 var(--sans); color: var(--ink); background: rgb(15 20 28 / .7); border: 1.5px solid rgb(236 232 220 / .3); border-radius: 999px; padding: 0.5rem 0.85rem; cursor: pointer; }
.life-toggle:hover { border-color: var(--ink); }
.life-toggle[hidden] { display: none; }

/* Site bar on inner pages */
.bar { display: flex; gap: 0.3rem 1.2rem; flex-wrap: wrap; align-items: baseline; padding: 1.6rem 0 0; font-family: var(--sans); font-size: 1rem; }
.bar a { color: var(--ink-2); text-decoration: none; }
.bar a:hover, .bar a[aria-current] { color: var(--ink); }
.bar .me { font-weight: 600; color: var(--ink); }

/* Blog index */
.blog-head { padding: clamp(2.5rem, 8vh, 4.5rem) 0 1.5rem; }
.blog-head h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(2.4rem, 1.7rem + 3vw, 3.6rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 0.9rem; }
.blog-head p { margin: 0; color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.year { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; color: var(--orange-hot); margin: 2.2rem 0 0.4rem; font-variant-numeric: tabular-nums; }
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { padding: 0.85rem 0 0.95rem; border-top: 1px solid var(--rule); }
.posts a { font-family: var(--sans); font-weight: 600; font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); text-wrap: balance; }
.posts a:hover { color: var(--orange-hot); }
.posts .d { display: block; font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2); margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.posts p { margin: 0.3rem 0 0; color: var(--ink-2); font-size: 1.02rem; line-height: 1.5; max-width: 62ch; text-wrap: pretty; }
.foot { margin: 3.5rem 0 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 1rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }

/* A post */
.post-head { padding: clamp(2.5rem, 8vh, 4.5rem) 0 1.6rem; }
.post-head h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 0.9rem; text-wrap: balance; }
.post-head .meta { font-family: var(--sans); font-size: 1rem; color: var(--ink-2); margin: 0; }
.post-head .origin { font-size: 1rem; color: var(--ink-2); margin: 0.5rem 0 0; text-wrap: pretty; }
.sep { color: #5d6870; margin: 0 0.3em; }
.prose { max-width: 62ch; }
.prose > * { margin-top: 0; margin-bottom: 1.1rem; }
.prose p, .prose li { text-wrap: pretty; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; margin-top: 2.4rem; margin-bottom: 0.8rem; text-wrap: balance; }
.prose h2 { font-size: 1.6rem; } .prose h3 { font-size: 1.3rem; } .prose h4 { font-size: 1.12rem; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.6rem auto; border-radius: 4px; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.5rem; margin: 1.6rem 0; }
.prose .gallery img { margin: 0; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.prose blockquote { margin-left: 0; padding-left: 1.4rem; font-style: italic; color: var(--ink-2); }
.prose hr { border: 0; text-align: center; margin: 2.4rem 0; }
.prose hr::after { content: "* * *"; color: var(--ink-2); letter-spacing: 0.5em; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--paper-2); padding: 0.1em 0.3em; border-radius: 3px; }
.prose pre { font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.prose table { border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.4rem 0.8rem 0.4rem 0; text-align: left; }
.highlight .c, .highlight .c1, .highlight .cm { color: #8b949e; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .nb { color: var(--orange-hot); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: var(--mint); }
.highlight .mi, .highlight .mf { color: #ffd28a; }
.highlight .nf, .highlight .nc { color: #8fc1ff; }

/* 404 */
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 3rem; padding-bottom: 3rem; }
.lost h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.4rem); letter-spacing: -0.035em; line-height: 1; margin: 0 0 1rem; }
.lost p { margin: 0 0 1.6rem; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }

@media (max-width: 52rem) {
  .scrim { background: linear-gradient(180deg, rgb(15 20 28 / .1) 0%, rgb(15 20 28 / .35) 30%, rgb(15 20 28 / .88) 48%, rgb(15 20 28 / .95) 100%); }
  .has-life .home { padding-left: clamp(1.25rem, 5vw, 2rem); padding-right: clamp(1.25rem, 5vw, 2rem); justify-content: flex-end; padding-top: 40svh; padding-bottom: 2rem; min-height: auto; }
  .life-note { position: relative; right: auto; bottom: auto; margin: 0 clamp(1.25rem, 5vw, 2rem) 2rem; max-width: none; font-size: 0.86rem; }
}
@media (max-width: 34rem) {
  .more { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .more dd { margin-bottom: 0.7rem; }
  .life-note span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pill { transition: none; } }
