/* Estúdio Elemental
   Colours: one cobalt page, one tile colour per game. Change them here. */
:root {
  --cobalt: #2238c9;
  --cobalt-deep: #18278f;
  --ink: #0c1340;
  --chalk: #f6f7ff;
  --sun: #ffd23f; /* Vitamin Blocks */
  --coral: #ff7a66; /* Lockstep */
  --mint: #7fe3b8; /* Folklore Survivors */

  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --page: min(72rem, 100% - 2.5rem);
  --tile-radius: 0.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cobalt);
  color: var(--chalk);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

.skip {
  position: absolute;
  left: -999rem;
  top: 0.5rem;
  background: var(--sun);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: var(--tile-radius);
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
}

/* Header */

.top {
  width: var(--page);
  margin-inline: auto;
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark-tile {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--chalk);
  color: var(--cobalt);
  border-radius: 0.375rem;
  font-weight: 800;
  font-size: 1.125rem;
}

.top nav {
  display: flex;
  gap: 1.75rem;
}

.top nav a {
  text-decoration: none;
  font-weight: 500;
}

.top nav a:hover {
  text-decoration: underline;
}

/* Hero */

.hero {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(4rem, 9vw, 8rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.2vw, 5.25rem);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-text p {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: 1.25rem;
}

.button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  background: var(--chalk);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 120ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

/* The table of games */

.table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--tile-radius);
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

.tile-n {
  font-weight: 600;
  font-size: 0.9375rem;
}

.tile-s {
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

.tile-name {
  font-size: clamp(0.75rem, 1.2vw, 0.9375rem);
  font-weight: 600;
}

.tile-vb,
.game-vb .game-tile {
  background: var(--sun);
}

.tile-ls,
.game-ls .game-tile {
  background: var(--coral);
}

.tile-fs,
.game-fs .game-tile {
  background: var(--mint);
}

a.tile {
  transition: transform 140ms ease;
}

a.tile:hover {
  transform: translateY(-4px) rotate(-1.5deg);
}

.tile-empty {
  border: 2px dashed rgb(246 247 255 / 0.28);
}

.tile-next {
  border: 2px dashed var(--chalk);
  color: var(--chalk);
}

/* One orchestrated moment: the tiles settle into the table on load. */
@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(-1.5rem) rotate(-6deg);
  }
}

.table > a.tile {
  animation: settle 520ms cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

.table > .tile-ls {
  animation-delay: 110ms;
}

.table > .tile-fs {
  animation-delay: 220ms;
}

/* Games */

.games {
  background: var(--chalk);
  color: var(--ink);
  padding-block: clamp(3.5rem, 8vw, 7rem);
}

.games > h2,
.game {
  width: var(--page);
  margin-inline: auto;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.game {
  display: grid;
  grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 2px solid var(--ink);
  margin-top: clamp(2rem, 4vw, 3rem);
  scroll-margin-top: 1rem;
}

.game + .game {
  margin-top: 0;
}

.game-tile {
  aspect-ratio: 1;
  align-self: start;
  border-radius: var(--tile-radius);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-tile .tile-s {
  font-size: clamp(4rem, 10vw, 7.5rem);
}

.game-body {
  max-width: 40rem;
}

.game h3 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.game-kind {
  margin-top: 0.375rem;
  font-weight: 600;
  color: var(--cobalt);
}

.game-body > p + p {
  margin-top: 1rem;
}

.facts {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem 1.5rem;
}

.facts dt {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.65;
}

.facts dd {
  font-weight: 600;
}

.games .button {
  background: var(--ink);
  color: var(--chalk);
}

/* Studio */

.studio {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.studio-text p {
  margin-top: 1.25rem;
  max-width: 36rem;
}

.people {
  display: grid;
  gap: 1.25rem;
}

.people li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: 1rem;
  align-items: center;
}

.person-tile {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--chalk);
  border-radius: 0.375rem;
  font-weight: 800;
  font-stretch: 80%;
  font-size: 1.25rem;
}

.person-name {
  font-weight: 700;
  line-height: 1.2;
  align-self: end;
}

.person-role {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.3;
  align-self: start;
}

/* Contact */

.contact {
  background: var(--cobalt-deep);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}

.contact > * {
  width: var(--page);
  margin-inline: auto;
}

.contact p {
  margin-top: 1rem;
  max-width: none;
}

.contact p:not(.small) {
  font-size: 1.25rem;
  padding-right: max(0px, calc(var(--page) - 40rem));
}

.contact .small {
  margin-top: 3rem;
  font-size: 0.9375rem;
  opacity: 0.7;
}

/* Text pages (privacy) */

.page {
  width: min(44rem, 100% - 2.5rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}

.page h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.page h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2.5rem;
}

.page p,
.page ul {
  margin-top: 1rem;
}

.page ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.page li + li {
  margin-top: 0.5rem;
}

.page-date {
  font-size: 0.9375rem;
  opacity: 0.7;
}

/* Small screens */

@media (max-width: 52rem) {
  .hero,
  .studio {
    grid-template-columns: 1fr;
  }

  .table {
    max-width: 26rem;
  }

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

  .game-tile {
    width: 9rem;
  }

  .game-tile .tile-s {
    font-size: 4rem;
  }
}

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

  .table > a.tile {
    animation: none;
  }

  .button,
  a.tile {
    transition: none;
  }
}
