:root {
  color-scheme: only light;
  --sky-top: oklch(0.78 0.17 58);
  --sky-mid: oklch(0.71 0.2 42);
  --sky-low: oklch(0.66 0.18 22);
  --sun-core: oklch(0.88 0.18 88);
  --sun-edge: oklch(0.75 0.19 46);
  --cloud: oklch(0.95 0.03 92);
  --ocean-far: oklch(0.55 0.16 210);
  --ocean-mid: oklch(0.5 0.18 220);
  --ocean-near: oklch(0.43 0.16 226);
  --foam: oklch(0.91 0.03 190);
  --sand: oklch(0.74 0.11 78);
  --sand-deep: oklch(0.67 0.11 74);
  --sand-wet: oklch(0.59 0.08 70);
  --shell: oklch(0.91 0.05 76);
  --shell-shadow: oklch(0.72 0.06 54);
  --ink: oklch(0.24 0.04 264);
  --panel: oklch(0.91 0.03 72 / 0.84);
  --panel-stroke: oklch(0.47 0.09 24);
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --frame-radius: 1.75rem;
  --pixel-shadow:
    0 0 0 4px oklch(0.27 0.04 270),
    0 0 0 8px oklch(0.85 0.03 78 / 0.38),
    0 1.5rem 0 0 oklch(0.24 0.04 270 / 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, oklch(0.83 0.13 82 / 0.5), transparent 28%),
    radial-gradient(circle at 80% 12%, oklch(0.75 0.14 28 / 0.4), transparent 24%),
    linear-gradient(180deg, oklch(0.83 0.12 84), oklch(0.64 0.14 50));
  font-family: "Familjen Grotesk", sans-serif;
  color: var(--ink);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0 49%, oklch(0.96 0.01 70 / 0.08) 49% 51%, transparent 51% 100%),
    linear-gradient(90deg, oklch(0.28 0.04 265 / 0.05), transparent 12%, transparent 88%, oklch(0.28 0.04 265 / 0.05));
  background-size: 100% 0.45rem, 100% 100%;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.scene-shell {
  width: 100%;
}

.scene-frame {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 40%, var(--sky-low) 61%, var(--sand) 61%, var(--sand) 100%);
  isolation: isolate;
}

.sky-grid,
.sky-grid::before {
  position: absolute;
  inset: 0;
  content: "";
}

.sky-grid {
  background-image:
    linear-gradient(transparent 0 94%, oklch(0.95 0.02 92 / 0.18) 94% 100%),
    linear-gradient(90deg, transparent 0 94%, oklch(0.95 0.02 92 / 0.12) 94% 100%);
  background-size: 6rem 6rem;
  opacity: 0.32;
  transform: perspective(50rem) rotateX(70deg) translateY(-36%);
  transform-origin: top center;
}

.sky-grid::before {
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, oklch(0.28 0.04 270 / 0.08));
}

.sun {
  position: absolute;
  inset: 9% auto auto 50%;
  width: clamp(10rem, 18vw, 16rem);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, var(--sun-core) 0 55%, var(--sun-edge) 55% 62%, var(--sun-core) 62% 72%, var(--sun-edge) 72% 78%, transparent 78% 100%);
  clip-path: polygon(8% 14%, 16% 14%, 16% 8%, 84% 8%, 84% 14%, 92% 14%, 92% 22%, 98% 22%, 98% 78%, 92% 78%, 92% 86%, 84% 86%, 84% 92%, 16% 92%, 16% 86%, 8% 86%, 8% 78%, 2% 78%, 2% 22%, 8% 22%);
  box-shadow:
    0 0 0 4px oklch(0.27 0.04 270),
    0 0 2.8rem oklch(0.91 0.13 85 / 0.5);
  z-index: 1;
  animation: hover-sun 8s steps(8) infinite;
}

