@font-face {
  font-family: "maple";
  src: url("maple-mono-regular.ttf") format("truetype");
}

:root {
  color-scheme: dark;

  /* --fg-1: #a0a0a1; */
  --fg-1: #8c8f92;
  --fg-2: #5f5f63;
  --mg-1: #414141;
  --bg-1: #212121;
  --bg-1_5: #161616;
  --bg-2: #121212;
  --code-1: #658594;
  --code-2: #5d8260;
  --code-3: #5f87af;
  /* --code-3: var(--code-3); */
  /* font-family: Arial, Helvetica, sans-serif; */
  font-family:
    system-ui,
    -apple-system,
    sans-serif;

  --box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.35);
  --bg-img: url("bg.webp");

  --radius: 8px;

  --border_color: #303030;
  --border: 1px solid var(--border_color);

  --site-header-height: 80px;

  --padding: 1.2rem;
  --padding-site-lr: calc(var(--padding) * 2);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-2: #e0e0e1;
  --bg-1: #cecece;
  --bg-1_5: #d7d7d7;
  --border_color: #aeaeae;
  --mg-1: var(--bg-1_5);
  --fg-2: #212121;
  --fg-1: #121212;
}

.site-nav {
  display: flex;
  position: fixed;
  bottom: 1.5rem;
  font-size: 0.8rem;
  left: 1.5rem;
  gap: 0.5rem;
  /* background: var(--bg-1); */
  background: linear-gradient(
    135deg,
    rgba(37, 37, 45, 0.15),
    rgba(37, 37, 45, 0.05),
    rgba(90, 90, 90, 0.05)
  );
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);

  border: var(--border);
  /* border-radius: 999px; */
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: var(--box-shadow);
  z-index: 999;
}

.site-nav a {
  padding: 0.5rem;
  padding-bottom: 1rem;
  height: 1rem;
  width: 1rem;
  border: var(--border);
  border-radius: var(--radius);
  /* border-radius: 999px; */
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.site-nav a.active {
  background-color: var(--code-3);
  color: var(--bg-2);
}

#theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2rem !important;
  height: 2rem !important;
  font-size: 1.2rem;
  font-family: maple;
  cursor: pointer;
  color: var(--fg-1);
  padding: 0;
  padding-right: 0.2rem;
  margin: 0;
  background: linear-gradient(
    135deg,
    rgba(37, 37, 45, 0.15),
    rgba(37, 37, 45, 0.05),
    rgba(90, 90, 90, 0.05)
  );
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);

  border-radius: 999px;
  border: var(--border);
  box-shadow: var(--box-shadow);
}

#theme-toggle:hover {
  color: var(--code-3);
}

html {
  scroll-behavior: smooth;

  scroll-padding-top: 120px;
  scrollbar-width: thin;
  /* scrollbar-color: transparent transparent; */
}

html,
body {
  background-color: var(--bg-2);
  color: var(--fg-1);
  margin: 0;
  padding: 0;
}

body {
  /* padding so that sticky header is not in the way of other things*/
  margin-top: var(--site-header-height);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--padding-site-lr);
  z-index: -9;
}

@media (max-width: 768px) {
  body {
    padding-left: var(--padding-site-lr) !important;
    padding-right: var(--padding-site-lr) !important;
  }
}

section {
  min-height: 100vh;
}

section .title {
  display: flex;
  gap: 2rem;
}

section .title .icon {
  color: var(--code-3);
  align-content: center;
  justify-content: center;
  font-size: 2rem;
}
.title h2 {
  align-content: center;
}

section h2 {
  font-size: 2rem;
  padding: 0;
  padding-top: 1rem;
  margin: 0;
}

section p {
  margin-bottom: 0;
}

/* Hero gets extra height and centered text */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero .subtitle {
  max-width: 50vw;
}

@media (max-width: 768px) {
  .hero {
    transform: translateY(-70px);
  }
  .hero .subtitle {
    max-width: 80vw;
  }
}

.accent {
  position: relative;
  z-index: 0;
}

