/*
    Hey there! ^^

    If interested, the theme switching idea is based on https://jzhao.xyz/ (2026-04)
*/
:root {
  --darkgray: #333;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: none;
  overflow-x: hidden;
  width: 100vw;
}

body {
  margin: 0;
  box-sizing: border-box;
  position: relative;
  min-height: 100vh;
  font-synthesis: style;
}

main {
  isolation: isolate;
}

[saved-theme=dark] body.animation-ready main {
  --animation-name: fade2;
}
[saved-theme=light] body.animation-ready main {
  --animation-name: fade;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(1) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.5s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(2) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.6s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(3) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.7s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(4) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.8s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(5) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.9s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(6) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(7) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.1s;
}
body.animation-ready main > *:nth-child(1) > *:nth-child(8) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.2s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(1) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 0.9s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(2) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(3) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.1s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(4) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.2s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(5) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.3s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(6) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.4s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(7) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.5s;
}
body.animation-ready main > *:nth-child(2) > *:nth-child(8) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.6s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(1) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.3s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(2) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.4s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(3) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.5s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(4) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.6s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(5) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.7s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(6) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.8s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(7) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.9s;
}
body.animation-ready main > *:nth-child(3) > *:nth-child(8) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(1) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.7s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(2) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.8s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(3) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 1.9s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(4) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(5) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2.1s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(6) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2.2s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(7) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2.3s;
}
body.animation-ready main > *:nth-child(4) > *:nth-child(8) {
  animation: var(--animation-name) 2s ease 1 normal backwards;
  animation-delay: 2.4s;
}

@keyframes fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes fade2 {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
#dappled-light {
  animation-duration: 0s;
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  pointer-events: none;
  position: fixed;
  height: 100%;
  width: 100%;
  isolation: isolate;
  --day: #fffdfa;
  --evening: #fccc83;
  --dusk: #db7a2a;
  --night: #0f131c;
  --dawn: #16132b;
  --morning: #9fb3bf;
  --shadow: #1a1917;
  --bounce-light: #fffffc;
  --timing-fn: cubic-bezier(0.455, 0.19, 0, 0.985);
}
body.animation-ready #dappled-light {
  animation-play-state: running;
  animation-duration: 1s;
  animation-name: sunrise;
}
[saved-theme=dark] body.animation-ready #dappled-light {
  animation-duration: 1.5s;
  animation-name: sunset;
}
[saved-theme=dark] #dappled-light {
  --shadow: #030307;
  --bounce-light: #1b293f;
}
#dappled-light > #progressive-blur {
  position: absolute;
  height: 100%;
  width: 100%;
}
#dappled-light > #progressive-blur > div {
  position: absolute;
  height: 100%;
  width: 100%;
  backdrop-filter: blur(var(--blur-amount));
  mask-image: linear-gradient(252deg, transparent, transparent var(--stop1), black var(--stop2), black);
}
#dappled-light > #progressive-blur > div:nth-child(1) {
  --blur-amount: 8px;
  --stop1: 0%;
  --stop2: 0%;
}
#dappled-light > #progressive-blur > div:nth-child(2) {
  --blur-amount: 72px;
  --stop1: 30%;
  --stop2: 60%;
}
#dappled-light #glow {
  position: absolute;
  background: linear-gradient(309deg, var(--bounce-light), var(--bounce-light) 20%, transparent);
  transition: background 1s var(--timing-fn);
  height: 100%;
  width: 100%;
  opacity: 0.5;
}
#dappled-light #glow-bounce {
  content: "";
  position: absolute;
  background: linear-gradient(355deg, var(--bounce-light) 0%, transparent 30%, transparent 100%);
  transition: background 1s var(--timing-fn);
  opacity: 0.5;
  height: 100%;
  width: 100%;
  bottom: 0;
}
#dappled-light > .perspective {
  position: absolute;
  transition: transform 1.7s var(--timing-fn), opacity 4s ease;
  top: -30vh;
  right: 0;
  width: 80vw;
  height: 130vh;
  opacity: 0.07;
  background-blend-mode: darken;
  transform-origin: top right;
  transform-style: preserve-3d;
  transform: matrix3d(0.75, -0.0625, 0, 0.0008, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
[saved-theme=dark] #dappled-light > .perspective {
  opacity: 0.3;
  transform: matrix3d(0.8333, 0.0833, 0, 0.0003, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
#dappled-light #leaves {
  position: absolute;
  background-size: cover;
  background-repeat: no-repeat;
  bottom: 0px;
  right: -600px;
  width: 1600px;
  height: 1400px;
  background-image: url("/assets/images/leaves.png");
  perspective: 400px;
  animation: billow 8s ease-in-out infinite;
}
#dappled-light #blinds {
  position: relative;
  width: 100%;
}
#dappled-light #blinds .shutter, #dappled-light #blinds .bar {
  background-color: var(--shadow);
}
#dappled-light #blinds .shutter {
  width: 100%;
  height: 40px;
  transition: height 1s var(--timing-fn);
}
[saved-theme=dark] #dappled-light #blinds .shutter {
  height: 80px;
}
#dappled-light #blinds .shutters {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 60px;
  transition: gap 1s var(--timing-fn);
}
[saved-theme=dark] #dappled-light #blinds .shutters {
  gap: 20px;
}
#dappled-light #blinds > .vertical {
  top: 0;
  position: absolute;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-around;
}
#dappled-light #blinds > .vertical > .bar {
  width: 12px;
  height: 100%;
}

@keyframes sunrise {
  0% {
    background-color: var(--night);
  }
  10% {
    background-color: var(--dawn);
  }
  35% {
    background-color: var(--morning);
  }
  100% {
    background-color: var(--day);
  }
}
@keyframes sunset {
  0% {
    background-color: var(--day);
  }
  30% {
    background-color: var(--evening);
  }
  60% {
    background-color: var(--dusk);
  }
  90% {
    background-color: var(--dawn);
  }
  100% {
    background-color: var(--night);
  }
}
@keyframes billow {
  0% {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
  18% {
    transform: rotateX(1deg) rotateY(2deg) scale(1.03);
  }
  32% {
    transform: rotateX(-4deg) rotateY(-2deg) scale(0.96);
  }
  66% {
    transform: rotateX(3deg) rotateY(-1deg) scale(1.04);
  }
  100% {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
}
.darkmode {
  cursor: pointer;
  padding: 0;
  position: relative;
  background: none;
  border: none;
  width: 20px;
  height: 32px;
  margin: 0;
  text-align: inherit;
  flex-shrink: 0;
}
.darkmode svg {
  position: absolute;
  width: 20px;
  height: 20px;
  top: calc(50% - 10px);
  fill: var(--darkgray);
  transition: opacity 0.1s ease;
}

:root[saved-theme=dark] {
  color-scheme: dark;
}

:root[saved-theme=light] {
  color-scheme: light;
}

:root[saved-theme=dark] .darkmode > .dayIcon {
  display: none;
}
:root[saved-theme=dark] .darkmode > .nightIcon {
  display: inline;
}

:root .darkmode > .dayIcon {
  display: inline;
}
:root .darkmode > .nightIcon {
  display: none;
}
