:root {
  color-scheme: dark;
  --ink: #020609;
  --ocean: #071a24;
  --ruby: #8e1d2d;
  --ruby-deep: #3d0712;
  --warm: #d6aa69;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.portal {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #020609;
  touch-action: manipulation;
}

.underwater,
.stage,
.entry,
.curtain {
  position: absolute;
  inset: 0;
}

.underwater {
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -16%, rgba(87, 180, 194, .23), transparent 42%),
    linear-gradient(180deg, #0b2b39 0%, #061923 42%, #02070b 100%);
}

.underwater::before,
.underwater::after {
  position: absolute;
  inset: -22%;
  content: "";
  pointer-events: none;
}

.underwater::before {
  background: repeating-linear-gradient(108deg, transparent 0 8%, rgba(151, 229, 226, .075) 8.15% 8.55%, transparent 8.7% 18%);
  filter: blur(10px);
  transform: rotate(-7deg);
  animation: caustics 11s ease-in-out infinite alternate;
}

.underwater::after {
  background: radial-gradient(ellipse at 50% 15%, transparent 0 28%, rgba(0, 3, 6, .65) 78%);
}

.water-glow {
  position: absolute;
  width: 75vw;
  height: 42vh;
  border-radius: 50%;
  filter: blur(25px);
  opacity: .33;
  animation: drift 14s ease-in-out infinite alternate;
}

