/* LaserBoy studio home: two app worlds, split by a laser. */

@property --split {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

:root {
  color-scheme: dark;

  --ground: #0B0B0E;
  --ground-line: #24242B;
  --text: #F4F4F6;
  --muted: #9C9CA6;
  --laser: #FF2D55;

  /* Reign */
  --night: #170F33;
  --velvet: #7C4DE8;
  --gold: #F6B93B;
  --gold-deep: #D4901A;
  --mist: #C9C2EA;

  /* CleanEats */
  --charcoal: #1F2022;
  --green: #43B047;
  --green-deep: #358A37;
  --red: #E84343;
  --ash: #B0B0B0;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1240px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---- Header ---- */

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand-studio {
  display: inline-flex;
  flex: none;
}

.brand-studio img {
  width: auto;
  height: clamp(38px, 2.2vw + 30px, 46px);
}

.motto {
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: right;
}

.motto em {
  font-style: normal;
  color: var(--laser);
  text-shadow: 0 0 18px rgba(255, 45, 85, 0.55);
}

/* ---- The split ---- */

.duel {
  --tilt: 5%;
  position: relative;
  height: clamp(620px, calc(100svh - 150px), 860px);
  overflow: hidden;
  isolation: isolate;
  transition: --split 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side {
  position: absolute;
  inset: 0;
}

.side-reign {
  --accent: var(--gold);
  --accent-deep: var(--gold-deep);
  --soft: var(--mist);
  --glow: rgba(124, 77, 232, 0.6);
  clip-path: polygon(0 0, calc(var(--split) + var(--tilt)) 0, calc(var(--split) - var(--tilt)) 100%, 0 100%);
  background:
    linear-gradient(180deg, rgba(23, 15, 51, 0.5) 0%, rgba(23, 15, 51, 0.72) 55%, rgba(23, 15, 51, 0.5) 100%),
    url("/reign/images/court-tall.jpg") center top / cover no-repeat,
    var(--night);
  background:
    linear-gradient(180deg, rgba(23, 15, 51, 0.5) 0%, rgba(23, 15, 51, 0.72) 55%, rgba(23, 15, 51, 0.5) 100%),
    image-set(url("/reign/images/court-tall.webp") type("image/webp"), url("/reign/images/court-tall.jpg") type("image/jpeg")) center top / cover no-repeat,
    var(--night);
}

/* Streets at an angle, the way the app's map shows the Village. */
.side-cleaneats {
  --accent: var(--green);
  --accent-deep: var(--green-deep);
  --soft: var(--ash);
  --glow: rgba(67, 176, 71, 0.4);
  clip-path: polygon(calc(var(--split) + var(--tilt)) 0, 100% 0, 100% 100%, calc(var(--split) - var(--tilt)) 100%);
  background:
    radial-gradient(60% 50% at 75% 100%, rgba(67, 176, 71, 0.2), rgba(67, 176, 71, 0) 70%),
    repeating-linear-gradient(29deg, rgba(255, 255, 255, 0) 0 92px, rgba(255, 255, 255, 0.045) 92px 97px),
    repeating-linear-gradient(119deg, rgba(255, 255, 255, 0) 0 138px, rgba(255, 255, 255, 0.045) 138px 144px),
    repeating-linear-gradient(29deg, rgba(255, 255, 255, 0) 0 30px, rgba(255, 255, 255, 0.012) 30px 31px),
    var(--charcoal);
}

.side-inner {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 5vh, 56px) 24px 0;
  text-align: center;
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-reign .side-inner {
  left: 0;
  padding-right: 7%;
}

.side-cleaneats .side-inner {
  left: 50%;
  padding-left: 7%;
}

.side-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: clamp(84px, 11vh, 112px);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.side-name .wordmark {
  width: auto;
  height: clamp(84px, 11vh, 112px);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
}

.side-name .icon {
  width: clamp(58px, 7.5vh, 72px);
  height: clamp(58px, 7.5vh, 72px);
  border-radius: 22%;
  box-shadow:
    0 0 0 1px rgba(67, 176, 71, 0.4),
    0 14px 28px -8px rgba(0, 0, 0, 0.8);
}

.side-pitch {
  max-width: 27ch;
  margin-top: 12px;
  color: var(--soft);
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  text-wrap: balance;
}

.side-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 18px;
}

.chip {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, rgba(0, 0, 0, 0.35));
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Above the side-wide link, so each badge goes to its own store. */
.store-badges a {
  position: relative;
  z-index: 2;
  display: block;
  border-radius: 8px;
}

.store-badges .apple {
  width: 108px;
  height: 36px;
}

/* Google's badge file carries a clear margin of its own; trimmed so the two badges match in height. */
.store-badges .google {
  width: 138px;
  height: 53px;
  max-width: none;
  margin: -8.5px;
}

.store-badges.is-dimmed img {
  opacity: 0.4;
  filter: grayscale(1);
}

.side-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-deep), 0 14px 30px -10px var(--glow);
  color: #14110A;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

/* The whole side is the link to the app's page. */
.side-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---- The phone, rising out of the floor, with company ---- */

.shot {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: clamp(22px, 4vh, 40px);
}

.phone {
  --w: clamp(200px, 19vw, 262px);
  width: var(--w);
  padding: calc(var(--w) * 0.034);
  border-radius: calc(var(--w) * 0.175);
  background: linear-gradient(145deg, #3A3A3A 0%, #131313 22%, #131313 78%, #2E2E2E 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 0 1px #070707,
    0 0 90px -6px var(--glow);
  transform: rotate(var(--lean));
  transform-origin: 50% 100%;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-reign .phone {
  --lean: -5deg;
}

.side-cleaneats .phone {
  --lean: 5deg;
}

.phone img {
  width: 100%;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * 0.141);
  background: #141414;
}

.jester {
  position: absolute;
  right: 90%;
  top: clamp(40px, 12vh, 120px);
  width: clamp(110px, 12vw, 170px);
  max-width: none;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.5));
  animation: bob 3.2s ease-in-out infinite alternate;
}

