/* patchplanet.space: the game's flat night-sky look. All styles live here (the CSP allows no inline ones). */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/nunito-800.woff2") format("woff2");
}

:root {
  --night: #0a1036;
  --low: #151d55;
  --gold: #ffc94a;
  --gold-deep: #b8892a;
  --soft: #c3c9f4;
  --panel: #121a4f;
  --edge: #242e78;
  --deep: #070b2c;
  --sparkle: #fff1c2;
  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --text: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(18px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

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

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #fff;
  font-family: var(--text);
  font-weight: 700;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: var(--night);
}

/* The sky: one canvas behind everything. site.js paints the nebula and stars; without it, the night shows. */
.sky {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  background: linear-gradient(var(--night), var(--low));
  pointer-events: none;
}

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

main {
  overflow: hidden;
}
@supports (overflow: clip) {
  main {
    overflow: visible;
    overflow-x: clip;
  }
}

/* --- Nav ---------------------------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(14px, 2.2vw, 28px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(16px, 0.3vw + 15px, 20px);
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: clamp(32px, 1.2vw + 27px, 40px);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--deep);
}

.links {
  display: flex;
  gap: clamp(4px, 1vw, 12px);
}

.links a {
  padding: 8px 6px;
  border-radius: 8px;
  color: var(--soft);
  font-size: clamp(14px, 0.35vw + 12.6px, 18px);
  text-decoration: none;
  transition: color 0.2s;
}

.links a:hover {
  color: #fff;
}

/* --- Hero --------------------------------------------------------------------------------------- */

.hero {
  display: grid;
  align-items: center;
  padding-top: clamp(26px, 4vw, 44px);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: clamp(11px, 0.25vw + 10.2px, 14px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0.18em 0 0.26em;
  font-family: var(--display);
  font-size: clamp(50px, 2.6vw + 42px, 86px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.012em;
}

h1 span {
  display: block;
}

.gold {
  color: var(--gold);
}

.lede {
  max-width: 24em;
  margin: 0;
  color: var(--soft);
  font-size: clamp(16px, 0.3vw + 14.8px, 20px);
  line-height: 1.5;
}

/* The nebula's brightest steps can drift behind words set on the open sky: a flat shadow keeps them crisp. */
.links a,
.eyebrow,
.lede,
.ghost,
.foot {
  text-shadow: 0 2px 0 rgba(7, 11, 44, 0.6);
}

/* On a phone the paragraph is the mockup's short version. */
@media (max-width: 599.98px) {
  .lede .more {
    display: none;
  }
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(22px, 2.4vw, 32px);
}

/* "Coming soon to Google Play": a plain badge, no link and no Google artwork until launch. */
.play-soon {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px 9px 14px;
  border: 1.5px solid #6a6f96;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 5px 0 var(--deep);
  color: #fff;
  line-height: 1.1;
  cursor: default;
  user-select: none;
}

.play-soon .tri {
  width: 0;
  height: 0;
  border-left: 20px solid var(--gold);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
}

.play-soon small {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.88;
}

.play-soon b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.005em;
}

.ghost {
  padding: 2px 0;
  border-bottom: 2px solid var(--gold);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s;
}

.ghost:hover {
  color: var(--gold);
}

/* The stage: the woken planet floating behind a tilted phone that plays the game. Phone layout first. */
.stage {
  position: relative;
  width: 100%;
  max-width: 470px;
  aspect-ratio: 344 / 470;
  margin: 22px auto 0;
}

.planet {
  position: absolute;
  top: 5%;
  right: -13%;
  width: 64%;
  height: auto;
}

.phone {
  position: absolute;
  top: 1.5%;
  left: 8%;
  width: 58%;
  padding: 7px;
  border-radius: 30px;
  background: #050820;
  box-shadow: 0 0 0 3px #2b3580, 16px 18px 0 rgba(4, 3, 28, 0.5);
  transform: rotate(5deg);
}

.phone video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 1200;
  border-radius: 24px;
  background: var(--panel);
}

.spark {
  position: absolute;
  width: 22px;
  aspect-ratio: 1;
  background: var(--sparkle);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}

.spark.one {
  top: 3%;
  left: 2%;
}

.spark.two {
  right: 3%;
  bottom: 10%;
  width: 15px;
}

@media (max-width: 479.98px) {
  .ctas {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
  }

  .pitch {
    padding-bottom: 24px;
  }

  .stage {
    max-width: 580px;
    aspect-ratio: 560 / 540;
    margin: 0 0 0 auto;
  }

  .planet {
    top: 7.4%;
    right: -7%;
    width: 59%;
  }

  .phone {
    top: 2%;
    left: 18%;
    width: 42.5%;
  }

  .spark.one {
    top: 7%;
    left: 8%;
  }
}

/* --- Feature cards ------------------------------------------------------------------------------ */

.feats {
  display: grid;
  gap: 22px;
  margin-top: clamp(30px, 4vw, 48px);
}

.card {
  overflow: hidden;
  border: 2px solid var(--edge);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 7px 0 var(--deep);
}

.shot {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-bottom: 2px solid var(--edge);
  background: var(--night);
}

.shot video,
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The Daily Planet: a tall screenshot that drifts slowly through the frame. */
.drift img {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
  transform: translate3d(0, -16%, 0);
}

.txt {
  padding: 16px 18px 18px;
}

.card h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: clamp(20px, 0.3vw + 18.6px, 23px);
  font-weight: 600;
  line-height: 1.15;
}

