/* achyuttiwari.com: one stylesheet for every page.
   Plain white paper, near-black ink, one monospace face. */

:root{ color-scheme:light; --bg:#ffffff; --fg:#111111; --muted:#6b6b6b; --rule:#e6e6e6; --shade:rgba(0,0,0,.16); }
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){ color-scheme:dark; --bg:#111111; --fg:#dddddd; --muted:#8a8a8a; --rule:#2a2a2a; --shade:rgba(0,0,0,.6); }
}
:root[data-theme="dark"]{ color-scheme:dark; --bg:#111111; --fg:#dddddd; --muted:#8a8a8a; --rule:#2a2a2a; --shade:rgba(0,0,0,.6); }

*{box-sizing:border-box}
html{background:var(--bg);-webkit-text-size-adjust:100%}
html:where(:focus-within){scroll-behavior:smooth}
body{
  margin:0;padding:1.5rem 1rem 6rem;background:var(--bg);color:var(--fg);
  font-family:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  font-variant-ligatures:none;font-size:14.5px;line-height:1.6;
}
main{max-width:72ch;margin:0 auto}
h1,h2,h3{font-size:inherit;font-weight:inherit;line-height:inherit;margin:0}
p{margin:1.5em 0;overflow-wrap:break-word}
a{color:inherit;text-underline-offset:2px;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:1px solid currentColor;outline-offset:2px}
::selection{background:var(--fg);color:var(--bg)}
.muted{color:var(--muted)}
em{font-style:italic}

/* ---------- Top line: home link on the left, theme switch on the right ---------- */
.top{display:flex;justify-content:space-between;align-items:baseline;min-height:1.6em;color:var(--muted)}
.top a{text-decoration:none}
.top a:hover{color:var(--fg);text-decoration:underline}
.theme{
  background:none;border:0;padding:0 0 0 1ch;margin-left:auto;cursor:pointer;
  font:inherit;font-size:1.1em;line-height:1;color:var(--muted);
}
.theme:hover{color:var(--fg)}

/* ---------- Title block ---------- */
h1{text-align:center;margin:3em 0 0;letter-spacing:.12em;font-weight:600}
.lede{text-align:center;margin:1em 0 1.5em}
.lede span{display:inline-block}
nav.links{text-align:center;margin:0 0 3.5em}
nav.links span{display:inline-block;white-space:nowrap;margin:0 .6ch}
nav.links a{text-decoration:none}
nav.links a:hover,nav.links a[aria-current="page"]{text-decoration:underline}
nav.links a[aria-current="page"]{font-weight:600}

/* ---------- Sections ---------- */
h2{margin:3.5em 0 1.5em;scroll-margin-top:1.5em;letter-spacing:.04em}
h2 a{text-decoration:none}
h2 a:hover,h2:target a{text-decoration:underline}
section > p{padding-left:3ch}

article{margin:1.75em 0;padding-left:3ch}
article .head{display:flex;justify-content:space-between;align-items:baseline}
article .head .meta{color:var(--muted);white-space:nowrap;flex:none;margin-left:2ch}
article .head .n{flex:none;width:4ch}
article .title{flex:1}
article p{margin:.5em 0 0;padding-left:4ch}
article .by{color:var(--muted)}
article .links{padding-left:4ch;margin-top:.25em;color:var(--muted)}

details{padding-left:4ch;margin-top:.25em}
summary{cursor:pointer;color:var(--muted);list-style:none;display:inline}
summary::-webkit-details-marker{display:none}
summary::before{content:"[+] "}
details[open] summary::before{content:"[−] "}
summary:hover{color:var(--fg)}
details p.abstract{padding-left:2ch;border-left:1px solid var(--rule);color:var(--muted);margin:.75em 0 0}

/* ---------- Footer ---------- */
footer{text-align:center;margin-top:4em;color:var(--muted)}
footer p{margin:.5em 0}
footer .sig{margin-top:3em;color:var(--fg)}

@media (max-width:700px){
  body{font-size:12.5px;padding-top:1rem}
  article,section > p{padding-left:0}
  article p,article .links,details{padding-left:0}
  article .head .n{width:3ch}
  article .head{flex-wrap:wrap}
  article .head .meta{width:100%;padding-left:3ch;margin-left:0}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@media print{html,body{background:#fff;color:#000}a{text-decoration:none}.theme{display:none}}