.cloud {
  position: absolute;
  width: 9rem;
  height: 3.5rem;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 14' shape-rendering='crispEdges'><rect x='8' y='4' width='2' height='1' fill='%232a1f3d'/><rect x='10' y='3' width='3' height='1' fill='%232a1f3d'/><rect x='13' y='2' width='4' height='1' fill='%232a1f3d'/><rect x='17' y='1' width='4' height='1' fill='%232a1f3d'/><rect x='21' y='2' width='3' height='1' fill='%232a1f3d'/><rect x='24' y='3' width='2' height='1' fill='%232a1f3d'/><rect x='26' y='4' width='2' height='1' fill='%232a1f3d'/><rect x='28' y='5' width='2' height='1' fill='%232a1f3d'/><rect x='4' y='5' width='2' height='1' fill='%232a1f3d'/><rect x='6' y='4' width='2' height='1' fill='%232a1f3d'/><rect x='2' y='6' width='2' height='1' fill='%232a1f3d'/><rect x='1' y='7' width='1' height='3' fill='%232a1f3d'/><rect x='30' y='6' width='2' height='1' fill='%232a1f3d'/><rect x='32' y='7' width='1' height='3' fill='%232a1f3d'/><rect x='2' y='10' width='1' height='1' fill='%232a1f3d'/><rect x='31' y='10' width='1' height='1' fill='%232a1f3d'/><rect x='3' y='11' width='28' height='1' fill='%232a1f3d'/><rect x='2' y='7' width='1' height='3' fill='%23f8f5ec'/><rect x='3' y='6' width='3' height='5' fill='%23f8f5ec'/><rect x='6' y='5' width='2' height='6' fill='%23f8f5ec'/><rect x='8' y='5' width='2' height='6' fill='%23f8f5ec'/><rect x='10' y='4' width='3' height='7' fill='%23f8f5ec'/><rect x='13' y='3' width='4' height='8' fill='%23f8f5ec'/><rect x='17' y='2' width='4' height='9' fill='%23f8f5ec'/><rect x='21' y='3' width='3' height='8' fill='%23f8f5ec'/><rect x='24' y='4' width='2' height='7' fill='%23f8f5ec'/><rect x='26' y='5' width='2' height='6' fill='%23f8f5ec'/><rect x='28' y='6' width='2' height='5' fill='%23f8f5ec'/><rect x='30' y='7' width='2' height='4' fill='%23f8f5ec'/><rect x='4' y='9' width='27' height='2' fill='%23e9d9c4'/></svg>");
  filter: drop-shadow(0 0.35rem 0 oklch(0.55 0.09 28 / 0.28));
  image-rendering: pixelated;
  z-index: 2;
  animation: drift 28s ease-in-out infinite;
}

.cloud span {
  display: none;
}

.cloud-a {
  top: 32%;
  left: 7%;
}

.cloud-b {
  top: 40%;
  right: 10%;
  width: 7rem;
  height: 2.75rem;
  animation-duration: 34s;
  animation-direction: reverse;
  opacity: 0.92;
}

.gulls {
  position: absolute;
  top: 18%;
  left: 50%;
  display: flex;
  gap: 1.75rem;
  transform: translateX(-50%);
  z-index: 2;
}

.gulls span {
  width: 1.4rem;
  height: 0.7rem;
  border-top: 4px solid oklch(0.29 0.05 268 / 0.8);
  border-radius: 999px 999px 0 0;
  transform: rotate(var(--tilt, 0deg));
}

.gulls span:nth-child(1) {
  --tilt: -10deg;
}

.gulls span:nth-child(3) {
  --tilt: 14deg;
}

.masthead {
  position: absolute;
  top: clamp(1.25rem, 3vw, 2.5rem);
  left: clamp(1rem, 4vw, 3rem);
  display: grid;
  gap: var(--space-md);
  width: fit-content;
  max-width: calc(100% - clamp(2rem, 8vw, 6rem));
  padding: clamp(0.85rem, 1vw, 1rem) clamp(1.4rem, 2.4vw, 2.2rem) clamp(0.85rem, 1vw, 1rem) clamp(1rem, 1.8vw, 1.4rem);
  background: var(--panel);
  border: 4px solid var(--panel-stroke);
  box-shadow: 0 0.8rem 0 oklch(0.33 0.06 32 / 0.24);
  z-index: 5;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: clamp(2rem, 3vw, 2.6rem);
  height: auto;
  display: block;
}

.masthead h1 {
  margin: 0;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: oklch(0.22 0.04 272);
  text-shadow:
    0.2rem 0 0 oklch(0.89 0.16 85),
    0.4rem 0.2rem 0 oklch(0.64 0.18 25);
}

.waterline {
  position: absolute;
  inset: 50% 0 20% 0;
  z-index: 1;
}

