@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --ink: #f5f5f2;
  --muted: rgba(245, 245, 242, 0.58);
  --yellow: #f6ff43;
  font-family: "Syne", "Helvetica Neue", Arial, sans-serif;
  background: #050608;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background: #050608;
}

button,
a {
  font: inherit;
}

.liquid {
  position: fixed;
  inset: -4%;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.14) 42%, rgba(0, 0, 0, 0.42)),
    url("/assets/liquid-chrome-home-v1.jpg") center / cover no-repeat;
  filter: saturate(0.76) contrast(1.12);
  transform: scale(1.04);
}

body[data-page="about"] .liquid {
  background-position: 42% center;
}

body[data-page="posts"] .liquid {
  background-position: 58% center;
}

body[data-page="contact"] .liquid {
  background-position: 68% center;
}

.liquid::before,
.liquid::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.liquid::before {
  background:
    radial-gradient(circle at var(--mx, 33%) var(--my, 28%), rgba(91, 245, 255, 0.22), transparent 12rem),
    radial-gradient(circle at calc(var(--mx, 33%) + 8%) calc(var(--my, 28%) + 2%), rgba(123, 79, 255, 0.2), transparent 15rem),
    radial-gradient(circle at calc(var(--mx, 33%) - 5%) calc(var(--my, 28%) - 5%), rgba(246, 255, 67, 0.14), transparent 10rem);
  mix-blend-mode: screen;
  opacity: 0.8;
  transition: opacity 300ms ease;
}

.liquid::after {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.05), transparent 22%, rgba(0, 0, 0, 0.18) 68%),
    radial-gradient(ellipse at center, transparent 34%, rgba(0, 0, 0, 0.44) 100%);
}

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(180px, 20vw) 1fr;
  width: 100%;
  min-height: 100svh;
  padding: clamp(24px, 4vw, 64px);
}

.gooey-nav {
  align-self: center;
  justify-self: start;
  width: 150px;
}

.gooey-nav ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gooey-nav a {
  position: relative;
  display: inline-grid;
  min-width: 96px;
  height: 36px;
  place-items: center;
  padding: 0 17px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.gooey-nav a:hover,
.gooey-nav a:focus-visible {
  color: #fff;
  outline: none;
  transform: translateX(4px);
}

.gooey-nav a.active {
  z-index: 0;
  color: #090a0b;
}

.gooey-nav a.active::before,
.gooey-nav a.active::after {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  background: var(--yellow);
  content: "";
}

.gooey-nav a.active::before {
  inset: 0;
  box-shadow: 0 0 28px rgba(246, 255, 67, 0.16);
}

.gooey-nav a.active::after {
  top: -7px;
  right: 6px;
  width: 13px;
  height: 13px;
  animation: droplet 3.8s ease-in-out infinite;
}

.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 4vh 7vw 7vh 4vw;
}

.title-wrap {
  position: relative;
  width: fit-content;
  max-width: 800px;
}

h1 {
  position: relative;
  width: fit-content;
  margin: 0;
  font-size: clamp(3.25rem, 5.55vw, 5.35rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  text-wrap: balance;
}

h1 span {
  display: block;
}

.subtitle,
.page-copy {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.subtitle {
  margin: 26px 0 0 3px;
  font-size: clamp(0.82rem, 1vw, 1rem);
}

.page-copy {
  max-width: 520px;
  margin: 27px 0 0 3px;
  font-size: clamp(0.9rem, 1.1vw, 1.08rem);
  line-height: 1.65;
}

.secondary-line {
  display: block;
  margin-top: 8px;
  color: rgba(245, 245, 242, 0.38);
}

.bolt {
  position: fixed;
  z-index: 5;
  width: 15px;
  height: 29px;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(246, 255, 67, 0.7));
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--rotate, 0deg)) scale(0.5);
}

.bolt::before {
  position: absolute;
  inset: 0;
  background: var(--yellow);
  clip-path: polygon(58% 0, 16% 53%, 48% 53%, 30% 100%, 86% 39%, 54% 39%);
  content: "";
}

.bolt.show {
  animation: flash 430ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.static-bolts {
  position: absolute;
  top: -27px;
  right: -27px;
  display: flex;
  gap: 9px;
  transform: rotate(8deg);
}

.static-bolts i {
  display: block;
  width: 7px;
  height: 15px;
  background: var(--yellow);
  clip-path: polygon(58% 0, 12% 54%, 47% 54%, 25% 100%, 88% 38%, 53% 38%);
  filter: drop-shadow(0 0 5px rgba(246, 255, 67, 0.58));
}

.static-bolts i:nth-child(2) {
  margin-top: -8px;
  transform: rotate(18deg) scale(0.75);
}

.static-bolts i:nth-child(3) {
  margin-top: 7px;
  transform: rotate(-14deg) scale(0.62);
}

.page-index {
  position: fixed;
  right: clamp(24px, 4vw, 64px);
  bottom: clamp(24px, 4vw, 64px);
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

@keyframes droplet {
  0%,
  100% {
    transform: translate(0, 0) scale(0.72);
  }
  45% {
    transform: translate(9px, -5px) scale(1);
  }
  70% {
    transform: translate(1px, 1px) scale(0.62);
  }
}

@keyframes flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--rotate)) scale(0.4);
  }
  18%,
  54% {
    opacity: 1;
  }
  36% {
    opacity: 0.32;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) rotate(var(--rotate)) scale(1.18);
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .gooey-nav {
    align-self: start;
    width: auto;
  }

  .gooey-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
  }

  .gooey-nav a {
    min-width: auto;
    height: 31px;
    padding: 0 12px;
    font-size: 10px;
  }

  .hero {
    padding: 0 4vw 12vh 1vw;
  }

  h1 {
    font-size: clamp(2.75rem, 11.8vw, 4rem);
  }

  .page-copy {
    max-width: 90%;
    font-size: 0.86rem;
  }

  .static-bolts {
    top: -22px;
    right: 0;
  }

  .page-index {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .liquid::before,
  .gooey-nav a,
  .gooey-nav a.active::after {
    animation: none;
    transition: none;
  }

  .bolt {
    display: none;
  }
}