@keyframes drift {
  0% {
    transform: translate(-50%, -50%);
  }
  25% {
    transform: translate(calc(-50% + 15px), calc(-50% - 11px));
  }
  50% {
    transform: translate(calc(-50% - 13px), calc(-50% + 9px));
  }
  75% {
    transform: translate(calc(-50% + 8px), calc(-50% + 14px));
  }
  100% {
    transform: translate(-50%, -50%);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    width: 50vw;
    height: 50vw;
    filter: saturate(80%);
  }
  50% {
    width: 58vw;
    height: 58vw;
    filter: saturate(180%);
  }
}

.accent::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50vw;
  height: 50vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #5f87af22 0%, transparent 70%);
  z-index: -1;
  animation:
    drift 8s ease-in-out infinite,
    pulse-glow 7s ease-in-out infinite;
}

@media (max-width: 768px) {
  .accent::before {
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1;
    animation: none;
  }
}

:root[data-theme="light"] .accent::before {
  background: radial-gradient(circle, #5f87af55 0%, transparent 70%);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--fg-2);
  font-style: italic;
  margin-bottom: 3rem;
}

.scroll-hint {
  margin-top: 3rem;
  font-size: 1.5rem;
  color: var(--code-3);
  animation: bounce 1.6s ease-in-out infinite;
}
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

#theme-toggle:focus-visible {
  outline: 2px solid var(--code-3);
  outline-offset: 2px;
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] #theme-toggle .icon-sun {
  display: inline;
}
:root[data-theme="light"] #theme-toggle .icon-moon {
  display: inline;
}

.icon {
  font-family: maple;
  font-size: 1.2rem;
}

.header-socials .icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

select,
button {
  background-color: var(--bg-1_5);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--fg-1);
  padding: var(--padding);
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background-color: var(--mg-1);
}

hr {
  border: none;
  height: 1px;
  background: var(--bg-1);
}

code {
  font-family: maple, monospace;
  /* font-size: 0.8rem; */
}

a {
  color: var(--fg-1);
  text-decoration: none;
}

a:hover {
  color: var(--code-3);
}

header {
  /* background-color: var(--bg-1); */
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--site-header-height);
  z-index: 199;
  /* background-color: var(--bg-2); */
  background: linear-gradient(
    135deg,
    rgba(37, 37, 45, 0.15),
    rgba(37, 37, 45, 0.05),
    rgba(90, 90, 90, 0.05)
  );
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);

  border-bottom: var(--border);

  /* other */
  margin: 0;
  padding-right: var(--padding-site-lr);
  padding-left: var(--padding-site-lr);
  padding-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--box-shadow);
}

:root[data-theme="light"] header {
  box-shadow: none;
}

.site-header .left {
  display: flex;
  align-items: center;
}

.site-header .right {
  display: flex;
  align-items: center;
  gap: calc(var(--padding) * 1.5);
}

.header-socials {
  display: flex;
  align-items: center;
  padding: 0;
  gap: calc(var(--padding) * 2);
}

.site-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
}

.site-header h3:hover {
  color: var(--code-3);
}

.hamburger {
  display: none;
}

@media (max-width: 768px) {
  .site-header h3 {
    display: block;
  }

  .hamburger {
    display: block;
    margin-right: 5px;
    cursor: pointer;
    font-family: maple;
  }

  .hamburger > *,
  .hamburger {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    font-family: maple;
    font-size: 1.8rem;
  }

  .hamburger > *:hover,
  .hamburger:hover {
    background: none;
    color: var(--code-3);
  }

  .site-header:not(.open) {
    height: var(--site-header-height);
  }

  .site-header.open {
    padding-top: 20.5px;
    height: fit-content;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .site-header .right {
    align-items: start;
    display: none;
    width: 100%;
  }

  .site-header .right.open .header-socials {
    flex-direction: column;
    align-items: center;
  }

  .header-socials {
    gap: 3rem;
  }

  .site-header .right.open {
    padding: 3rem;
    font-size: 1.3rem;
    display: flex !important;
    height: fit-content;
    justify-content: center;
  }
}

/* footer ------------------------------------------------------------------ */

footer {
  display: flex;
  align-items: center;
  justify-content: center;
}
footer > * {
  color: var(--clr-fg2);
  font-size: 0.8rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
