/* ==========================================================================
   Mintpop Games — site styles
   Plain CSS, no build step. Sections: fonts, tokens, base, buttons, hero,
   ribbon, games, contact, footer, motion.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Bagel Fat One";
  src: url("../fonts/bagel-fat-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bagel Fat One";
  src: url("../fonts/bagel-fat-one-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --mint-50: #f2fff9;
  --mint-200: #b5f7dc;
  --mint-400: #4fe3ae;
  --pine: #0f4037;
  --pine-deep: #0a2e28;
  --sun: #ffd23f;
  --pop: #ff5c93;
  --white: #fff;
  --logo-green: #017d69; /* the two colours of the logo artwork */
  --logo-mint: #ddf5e5;

  --display: "Bagel Fat One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  margin: 0;
  background: var(--mint-50);
  color: var(--pine);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

a {
  color: inherit;
}

:focus-visible {
  outline: 0.1875rem solid var(--pine);
  outline-offset: 0.1875rem;
  border-radius: 0.375rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--pine);
  color: var(--mint-50);
  font-weight: 600;
}
.skip:focus {
  top: 1rem;
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1;
}

.section-lede {
  margin-top: 0.75rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
}

/* ---------- Buttons ----------
   Anything you can press has a solid "lip" underneath, like a game button. */
.btn {
  --lip: 0.375rem;
  display: inline-block;
  padding: 0.85em 1.5em;
  border: 0.1875rem solid var(--pine);
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 var(--lip) 0 var(--pine);
  color: var(--pine);
  font: 700 1.0625rem/1.2 var(--body);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover {
  background: #ffdf70;
  transform: translateY(-0.125rem);
  box-shadow: 0 calc(var(--lip) + 0.125rem) 0 var(--pine);
}
.btn:active {
  transform: translateY(calc(var(--lip) - 0.125rem));
  box-shadow: 0 0.125rem 0 var(--pine);
}
.btn--plain {
  background: var(--white);
}
.btn--plain:hover {
  background: var(--mint-50);
}
.btn--small {
  --lip: 0.3125rem;
  padding: 0.7em 1.15em;
  font-size: 0.9375rem;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-block;
  flex: none;
  line-height: 0;
}
.logo img {
  width: auto;
  height: clamp(3rem, 5.5vw, 4rem);
}
/* In the dark footer the logo sits on its own pale mint, as in the brand artwork. */
.logo--badge {
  padding: 0.85rem 1.1rem;
  border-radius: 1.1rem;
  background: var(--logo-mint);
}
.logo--badge img {
  height: 3.25rem;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--mint-200);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}
.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-weight: 600;
}
.nav__links a {
  padding: 0.35rem 0.15rem;
  text-decoration: none;
  background: linear-gradient(var(--pine), var(--pine)) no-repeat 0 100% / 0 0.1875rem;
  transition: background-size 0.2s ease;
}
.nav__links a:hover {
  background-size: 100% 0.1875rem;
}

@media (max-width: 23rem) {
  .nav__links {
    gap: 0.85rem;
    font-size: 1rem;
  }
}

.hero__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.005em;
  /* A solid offset under the letters: the same "lip" the buttons have. */
  text-shadow: 0 0.055em 0 var(--mint-400);
}
.hero__title span {
  display: block;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 1.75rem;
  text-wrap: pretty;
  font-size: clamp(1.125rem, 1.7vw, 1.375rem);
  line-height: 1.45;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* The pile of game icons. Positions are percentages of a square box, so the
   whole arrangement scales with the screen. */
.pile {
  position: relative;
  width: min(100%, 34rem);
  aspect-ratio: 1;
  margin-inline: auto;
}
.pile::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: var(--mint-400);
}
.pile__dot {
  position: absolute;
  border-radius: 50%;
}
.pile__dot--a { left: 44%; top: 3%; width: 9%; aspect-ratio: 1; background: var(--pop); }
.pile__dot--b { left: 90%; top: 76%; width: 6%; aspect-ratio: 1; background: var(--sun); }
.pile__dot--c { left: 3%; top: 83%; width: 4.5%; aspect-ratio: 1; background: var(--white); }

.pile__item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: rotate(var(--r));
  border-radius: 22.5%;
}
.pile__float {
  display: block;
}
.pile__item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: clamp(0.1875rem, 0.6vw, 0.3125rem) solid var(--white);
  border-radius: 22.5%;
  background: var(--white);
  box-shadow: 0 clamp(0.3rem, 1vw, 0.55rem) 0 rgba(15, 64, 55, 0.22);
  transition: transform 0.25s var(--spring);
}
.pile__item:hover img,
.pile__item:focus-visible img {
  transform: scale(1.1) rotate(calc(var(--r) * -1));
}

