:root {
  --ink: #101615;
  --teal: #0c6b68;
  --coral: #e2574c;
  --gold: #d9a441;
  --disco-x: 50vw;
  --disco-y: 42vh;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background-color: #e7e6dc;
  background-image: image-set(
    url("assets/tidesco-hero-v3-cover.webp") type("image/webp"),
    url("assets/tidesco-hero-v3-cover.png") type("image/png")
  );
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

body.bounce-active {
  background-image: image-set(
    url("assets/tidesco-hero-letters-only.webp") type("image/webp"),
    url("assets/tidesco-hero-letters-only.png") type("image/png")
  );
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 36%, rgba(16, 22, 21, 0.08));
}

.home-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  padding: 1rem;
  isolation: isolate;
}

.logo-mark {
  position: fixed;
  left: 12vw;
  top: calc(50vh - 9vw);
  z-index: 3;
  width: min(76vw, 980px);
  height: min(24vw, 310px);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.quiet-links {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 4;
  transform: translateX(-50%);
}

.quiet-links a {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(16, 22, 21, 0.16);
  border-radius: 8px;
  color: rgba(16, 22, 21, 0.7);
  background: rgba(255, 255, 255, 0.42);
  text-decoration: none;
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.quiet-links a:hover,
.quiet-links a:focus-visible {
  color: var(--ink);
  border-color: rgba(16, 22, 21, 0.32);
}

.corner-egg {
  position: fixed;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  opacity: 0.2;
  cursor: pointer;
}

.corner-egg-left {
  left: 14px;
  bottom: 14px;
  background: var(--coral);
}

.corner-egg-right {
  left: var(--disco-x);
  top: var(--disco-y);
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.98) 0 9%, transparent 10%),
    linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, 0.72) 19% 22%, transparent 23% 42%, rgba(255, 255, 255, 0.52) 43% 46%, transparent 47% 66%, rgba(255, 255, 255, 0.7) 67% 70%, transparent 71%),
    linear-gradient(0deg, transparent 0 20%, rgba(255, 255, 255, 0.58) 21% 24%, transparent 25% 47%, rgba(255, 255, 255, 0.7) 48% 51%, transparent 52% 74%, rgba(255, 255, 255, 0.46) 75% 78%, transparent 79%),
    radial-gradient(circle at 38% 30%, #ffffff 0, #f1f3f5 20%, #c5cad1 42%, #818891 68%, #eef1f4 100%);
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.76),
    0 0 22px rgba(108, 147, 196, 0.36),
    0 8px 14px rgba(0, 0, 0, 0.26);
  transform: translate(-50%, -50%);
}

.corner-egg:hover,
.corner-egg:focus-visible {
  opacity: 1;
}

.secret-line {
  display: none;
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top));
  z-index: 4;
  max-width: min(90vw, 640px);
  margin: 0;
  color: rgba(16, 22, 21, 0.72);
  font-size: clamp(0.8rem, 2.2vw, 1rem);
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.home-shell.party::before,
.home-shell.party::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.home-shell.party::before {
  z-index: 1;
  opacity: 0.92;
  mix-blend-mode: screen;
  background:
    linear-gradient(115deg, rgba(255, 0, 110, 0.74), rgba(255, 230, 0, 0.62) 24%, rgba(0, 255, 204, 0.66) 48%, rgba(0, 100, 255, 0.72) 72%, rgba(180, 0, 255, 0.62)),
    linear-gradient(245deg, rgba(0, 255, 255, 0.55), transparent 32%, rgba(255, 0, 180, 0.56) 62%, rgba(255, 132, 0, 0.48)),
    radial-gradient(circle at var(--disco-x) var(--disco-y), rgba(255, 255, 255, 0.72), transparent 15%);
  background-size: 320% 320%, 280% 280%, 100% 100%;
  animation: disco-wash 1.25s linear infinite;
}

.home-shell.party::after {
  z-index: 2;
  opacity: 0.86;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.68) 0 3%, transparent 10%),
    radial-gradient(circle at 76% 20%, rgba(0, 180, 255, 0.74) 0 5%, transparent 13%),
    radial-gradient(circle at 38% 76%, rgba(255, 0, 180, 0.68) 0 5%, transparent 13%),
    radial-gradient(circle at 86% 74%, rgba(255, 236, 0, 0.62) 0 5%, transparent 13%),
    radial-gradient(circle at 52% 44%, rgba(0, 255, 132, 0.46) 0 4%, transparent 12%);
  background-size: 150% 150%;
  animation: disco-spots 1.05s ease-in-out infinite alternate;
}