.ocean {
  position: absolute;
  inset-inline: 0;
  image-rendering: pixelated;
}

.ocean-back {
  inset-block-start: 0;
  height: 28%;
  background:
    repeating-linear-gradient(
      180deg,
      oklch(0.66 0.13 201) 0 0.65rem,
      var(--ocean-far) 0.65rem 1.25rem,
      oklch(0.6 0.14 205) 1.25rem 1.7rem
    );
}

.ocean-mid {
  inset-block-start: 22%;
  height: 32%;
  background:
    repeating-linear-gradient(
      180deg,
      oklch(0.58 0.17 210) 0 0.9rem,
      var(--ocean-mid) 0.9rem 1.6rem,
      oklch(0.51 0.16 215) 1.6rem 2.25rem
    );
}

.ocean-front {
  inset-block-end: 0;
  height: 52%;
  background:
    repeating-linear-gradient(
      180deg,
      oklch(0.47 0.16 219) 0 1.1rem,
      var(--ocean-near) 1.1rem 2rem,
      oklch(0.39 0.15 228) 2rem 2.5rem
    );
}

.foam {
  position: absolute;
  height: 0.35rem;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 1.6rem,
      oklch(0.93 0.03 190 / 0.55) 1.6rem 2.4rem,
      transparent 2.4rem 4rem
    );
  image-rendering: pixelated;
}

.foam-a {
  top: 24%;
  inset-inline: 18% 12%;
  animation: surf 5s steps(6) infinite;
}

.foam-b {
  top: 58%;
  inset-inline: 10% 18%;
  animation: surf 7s steps(7) infinite reverse;
}

.shore {
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(180deg, var(--sand) 0%, var(--sand-deep) 100%);
  z-index: 4;
}

.wet-sand {
  position: absolute;
  inset: 0 0 auto 0;
  height: 38%;
  background:
    linear-gradient(
      180deg,
      var(--sand-wet) 0%,
      oklch(0.63 0.09 72) 70%,
      var(--sand) 100%
    );
}

.wet-sand::after {
  content: "";
  position: absolute;
  inset: 35% 0 0 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 16' shape-rendering='crispEdges'><rect x='4' y='3' width='2' height='2' fill='%23ffffff' fill-opacity='0.85'/><rect x='12' y='6' width='2' height='2' fill='%23ffffff' fill-opacity='0.7'/><rect x='20' y='2' width='2' height='2' fill='%23ffffff' fill-opacity='0.85'/><rect x='28' y='8' width='2' height='2' fill='%23ffffff' fill-opacity='0.6'/><rect x='36' y='4' width='2' height='2' fill='%23ffffff' fill-opacity='0.8'/><rect x='44' y='7' width='2' height='2' fill='%23ffffff' fill-opacity='0.65'/><rect x='52' y='3' width='2' height='2' fill='%23ffffff' fill-opacity='0.85'/><rect x='60' y='6' width='2' height='2' fill='%23ffffff' fill-opacity='0.7'/></svg>");
  background-size: 12rem 3rem;
  background-repeat: repeat-x;
  opacity: 0.85;
  animation: wash-front 11s linear infinite;
}

.wave {
  position: absolute;
  inset-inline: -10%;
  background-repeat: repeat-x;
  image-rendering: pixelated;
}

.wave-back {
  top: -2.6rem;
  height: 3.6rem;
  background-size: 10rem 3.6rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12' preserveAspectRatio='none' shape-rendering='crispEdges'><rect x='0' y='9' width='40' height='3' fill='%23bfe8f0'/><rect x='8' y='0' width='4' height='2' fill='%23bfe8f0'/><rect x='6' y='2' width='8' height='2' fill='%23bfe8f0'/><rect x='5' y='4' width='10' height='2' fill='%23bfe8f0'/><rect x='4' y='6' width='12' height='3' fill='%23bfe8f0'/><rect x='28' y='4' width='4' height='2' fill='%23bfe8f0'/><rect x='26' y='6' width='8' height='3' fill='%23bfe8f0'/></svg>");
  animation: wash-back 11s linear infinite;
  opacity: 0.95;
}

