/* Mi Carnal, micarnal.app. Colours come from the app (lib/app/theme.dart). */

@font-face {
  font-family: "Chango";
  src: url("fonts/chango.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --rosa: #e4007c;
  --rosa-deep: #b80064;
  --chile: #c62828;
  --chile-dark: #8e1b1b;
  --cream: #fff8ec;
  --ink: #2b1b17;
  --agave: #1b4d38;
  --agave-light: #8fcfae;
  --marigold: #f5a623;

  --display: "Chango", "Arial Black", sans-serif;
  --body: "Bricolage Grotesque", system-ui, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html {
  font-family: var(--body);
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 0.16em;
}

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

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--cream);
  padding: 0.5rem 0.75rem;
}

/* Header: the mark, the name, the other language. */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  background: var(--rosa);
  color: var(--cream);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.125rem;
  text-decoration: none;
}
.brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
}
.lang {
  font-weight: 600;
}

/* Hero: the name, what it is, and the hand of cards. */

.hero {
  background: var(--rosa);
  color: var(--cream);
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(3rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  overflow: hidden;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  /* A printed-card offset in chile red. */
  text-shadow: 0.05em 0.05em 0 var(--chile-dark);
}

.tagline {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

.stores {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.soon {
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  padding: 0.75rem 1.1rem;
  border-radius: 0.75rem;
}

/* The cards. Each is a button: tap to flip between word and meaning. */

.deck {
  margin: 0;
}
.hand {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}
.hand li {
  --tilt: 0deg;
  --lift: 0rem;
  flex: 0 0 auto;
  margin-inline: -1.6rem;
  transform: translateY(var(--lift)) rotate(var(--tilt));
  transition: transform 0.3s ease;
}
/* A flipped card comes to the front of the fan (cards.js sets z-index). */
.hand li.up {
  transform: translateY(calc(var(--lift) - 1rem)) rotate(var(--tilt)) scale(1.06);
}
.hand li:nth-child(1) { --tilt: -12deg; --lift: 1.6rem; }
.hand li:nth-child(2) { --tilt: -6deg; --lift: 0.4rem; }
.hand li:nth-child(3) { --tilt: 0deg; --lift: 0rem; }
.hand li:nth-child(4) { --tilt: 6deg; --lift: 0.4rem; }
.hand li:nth-child(5) { --tilt: 12deg; --lift: 1.6rem; }

.card {
  display: block;
  width: clamp(8.5rem, 13vw, 11rem);
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  perspective: 900px;
}
.card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.card[aria-pressed="true"] .card-inner {
  transform: rotateY(180deg);
}
.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  background: var(--cream);
  border: 0.55rem solid var(--chile);
  border-radius: 0.9rem;
  box-shadow: 0.35rem 0.4rem 0 rgb(142 27 27 / 0.55);
  padding: 0.55rem;
  text-align: left;
}
.num {
  align-self: flex-start;
  min-width: 1.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: var(--chile);
  color: var(--cream);
  font-family: var(--display);
  font-size: 0.85rem;
  text-align: center;
}
.word {
  /* Top left, like the name on a card held in a fanned hand. */
  flex: 1;
  margin-top: 0.6rem;
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  line-height: 1.05;
  white-space: nowrap;
}
.band {
  background: var(--chile);
  border-radius: 0.35rem;
  height: 1.4rem;
  background-image: radial-gradient(circle, var(--marigold) 0.18rem, transparent 0.2rem);
  background-size: 1.6rem 100%;
  background-position: center;
}
.back {
  transform: rotateY(180deg);
  justify-content: center;
  gap: 0.4rem;
  background: var(--ink);
  color: var(--cream);
  border-color: var(--marigold);
  padding: 0.8rem;
}
.back b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
  color: var(--marigold);
}
.back span {
  font-size: 0.95rem;
  line-height: 1.3;
}

.hint {
  margin: 3rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Games. */

.games {
  background: var(--agave);
  color: var(--cream);
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}
.games h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 2.5rem;
}
.games dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem clamp(2rem, 4vw, 3.5rem);
  margin: 0;
  max-width: 72rem;
}
.games dt {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--marigold);
  margin-bottom: 0.4rem;
}
.games dd {
  margin: 0;
  max-width: 24rem;
}
.games .note {
  margin: 3rem 0 0;
  max-width: var(--measure);
  color: var(--agave-light);
}

/* Footer. */

.foot {
  background: var(--ink);
  color: var(--cream);
  padding: 2.5rem var(--gutter) 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  font-size: 0.95rem;
}
.foot p {
  margin: 0;
}
.foot .copy {
  margin-left: auto;
  opacity: 0.7;
}

/* Text pages (privacy). */

.page {
  background: var(--cream);
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 4rem;
}
.page > * {
  max-width: 40rem;
}
.page h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1;
  color: var(--chile);
  margin: 0 0 0.75rem;
}
.page .updated {
  margin: 0 0 2.5rem;
  color: #5c4740;
}
.page h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.25rem 0 0.5rem;
}
.page p,
.page li {
  line-height: 1.6;
}
.page ul {
  padding-left: 1.2rem;
}

/* Small screens: stack, and fan the cards tighter. */

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: 1fr;
  }
  /* Three cards fit a phone; the outer two sit out. */
  .hand li:nth-child(1),
  .hand li:nth-child(5) {
    display: none;
  }
  .hand li:nth-child(2) { --tilt: -8deg; --lift: 0.6rem; }
  .hand li:nth-child(4) { --tilt: 8deg; --lift: 0.6rem; }
  .hand li {
    margin-inline: -0.9rem;
  }
  .card {
    width: clamp(7rem, 30vw, 9rem);
  }
  .word {
    font-size: 0.9rem;
  }
  .face {
    border-width: 0.4rem;
  }
  .foot .copy {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-inner,
  .hand li {
    transition: none;
  }
}
