/* aniketvinchurkar.com
   One stylesheet, no framework. The palette has four states and the page is
   in whichever one the sky over Mumbai is in: see assets/sky.js. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/mono.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --paper: #f4eee3; --ink: #1d1a16; --soft: #675d51; --faint: #988e7e; --rule: #d8cebc;
  --accent: #c13c18; --gold: #dfa019; --wash: rgba(223,160,25,.16);
  --sky1: #c9dfe6; --sky2: #e6ebdf; --orb: #e3a21a; --ghost: rgba(29,26,22,.4);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-phase="dawn"] {
  --paper: #f7ece2; --rule: #e2cfc0; --accent: #bf4527; --gold: #e58a3c; --wash: rgba(229,138,60,.17);
  --sky1: #dcc0d6; --sky2: #f6d3b6; --orb: #f08a3e;
}
:root[data-phase="dusk"] {
  --paper: #f3e4d2; --ink: #1f1813; --soft: #6a5847; --faint: #9a8672; --rule: #dcc6ae;
  --accent: #b23314; --gold: #d9661f; --wash: rgba(217,102,31,.17);
  --sky1: #e88a55; --sky2: #f2c19b; --orb: #c9361a; --ghost: rgba(31,24,19,.42);
}
:root[data-phase="night"] {
  --paper: #12111b; --ink: #ebe3d4; --soft: #a79e8c; --faint: #777062; --rule: #2b2938;
  --accent: #f0b24a; --gold: #f0b24a; --wash: rgba(240,178,74,.13);
  --sky1: #06050c; --sky2: #171529; --orb: #efe9da; --ghost: rgba(235,227,212,.4);
  color-scheme: dark;
}
/* without JavaScript there is no sky to read, so follow the reader instead */
@media (prefers-color-scheme: dark) {
  :root:not([data-phase]) {
    --paper: #12111b; --ink: #ebe3d4; --soft: #a79e8c; --faint: #777062; --rule: #2b2938;
    --accent: #f0b24a; --gold: #f0b24a; --wash: rgba(240,178,74,.13);
    --sky1: #06050c; --sky2: #171529; --orb: #efe9da; --ghost: rgba(235,227,212,.4);
    color-scheme: dark;
  }
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(var(--sky1), var(--sky2) 16rem, var(--paper) 33rem) no-repeat var(--paper);
  background-size: 100% 33rem;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: color .6s ease, background-color .6s ease;
}

/* stars, only when it is actually night */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 26rem; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease;
  background-image:
    radial-gradient(1.2px 1.2px at 7% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 16% 52%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 24% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 41% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 7%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 74% 16%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 81% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 89% 11%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 36%, #fff 50%, transparent 51%);
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
          mask-image: linear-gradient(#000 40%, transparent);
}
:root[data-phase="night"] body::before { opacity: .55; }

/* paper grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-phase="night"] body::after { filter: invert(1); opacity: .04; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

::selection { background: var(--gold); color: #1d1a16; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.4rem; position: relative; }
.wrap > section:not(.typer), .wrap > .foot, .wrap > article, .wrap > .onward { max-width: 43rem; }

/* ---------- top strip: name, and the sky ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.4rem 0;
}
.mark {
  font-style: italic; font-size: 1.12rem; font-weight: 500; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; view-transition-name: mark;
}
.mark:hover { color: var(--accent); }

.sky { display: flex; align-items: center; gap: .7rem; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.arc { width: 104px; height: 38px; overflow: visible; display: none; }
.js .arc { display: block; }
.arc .horizon { stroke: var(--ink); stroke-width: 1; opacity: .45; fill: none; }
.arc .path { stroke: var(--ink); stroke-width: 1; opacity: .3; fill: none; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.arc .orb { fill: var(--orb); transition: cx 1s ease, cy 1s ease; }
.arc .bite { fill: var(--sky2); opacity: 0; transition: cx 1s ease, cy 1s ease; }
:root[data-moon] .arc .bite { opacity: 1; }
.clock time { font-variant-numeric: tabular-nums; }
.skybtn {
  display: none; appearance: none; font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--ink); background: transparent; border: 1px solid currentColor; border-radius: 99px;
  padding: .22rem .6rem; cursor: pointer; opacity: .75;
}
.js .skybtn { display: inline-block; }
.skybtn:hover { opacity: 1; }

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

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  background: linear-gradient(var(--wash), var(--wash)) no-repeat 0 100% / 100% 0;
  transition: background-size .18s ease; }
a:hover { background-size: 100% 100%; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }

/* ---------- the line you can type ---------- */

.typer { padding: 4.2rem 0 1.2rem; cursor: text; }
.typer .label { display: block; margin-bottom: 1.3rem; }
.typer .label b { font-weight: 500; color: var(--accent); }
.line {
  font-size: clamp(2rem, 5.4vw, 4.1rem); line-height: 1.13; font-weight: 380; letter-spacing: -.022em;
  margin: 0; min-height: 2.3em;
}
.line .w { display: inline-block; white-space: nowrap; }
.line .sp { white-space: pre-wrap; }
.line .pend { color: var(--ghost); }
.line .ok { color: var(--ink); }
.line .bad { color: var(--accent); text-decoration: underline wavy var(--accent) 2px; text-underline-offset: .12em; }
.line .sp.bad { background: var(--wash); }
.line .cur { color: var(--ghost); box-shadow: inset 3px 0 0 var(--accent); }
.typer.live .line .cur { animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { box-shadow: inset 3px 0 0 transparent; } }
.no-js-line { color: var(--ink); }
.typer-input { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.typer-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.4rem; margin-top: 1.5rem; min-height: 1.8rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--soft);
}
.typer-foot .stat b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.typer-foot .src { margin-left: auto; }
.typer-foot button {
  appearance: none; font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px;
}
.typer .verdict { font-family: var(--serif); font-style: italic; font-size: 1.15rem; letter-spacing: 0; color: var(--ink); width: 100%; }

