@import url("https://fonts.googleapis.com/css2?family=Manufacturing+Consent&display=swap");

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
  overflow-x: hidden;
  scrollbar-color: #5c160f #050100;
}

body {
  overscroll-behavior-y: none;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.ready .scene {
  opacity: 1;
}
.foreground-petals {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.ready .foreground-petals { opacity: 1; }
.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* total scroll length of the experience */
.scroll-space {
  height: 500vh;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 38%,
    rgba(0, 0, 0, 0.78) 100%
  );
}

/* progressive blur + darkening that melts the rocks into the bottom edge */
.blur-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40vh;
  z-index: 3;
  pointer-events: none;
}
.blur-bottom::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.8) 75%, #000 100%);
}
.blur-bottom i {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent var(--s0),
    #000 var(--s1),
    #000 var(--s2),
    transparent var(--s3)
  );
  mask-image: linear-gradient(
    to bottom,
    transparent var(--s0),
    #000 var(--s1),
    #000 var(--s2),
    transparent var(--s3)
  );
}
.blur-bottom i:nth-child(1) { --b: 0.5px; --s0: 0%;    --s1: 12.5%; --s2: 25%;  --s3: 37.5%; }
.blur-bottom i:nth-child(2) { --b: 1px;   --s0: 12.5%; --s1: 25%;   --s2: 37.5%; --s3: 50%; }
.blur-bottom i:nth-child(3) { --b: 2px;   --s0: 25%;   --s1: 37.5%; --s2: 50%;  --s3: 62.5%; }
.blur-bottom i:nth-child(4) { --b: 4px;   --s0: 37.5%; --s1: 50%;   --s2: 62.5%; --s3: 75%; }
.blur-bottom i:nth-child(5) { --b: 8px;   --s0: 50%;   --s1: 62.5%; --s2: 75%;  --s3: 87.5%; }
.blur-bottom i:nth-child(6) { --b: 16px;  --s0: 62.5%; --s1: 75%;   --s2: 87.5%; --s3: 100%; }

/* scroll-to-black overlay (opacity driven from JS) */
.fade {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  background: #000;
  color: rgba(255, 196, 157, 0.72);
  font: 10px/1.4 "Courier New", monospace;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.ready .loading {
  visibility: hidden;
  opacity: 0;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: max(100px, 11vh);
  z-index: 5;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  font: 10px/1 "Courier New", monospace;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(255, 190, 150, 0.7);
  text-shadow: 0 0 8px rgba(255, 90, 20, 0.8);
  pointer-events: none;
  animation: bob 2.6s ease-in-out infinite;
}
.hint b {
  color: rgba(255, 106, 55, 0.8);
  font: 18px/1 Georgia, serif;
  filter: drop-shadow(0 0 6px rgba(255, 72, 12, 0.85));
}
@keyframes bob {
  50% { transform: translate(-50%, 6px); opacity: 0.4; }
}

noscript {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: #d9b09b;
  font: 14px/1.5 "Courier New", monospace;
  text-align: center;
}

@media (max-width: 600px) {
  .scroll-space { height: 420vh; }
  .blur-bottom { height: 32vh; }
  .hint { bottom: max(100px, 11vh); }
}

.title-position {
  position: fixed;
  left: 50%;
  top: 61.5%;
  z-index: 5;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.4s ease;
  will-change: transform;
}

.ready .title-position { opacity: 1; }

.title {
  margin: 0;
  padding: 0.12em 0.08em;
  font-family: "Manufacturing Consent", Georgia, serif;
  font-size: clamp(110px, 24vw, 310px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: #f0bd83;
  background: linear-gradient(to bottom, #fff3cd 8%, #e6b57d 28%, #9b5432 48%, #38140d 66%, #100504 85%, #050202 100%);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 1px #180300) drop-shadow(0 0 16px #b42c1866);
  /* Keep the copper finish cached instead of repainting large text each frame. */
  will-change: opacity;
}

@keyframes ember-lettering {
  from { background-position: 50% 0%; }
  to { background-position: 50% 100%; }
}

.signature {
  position: fixed;
  z-index: 8;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #bba08d;
  font: 11px/1.4 "Courier New", monospace;
  letter-spacing: 0.16em;
  opacity: 0;
  transition: opacity 2.4s ease;
}

.ready .signature { opacity: 1; }
.signature a { color: #e1c4ab; text-decoration: none; }
.signature a:hover { color: #fff0d6; text-decoration: underline; }
.signature a:focus-visible { outline: 1px solid #e1c4ab; outline-offset: 5px; }

@media (prefers-reduced-motion: reduce) {
  .scene { transition-duration: 0.4s; }
  .hint { animation: none; }
  .title { animation: none; }
  .title-position, .signature { transition-duration: 0.4s; }
  .foreground-petals { transition-duration: 0.4s; }
}

/* The gradient retains the dark rock edge without six live backdrop blurs. */
.blur-bottom i { display: none; }