.home-shell.party .corner-egg-right {
  opacity: 1;
  animation: disco-ball 900ms linear infinite;
}

.home-shell.signal-mode::before,
.home-shell.signal-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.home-shell.signal-mode::before {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(83, 166, 255, 0) 0 28px,
      rgba(83, 166, 255, 0.18) 29px 31px,
      rgba(83, 166, 255, 0) 32px 58px
    );
  mix-blend-mode: screen;
  animation: signal-scan 1.35s linear infinite;
}

.home-shell.signal-mode::after {
  background:
    radial-gradient(ellipse at 32% 50%, transparent 0 18%, rgba(0, 127, 255, 0.34) 18.4% 18.9%, transparent 19.3% 27%),
    radial-gradient(ellipse at 32% 50%, transparent 0 31%, rgba(0, 127, 255, 0.28) 31.4% 31.9%, transparent 32.3% 45%),
    radial-gradient(ellipse at 32% 50%, transparent 0 51%, rgba(0, 127, 255, 0.2) 51.4% 51.9%, transparent 52.3%);
  filter: drop-shadow(0 0 16px rgba(33, 139, 255, 0.8));
  opacity: 0;
  animation: signal-pulse 1.7s ease-out 3;
}

.bouncing-logo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  display: block;
  width: 360px;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-120vw, -120vh, 0);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.28));
  will-change: transform;
}

.home-shell.bounce-mode .bouncing-logo {
  opacity: 1;
}

.home-shell.bounce-mode .logo-mark {
  cursor: crosshair;
}

.home-shell.tiny .logo-mark {
  transform: scale(0.18);
  transition: transform 500ms ease;
}

.home-shell.flip .logo-mark {
  transform: rotate(180deg);
}

.sparkle {
  position: fixed;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--gold);
  box-shadow: 0 0 20px rgba(217, 164, 65, 0.85);
  animation: pop 760ms ease-out forwards;
}

@keyframes logo-colors {
  to {
    background-position: 260% 0;
  }
}

@keyframes disco-wash {
  0% {
    background-position: 0% 42%, 100% 30%, 0 0;
    filter: hue-rotate(0deg);
  }

  50% {
    background-position: 86% 18%, 24% 88%, 0 0;
    filter: hue-rotate(150deg) saturate(1.35);
  }

  100% {
    background-position: 100% 58%, 0% 70%, 0 0;
    filter: hue-rotate(300deg) saturate(1.55);
  }
}

@keyframes disco-spots {
  0% {
    background-position: 0% 25%;
  }

  100% {
    background-position: 100% 72%;
  }
}

@keyframes disco-ball {
  to {
    filter: hue-rotate(360deg);
  }
}

@keyframes signal-scan {
  to {
    transform: translateY(58px);
  }
}

@keyframes signal-pulse {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes pop {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0);
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  body {
    overflow: hidden;
    background-image: image-set(
      url("assets/tidesco-hero-mobile.webp") type("image/webp"),
      url("assets/tidesco-hero-mobile.png") type("image/png")
    );
    background-position: center center;
    background-size: auto 100%;
  }

  body.bounce-active {
    background-image: image-set(
      url("assets/tidesco-hero-letters-only.webp") type("image/webp"),
      url("assets/tidesco-hero-letters-only.png") type("image/png")
    );
    background-size: cover;
  }

  .home-shell {
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .quiet-links {
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  .quiet-links a {
    min-height: 40px;
    padding: 0.5rem 0.72rem;
    font-size: 0.9rem;
  }

  .logo-mark {
    left: 4vw;
    top: 35svh;
    width: 92vw;
    height: 32svh;
  }

  .corner-egg {
    width: 42px;
    height: 42px;
    opacity: 0.14;
  }

  .corner-egg-left {
    left: max(0.45rem, env(safe-area-inset-left));
    bottom: max(0.45rem, env(safe-area-inset-bottom));
  }

  .corner-egg-right {
    left: var(--disco-x);
    top: var(--disco-y);
  }

  .secret-line {
    top: max(0.8rem, env(safe-area-inset-top));
    max-width: min(88vw, 360px);
    font-size: 0.82rem;
  }

  .bouncing-logo {
    width: 260px;
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  body {
    background-position: center center;
    background-size: cover;
  }

  .logo-mark {
    left: 12vw;
    top: 31vh;
    width: 76vw;
    height: 34vh;
  }

  .quiet-links {
    bottom: 0.65rem;
  }
}
