/* Infinità Game Studio: shared styles for every page */

:root {
  --brand-navy: #012a54;
  --brand-orange: #ed7d24;
  --navy-700: #0b3a6e;
  --navy-900: #001a36;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #dde4ee;
  --text: #0e1b2c;
  --text-muted: #4a5a70;
  --link: #b5520a;
  --radius: 16px;
  --maxw: 1080px;
  --font-heading: "Fredoka", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --deco-opacity: 0.3;
  --deco-bg-opacity: 0.16;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071b33;
    --surface: #0d2747;
    --border: #1d3d63;
    --text: #e8eef6;
    --text-muted: #a9b8cc;
    --link: #f39a52;
    --deco-opacity: 0.7;
    --deco-bg-opacity: 0.3;
  }
}

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

h3 {
  font-size: 1.375rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* Skip link */

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Header */

.site-header {
  background: var(--brand-navy);
  color: #fff;
  z-index: 50;
}

@media (min-width: 720px) {
  .site-header {
    position: sticky;
    top: 0;
  }
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand__mark {
  width: 44px;
  height: 22px;
  color: var(--brand-orange);
}

.brand small {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  line-height: 1;
}

.brand span {
  line-height: 1.1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

.site-nav a:hover {
  background: var(--navy-700);
}

.site-nav a[aria-current="page"] {
  background: var(--brand-orange);
  color: var(--brand-navy);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--brand-navy);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  border-color: var(--brand-navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgb(1 42 84 / 0.25);
}

.btn:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgb(255 255 255 / 0.5);
}

.btn--ghost:hover {
  border-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* Hero */

.hero {
  background: var(--brand-navy);
  color: #fff;
  text-align: center;
  padding-bottom: 56px;
}

.hero img {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.hero h1 {
  margin-top: 8px;
}

.hero p {
  max-width: 34em;
  margin: 0 auto 28px;
  color: #d6e0ec;
  font-size: 1.15rem;
}

/* Sections */

.section {
  padding: 64px 0;
}

.section-title {
  text-align: center;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 36em;
  margin: 0 auto 40px;
}

.divider {
  display: block;
  width: 44px;
  height: 22px;
  margin: 0 auto 16px;
  color: var(--brand-orange);
}

/* Decorations: the header art's doodles (assets/decorations.svg), placed with inline custom properties */

.has-deco {
  position: relative;
  overflow: hidden;
  overflow: clip;
}

.has-deco > .container {
  position: relative;
  z-index: 1;
}

.deco {
  position: absolute;
  z-index: 0;
  top: var(--top, auto);
  right: var(--right, auto);
  bottom: var(--bottom, auto);
  left: var(--left, auto);
  width: var(--size);
  height: var(--size);
  max-width: none;
  transform: rotate(var(--rot, 0deg));
  opacity: var(--deco-opacity);
  pointer-events: none;
}

/* Without room beside the content, the doodles become a tiled background instead */
@media (max-width: 1099px) {
  .deco {
    display: none;
  }

  .has-deco::before,
  .legal::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: url("/assets/doodle-pattern.svg") center top / 320px repeat;
    opacity: var(--deco-bg-opacity);
    pointer-events: none;
  }

  /* The legal column is narrower than the screen: stretch the pattern to the full width */
  .legal::before {
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
  }
}

/* Game cards */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 10px rgb(1 42 84 / 0.06);
}

.game-card__icon {
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
}

.game-card__pitch {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-weight: 700;
}

.game-card ul {
  flex: 1;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.game-card li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 6px;
}

.game-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand-orange);
  font-weight: 700;
}

/* Store links: the official Google Play badge, plus a QR code for visitors on a computer */

.store {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* The badge image has transparent padding around it: pull it back so the visible badge lines up with the text */
.store__badge {
  display: block;
  flex: none;
  margin: -12px 0 -12px -12px;
  border-radius: 12px;
}

.store__badge img {
  display: block;
  width: auto;
  height: 72px;
  transition: transform 0.15s ease;
}

.store__badge:hover img {
  transform: translateY(-1px);
}

.store__qr {
  display: none;
  margin: 0;
  text-align: center;
}

.store__qr img {
  display: block;
  width: 96px;
  height: 96px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.store__qr figcaption {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Only on devices with a mouse: on a phone, scanning a code on its own screen doesn't work */
@media (hover: hover) and (pointer: fine) {
  .store__qr {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store__badge img {
    transition: none;
  }

  .store__badge:hover img {
    transform: none;
  }
}

.game-card--soon {
  border-style: dashed;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--brand-navy);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.store-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.soon-note {
  margin: auto 0 0;
  color: var(--text-muted);
  font-style: italic;
}

/* About */

.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.about p {
  max-width: 40em;
  margin: 0 auto 12px;
}

/* Legal pages */

.legal {
  position: relative;
  max-width: calc(68ch + 32px);
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.legal > :not(.deco) {
  position: relative;
  z-index: 1;
}

.legal .dates {
  margin: 0 0 32px;
  color: var(--text-muted);
}

.legal h2 {
  margin-top: 2em;
  scroll-margin-top: 88px;
}

.legal h3 {
  font-size: 1.125rem;
  margin-top: 1.5em;
}

.summary {
  margin: 0 0 32px;
  padding: 20px 24px;
  border-left: 4px solid var(--brand-orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
}

.summary h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.summary ul {
  margin: 0;
  padding-left: 1.2em;
}

.toc {
  margin: 0 0 32px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
  columns: 2 220px;
  column-gap: 32px;
}

.toc li {
  break-inside: avoid;
}

.providers {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 0.975rem;
}

.providers th,
.providers td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.providers th {
  font-family: var(--font-heading);
  font-weight: 600;
}

@media (max-width: 560px) {
  .providers thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .providers tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .providers td {
    display: block;
    padding: 2px 0;
    border: 0;
  }

  .providers td:first-child {
    font-weight: 700;
  }
}

/* 404 */

.not-found {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
  background: var(--brand-navy);
  color: #fff;
  text-align: center;
}

.not-found__card {
  max-width: 480px;
}

.not-found__art {
  width: 220px;
  margin: 0 auto 16px;
}

.not-found p {
  color: #d6e0ec;
  margin: 0 0 28px;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Footer */

.site-footer {
  background: var(--navy-900);
  color: #c9d5e3;
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .trademarks {
  flex-basis: 100%;
  color: #8fa3bb;
  font-size: 0.8rem;
}

/* Print */

@media print {
  .site-header,
  .site-footer,
  .skip,
  .toc,
  .deco {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .summary {
    background: none;
  }

  a {
    color: #000;
  }

  .legal {
    max-width: none;
    padding: 0;
  }
}
