/* RESET */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
:target { scroll-margin-block: 5ex; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3 { overflow-wrap: break-word; }
body { min-height: 100vh; }

/** CSS **/
:root {
  --gap: 14px;
  --font-small: 14px;
  --width: 575px;
  --border: 1.5px;
  --radius: 4px;
  --gray-text: rgba(0, 0, 0, 0.4);
  --gray-line: rgba(0, 0, 0, 0.2);
  --gray-bg: rgba(0, 0, 0, 0.06);
  --text: #000;
}

body { margin: 50px 0; background-color: #FDDB29; color: var(--text); }
.page { display: flex; flex-direction: column; gap: 50px; align-items: center; }

/* MENU */
.menu { width: min(var(--width), 96vw); display: flex; flex-direction: row; gap: var(--gap); color: var(--gray-text); }
.menu > li { list-style: none; }
.menu > li > a { border-color: transparent; }
.menu > li.inside > a { border-bottom: var(--border) solid var(--gray-line); }
.menu > li.selected > a,
.menu > li:hover > a { color: #000; border-bottom: var(--border) solid #000; }
.menu > .spacer { flex-grow: 1; }
.dark_mode { align-self: center; width: 50px; height: 24px; border-radius: 12px; background-image: url("/i/dark_mode.png"); background-size: 76px 24px; background-position: -26px 0; transition: 100ms; }
body.dark { background-color: #000; background-image: url(/i/flashlight.png); background-repeat: no-repeat; background-size: 500px 500px; }
body.dark .dark_mode { background-position: 0 0; }

/* CONTENT */
.content { display: flex; flex-direction: column; gap: var(--gap); align-items: center; }
.content > * { width: 96vw; max-width: var(--width); }

/* INDEX */
.starred { margin: 0 0.5em 0 -1.5em; }
.date { color: var(--gray-text); font-size: var(--font-small); margin-left: 4px; }

/* HEADERS */
.title, h1, h2, h3 { font-weight: 600; line-height: 1.1; text-wrap: balance; }
.title { font-size: 2.5em; margin-bottom: var(--gap); }
h1, h2, h3 { margin-top: calc(2 * var(--gap)); }
h1:nth-child(1):not(.title) { margin-top: 0; }
h1 { font-size: 1.7em; }
h2 { font-size: 1.4em; }
h1 + h2, h2 + h3 { margin-top: 0; }
.title + h2 { margin-top: calc(0px - var(--gap)); }

/* PARAGRAPHS */
.loud { max-width: calc(var(--width) + 60px); font-weight: 600; line-height: 1.25; text-wrap: balance; border: var(--border) solid var(--gray-line); padding: calc(2 * var(--gap)); margin: var(--gap) 0; font-size: 1.4em; text-align: center; border-radius: var(--radius); }
.foot { text-align: center; font-size: var(--font-small); font-style: italic; }
pre + .foot, figure + .foot blockquote + .foot { margin-top: -15px; }
h1 + .foot, h2 + .foot, h3 + .foot { text-align: left; color: var(--gray-text); }
.fig { margin: var(--gap) 0; max-width: calc(var(--width) + 60px); }
sup, sub { vertical-align: baseline; position: relative; font-size: .7em; line-height: 1; }
sup { bottom: 1.4ex; }
sub { top: .5ex; }
img.inline { margin: 0; display: inline-block; position: relative; top: 3px; }
.emoji { font-size: 125%; line-height: 22.5px; }

/* FIGURES */
.content > figure { width: unset; max-width: 96vw; margin: var(--gap) 0; display: flex; flex-direction: column; align-items: center; gap: var(--gap); }
.content > figure > img,
.content > figure > video,
.content > figure > iframe,
.content > figure > a > img { border-radius: var(--radius);  }
.content > figure > a { border: none; }
figcaption { max-width: var(--width); text-align: center; font-size: var(--font-small); font-style: italic; }

.hoverable { object-fit: cover; object-position: center top; height: unset; }
.hoverable.clicked { object-position: center bottom; }
@media (hover: hover) {
  .hoverable.clicked:hover { object-fit: cover; object-position: center top; }
  .hoverable:hover { object-position: center bottom; }
}

/* ANIMATION */
.anim { width: 400px; height: 250px; background-size: 100%; background-color: white; margin: 0 6px; }

/* STRONG */
strong { font-weight: 600; }

/* LINKS */
a { color: inherit; text-decoration: none; border-bottom: var(--border) solid var(--gray-line); }
a:hover { color: var(--text); border-color: var(--text); }

/* CODE */
pre, code { font-family: 'IBM Plex Mono', monospace; }
code { font-style: normal; background: var(--gray-bg); padding: 2px 6px; border-radius: 4px; font-size: 17px; }
h1 > code, h2 > code, h3 > code, h4 > code, .loud > code, .foot > code { font: inherit; }
.content > pre, blockquote > pre { max-width: calc(var(--width) + 60px); background: var(--gray-bg); margin: var(--gap) 0; padding: 16px 30px 14px; border-radius: 8px; white-space: pre-wrap; word-wrap: break-word; font-style: normal; }
pre > code { background: none; padding: 0; font-size: 16px; white-space: unset; }

/* BLOCKQUOTES */
blockquote { display: flex; flex-direction: column; gap: var(--gap); margin: var(--gap) 0; padding: 0 0 0 1em; border-left: 2px solid var(--gray-line); font-style: italic; }

/* LISTS */
.content ul, .content ol { display: flex; flex-direction: column; gap: var(--gap); padding: 0 0 0 1em; }
.content ul { list-style-type: square; }

/* FOOTNOTES */
.footnote { margin: 0 5px; }
.reversefootnote { margin: 0 5px; }
.footnotes-br { margin-top: calc(2 * var(--gap)); }
.footnotes-br_inner { width: 100px; height: var(--border); background: var(--gray-line); }

/* FOOTER */
.footer { display: flex; flex-direction: row; flex-wrap: wrap; gap: 5px; color: var(--gray-text); font-size: 16px; margin: var(--gap) 0; }

/* SUBSCRIBE */
.about { width: 96vw; max-width: calc(var(--width) + 50px); }
.about_photo { float: left; width: 100px; height: 160px; margin-left: -125px; margin-top: -10px; background: url("/i/photo.png"); background-size: 200px; }
.about_photo:hover { background-position: 100%; }
.about_inner { font-size: 16px; padding: var(--gap) 25px; border: var(--border) solid var(--gray-line); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--gap); }
.btn-subscribe { line-height: 20px; text-decoration: none; background: var(--gray-bg); border: none; font-size: 12px; padding: 0px 7px 0 2px; display: inline-block; border-radius: 4px; position: relative; top: -1px; }
.btn-subscribe:hover { background: rgba(0,0,0,0.2); }
.btn-subscribe > img { width: 21px; height: 21px; display: inline-block; vertical-align: bottom; }

/* FLASHLIGHT */
.preload::after { content: ''; background-image: url(/i/flashlight.png); }

/* POINTERS */
.pointer { width: 16px; height: 24px; position: absolute; background-image: url(/i/pointers.png); background-size: 300% 100%; transition: 200ms; transition-timing-function: ease-in-out; pointer-events: none; }
.pointer.m { background-position-x: 0; }
.pointer.w { background-position-x: -100%; }
.pointer.l { background-position-x: -200%; }
