/* Bloco Games site. Images and the font come from tools/make_site_assets.py in the game repository. */

@font-face {
  font-family: "Lato Black";
  src: url("fonts/lato-black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #0d1230;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f3efe6;
  --muted: #a9b3dc;
  --accent: #ffcf3f;
  --orange: #f39a2b;
  --red: #e8524a;
  --blue: #4a7be8;
  --purple: #a35ce0;
  --display: "Lato Black", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

/* The backdrop: a faint board grid with warm and cool glows in opposite corners. Fixed, so it stays while the
   page scrolls (background-attachment: fixed is unreliable on phones). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vmax 50vmax at 0% 0%, rgba(232, 82, 74, 0.42), transparent 70%),
    radial-gradient(60vmax 55vmax at 100% 100%, rgba(74, 123, 232, 0.5), transparent 70%),
    radial-gradient(40vmax 40vmax at 100% 0%, rgba(163, 92, 224, 0.18), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: linear-gradient(rgba(13, 18, 48, 0.85), rgba(13, 18, 48, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 900 20px/1 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 10px);
  gap: 2px;
}

.brand-mark i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.3);
}

.brand-mark i:not([style]) {
  visibility: hidden;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

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

.site-nav .nav-link {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text) !important;
  font-weight: 600;
}

.pill:hover {
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- sections */

/* On phones only the first screen fills the window; the rest take the height they need. */
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px var(--gutter);
}

.screen.hero {
  min-height: 100svh;
  padding-top: 104px;
  padding-bottom: 96px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 8px;
  background: var(--accent);
}

.display {
  margin: 0;
  font: 900 clamp(42px, 8.4vw, 116px) / 1.02 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.display em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  max-width: 34em;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.scroll-hint::after {
  content: "";
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--muted), transparent);
  animation: hint 1.8s ease-in-out infinite;
}

@keyframes hint {
  0%,
  100% {
    transform: scaleY(0.4);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
}

/* Sections fade up as they come into view (site.js adds .in). Without JavaScript they are simply visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------- floating logo (home hero) */

/* The 3x3 logo as separate 3D blocks. It stays fixed while the page scrolls; site.js spreads the blocks apart
   and fades them as you leave the first screen. */
.float-logo {
  --spread: 0px;
  position: fixed;
  z-index: -1;
  top: 92px;
  left: 50%;
  width: min(56vw, 300px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  pointer-events: none;
}

.float-logo::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(closest-side, rgba(255, 207, 63, 0.22), transparent);
}

.fb {
  position: absolute;
  left: calc(var(--x) * 34%);
  top: calc(var(--y) * 34%);
  width: 31%;
  transform: translate(calc(var(--dx) * var(--spread)), calc(var(--dy) * var(--spread))) rotate(var(--r));
}

.fb img {
  display: block;
  width: 100%;
  filter: drop-shadow(0 14px 18px rgba(4, 6, 24, 0.55));
  animation: bob 5s ease-in-out var(--d) infinite alternate;
}

@keyframes bob {
  from {
    transform: translateY(-6%) rotate(-3deg);
  }
  to {
    transform: translateY(6%) rotate(3deg);
  }
}

.hero {
  justify-content: flex-end;
}

/* ---------------------------------------------------------------- game showcase */

.showcase {
  display: grid;
  gap: 40px;
  align-items: center;
}

.showcase > * {
  min-width: 0;
}

.wordmark {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 0 0 8px -2%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 26px;
}

/* Google's badge image has transparent padding built in, so it sits flush left with a negative margin. */
.store-badge {
  display: inline-block;
  margin-left: -10px;
}

.store-badge img {
  display: block;
  height: 72px;
  width: auto;
}

.more {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.more::after {
  content: " →";
  color: var(--accent);
}

.phones {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.phone {
  width: min(44vw, 230px);
  padding: 7px;
  border-radius: 30px;
  background: #11131d;
  box-shadow:
    0 0 0 2px #3a4060,
    0 30px 60px rgba(4, 6, 24, 0.6);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}

/* Three phones side by side need to be narrower on small screens. */
.phones:not(.two) .phone {
  width: min(30vw, 230px);
}

.phones .phone:first-child {
  transform: rotate(-7deg) translate(14%, 4%);
}

.phones .phone:nth-child(2) {
  position: relative;
  z-index: 1;
  transform: translateY(-4%);
}

.phones .phone:nth-child(3) {
  transform: rotate(7deg) translate(-14%, 4%);
}

.phones.two .phone:first-child {
  transform: rotate(-6deg) translateX(8%);
}

.phones.two .phone:nth-child(2) {
  transform: rotate(6deg) translate(-8%, 6%);
}

/* ---------------------------------------------------------------- news, community, contact */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li + li {
  margin-top: 28px;
}

.list time,
.list small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.list a {
  color: var(--text);
  text-decoration: none;
  font: 900 clamp(26px, 4.2vw, 52px) / 1.15 var(--display);
}

.list a:hover {
  color: var(--accent);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.socials a:hover {
  border-color: var(--accent);
}

.socials svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.contact {
  display: grid;
  gap: 28px;
  margin-top: 8px;
}

.contact ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.contact li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.email {
  color: var(--text);
  font: 900 clamp(22px, 3.1vw, 44px) / 1.1 var(--display);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.email:hover {
  color: var(--accent);
}

.site-footer {
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

/* ---------------------------------------------------------------- game page features */

.features {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.feature h3 {
  margin: 14px 0 6px;
  font: 900 24px/1.2 var(--display);
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.feature .brand-mark {
  grid-template-columns: repeat(3, 16px);
}

.feature .brand-mark i {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- text pages (privacy policy) */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px var(--gutter) 64px;
}

.doc header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.doc header img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.doc h1 {
  margin: 0;
  font: 900 clamp(32px, 5vw, 44px) / 1.1 var(--display);
}

.doc h2 {
  margin-top: 36px;
  color: var(--accent);
  font: 900 22px/1.3 var(--display);
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc footer {
  margin-top: 48px;
  font-size: 14px;
}

/* ---------------------------------------------------------------- wider screens */

@media (min-width: 700px) {
  :root {
    --gutter: 40px;
  }

  .site-header {
    padding: 22px var(--gutter);
  }

  .site-nav .nav-link {
    display: inline;
  }

  .contact {
    grid-template-columns: 1fr 1.6fr;
    align-items: end;
  }

  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .screen {
    min-height: 100svh;
    padding: 104px var(--gutter) 88px;
  }

  .float-logo {
    top: 50%;
    left: auto;
    right: 6vw;
    width: min(38vw, 520px);
    transform: translateY(-50%);
  }

  .hero {
    justify-content: center;
  }

  .hero .display,
  .hero .lead {
    max-width: 52%;
  }

  .showcase {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fb img,
  .scroll-hint::after {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