.wave-front {
  top: -1.2rem;
  height: 2.4rem;
  background-size: 7rem 2.4rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 8' preserveAspectRatio='none' shape-rendering='crispEdges'><rect x='0' y='6' width='28' height='2' fill='%23ffffff'/><rect x='5' y='0' width='4' height='2' fill='%23ffffff'/><rect x='3' y='2' width='8' height='2' fill='%23ffffff'/><rect x='2' y='4' width='10' height='2' fill='%23ffffff'/><rect x='18' y='2' width='4' height='2' fill='%23ffffff'/><rect x='17' y='4' width='6' height='2' fill='%23ffffff'/></svg>");
  animation: wash-front 8s linear infinite reverse;
}

.beach-texture {
  position: absolute;
  inset: 35% 0 0 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'><rect x='3' y='5' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='11' y='2' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='18' y='9' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='25' y='6' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='7' y='14' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='15' y='19' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='22' y='22' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='29' y='15' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='4' y='25' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='12' y='28' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/><rect x='20' y='30' width='1' height='1' fill='%23a07640' fill-opacity='0.35'/></svg>");
  background-size: 4rem 4rem;
  opacity: 0.7;
}

.shell {
  position: absolute;
  right: 16%;
  bottom: 12%;
  width: clamp(5rem, 7vw, 7rem);
  height: auto;
  filter: drop-shadow(0.2rem 0.35rem 0 oklch(0.5 0.08 64 / 0.45));
  transform: rotate(-6deg);
}

.projects {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: flex-end;
  justify-content: flex-start;
  z-index: 5;
}

.project {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.project-link {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  outline-offset: 6px;
}

.project-link:focus-visible {
  outline: 3px solid oklch(0.43 0.16 226);
}

.project-tile {
  width: clamp(4.5rem, 7vw, 6.5rem);
  aspect-ratio: 1;
  padding: 0.4rem;
  background: oklch(0.92 0.04 78);
  border: 4px solid oklch(0.27 0.04 270);
  box-shadow:
    0 0 0 4px oklch(0.92 0.04 78),
    0 0 0 8px oklch(0.27 0.04 270),
    0.35rem 0.5rem 0 0 oklch(0.5 0.08 64 / 0.45);
  image-rendering: pixelated;
  transition: transform 180ms ease-out;
}

.project:hover .project-tile {
  transform: translateY(-0.35rem);
}

.project-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.project-name {
  font-family: "Press Start 2P", cursive;
  font-size: clamp(0.7rem, 1vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: oklch(0.22 0.04 272);
  text-shadow: 0.12rem 0.12rem 0 oklch(0.92 0.04 78);
}

@keyframes hover-sun {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(0.8rem);
  }
}

@keyframes drift {
  0% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(2rem);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes surf {
  0% {
    transform: translateX(-1rem);
  }

  50% {
    transform: translateX(1rem);
  }

  100% {
    transform: translateX(-1rem);
  }
}

@keyframes wash-back {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: 10rem;
  }
}

@keyframes wash-front {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: 7rem;
  }
}

@media (max-width: 820px) {
  .scene-frame {
    min-height: 100svh;
  }

  .masthead {
    right: 1rem;
    max-width: none;
  }

  .waterline {
    inset-block: 46% 18%;
  }

  .shore {
    height: 28%;
  }

  .shell {
    right: 10%;
    bottom: 16%;
  }
}

@media (max-width: 560px) {
  .eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
  }

  .projects {
    left: 5%;
    right: 5%;
    gap: 1rem;
    justify-content: space-between;
  }

  .project-tile {
    width: clamp(3.2rem, 18vw, 4.2rem);
  }

  .project-name {
    font-size: clamp(0.55rem, 2.6vw, 0.7rem);
  }

  .masthead h1 {
    font-size: clamp(1.5rem, 9vw, 2.8rem);
    line-height: 1.15;
  }

  .sun {
    top: 18%;
    width: 10rem;
  }

  .cloud-a {
    left: 2%;
  }

  .cloud-b {
    right: 4%;
  }

  .waterline {
    inset-block: 48% 16%;
  }

  .shore {
    height: 30%;
  }

  .shoreline-a {
    top: -1.7rem;
    height: 3.4rem;
  }

  .shoreline-b {
    inset-inline: 3% 5%;
  }

  .shell {
    right: 10%;
    bottom: 18%;
    width: 4.8rem;
    height: 3.6rem;
  }

  .shell::before {
    width: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}