/* Opening animation. The horizon sits 40% up from the bottom of the screen. */
html.intro-active { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #020b18;
  color: #fff;
}
.intro--revealed { background: transparent; pointer-events: none; }
.intro--revealed .intro-scene,
.intro--revealed .intro-brand,
.intro--revealed .intro-skip { display: none; }
.intro--fade { opacity: 0; transition: opacity .3s ease; }

.intro-scene, .intro-night, .intro-stars, .intro-dawn, .intro-day { position: absolute; inset: 0; }
.intro-night, .intro-stars, .intro-dawn, .intro-day { bottom: 40%; }
.intro-night { background: linear-gradient(to top, #0b2a55 0%, #06173a 45%, #020b18 100%); }

.intro-stars { background-repeat: repeat; opacity: 0; }
.intro-stars--near {
  background-image:
    radial-gradient(1.7px 1.7px at 31px 47px, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 163px 92px, #dff3ff 50%, transparent 51%),
    radial-gradient(1.9px 1.9px at 287px 28px, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 104px 213px, #ffeccc 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 352px 171px, #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 411px 66px, #dff3ff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 229px 296px, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 58px 331px, #fff 50%, transparent 51%);
  background-size: 463px 367px;
}
.intro-stars--far {
  background-image:
    radial-gradient(1px 1px at 73px 19px, #c9e4ff 50%, transparent 51%),
    radial-gradient(1px 1px at 139px 151px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 17px 118px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 201px 77px, #c9e4ff 50%, transparent 51%),
    radial-gradient(1px 1px at 251px 203px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 96px 239px, #c9e4ff 50%, transparent 51%);
  background-size: 293px 271px;
}
.intro-dawn { background: linear-gradient(to top, #ffbe73 0%, #ff8f66 13%, #ee5c8e 30%, #8a56c2 53%, #2a4a9e 77%, #0a2358 100%); opacity: 0; }
.intro-day { background: linear-gradient(to top, #ffeccb 0%, #a9e5f6 20%, #48b6e7 58%, #1479c4 100%); opacity: 0; }

.intro-sun {
  position: absolute;
  left: 50%;
  bottom: 40%;
  width: 18vmin;
  height: 18vmin;
  margin-left: -9vmin;
  transform: translateY(130%);
}
.intro-sun-disc { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fffdf0 0%, #ffe9a6 55%, #ffc65c 100%); box-shadow: 0 0 6vmin 2vmin rgba(255, 214, 130, .55); }
.intro-sun-halo { position: absolute; inset: -22vmin; border-radius: 50%; background: radial-gradient(circle, rgba(255, 222, 150, .5) 0%, rgba(255, 170, 110, .22) 34%, transparent 66%); opacity: 0; }

.intro-birds { position: absolute; left: 0; top: 47%; width: clamp(90px, 16vmin, 180px); color: rgba(6, 26, 58, .75); opacity: 0; translate: -20vw 0; }

.intro-island { position: absolute; right: -3%; bottom: 40%; width: min(48vw, 560px); height: auto; margin-bottom: -2px; fill: #020d1c; stroke: #020d1c; }

.intro-horizon { position: absolute; left: 0; right: 0; bottom: 40%; height: 2px; background: linear-gradient(90deg, transparent 4%, #ffd9a0 50%, transparent 96%); transform: scaleX(0); opacity: .9; }

.intro-sea { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(to bottom, #0a2f57 0%, #051c38 55%, #020f22 100%); }
.intro-sea-light { position: absolute; inset: 0; background: linear-gradient(to bottom, #38cfc7 0%, #1596d4 38%, #0b5d9a 72%, #06355f 100%); opacity: 0; }
.intro-glitter {
  position: absolute;
  left: 50%;
  top: 0;
  width: 34vmin;
  height: 78%;
  margin-left: -17vmin;
  background: repeating-linear-gradient(to bottom, rgba(255, 240, 200, .95) 0 3px, transparent 3px 12px);
  -webkit-mask-image: radial-gradient(ellipse 50% 100% at 50% 0, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 100% at 50% 0, #000 0%, transparent 72%);
  opacity: 0;
}

.intro-boat { position: absolute; top: -8.6vmin; left: 0; width: 10vmin; height: 10vmin; fill: #020d1c; translate: -14vw 0; transform-origin: 50% 90%; }

.wave { position: absolute; left: 0; width: max(200%, 1800px); max-width: none; -webkit-mask-image: linear-gradient(#000 45%, transparent 100%); mask-image: linear-gradient(#000 45%, transparent 100%); }
.intro-sea .wave--back { top: -2.4vh; height: 13vh; fill: rgba(190, 236, 255, .16); }
.intro-sea .wave--mid { top: 9vh; height: 17vh; fill: rgba(60, 200, 196, .2); }
.intro-sea .wave--front { top: 22vh; height: 22vh; fill: rgba(2, 15, 34, .5); -webkit-mask-image: none; mask-image: none; }

.intro-brand { position: absolute; left: 0; right: 0; top: 9%; padding: 0 1rem; text-align: center; text-shadow: 0 2px 26px rgba(2, 15, 34, .55); }
.intro-mark { width: min(12vmin, 15vh, 120px); min-width: 44px; height: auto; stroke: #ffe6ae; stroke-width: 3.6; filter: drop-shadow(0 0 14px rgba(255, 214, 130, .5)); }
.intro-mark .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro-word { margin: .5rem 0 0; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: clamp(1.6rem, min(6.4vw, 9vh), 4.4rem); font-weight: 500; line-height: 1.1; letter-spacing: .3em; margin-right: -.3em; overflow: hidden; }
.intro-word span { display: inline-block; opacity: 0; transform: translateY(70%); }
.intro-word .gap { width: .45em; }
.intro-sub { margin: .25rem 0 0; font-size: clamp(.7rem, min(1.7vw, 2.6vh), 1.05rem); letter-spacing: .55em; margin-right: -.55em; text-transform: uppercase; color: #ffe6ae; opacity: 0; }
.intro-tag { margin: .5rem 0 0; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-style: italic; font-size: clamp(.85rem, min(2vw, 3vh), 1.3rem); opacity: 0; }

.intro-wash { position: absolute; left: 0; top: 0; width: 100%; height: 240%; display: flex; flex-direction: column; transform: translateY(41.7%); visibility: hidden; will-change: transform; }
.intro-wash.is-running { visibility: visible; }
.intro-wash-crest, .intro-wash-tail { display: block; width: 100%; height: 6.7%; flex: none; }
.intro-wash-crest { margin-bottom: -1px; }
.intro-wash-tail { margin-top: -1px; }
.intro-wash-crest .foam { fill: #f2fffd; }
.intro-wash-crest .water { fill: #2ec6c8; }
.intro-wash-tail .water { fill: #041a2f; }
.intro-wash-body { flex: 1; background: linear-gradient(to bottom, #2ec6c8 0%, #1596d4 22%, #0b5d9a 50%, #062a4a 78%, #041a2f 100%); }

.intro-skip {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  padding: .6rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(2, 15, 34, .45);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.intro-skip:hover { background: rgba(2, 15, 34, .7); }
.intro-skip:focus-visible { outline: 3px solid #ffe6ae; outline-offset: 3px; }

/* Timeline, started when the script adds .intro--play. */
.intro--play .intro-stars--near { animation: intro-stars 2.6s ease both, intro-twinkle 1.7s ease-in-out infinite alternate; }
.intro--play .intro-stars--far { animation: intro-stars 2.6s .15s ease both; }
.intro--play .intro-horizon { animation: intro-horizon 2.4s .1s ease both; }
.intro--play .intro-dawn { animation: intro-fade-in 2s .35s ease both; }
.intro--play .intro-day { animation: intro-fade-in 1.5s 2.05s ease both; }
.intro--play .intro-sun { animation: intro-sunrise 2.7s .5s cubic-bezier(.2, .7, .2, 1) both; }
.intro--play .intro-sun-halo { animation: intro-fade-in 2s 1s ease both, intro-pulse 3s 2.4s ease-in-out infinite alternate; }
.intro--play .intro-sea-light { animation: intro-fade-in 1.7s 1.9s ease both; }
.intro--play .intro-glitter { animation: intro-glitter-in 1.6s 1.5s ease both, intro-glitter 1.1s linear infinite; }
.intro--play .intro-island { animation: intro-island 1.8s 1.9s ease both; }
.intro--play .intro-boat { animation: intro-boat 5.4s .3s cubic-bezier(.25, .6, .35, 1) both, intro-bob 2.3s ease-in-out infinite, intro-sails 1.6s 2s ease both; }
.intro--play .intro-birds { animation: intro-birds 4.6s 1.2s linear both; }
.intro--play .wave--back { animation: wave-slide 9s linear infinite; }
.intro--play .wave--mid { animation: wave-slide 6.5s linear infinite reverse; }
.intro--play .wave--front { animation: wave-slide 4.6s linear infinite; }
.intro--play .intro-mark .draw { animation: intro-draw 1.25s .75s cubic-bezier(.6, 0, .3, 1) both; }
.intro--play .intro-mark .draw--sun { animation-delay: 1.15s; animation-duration: .8s; }
.intro--play .intro-mark .draw--ray { animation-delay: 1.6s; animation-duration: .5s; }
.intro--play .intro-mark .draw--wave { animation-delay: 1.45s; animation-duration: .8s; }
.intro--play .intro-mark .draw--wave2 { animation-delay: 1.65s; animation-duration: .8s; }
.intro--play .intro-word span { animation: intro-letter .75s cubic-bezier(.2, .8, .2, 1) both; }
.intro--play .intro-word span:nth-child(1) { animation-delay: 1.5s; }
.intro--play .intro-word span:nth-child(2) { animation-delay: 1.57s; }
.intro--play .intro-word span:nth-child(3) { animation-delay: 1.64s; }
.intro--play .intro-word span:nth-child(4) { animation-delay: 1.71s; }
.intro--play .intro-word span:nth-child(5) { animation-delay: 1.78s; }
.intro--play .intro-word span:nth-child(7) { animation-delay: 1.92s; }
.intro--play .intro-word span:nth-child(8) { animation-delay: 1.99s; }
.intro--play .intro-word span:nth-child(9) { animation-delay: 2.06s; }
.intro--play .intro-sub { animation: intro-sub 1s 2.35s ease both; }
.intro--play .intro-tag { animation: intro-fade-in .9s 2.75s ease both; }
.intro--play .intro-skip { animation: intro-fade-in .5s .4s ease both; }

@keyframes intro-stars { 0% { opacity: 0; } 22% { opacity: 1; } 60% { opacity: .8; } 100% { opacity: 0; } }
@keyframes intro-twinkle { from { filter: brightness(.7); } to { filter: brightness(1.4); } }
@keyframes intro-horizon { 0% { transform: scaleX(0); opacity: .9; } 55% { transform: scaleX(1); opacity: .9; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes intro-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-sunrise { from { transform: translateY(130%); } to { transform: translateY(38%); } }
@keyframes intro-pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes intro-glitter-in { from { opacity: 0; } to { opacity: .85; } }
@keyframes intro-glitter { from { background-position: 0 0; } to { background-position: 0 12px; } }
@keyframes intro-island { from { fill: #020d1c; stroke: #020d1c; } to { fill: #0b4a50; stroke: #0b4a50; } }
@keyframes intro-boat { from { translate: -14vw 0; } to { translate: 66vw 0; } }
@keyframes intro-bob { 0%, 100% { rotate: -3.5deg; } 50% { rotate: 3.5deg; } }
@keyframes intro-sails { from { fill: #020d1c; } to { fill: #fffaf0; } }
@keyframes intro-birds { 0% { opacity: 0; translate: -20vw 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; translate: 105vw -4vh; } }
@keyframes wave-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-letter { from { opacity: 0; transform: translateY(70%); } to { opacity: 1; transform: translateY(0); } }
@keyframes intro-sub { from { opacity: 0; letter-spacing: 1.1em; } to { opacity: 1; letter-spacing: .55em; } }

@media (prefers-reduced-motion: reduce) {
  .intro--play *, .intro--play *::before, .intro--play *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .intro--play .intro-stars { animation: none; opacity: 0; }
  .intro--play .intro-birds { animation: none; opacity: 0; }
  .intro--play .intro-boat { animation: none; translate: 66vw 0; fill: #fffaf0; }
  .intro--play .intro-horizon { animation: none; }
  .intro--play .intro-glitter { animation: none; opacity: .85; }
  .intro--play .wave { animation: none; }
}