.stamp {
  position: absolute;
  padding: 6px 16px;
  border: 2px solid currentColor;
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 14%, #151515);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  z-index: 1;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.9);
}

.stamp-eat {
  right: 88%;
  top: 24%;
  color: var(--green);
  transform: rotate(-9deg);
  animation: stamp 0.5s 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
}

.stamp-skip {
  left: 82%;
  top: 48%;
  color: var(--red);
  transform: rotate(7deg);
  animation: stamp 0.5s 0.85s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
}

/* Map pins scattered on the streets: green passes, red does not. */
.pins span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent);
  animation: ping 3.4s var(--d, 0s) ease-out infinite;
}

.pins .no {
  background: var(--red);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent);
  animation-name: ping-red;
}

/* ---- The laser ---- */

.beam {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 14px var(--laser)) drop-shadow(0 0 38px var(--laser));
  animation: hum 2.6s ease-in-out infinite;
}

.beam span {
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: polygon(
    calc(var(--split) + var(--tilt) - 1.5px) 0,
    calc(var(--split) + var(--tilt) + 1.5px) 0,
    calc(var(--split) - var(--tilt) + 1.5px) 100%,
    calc(var(--split) - var(--tilt) - 1.5px) 100%
  );
}

@keyframes hum {
  0%, 100% { opacity: 1; }
  46% { opacity: 0.82; }
  50% { opacity: 1; }
  54% { opacity: 0.88; }
}

@keyframes bob {
  from { translate: 0 0; }
  to { translate: 0 -10px; }
}

@keyframes stamp {
  from { opacity: 0; scale: 1.8; }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(67, 176, 71, 0.6); }
  40%, 100% { box-shadow: 0 0 0 16px rgba(67, 176, 71, 0); }
}

@keyframes ping-red {
  0% { box-shadow: 0 0 0 0 rgba(232, 67, 67, 0.6); }
  40%, 100% { box-shadow: 0 0 0 16px rgba(232, 67, 67, 0); }
}

/* ---- Leaning in: only where there is a pointer, and only side by side ---- */

@media (hover: hover) and (min-width: 861px) {
  .duel:has(.side-reign:hover),
  .duel:has(.side-reign:focus-within) {
    --split: 55%;
  }

  .duel:has(.side-cleaneats:hover),
  .duel:has(.side-cleaneats:focus-within) {
    --split: 45%;
  }

  .duel:has(.side-reign:hover) .side-cleaneats .side-inner,
  .duel:has(.side-cleaneats:hover) .side-reign .side-inner {
    opacity: 0.55;
  }

  .duel:has(.side-reign:hover) .side-reign .side-inner {
    transform: translateX(2.5vw);
  }

  .duel:has(.side-cleaneats:hover) .side-cleaneats .side-inner {
    transform: translateX(-2.5vw);
  }

  .side:hover .phone,
  .side:focus-within .phone {
    transform: rotate(0deg) translateY(-14px);
  }
}

/* ---- Footer ---- */

.site-foot {
  padding-block: 26px 36px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
}

.site-foot a {
  text-underline-offset: 3px;
}

.site-foot a:hover {
  color: var(--text);
}

.copyright {
  margin-top: 12px;
}

/* ---- Stacked: one world above the other, the laser running across ---- */

@media (max-width: 860px) {
  .duel {
    --cut: 34px;
    height: auto;
    overflow: visible;
  }

  .side {
    position: relative;
    inset: auto;
    overflow: hidden;
  }

  .side-reign {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  }

  .side-cleaneats {
    margin-top: calc(-1 * var(--cut));
    clip-path: polygon(0 var(--cut), 100% 0, 100% 100%, 0 100%);
  }

  .side .side-inner {
    position: relative;
    left: auto;
    width: 100%;
    padding: 34px 20px 0;
    opacity: 1;
    transform: none;
  }

  .side-cleaneats .side-inner {
    padding-top: calc(34px + var(--cut));
  }

  .shot {
    flex: none;
    height: 300px;
    margin-top: 28px;
  }

  .phone {
    --w: 220px;
  }

  .jester {
    right: 88%;
    top: 70px;
    width: 104px;
  }

  .stamp-eat {
    right: 84%;
  }

  .stamp-skip {
    left: 80%;
  }

  .pins span {
    left: var(--mx);
    top: var(--my);
  }

  .beam {
    position: relative;
    inset: auto;
    height: 0;
  }

  .beam span {
    inset: calc(-1 * var(--cut)) 0 auto;
    height: var(--cut);
    clip-path: polygon(0 calc(100% - 3px), 100% 0, 100% 3px, 0 100%);
  }
}

@media (max-width: 400px) {
  .motto {
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .duel,
  .side-inner,
  .phone {
    transition: none;
  }

  .beam,
  .jester,
  .stamp,
  .pins span {
    animation: none;
  }
}