.card p {
  margin: 0;
  color: var(--soft);
  font-size: clamp(14px, 0.15vw + 13.4px, 16px);
  line-height: 1.4;
}

@media (min-width: 600px) and (max-width: 899.98px) {
  .feats {
    max-width: 760px;
  }

  .card {
    display: grid;
    grid-template-columns: 44% 1fr;
    align-items: center;
  }

  .shot {
    aspect-ratio: 4 / 3;
    border-right: 2px solid var(--edge);
    border-bottom: 0;
  }

  .txt {
    padding: 18px 24px;
  }
}

@media (min-width: 900px) {
  .feats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- The trailer -------------------------------------------------------------------------------- */

.trailer {
  margin-top: clamp(34px, 4.6vw, 56px);
  scroll-margin-top: 24px;
}

.trailer-box {
  --pad: clamp(14px, 2.2vw, 28px);
  --d: clamp(52px, 2.4vw + 42px, 78px);
  position: relative;
}

.screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--edge);
  border-radius: 22px;
  background: linear-gradient(120deg, #1c1a56, #3a2685 45%, #174a73);
  box-shadow: 0 7px 0 var(--deep);
}

.screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* On a phone the title sits above the trailer; on wider screens, beside the gold play button. */
.trailer-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(20px, 1vw + 13.6px, 28px);
  font-weight: 600;
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(7, 11, 44, 0.75);
  transition: opacity 0.3s;
}

@media (min-width: 600px) {
  .trailer-title {
    position: absolute;
    z-index: 2;
    left: calc(var(--pad) + var(--d) + 14px);
    bottom: calc(var(--pad) + var(--d) / 2);
    margin: 0;
    pointer-events: none;
    transform: translateY(50%);
  }

  /* Without JavaScript the native controls sit along the bottom, so the title moves to the top. */
  html:not(.js) .trailer-title {
    top: var(--pad);
    bottom: auto;
    left: var(--pad);
    transform: none;
  }

  html.js .screen::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(rgba(7, 11, 44, 0), rgba(7, 11, 44, 0.55));
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .trailer.playing .trailer-title,
  html.js .trailer.playing .screen::after {
    opacity: 0;
  }
}

/* The whole poster is the button; its gold disc sits at the bottom left. */
.big-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
}

.big-play[hidden] {
  display: none;
}

.big-play::before,
.big-play::after {
  content: "";
  position: absolute;
}

