:root {
  color-scheme: dark;
  --water-deep: #65787d;
  --ink: #f1f3ef;
  --ink-soft: rgb(241 243 239 / 0.68);
  --ink-faint: rgb(241 243 239 / 0.46);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

@property --wash-progress {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--water-deep);
}

body {
  min-height: 100dvh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.landing-surface {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transform: translateZ(0);
  transform-origin: center;
  will-change: transform, filter, opacity;
}

#water {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--water-deep);
  transform: translateZ(0);
}

.composition {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  width: 100%;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  pointer-events: none;
}

.brand {
  grid-row: 2;
  align-self: center;
  text-align: center;
  text-shadow: 0 1px 20px rgb(25 40 42 / 0.16);
}

.brand h1 {
  margin: 0;
  font-size: clamp(3.1rem, 8.5vw, 7rem);
  font-weight: 300;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.brand p {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.78rem, 1.25vw, 0.98rem);
  letter-spacing: 0.025em;
}

.products {
  grid-row: 3;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 960px);
  margin: 0 auto clamp(4.5rem, 9vh, 7rem);
  pointer-events: auto;
}

.product {
  position: relative;
  display: grid;
  min-height: 4.5rem;
  padding: 1rem 0.75rem;
  color: var(--ink-soft);
  text-align: center;
  text-decoration: none;
  outline: none;
}

.product__name {
  align-self: end;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.product__description {
  position: absolute;
  top: 100%;
  left: 50%;
  width: max-content;
  max-width: 13rem;
  color: var(--ink-faint);
  font-size: 0.66rem;
  letter-spacing: 0.035em;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1), transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.product:is(:hover, :focus-visible) .product__name { color: var(--ink); }
.product:is(:hover, :focus-visible) .product__description { opacity: 1; transform: translate(-50%, 0); }

.product:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0.45rem 0.6rem;
  border: 1px solid rgb(241 243 239 / 0.88);
}

noscript { position: fixed; inset: auto 1rem 1rem; z-index: 2; color: var(--ink); text-align: center; }

.transition-layer {
  --ripple-x: 50vw;
  --ripple-y: 50vh;
  --ripple-scale: 1;
  --wash-feather: 160px;
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.transition-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      circle at var(--ripple-x) var(--ripple-y),
      transparent calc(var(--wash-progress) - 44px),
      rgb(225 231 228 / 0.08) calc(var(--wash-progress) - 42px),
      rgb(88 106 109 / 0.07) calc(var(--wash-progress) - 40px),
      transparent calc(var(--wash-progress) - 37px)
    ),
    radial-gradient(
      circle at var(--ripple-x) var(--ripple-y),
      transparent calc(var(--wash-progress) - 23px),
      rgb(226 232 229 / 0.1) calc(var(--wash-progress) - 21px),
      rgb(86 104 107 / 0.08) calc(var(--wash-progress) - 19px),
      transparent calc(var(--wash-progress) - 16px)
    ),
    radial-gradient(
      circle at var(--ripple-x) var(--ripple-y),
      transparent calc(var(--wash-progress) - 4px),
      rgb(226 232 229 / 0.12) calc(var(--wash-progress) - 2px),
      rgb(84 102 105 / 0.09) var(--wash-progress),
      transparent calc(var(--wash-progress) + 3px)
    );
  pointer-events: none;
}

.transition-ripple {
  position: absolute;
  top: var(--ripple-y);
  left: var(--ripple-x);
  width: 48px;
  height: 48px;
  border: 1px solid rgb(238 244 241 / 0.48);
  border-radius: 50%;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.12);
  will-change: transform, opacity;
}

.transition-light {
  position: absolute;
  inset: 0;
  background: #f4f3ee;
  clip-path: circle(0 at var(--ripple-x) var(--ripple-y));
  -webkit-mask-image: radial-gradient(
    circle at var(--ripple-x) var(--ripple-y),
    #000 0,
    #000 calc(var(--wash-progress) - var(--wash-feather)),
    transparent var(--wash-progress)
  );
  mask-image: radial-gradient(
    circle at var(--ripple-x) var(--ripple-y),
    #000 0,
    #000 calc(var(--wash-progress) - var(--wash-feather)),
    transparent var(--wash-progress)
  );
  opacity: 0;
  will-change: clip-path, opacity;
}

.transition-title {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f4f3ee;
  font-size: clamp(3.8rem, 10vw, 9.5rem);
  font-weight: 300;
  letter-spacing: -0.055em;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  will-change: opacity, transform, letter-spacing;
}

