/* 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; }

/** CSS **/
:root {
  --cap-height: calc(1rem * 12.5 / 16);
  --cap-ratio: calc(1 / 0.698);

  --gap: var(--cap-height);
  --font-smaller: calc(var(--cap-height) * 11 / 12 * var(--cap-ratio));
  --font-small: calc(var(--cap-height) * 10 / 12 * var(--cap-ratio));
  --width: 575px;
  --border: 1.5px;
  --radius: calc(var(--cap-height) / 3);
  --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;
  --bg: #FDDB29;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  font-size: calc(var(--cap-height) * var(--cap-ratio));
  line-height: 1.5;
  font-family: 'IBM Plex Sans', sans-serif;
  font-feature-settings: "kern" 1,"liga" 1,"calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media only screen and (max-device-width: 480px) {
  :root { --cap-height: calc(1rem * 18 / 16); }
}

body.winter { --bg: #6ADCFF; }

body, .page { min-height: calc(100svh - var(--gap) * 8); }
body { margin: calc(var(--gap) * 4) 0; background-color: var(--bg); color: var(--text); }
.page { display: flex; flex-direction: column; gap: calc(var(--gap) * 4); align-items: center; }

/* MENU */
.menu { width: min(var(--width), 96vw); display: flex; flex-direction: row; align-items: center; 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; }
div.winter { width: 26px; height: 26px; background-image: url("/i/snow.svg"); opacity: .3; cursor: pointer; }
body.winter div.winter { opacity: 1; }
.dark_mode, #darkModeGlow { align-self: center; width: 26px; height: 26px; border-radius: 13px; background-image: url("/i/dark_mode.svg"); background-size: 52px 52px; transition: background-position-x 100ms; cursor: pointer; }
.dark_mode { opacity: .3; }
.dark_mode:hover, body.dark .dark_mode { opacity: 1; }
body.dark .dark_mode { background-position: -26px 0; }
#darkModeGlow { background-position: -26px -26px; background-color: #15FB1F; box-shadow: 0 0 10px 1.5px #15FB1F; z-index: 20; opacity: 0; position: absolute; }
body.dark #darkModeGlow { opacity: 1; }
@media (any-hover: none) {
  .dark_mode, #darkModeGlow { display: none; }
}
.hamburger { position: relative; }
.hamburger input { display: none; }
.hamburger label { display: block; width: 32px; height: 32px; background-image: url("/i/hamburger.svg"); background-size: 100%; opacity: .3; cursor: pointer; border: none; }
.hamburger label:hover,
.hamburger input:checked ~ label { opacity: 1; }
.hamburger ul { display: none; position: absolute; margin: 0.5em -0.5em 0 0; right: 0; background: var(--bg); padding: 0.375em 0; box-shadow: 0 0 0 1.5px #00000030, 4.5px 4.5px 3px #00000030; border-radius: 4px; }
.hamburger input:checked ~ ul { display: block; }
.hamburger li { list-style: none; white-space: nowrap; }
.hamburger a { border: none; display: block; padding: 0.125em 1.125em; color: #000; }
.hamburger a:hover { background: #00000020; }
.hamburger a.selected:before { content: '> '; }

/* CONTENT */
.cover { width: 100%; display: flex; flex-direction: column; align-items: center; }
.cover > img { width: auto; max-height: 50svh; }
.content { margin-top: calc(var(--cap-height) * 2); }
.cover + .content { margin-top: 0; }
.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; }
@media only screen and (max-device-width: 480px) {
  .starred { margin: 0 0.5em 0 0; }
}
.date { color: var(--gray-text); font-size: var(--font-small); margin-left: calc(var(--cap-height) / 3); }

/* HEADERS */
.title, h1, h2, h3 { font-weight: 600; line-height: 1.1; text-wrap: balance; }
.title { font-size: 2.5em; margin: 0 0 var(--gap) 0; }
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: var(--font-smaller); }
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: var(--font-small); 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; }

/* BUTTON */
button {
  height: 48px;
  padding: 0 1.4rem;

  background: linear-gradient(#FFFFFF20 45%, #FFFFFF00 55%),
              linear-gradient(#FFFFFF20 0%, #FFFFFF00 100%),
              #303030;
  background-blend-mode: overlay, normal, normal;
  box-shadow: #304050FF 0px 0px 0px 1px,
              #FFFFFF20 0px 1px inset,
              #00000080 0px 2px 6px;
  
  outline: 2px solid transparent;
  outline-offset: 2px;

  color: #EEE;
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
  border-radius: .5rem;
  border: 0 solid #d9d9de;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  gap: 1rem;
}

@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

button > img { display: inline-block; animation: rotate360 0.8s linear infinite; }

button:hover,
button:active {
  transition-duration: .3s;
  transition-timing-function: cubic-bezier(.4,.36,0,1);
  transition-property: background-color,box-shadow;
}

button:hover {
  background: linear-gradient(#FFFFFF28 45%, #FFFFFF00 55%),
              linear-gradient(#FFFFFF28 0%, #FFFFFF00 100%),
              #383838;
  box-shadow: #405060FF 0px 0px 0px 1px,
              #FFFFFF20 0px 1px inset,
              #00000080 0px 2px 8px;
}

button:active, button[disabled] {
  background: linear-gradient(#FFFFFF20 45%, #FFFFFF00 55%),
              /* linear-gradient(#FFFFFF20 0%, #FFFFFF00 100%), */
              #303030;
  box-shadow: #405060FF 0px 0px 0px 1px,
              #FFFFFF05 0px 1px inset,
              #00000080 0px 2px 0px;
}

/* SUBSCRIBE */
.about { width: 96vw; max-width: calc(var(--width) + 50px); }
.about_photo { float: left; width: 125px; height: 160px; margin-left: -150px; margin-top: -10px; background-image: url("/i/photo.webp"); background-size: 250px; background-blend-mode: multiply; background-color: var(--bg); }
body.winter .about_photo { background-image: url("/i/photo_winter.webp"); }
.about_photo:hover { background-position: 100%; }
.about_inner { font-size: var(--font-small); padding: var(--gap) 25px; border: var(--border) solid var(--gray-line); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--gap); }
.btn-action { text-decoration: none; background: var(--gray-bg); border: none; padding: 0px 7px; display: inline-block; border-radius: 4px; }
.btn-action:hover { background: rgba(0,0,0,0.2); }

/* FLASHLIGHT */
#flashlight { display: none; width: 500px; height: 500px; pointer-events: none; z-index: 10; transition-duration: .75s; transition-timing-function: cubic-bezier(.4,.36,0,1); transition-property: opacity; }
body.dark0 #flashlight,
body.dark #flashlight { display: block; position: fixed; box-shadow: 0 0 0 9999px #000; }
body.dark0 #flashlight { opacity: 0; }
body.dark #flashlight { opacity: 1; }

/* 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%; }

/* SNOW */
.snowflake { border-radius: 50%; background: #FFF; }
@keyframes snow-fall {to{top: calc(100vh + 200px);}}
@keyframes snow-right {to{left: -100vw;}}
@keyframes snow-left {to{left: 100vw;}}