/* ============================================================
   MAMA TAVA · OCEAN HORIZON PRELOADER
   Hawaiian sunrise / Pacific dawn scene with cinematic exit
   ============================================================ */

html.is-loading {
  overflow: hidden !important;
  height: 100%;
}

html.is-loading body > *:not(#mtt-preloader) {
  visibility: hidden;
}

/* ── Root container ─────────────────────────────────────── */
#mtt-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 75%, rgba(255, 140, 66, 0.45) 0%, transparent 65%),
    linear-gradient(180deg,
      #050d1c 0%,
      #0a1830 22%,
      #14304d 48%,
      #2c5566 70%,
      #c97548 88%,
      #ff8c42 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 1.05s cubic-bezier(0.86, 0, 0.07, 1),
    opacity 0.7s ease 0.5s;
  will-change: transform, opacity;
}

#mtt-preloader.is-leaving {
  transform: translateY(-100%);
  opacity: 0.92;
}

#mtt-preloader.is-entering {
  transform: translateY(0);
  animation: mtt-pl-enter 0.55s cubic-bezier(0.76, 0, 0.24, 1) both;
}

@keyframes mtt-pl-enter {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

/* ── Star / bioluminescent layer ─────────────────────────── */
.mtt-pl__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 28% 9%,  rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 47% 14%, rgba(255,255,255,0.85) 50%, transparent 100%),
    radial-gradient(1px 1px at 64% 6%,  rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 78% 22%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 89% 11%, rgba(255,255,255,0.9) 50%, transparent 100%),
    radial-gradient(1px 1px at 8% 30%,  rgba(131,193,198,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 95% 32%, rgba(131,193,198,0.6) 50%, transparent 100%);
  animation: mtt-pl-twinkle 4s ease-in-out infinite alternate;
}

@keyframes mtt-pl-twinkle {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

/* ── Bioluminescent rising particles ─────────────────────── */
.mtt-pl__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mtt-pl__particle {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(131,193,198,0.95) 0%, rgba(131,193,198,0.0) 70%);
  filter: blur(0.5px);
  opacity: 0;
  animation: mtt-pl-float linear infinite;
}

@keyframes mtt-pl-float {
  0%   { transform: translateY(0) scale(0.4); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) scale(1.1); opacity: 0; }
}

/* ── Palm fronds (top corners) ───────────────────────────── */
.mtt-pl__palm {
  position: absolute;
  top: -30px;
  width: clamp(180px, 28vw, 360px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
  opacity: 0.92;
}

.mtt-pl__palm--left {
  left: -40px;
  transform-origin: top left;
  animation: mtt-pl-sway-l 6s ease-in-out infinite alternate;
}

.mtt-pl__palm--right {
  right: -40px;
  transform: scaleX(-1);
  transform-origin: top right;
  animation: mtt-pl-sway-r 6.5s ease-in-out infinite alternate;
}

@keyframes mtt-pl-sway-l {
  from { transform: rotate(-2deg); }
  to   { transform: rotate(2.5deg); }
}

@keyframes mtt-pl-sway-r {
  from { transform: scaleX(-1) rotate(-2deg); }
  to   { transform: scaleX(-1) rotate(2.5deg); }
}

/* ── Central scene ──────────────────────────────────────── */
.mtt-pl__scene {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(60px, 12vh, 140px);
}

/* Sun + ring */
.mtt-pl__sun-wrap {
  position: relative;
  width: clamp(180px, 24vw, 280px);
  height: clamp(180px, 24vw, 280px);
  margin-bottom: clamp(28px, 4vh, 48px);
}

.mtt-pl__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.mtt-pl__ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 1.5;
}

