:root {
  --char: #14100a;
  --earth: #21180c;
  --ash: #b3a795;
  --steam: #cfc7b6;
  --bone: #eee7d8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: var(--char);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

/* Löyly — steam rising off the stones */
.loyly {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 44%, #2a1f11 0%, transparent 58%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(201, 168, 118, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 80% 20%, rgba(48, 36, 22, 0.55) 0%, transparent 50%),
    linear-gradient(180deg, #0c0905 0%, var(--char) 28%, var(--earth) 74%, #2b2013 100%);
}

.loyly__defs {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.loyly__plumes {
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: min(130vw, 60rem);
  height: 145%;
  transform: translateX(-50%);
  filter: url(#steam-turbulence);
  opacity: 0.9;
  mask-image: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.75) 42%,
    rgba(0, 0, 0, 0.28) 72%,
    rgba(0, 0, 0, 0.08) 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.75) 42%,
    rgba(0, 0, 0, 0.28) 72%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.loyly__plume {
  position: absolute;
  bottom: 0;
  display: block;
  border-radius: 45% 45% 40% 40% / 55% 55% 35% 35%;
  background:
    radial-gradient(
      ellipse 75% 48% at 50% 18%,
      rgba(238, 231, 216, 0.4) 0%,
      rgba(207, 199, 182, 0.17) 42%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 45% 70% at 50% 55%,
      rgba(207, 199, 182, 0.13) 0%,
      rgba(207, 199, 182, 0.05) 45%,
      transparent 70%
    ),
    linear-gradient(
      180deg,
      rgba(238, 231, 216, 0.2) 0%,
      rgba(207, 199, 182, 0.08) 38%,
      rgba(201, 168, 118, 0.05) 68%,
      transparent 100%
    );
  opacity: 0;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
}

.loyly__plume--a { left: 24%; width: 38%; height: 95%; }
.loyly__plume--b { left: 38%; width: 46%; height: 105%; }
.loyly__plume--c { left: 50%; width: 34%; height: 92%; }
.loyly__plume--d { left: 14%; width: 28%; height: 78%; }
.loyly__plume--e { left: 62%; width: 30%; height: 84%; }

.loyly__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(207, 199, 182, 0.11) 0%,
    rgba(207, 199, 182, 0.05) 28%,
    rgba(207, 199, 182, 0.02) 55%,
    transparent 78%
  );
}

.loyly__grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.loyly__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 46%, transparent 20%, rgba(9, 5, 2, 0.74) 100%),
    linear-gradient(to bottom, rgba(9, 5, 2, 0.45) 0%, transparent 22%, transparent 70%, rgba(9, 5, 2, 0.28) 100%);
}

/* Wordmark */
.wordmark {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1.25rem 1.5rem;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ash);
  text-align: center;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.wordmark__text {
  display: block;
  font-family: "Syne", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2.5rem, 10vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.9;
  color: var(--bone);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .wordmark {
    padding: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loyly__plumes {
    filter: none;
    opacity: 0.55;
  }

  .loyly__plume {
    opacity: 0.55;
    transform: translate3d(0, -18%, 0) scale3d(1.15, 1.1, 1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .loyly__plume--a { animation: plume-rise 9s linear infinite; }
  .loyly__plume--b { animation: plume-rise 11s linear 1.8s infinite; }
  .loyly__plume--c { animation: plume-rise 8.5s linear 0.9s infinite; }
  .loyly__plume--d { animation: plume-rise 12s linear 3.2s infinite; }
  .loyly__plume--e { animation: plume-rise 10s linear 4.4s infinite; }

  .wordmark {
    opacity: 0;
    animation: fade-in 2s ease-out 0.4s forwards;
  }

}

@keyframes plume-rise {
  0% {
    transform: translate3d(0, 22%, 0) scale3d(0.62, 0.78, 1);
    opacity: 0;
  }

  12% { opacity: 0.35; }

  35% {
    transform: translate3d(0, 2%, 0) scale3d(0.92, 1.02, 1);
    opacity: 0.7;
  }

  62% {
    transform: translate3d(0, -24%, 0) scale3d(1.2, 1.14, 1);
    opacity: 0.95;
  }

  82% {
    transform: translate3d(0, -42%, 0) scale3d(1.42, 1.22, 1);
    opacity: 0.45;
  }

  100% {
    transform: translate3d(0, -58%, 0) scale3d(1.58, 1.28, 1);
    opacity: 0;
  }
}

@keyframes plume-rise-mobile {
  0% {
    transform: translate3d(0, 16%, 0) scale3d(0.72, 0.86, 1);
    opacity: 0;
  }

  18% { opacity: 0.4; }

  48% {
    transform: translate3d(0, -12%, 0) scale3d(1.08, 1.08, 1);
    opacity: 0.72;
  }

  78% {
    transform: translate3d(0, -34%, 0) scale3d(1.28, 1.16, 1);
    opacity: 0.35;
  }

  100% {
    transform: translate3d(0, -48%, 0) scale3d(1.4, 1.2, 1);
    opacity: 0;
  }
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* Mobile / touch: SVG displacement filters look blocky — use CSS blur instead */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .loyly__defs {
    display: none;
  }

  .loyly__plumes {
    width: 150vw;
    bottom: -14%;
    height: 135%;
    filter: blur(32px);
    -webkit-filter: blur(32px);
    opacity: 0.7;
    mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.65) 40%,
      rgba(0, 0, 0, 0.22) 70%,
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.65) 40%,
      rgba(0, 0, 0, 0.22) 70%,
      transparent 100%
    );
  }

  .loyly__plume {
    background:
      radial-gradient(
        ellipse 80% 52% at 50% 20%,
        rgba(238, 231, 216, 0.48) 0%,
        rgba(207, 199, 182, 0.19) 48%,
        transparent 76%
      ),
      linear-gradient(
        180deg,
        rgba(238, 231, 216, 0.26) 0%,
        rgba(207, 199, 182, 0.1) 42%,
        transparent 100%
      );
  }

  .loyly__plume--d,
  .loyly__plume--e {
    display: none;
  }

  .loyly__grain {
    opacity: 0.08;
    mix-blend-mode: soft-light;
  }

  .loyly__veil {
    background: linear-gradient(
      180deg,
      rgba(207, 199, 182, 0.1) 0%,
      rgba(207, 199, 182, 0.04) 32%,
      transparent 68%
    );
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: no-preference),
       (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  .loyly__plume--a { animation: plume-rise-mobile 11s ease-in-out infinite; }
  .loyly__plume--b { animation: plume-rise-mobile 13s ease-in-out 2s infinite; }
  .loyly__plume--c { animation: plume-rise-mobile 12s ease-in-out 1s infinite; }
}