.water-glow--one { top: -19vh; left: -17vw; background: #3e9ba5; }
.water-glow--two { top: -12vh; right: -18vw; background: #215b7d; animation-delay: -6s; }

.surface-shimmer {
  position: absolute;
  top: -10px;
  left: -10%;
  width: 120%;
  height: 17vh;
  opacity: .24;
  background: repeating-linear-gradient(174deg, transparent 0 17px, rgba(228, 255, 246, .55) 18px 20px, transparent 21px 34px);
  filter: blur(7px);
  animation: shimmer 8s ease-in-out infinite;
}

.sea-particles {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(circle, rgba(192, 241, 229, .7) 0 1px, transparent 1.8px);
  background-size: 74px 93px;
  animation: particles 26s linear infinite;
}

.sea-particles--two {
  opacity: .22;
  background-size: 123px 151px;
  animation-duration: 38s;
  animation-direction: reverse;
}

.dolphin {
  position: absolute;
  width: clamp(180px, 24vw, 350px);
  height: auto;
  fill: rgba(111, 184, 192, .16);
  stroke: rgba(174, 228, 223, .28);
  stroke-width: 2;
  filter: blur(.15px) drop-shadow(0 8px 16px rgba(0, 0, 0, .24));
  animation: swim 23s linear infinite;
}

.dolphin--one { top: 24%; left: -26%; animation-delay: -4s; }
.dolphin--two { top: 67%; left: -30%; width: clamp(130px, 18vw, 260px); opacity: .65; animation-duration: 31s; animation-delay: -18s; }

.stage { z-index: 1; background: #000; }

.film {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
  transition: opacity .36s ease;
}

.film--intro { opacity: 0; }
.film--intro.is-playing { opacity: 1; }
.film--intro.is-fading { opacity: 0; }
.film--main.is-visible { opacity: 1; pointer-events: auto; }

.main-controls {
  position: absolute;
  z-index: 4;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 235, 213, .28);
  border-radius: 999px;
  background: rgba(12, 5, 8, .76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .42), inset 0 0 22px rgba(205, 128, 89, .08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity .3s ease, transform .3s ease;
  backdrop-filter: blur(14px);
}

.film--main.is-visible ~ .main-controls { opacity: 1; pointer-events: auto; transform: translateY(0); }
.main-controls__button { flex: 0 0 auto; min-width: 48px; height: 34px; padding: 0 10px; border: 1px solid rgba(255, 232, 207, .42); border-radius: 999px; color: #fff7ec; background: rgba(113, 20, 33, .72); font-size: 11px; font-weight: 800; letter-spacing: .05em; cursor: pointer; }
.main-controls__button:hover, .main-controls__button:focus-visible { border-color: rgba(255, 239, 218, .9); background: rgba(153, 31, 49, .9); outline: none; }
.main-controls__play { min-width: 38px; padding: 0; font-size: 13px; }
.main-controls__seek { min-width: 0; width: 100%; accent-color: #c87165; cursor: pointer; }

.entry {
  z-index: 5;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(8, 25, 33, .08), rgba(0, 0, 0, .48));
  transition: opacity .42s ease, visibility .42s ease;
}

.entry.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.entry__button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  width: 184px;
  height: 184px;
  padding: 18px 16px;
  border: 1px solid rgba(220, 253, 244, .5);
  border-radius: 50%;
  color: rgba(239, 255, 250, .93);
  background: rgba(3, 17, 22, .3);
  box-shadow: 0 0 0 10px rgba(133, 210, 202, .035), 0 20px 70px rgba(0, 0, 0, .32), inset 0 0 45px rgba(134, 212, 202, .08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.entry__button:hover,
.entry__button:focus-visible { transform: scale(1.045); border-color: rgba(239, 255, 250, .9); background: rgba(6, 32, 37, .44); outline: none; }
.entry__ring { position: absolute; inset: -13px; border: 1px solid rgba(165, 239, 228, .2); border-radius: 50%; animation: pulse 2.7s ease-in-out infinite; }
.entry__icon { width: 42px; height: 42px; margin-bottom: 4px; fill: none; stroke: rgba(239, 255, 250, .93); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.entry__title { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.entry__note { color: rgba(205, 235, 229, .66); font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.skip {
  position: absolute;
  z-index: 7;
  top: max(22px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  min-width: 128px;
  padding: 13px 17px;
  border: 1px solid rgba(255, 238, 213, .72);
  border-radius: 999px;
  color: #fff8ec;
  background: rgba(44, 7, 14, .82);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .33), inset 0 0 18px rgba(244, 176, 120, .1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-9px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease, background .2s ease;
}

.skip.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.skip:hover, .skip:focus-visible { background: rgba(132, 24, 42, .9); outline: 2px solid rgba(255, 225, 181, .7); outline-offset: 3px; }

.seek-feedback {
  position: absolute;
  z-index: 6;
  top: 50%;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 244, 224, .46);
  border-radius: 50%;
  color: rgba(255, 247, 232, .96);
  background: rgba(22, 6, 10, .62);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 26px rgba(250, 182, 118, .12);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.82);
}

.seek-feedback--left { left: 12%; }
.seek-feedback--right { right: 12%; }
.seek-feedback.is-visible { animation: seek-pop .58s ease both; }

.curtain { z-index: 8; pointer-events: none; visibility: hidden; }
.curtain.is-active { visibility: visible; }
.curtain__left,
.curtain__right {
  position: absolute;
  top: -3%;
  bottom: -7%;
  width: 54%;
  background:
    radial-gradient(ellipse at 22% 13%, rgba(249, 150, 118, .44) 0 2%, transparent 18%),
    repeating-linear-gradient(101deg, #500913 0 6%, #a92c3b 8%, #5a0b17 13%, #26040a 18%, #8c1f30 24%);
  box-shadow: inset 0 0 70px rgba(20, 0, 4, .55), 0 0 34px rgba(0, 0, 0, .72);
  transition: transform 1.22s cubic-bezier(.75, .02, .18, 1);
}

.curtain__left { left: -3%; border-radius: 0 0 55% 14%; transform-origin: 6% 50%; }
.curtain__right { right: -3%; border-radius: 0 0 14% 55%; transform-origin: 94% 50%; }
.curtain__left::before, .curtain__right::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(255, 184, 119, .2), transparent 16% 38%, rgba(19, 0, 5, .32) 48% 52%, transparent 66%, rgba(255, 182, 130, .14));
  mix-blend-mode: screen;
}
.curtain__left::after, .curtain__right::after {
  position: absolute;
  top: 16%;
  bottom: 4%;
  width: 11px;
  content: "";
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(252, 200, 133, .68), transparent);
  box-shadow: 0 0 15px rgba(255, 199, 118, .28);
}
.curtain__left::after { right: 2.7%; }
.curtain__right::after { left: 2.7%; }
.curtain.is-open .curtain__left { transform: translateX(-106%) rotate(-2deg); }
.curtain.is-open .curtain__right { transform: translateX(106%) rotate(2deg); }

.curtain__valance {
  position: absolute;
  z-index: 2;
  top: -2%;
  left: -4%;
  width: 108%;
  height: 22%;
  border-radius: 0 0 50% 50%;
  background: repeating-linear-gradient(99deg, #4d0712 0 5%, #9f2737 8%, #600a16 14%, #8c1c2c 20%);
  box-shadow: inset 0 -18px 25px rgba(29, 1, 7, .48), 0 14px 28px rgba(0, 0, 0, .62);
  transition: transform 1.06s cubic-bezier(.75, .02, .18, 1), opacity .3s ease;
}
.curtain.is-open .curtain__valance { transform: translateY(-145%); opacity: .1; }
.curtain__rail { position: absolute; z-index: 3; top: 15%; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, rgba(242, 187, 113, .8) 50%, transparent); box-shadow: 0 0 18px rgba(255, 206, 129, .65); transition: opacity .4s ease; }
.curtain.is-open .curtain__rail { opacity: 0; }

.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes caustics { from { transform: translate3d(-2%, -1%, 0) rotate(-7deg); } to { transform: translate3d(3%, 2%, 0) rotate(-4deg); } }
@keyframes drift { from { transform: translate3d(-2vw, 0, 0) scale(1); } to { transform: translate3d(4vw, 3vh, 0) scale(1.08); } }
@keyframes shimmer { 0%, 100% { transform: translateX(-2%) rotate(-1deg); opacity: .14; } 50% { transform: translateX(3%) rotate(1deg); opacity: .34; } }
@keyframes particles { from { transform: translateY(10%); } to { transform: translateY(-10%); } }
@keyframes swim { 0% { transform: translateX(-22vw) translateY(5vh) scale(.82); } 48% { transform: translateX(60vw) translateY(-4vh) scale(1); } 100% { transform: translateX(124vw) translateY(8vh) scale(.88); } }
@keyframes pulse { 0%, 100% { transform: scale(.95); opacity: .45; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes seek-pop { 0% { opacity: 0; transform: translateY(-50%) scale(.78); } 22% { opacity: 1; transform: translateY(-50%) scale(1); } 78% { opacity: 1; transform: translateY(-50%) scale(1); } 100% { opacity: 0; transform: translateY(-50%) scale(1.06); } }

@media (max-aspect-ratio: 3/4) {
  .film { object-fit: contain; }
}

@media (max-width: 430px) {
  .main-controls { gap: 6px; padding: 8px; }
  .main-controls__button { min-width: 44px; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