.transition-title::before,
.transition-title::after {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.transition-title::before {
  clip-path: inset(28% 0 48% 0);
}

.transition-title::after {
  clip-path: inset(56% 0 23% 0);
}

body.is-transitioning .transition-layer { visibility: visible; }

body.is-transitioning .transition-layer {
  animation: wash-progress 4000ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.is-transitioning .transition-ripple {
  animation: none;
}

body.is-transitioning .transition-light {
  animation: transition-light 4000ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.is-transitioning .transition-title {
  animation: transition-title 4000ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.is-transitioning .transition-title::before {
  animation: none;
}

body.is-transitioning .transition-title::after {
  animation: none;
}

body.is-transitioning .landing-surface {
  animation: surface-dissolve 2600ms cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: none;
}

body.is-transitioning .product:focus-visible::after { opacity: 0; }

@keyframes transition-ripple {
  0% { opacity: 0; transform: translate3d(-50%, -50%, 0) scale(0.12); }
  8% { opacity: 0.46; }
  64% { opacity: 0.2; }
  100% { opacity: 0; transform: translate3d(-50%, -50%, 0) scale(var(--ripple-scale)); }
}

@keyframes wash-progress {
  0% { --wash-progress: 0px; }
  62%, 100% { --wash-progress: var(--wash-radius); }
}

@keyframes surface-dissolve {
  0%, 62% { opacity: 1; filter: brightness(1) contrast(1) saturate(1); transform: translate3d(0, 0, 0); }
  100% { opacity: 0; filter: brightness(1.08) contrast(0.94) saturate(0.9); transform: translate3d(0, 0, 0); }
}

@keyframes transition-light {
  0% { opacity: 0; clip-path: circle(0 at var(--ripple-x) var(--ripple-y)); }
  7% { opacity: 1; }
  62%, 100% { opacity: 1; clip-path: circle(var(--wash-radius) at var(--ripple-x) var(--ripple-y)); }
}

@keyframes transition-title {
  0%, 42% { color: #f4f3ee; opacity: 0; transform: translate3d(0, 0, 0); letter-spacing: -0.048em; }
  50% { color: #eeeee9; opacity: 0.42; transform: translate3d(0, 0, 0); letter-spacing: -0.051em; }
  60% { color: #c5c9c6; opacity: 0.82; transform: translate3d(0, 0, 0); letter-spacing: -0.053em; }
  72% { color: #788082; opacity: 1; transform: translate3d(0, 0, 0); letter-spacing: -0.0545em; }
  84%, 100% { color: #273032; opacity: 1; transform: translate3d(0, 0, 0); letter-spacing: -0.055em; }
}

@keyframes title-refraction-upper {
  0%, 44% { opacity: 0; transform: translate3d(0, 0, 0); }
  52% { opacity: 0.12; transform: translate3d(0.4%, -0.32px, 0) skewX(-0.32deg); }
  62% { opacity: 0.08; transform: translate3d(-0.24%, 0.2px, 0) skewX(0.18deg); }
  73% { opacity: 0.035; transform: translate3d(0.08%, -0.08px, 0) skewX(-0.06deg); }
  83%, 100% { opacity: 0; transform: translate3d(0, 0, 0); }
}

@keyframes title-refraction-lower {
  0%, 48% { opacity: 0; transform: translate3d(0, 0, 0); }
  56% { opacity: 0.1; transform: translate3d(-0.36%, 0.26px, 0) skewX(0.26deg); }
  66% { opacity: 0.06; transform: translate3d(0.2%, -0.15px, 0) skewX(-0.14deg); }
  76% { opacity: 0.025; transform: translate3d(-0.06%, 0.05px, 0) skewX(0.05deg); }
  84%, 100% { opacity: 0; transform: translate3d(0, 0, 0); }
}

@media (max-width: 700px) {
  .composition { grid-template-rows: 0.8fr auto 1fr; padding-inline: max(14px, env(safe-area-inset-left)); }
  .brand h1 { font-size: clamp(3.6rem, 19vw, 5.6rem); }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.85rem; margin-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  .product { min-height: 4.1rem; padding-inline: 0.3rem; }
  .product__description { top: 88%; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .product__name, .product__description { transition-duration: 1ms; }

  body.is-transitioning .landing-surface { animation: reduced-surface 360ms ease-out both; }
  body.is-transitioning .transition-ripple { animation: none; }
  body.is-transitioning .transition-light { animation: reduced-light 360ms ease-out both; }
  body.is-transitioning .transition-title { animation: reduced-title 360ms ease-out both; }
  body.is-transitioning .transition-title::before,
  body.is-transitioning .transition-title::after { animation: none; }
  body.is-transitioning .transition-layer { animation: none; --wash-progress: var(--wash-radius); }
}

body.force-reduced-motion.is-transitioning .landing-surface { animation: reduced-surface 360ms ease-out both; }
body.force-reduced-motion.is-transitioning .transition-ripple { animation: none; }
body.force-reduced-motion.is-transitioning .transition-light { animation: reduced-light 360ms ease-out both; }
body.force-reduced-motion.is-transitioning .transition-title { animation: reduced-title 360ms ease-out both; }
body.force-reduced-motion.is-transitioning .transition-title::before,
body.force-reduced-motion.is-transitioning .transition-title::after { animation: none; }
body.force-reduced-motion.is-transitioning .transition-layer { animation: none; --wash-progress: var(--wash-radius); }

@keyframes reduced-surface { to { opacity: 0; } }
@keyframes reduced-light { to { opacity: 1; } }
@keyframes reduced-title { 0%, 100% { opacity: 0; } 38%, 78% { opacity: 1; } }

@supports ((mask-image: radial-gradient(circle, #000, transparent)) or (-webkit-mask-image: radial-gradient(circle, #000, transparent))) {
  .transition-light { clip-path: none; }
}