/* ---------- the letter ---------- */

.letter { padding: 2.6rem 0 1rem; }
.letter p { margin: 0 0 1.05rem; }
.letter .hello { font-size: 1.5rem; font-style: italic; line-height: 1.3; margin-bottom: 1.2rem; }
.sig { font-style: italic; font-size: 1.45rem; margin-top: 1.6rem; }

.photo {
  float: right; width: 148px; margin: .2rem 0 1rem 1.8rem; padding: 7px 7px 26px;
  background: #fbf8f1; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 10px 24px -12px rgba(0,0,0,.45);
  transform: rotate(2.4deg); position: relative;
}
.photo img { display: block; width: 100%; height: auto; filter: saturate(.85) contrast(1.03); }
.photo::before {            /* tape */
  content: ""; position: absolute; top: -11px; left: 50%; width: 74px; height: 22px;
  transform: translateX(-50%) rotate(-3deg); background: var(--gold); opacity: .55;
}
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase; color: #6a6054; }

@media (min-width: 66rem) {
  .letter { position: relative; }
  .photo { float: none; position: absolute; left: calc(100% + 4.5rem); top: 2.9rem; width: 178px; margin: 0; }
}

/* ---------- contents ---------- */

.shelf { padding-top: 3.2rem; }
.shelf > h2 {
  display: flex; align-items: baseline; gap: .9rem; margin: 0 0 .6rem;
  font-size: 1.7rem; font-weight: 400; font-style: italic; letter-spacing: -.015em;
}
.shelf > h2 .num { font-family: var(--mono); font-style: normal; font-size: .72rem; letter-spacing: .12em; color: var(--accent); }
.shelf > .aside { color: var(--soft); margin: 0 0 1rem; font-size: .98rem; }

.toc { list-style: none; margin: 0; padding: 0; }
.toc li { padding: 1.05rem 0 1.1rem; border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc a { display: flex; align-items: baseline; gap: .7rem; text-decoration: none; background: none; }
.toc .t { font-size: 1.42rem; line-height: 1.25; letter-spacing: -.012em; transition: color .15s ease; }
.toc .dots { flex: 1 1 2rem; min-width: 1.5rem; border-bottom: 2px dotted var(--faint); transform: translateY(-.32em); opacity: .7; }
.toc .k { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); white-space: nowrap; }
.toc a:hover .t { color: var(--accent); }
.toc a:hover .dots { border-color: var(--accent); opacity: 1; }
.toc p { margin: .3rem 0 0; color: var(--soft); font-size: 1rem; line-height: 1.5; max-width: 36rem; }

/* ---------- where I've been ---------- */

.path { list-style: none; margin: 0; padding: 0; }
.path li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.path li:last-child { border-bottom: 1px solid var(--rule); }
.path .y { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--soft); padding-top: .42rem; }
.path b { font-weight: 550; }
.path span.d { color: var(--soft); }

/* ---------- write to me ---------- */