.pile__item--1 { --x: 30%; --y: 28%; --w: 40%; --r: -4deg; --i: 0; z-index: 2; }
.pile__item--2 { --x: 3%;  --y: 7%;  --w: 28%; --r: -10deg; --i: 1; }
.pile__item--3 { --x: 65%; --y: 4%;  --w: 26%; --r: 8deg;  --i: 2; }
.pile__item--4 { --x: 72%; --y: 41%; --w: 27%; --r: 6deg;  --i: 3; }
.pile__item--5 { --x: 0%;  --y: 46%; --w: 26%; --r: 7deg;  --i: 4; }
.pile__item--6 { --x: 19%; --y: 73%; --w: 24%; --r: -7deg; --i: 5; }
.pile__item--7 { --x: 51%; --y: 71%; --w: 27%; --r: 9deg;  --i: 6; }

@media (min-width: 56rem) {
  .hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .hero__title {
    font-size: clamp(3.75rem, 7.6vw, 6.25rem);
  }
}

/* ---------- Ribbon ---------- */
.ribbon {
  position: relative;
  z-index: 2;
  margin-block: -1.75rem;
  padding-block: 0.75rem;
  overflow: hidden;
  pointer-events: none;
}
.ribbon__band {
  width: 106%;
  margin-left: -3%;
  padding-block: 0.7rem;
  background: var(--pine);
  color: var(--mint-200);
  transform: rotate(-1.2deg);
}
.ribbon__track {
  display: flex;
  width: max-content;
}
.ribbon__group {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  padding-right: clamp(1rem, 2.4vw, 1.75rem);
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.875rem);
  line-height: 1;
  white-space: nowrap;
}
.ribbon__group svg {
  width: 0.7em;
  height: 0.7em;
  flex: none;
  fill: var(--sun);
}
.ribbon__group svg:nth-of-type(even) {
  fill: var(--pop);
}

/* ---------- Games ---------- */
.games {
  padding-block: clamp(5rem, 10vw, 7.5rem) clamp(4rem, 9vw, 7rem);
}