.big-play::before {
  left: var(--pad);
  bottom: var(--pad);
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 5px 0 var(--gold-deep), 0 0 0 9px rgba(255, 201, 74, 0.16);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.big-play::after {
  left: calc(var(--pad) + var(--d) * 0.39);
  bottom: calc(var(--pad) + var(--d) * 0.3);
  border-left: calc(var(--d) * 0.31) solid var(--night);
  border-top: calc(var(--d) * 0.2) solid transparent;
  border-bottom: calc(var(--d) * 0.2) solid transparent;
  transition: transform 0.25s var(--ease);
}

.big-play:hover::before {
  transform: scale(1.07);
  box-shadow: 0 5px 0 var(--gold-deep), 0 0 0 13px rgba(255, 201, 74, 0.2);
}

.big-play:active::before,
.big-play:active::after {
  transform: translateY(3px);
}

.big-play:focus-visible {
  outline-offset: -6px;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  padding: clamp(30px, 3.6vw, 44px) 0 clamp(24px, 3vw, 36px);
  color: var(--soft);
  font-size: 14px;
}

.foot a {
  padding: 6px 0;
  color: var(--soft);
  text-decoration: none;
  transition: color 0.2s;
}

.foot a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.foot .mail {
  margin-left: auto;
}

@media (max-width: 599.98px) {
  .foot .mail {
    flex-basis: 100%;
    margin-left: 0;
  }
}

/* --- Motion: only for visitors who have not asked for less of it ------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Rising in is site.js's job: without it (or its .js class) nothing is ever hidden. */
  html.js .rise {
    transition:
      opacity 0.8s var(--ease),
      transform 0.8s var(--ease);
  }

  html.js .rise:not(.in) {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }

  .planet {
    animation: float 9s ease-in-out infinite alternate;
  }

  .spark {
    animation: twinkle 3.4s ease-in-out infinite;
  }

  .spark.two {
    animation-duration: 4.3s;
    animation-delay: -1.7s;
  }

  .drift img {
    animation: drift 26s ease-in-out infinite alternate;
  }
}

@keyframes float {
  from {
    transform: translate3d(0, -10px, 0) rotate(-2deg);
  }
  to {
    transform: translate3d(-6px, 12px, 0) rotate(2deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.5) rotate(25deg);
    opacity: 0.55;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -36%, 0);
  }
}

/* --- Policy pages (privacy.html, delete-data.html): static, no sky canvas, no motion ------------ */

body.doc {
  background:
    radial-gradient(60vmax 40vmax at 90% -10%, rgba(94, 70, 190, 0.35), transparent 70%),
    radial-gradient(50vmax 36vmax at -10% 30%, rgba(30, 130, 150, 0.22), transparent 70%),
    linear-gradient(var(--night), var(--low));
  background-attachment: fixed;
}

.doc .page {
  padding-top: clamp(24px, 4vw, 48px);
}

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(20px, 3.5vw, 40px);
  border: 2px solid var(--edge);
  border-radius: 22px;
  background: rgba(18, 26, 79, 0.82);
  box-shadow: 0 6px 0 var(--deep);
  font-size: 17px;
  line-height: 1.65;
}

.prose h1 {
  margin: 0.15em 0 0.2em;
  font-size: clamp(36px, 3vw + 26px, 56px);
}

.prose h2 {
  margin: 1.8em 0 0.4em;
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(21px, 0.8vw + 18px, 26px);
  font-weight: 600;
  line-height: 1.2;
}

.prose h3 {
  margin: 1.4em 0 0.3em;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
}

.prose p,
.prose li {
  color: #e3e6fb;
}

.prose p {
  margin: 0.8em 0;
}

.prose .meta {
  margin: 0 0 1.4em;
  color: var(--soft);
  font-size: 15px;
}

.prose strong {
  color: #fff;
  font-weight: 800;
}

.prose a {
  color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose a:hover {
  color: var(--sparkle);
}

.prose ul {
  margin: 0.8em 0;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.5em 0;
}

.tablebox {
  margin: 1em 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1.5px solid var(--edge);
  text-align: left;
  vertical-align: top;
  color: #e3e6fb;
}

.prose thead th {
  background: var(--panel);
  color: var(--gold);
  font-family: var(--display);
  font-weight: 600;
}

.prose tbody th {
  color: #fff;
  font-weight: 800;
}

.prose .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 599.98px) {
  .prose {
    border-radius: 16px;
    font-size: 16px;
  }

  .prose table {
    font-size: 14px;
  }

  .prose th,
  .prose td {
    padding: 8px;
  }
}