.reach .big { font-size: clamp(1.25rem, 3.6vw, 2rem); font-style: italic; letter-spacing: -.015em; word-break: break-word; }
.reach ul { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; margin: 1.1rem 0 0; padding: 0;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- foot ---------- */

.foot { margin-top: 5rem; padding: 2.2rem 0 4rem; border-top: 1px solid var(--rule); color: var(--soft); font-size: .98rem; }
.foot .end { font-style: italic; font-size: 1.2rem; color: var(--ink); margin: 0 0 .6rem; }
.foot p { margin: 0 0 .5rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin-top: 1.3rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.foot .tended { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 1.4rem; }

/* ---------- a piece of writing ---------- */

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }

.piece { padding-top: 4.6rem; }
.piece header .label { display: block; margin-bottom: 1.1rem; }
.piece header .label b { color: var(--accent); font-weight: 500; }
.piece h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.07; font-weight: 400; letter-spacing: -.025em; margin: 0 0 1.2rem; }
.piece .standfirst { font-size: 1.36rem; line-height: 1.42; font-style: italic; color: var(--soft); margin: 0 0 1.5rem; max-width: 36rem; }
.piece .meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
  padding-top: .9rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }

.body { padding-top: 2.4rem; font-size: 1.06rem; }
.body p { margin: 0 0 1.2rem; }
.body.lead > p:first-child::first-letter {
  float: left; font-size: 4.25em; line-height: .82; font-weight: 500; padding: .08em .1em 0 0; color: var(--accent);
}
.body h2 { font-size: 1.62rem; line-height: 1.2; font-weight: 450; font-style: italic; letter-spacing: -.015em; margin: 3rem 0 .9rem; }
.body h2::before { content: "§"; font-style: normal; font-family: var(--mono); font-size: .8rem; color: var(--accent); margin-right: .7rem; vertical-align: .22em; }
.body h2.person { font-style: normal; font-size: 2rem; font-weight: 420; margin-top: 3.6rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); }
.body h2.person::before { content: none; }
.body .dek { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin: -.3rem 0 1.3rem; line-height: 1.6; }
.body h3 { font-size: 1.12rem; font-weight: 600; margin: 2rem 0 .5rem; }
.body ul, .body ol { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.body li { margin-bottom: .5rem; padding-left: .2rem; }
.body li::marker { color: var(--accent); }
.body strong { font-weight: 600; }
.body blockquote { margin: 2.2rem 0; padding: 0 0 0 1.4rem; border-left: 3px solid var(--accent);
  font-size: 1.6rem; line-height: 1.3; font-style: italic; letter-spacing: -.01em; }
.body hr { border: 0; margin: 2.8rem auto; text-align: center; }
.body hr::after { content: "·  ·  ·"; font-family: var(--mono); color: var(--accent); letter-spacing: .3em; }
.body .callout { margin: 2rem 0; padding: 1.15rem 1.3rem; background: var(--wash); border-left: 3px solid var(--gold); font-size: 1rem; line-height: 1.55; }
.body .callout p:last-child { margin-bottom: 0; }
.body .footnote { font-size: .92rem; color: var(--soft); line-height: 1.55; }

.onward { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 3.6rem; padding-top: 1.3rem; border-top: 1px solid var(--rule); }
.onward a { text-decoration: none; background: none; display: block; }
.onward .next { text-align: right; grid-column: 2; }
.onward .dir { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--soft); margin-bottom: .25rem; }
.onward .ttl { font-size: 1.2rem; font-style: italic; line-height: 1.3; }
.onward a:hover .ttl { color: var(--accent); }

/* lines list on the typing page */
.lines { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.lines li { padding: 1rem 0; border-top: 1px solid var(--rule); font-size: 1.22rem; line-height: 1.35; font-style: italic; }
.lines li small { display: block; font-style: normal; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); margin-top: .45rem; }

@media (max-width: 40rem) {
  body { font-size: 17.5px; }
  .top { padding-top: 1.1rem; }
  .mark { white-space: nowrap; font-size: 1.05rem; }
  .sky { gap: .45rem; font-size: .62rem; }
  .sky .city { display: none; }
  .arc { width: 50px; height: 19px; }
  .skybtn { white-space: nowrap; padding: .2rem .5rem; }
  .typer { padding-top: 3rem; }
  .typer-foot .src { margin-left: 0; width: 100%; }
  .photo { width: 112px; margin: .2rem -.2rem .8rem 1.1rem; }
  .toc a { flex-wrap: wrap; }
  .toc .dots { display: none; }
  .toc .k { width: 100%; order: -1; margin-bottom: .15rem; }
  .path li { grid-template-columns: 1fr; gap: 0; }
  .path .y { padding-top: 0; }
  .onward { grid-template-columns: 1fr; }
  .onward .next { grid-column: 1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
}