.games__grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
@media (min-width: 56rem) {
  .games__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tile colours: one per game. */
.game--crop-drop { --tile: #b9f26b; }
.game--lolly-loop { --tile: #ffa9d0; }
.game--people-up { --tile: #ffdd55; }
.game--slither-squeeze { --tile: #c3b1ff; }
.game--rush-people { --tile: #9cc8ff; }
.game--connect-up { --tile: #ffbe85; }
.game--dive-and-fish { --tile: #7fe3f2; }

.game {
  position: relative;
  display: flex;
  min-height: 22rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  border-radius: 2rem;
  background: var(--tile, var(--mint-200));
  scroll-margin-top: 1.5rem;
}

.game__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 60%;
}

.game__flag {
  margin-bottom: 1rem;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  background: var(--pine);
  color: var(--sun);
  font-size: 0.875rem;
  font-weight: 700;
}

.game__icon {
  width: 5.5rem;
  height: auto;
  aspect-ratio: 1;
  border: 0.25rem solid var(--white);
  border-radius: 22.5%;
  background: var(--white);
}

.game__name {
  margin-top: 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  line-height: 1;
}

.game__tagline {
  margin-top: 0.5rem;
  font-weight: 700;
}

.game__desc {
  margin-top: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.45;
}

.game__cta {
  margin-top: auto;
  margin-bottom: 0.3125rem; /* room for the button's lip */
}

.game__shots {
  position: absolute;
  top: 1.75rem;
  right: 4%;
  width: 31%;
  max-width: 13.5rem;
}
.game__shots img {
  width: 100%;
  height: auto;
  border: 0.3125rem solid var(--pine);
  border-radius: 1.5rem;
  background: var(--pine);
  transform: rotate(5deg);
  box-shadow: -0.5rem 0.75rem 0 rgba(15, 64, 55, 0.16);
}
.game:nth-child(odd) .game__shots img {
  transform: rotate(-4deg);
}

/* The newest release gets the full row and a second screenshot. */
.game--featured .game__shots img + img {
  display: none;
}
@media (min-width: 56rem) {
  .game--featured {
    grid-column: 1 / -1;
    min-height: 27rem;
  }
  .game--featured .game__body {
    width: 48%;
  }
  .game--featured .game__icon {
    width: 7rem;
  }
  .game--featured .game__name {
    font-size: 3.25rem;
  }
  .game--featured .game__desc {
    font-size: 1.125rem;
    max-width: 26rem;
  }
  .game--featured .game__shots {
    display: flex;
    gap: 1.75rem;
    right: 5%;
    width: 40%;
    max-width: 30rem;
  }
  .game--featured .game__shots img {
    flex: 1;
    min-width: 0;
    transform: rotate(-5deg);
  }
  .game--featured .game__shots img + img {
    display: block;
    margin-top: 3.5rem;
    transform: rotate(4deg);
  }
}

@media (max-width: 30rem) {
  .game {
    min-height: 0;
  }
  .game__body {
    width: 62%;
  }
  .game__shots {
    top: 1.5rem;
    right: -2%;
    width: 36%;
  }
  .game__icon {
    width: 4.5rem;
  }
  /* On phones the button runs the full width of the tile. */
  .game__cta {
    align-self: stretch;
    width: calc(100% / 0.62);
    white-space: nowrap;
  }
}

/* ---------- Contact ---------- */
.contact {
  padding-block: clamp(4rem, 9vw, 7rem);
  background: var(--pine);
  color: var(--mint-50);
}
.contact :focus-visible,
.footer :focus-visible {
  outline-color: var(--sun);
}

.contact__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 56rem) {
  .contact__grid {
    grid-template-columns: 0.85fr 1.15fr;
  }
}

.contact .section-title {
  color: var(--mint-200);
}
.contact__intro p {
  max-width: 26rem;
  margin-top: 1.25rem;
}
.contact__email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.contact__email a {
  color: var(--sun);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__email a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.2em;
}
.copy {
  padding: 0.35em 0.9em;
  border: 0.125rem solid var(--mint-200);
  border-radius: 999px;
  background: transparent;
  color: var(--mint-200);
  font: 600 0.9375rem/1.2 var(--body);
  cursor: pointer;
}
.copy:hover {
  background: var(--mint-200);
  color: var(--pine);
}

.form {
  display: grid;
  gap: 1rem;
}
.form__row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 36rem) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}
.field {
  display: grid;
  gap: 0.4rem;
}
.field span {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mint-200);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0.1875rem solid transparent;
  border-radius: 1rem;
  background: var(--white);
  color: var(--pine);
  font: inherit;
}
.field textarea {
  min-height: 9rem;
  resize: vertical;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--sun);
  box-shadow: 0 0 0 0.1875rem rgba(255, 210, 63, 0.45);
}
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-top: 0.25rem;
  padding-bottom: 0.375rem; /* room for the button's lip */
}
.contact .btn {
  border-color: var(--pine-deep);
  box-shadow: 0 var(--lip) 0 var(--pine-deep);
}
.contact .btn:hover {
  box-shadow: 0 calc(var(--lip) + 0.125rem) 0 var(--pine-deep);
}
.contact .btn:active {
  box-shadow: 0 0.125rem 0 var(--pine-deep);
}
.form__status {
  flex: 1 1 14rem;
  font-weight: 600;
}
.form__status:empty {
  display: none;
}
.form__status a {
  color: var(--sun);
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 2.5rem;
  background: var(--pine-deep);
  color: var(--mint-200);
  font-size: 1rem;
}
.footer__grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 48rem) {
  .footer__grid {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .footer__legal {
    grid-column: 1 / -1;
  }
}
.footer__motto {
  margin-top: 0.85rem;
}
.footer__links {
  display: grid;
  gap: 0.5rem;
}
.footer__links a {
  text-underline-offset: 0.2em;
}
.footer__links a:hover {
  color: var(--white);
}
.footer__legal {
  padding-top: 1.25rem;
  border-top: 0.0625rem solid rgba(181, 247, 220, 0.2);
  font-size: 0.875rem;
  color: rgba(181, 247, 220, 0.75);
}

/* ---------- Motion ----------
   One moment on load (the icons pop in), a slow idle float, and the ribbon.
   All of it is switched off for people who ask for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .pile__item img {
    animation: pop-in 0.6s var(--spring) both;
    animation-delay: calc(var(--i) * 80ms + 150ms);
  }
  .pile__float {
    animation: float 5s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -700ms);
  }
  .ribbon__track {
    animation: slide 40s linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .pile__item img {
    transition: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}
@keyframes float {
  from {
    transform: translateY(-0.3rem);
  }
  to {
    transform: translateY(0.3rem);
  }
}
@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}
