@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/nunito-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/nunito-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/nunito-black.woff") format("woff");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  font-synthesis: none;
  color: #203e34;
  background: #eff8f3;
  --focus-color: #6512b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px)
    max(20px, env(safe-area-inset-right, 0px))
    env(safe-area-inset-bottom, 0px)
    max(20px, env(safe-area-inset-left, 0px));
}

main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(24px, 5dvh, 48px);
}

.landing {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.app-icon {
  display: block;
  width: clamp(140px, min(45vw, 28dvh), 224px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
}

h1 {
  margin: clamp(20px, 3dvh, 28px) 0 0;
  font-size: clamp(32px, 7vw, 44px);
  font-weight: 700;
  line-height: 1.2;
}

.tagline {
  max-width: 420px;
  margin: 12px 0 0;
  font-size: clamp(17px, 3.8vw, 20px);
  line-height: 1.5;
  color: #476457;
  text-wrap: pretty;
}

/* SUActionButton + ActionButtonPalette.gamePrimary; metrics use button height. */
.game-primary {
  --button-height: clamp(60px, 9dvh, 72px);
  --face-radius: calc(var(--button-height) * 0.2);
  --face-inset: calc(var(--button-height) * 0.05);
  --dark-stroke: rgb(61 10 104 / 90%);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  height: var(--button-height);
  margin-top: clamp(24px, 4dvh, 32px);
  padding: 8px 16px;
  border-radius: calc(var(--button-height) * 0.25);
  background: linear-gradient(to bottom, #f42691, #7417d9);
  color: #fff;
  font-size: clamp(26px, 5.8vw, 32px);
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-primary::before,
.game-primary::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: transform 150ms ease-out;
}

.game-primary::before {
  z-index: -2;
  inset: var(--face-inset);
  border-radius: var(--face-radius);
  background: linear-gradient(to bottom, #6512b8, #f21886);
  /* Native strokes are centered on the rounded paths. */
  outline: calc(var(--button-height) * 0.025) solid var(--dark-stroke);
  outline-offset: calc(var(--button-height) * -0.0125);
}

.game-primary::after {
  z-index: -1;
  /* 0.05 + (0.16 * 0.35): native container and highlight padding. */
  inset: calc(var(--button-height) * 0.106);
  border-radius: var(--face-radius);
  outline: calc(var(--button-height) * 0.018) solid #e052d6;
  outline-offset: calc(var(--button-height) * -0.009);
}

.game-primary span {
  /* Closest CSS equivalent to the hub's white SUFramedTitle (4pt outline). */
  -webkit-text-stroke: 4px var(--dark-stroke);
  paint-order: stroke fill;
  transition: transform 150ms ease-out;
}

/* The native component has no hover shading or drop shadow. */
@media (hover: hover) {
  .game-primary:hover {
    outline: 2px solid var(--focus-color);
    outline-offset: 4px;
  }
}

.game-primary:active::before {
  transform: scale(0.9);
}

.game-primary:active::after {
  transform: scale(0.9);
}

.game-primary:active span {
  transform: scale(0.9);
}

a:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 5px;
}

footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-block: 12px 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #476457;
}

footer a {
  padding-block: 8px;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

footer a:hover {
  color: #203e34;
}

@media (max-height: 540px) {
  main {
    padding-block: 20px;
  }

  .app-icon {
    width: clamp(88px, 24dvh, 128px);
  }

  h1 {
    margin-top: 16px;
    font-size: clamp(28px, 5vw, 36px);
  }

  .tagline {
    margin-top: 8px;
    font-size: 17px;
  }

  .game-primary {
    margin-top: 20px;
    --button-height: 56px;
    font-size: 26px;
  }

  footer {
    padding-block: 4px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-primary::before,
  .game-primary::after,
  .game-primary span {
    transition: none;
  }
}
