:root {
  --bg: #eceae6;
  --bg-deep: #e2dfd8;
  --ink: #1c1b19;
  --ink-soft: rgba(28, 27, 25, 0.62);
  --mist-a: rgba(255, 255, 255, 0.72);
  --mist-b: rgba(196, 201, 208, 0.35);
  --line: rgba(28, 27, 25, 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 18%, #f7f5f1 0%, transparent 55%),
    radial-gradient(80% 70% at 80% 85%, var(--bg-deep) 0%, transparent 50%),
    linear-gradient(165deg, #f4f2ee 0%, var(--bg) 45%, #e8e5df 100%);
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: mist-in 2.4s var(--ease-out) forwards;
}

.mist-a {
  width: min(70vw, 560px);
  height: min(70vw, 560px);
  top: 28%;
  left: 50%;
  translate: -50% -40%;
  background: var(--mist-a);
}

.mist-b {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  bottom: 8%;
  right: 12%;
  background: var(--mist-b);
  animation-delay: 0.25s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0;
  padding: 2rem;
}

.mark {
  position: relative;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 1.35s var(--ease-out),
    transform 1.5s var(--ease-out);
  will-change: transform, opacity;
}

.logo {
  width: clamp(108px, 18vw, 152px);
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 18px 28px rgba(40, 42, 48, 0.12));
}

.coming {
  margin: 0;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 1.1s var(--ease-out),
    transform 1.25s var(--ease-out),
    margin-top 1.1s var(--ease-out),
    max-height 1.1s var(--ease-out);
  will-change: transform, opacity;
}

.coming-word {
  display: inline-block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: lowercase;
  color: var(--ink-soft);
  position: relative;
}

.coming-word::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -0.55em;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1.15s var(--ease-soft) 0.15s;
}

/* Phase: logo revealed */
body.is-logo .mark {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Phase: settle into coming */
body.is-coming .mark {
  transform: translateY(-18px) scale(0.94);
}

body.is-coming .coming {
  opacity: 1;
  transform: translateY(0);
  margin-top: 1.65rem;
  max-height: 4rem;
}

body.is-coming .coming-word::after {
  transform: scaleX(1);
}

@keyframes mist-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mist,
  .mark,
  .coming,
  .coming-word::after {
    animation: none !important;
    transition: none !important;
  }

  body .mark,
  body .coming {
    opacity: 1;
    transform: none;
    max-height: none;
    margin-top: 1.65rem;
  }

  body .coming-word::after {
    transform: scaleX(1);
  }
}