.mtt-pl__ring-fg {
  fill: none;
  stroke: url(#mtt-ring-grad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 565.48; /* 2 * π * 90 */
  stroke-dashoffset: 565.48;
  filter: drop-shadow(0 0 6px rgba(255, 200, 130, 0.6));
  transition: stroke-dashoffset 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sun disc */
.mtt-pl__sun {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff8e8 0%, #ffd9a3 30%, #ff8c42 65%, #c4500e 100%);
  box-shadow:
    0 0 0 2px rgba(255, 220, 180, 0.3),
    0 0 60px 8px rgba(255, 140, 66, 0.55),
    0 0 120px 20px rgba(255, 140, 66, 0.30),
    0 0 180px 30px rgba(255, 140, 66, 0.18),
    inset -20px -25px 40px rgba(180, 60, 20, 0.5);
  animation: mtt-pl-pulse 3.2s ease-in-out infinite;
}

.mtt-pl__sun::before {
  content: '';
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.85), transparent 60%);
  filter: blur(2px);
}

@keyframes mtt-pl-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* Sun rays */
.mtt-pl__rays {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  animation: mtt-pl-rotate 30s linear infinite;
  opacity: 0.5;
}

@keyframes mtt-pl-rotate {
  to { transform: rotate(360deg); }
}

/* ── Brand wordmark ─────────────────────────────────────── */
.mtt-pl__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vh, 14px);
}

.mtt-pl__wordmark {
  font-family: 'Bangond', Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 0.9;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 30px rgba(8, 15, 26, 0.6);
}

.mtt-pl__wordmark-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: mtt-pl-letter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes mtt-pl-letter {
  to { opacity: 1; transform: translateY(0); }
}

.mtt-pl__divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  margin: 4px 0;
}

.mtt-pl__tagline {
  font-family: 'Bebas Neue', 'BebasNeue-Regular', sans-serif;
  font-size: clamp(0.8rem, 1.3vw, 1.05rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.mtt-pl__pct {
  display: inline-block;
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #fff;
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
}

.mtt-pl__pct-sym {
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
}

/* ── Ocean / waves ──────────────────────────────────────── */
.mtt-pl__ocean {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38%;
  pointer-events: none;
  z-index: 4;
}

.mtt-pl__wave {
  position: absolute;
  left: -10%;
  right: -10%;
  width: 120%;
  height: 100%;
}

.mtt-pl__wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mtt-pl__wave--back {
  bottom: 8%;
  opacity: 0.55;
  animation: mtt-pl-wave-x 14s linear infinite;
}

.mtt-pl__wave--mid {
  bottom: 4%;
  opacity: 0.8;
  animation: mtt-pl-wave-x-r 11s linear infinite;
}

.mtt-pl__wave--front {
  bottom: 0;
  opacity: 1;
  animation: mtt-pl-wave-x 8s linear infinite;
}

@keyframes mtt-pl-wave-x {
  from { transform: translateX(-8%); }
  to   { transform: translateX(8%); }
}

@keyframes mtt-pl-wave-x-r {
  from { transform: translateX(8%); }
  to   { transform: translateX(-8%); }
}

/* Reflection of sun on water */
.mtt-pl__reflection {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(120px, 18vw, 240px);
  height: 38%;
  background: linear-gradient(180deg,
    rgba(255, 200, 130, 0.45) 0%,
    rgba(255, 140, 66, 0.30) 30%,
    rgba(255, 140, 66, 0.10) 70%,
    transparent 100%);
  filter: blur(8px);
  z-index: 3;
  opacity: 0.85;
  animation: mtt-pl-reflect 3.2s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes mtt-pl-reflect {
  0%, 100% { transform: translateX(-50%) scaleY(1); }
  50%      { transform: translateX(-50%) scaleY(1.08); }
}

/* ── Subtle vignette to focus center ─────────────────────── */
#mtt-preloader::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 65% at 50% 50%, transparent 40%, rgba(0,0,0,0.35) 100%);
  z-index: 6;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mtt-pl__sun,
  .mtt-pl__rays,
  .mtt-pl__wave--back,
  .mtt-pl__wave--mid,
  .mtt-pl__wave--front,
  .mtt-pl__palm--left,
  .mtt-pl__palm--right,
  .mtt-pl__reflection,
  .mtt-pl__stars,
  .mtt-pl__particle {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
  }
}

/* ── Mobile tuning ───────────────────────────────────────── */
@media (max-width: 600px) {
  .mtt-pl__palm { width: 180px; }
  .mtt-pl__sun-wrap { width: 180px; height: 180px; }
  .mtt-pl__scene { margin-bottom: 80px; }
}
