/* Cooper Games
   One blue field, one typeface, white type, one small light. */

:root {
  --blue-hi: #0A38AB;
  --blue: #082C92;
  --blue-lo: #061C6E;
  --white: #FFFFFF;
  --soft: #BCC9F6;
  --mint: #1FDC82;

  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  background: var(--blue);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Urbanist", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.sprite { position: absolute; }

/* The field. Fixed, so it never scrolls or bands with the content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 105% at 60% 42%, var(--blue-hi) 0%, var(--blue) 46%, var(--blue-lo) 100%);
}

::selection { background: var(--mint); color: var(--blue-lo); }

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

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

.skip {
  position: absolute;
  left: var(--pad);
  top: -80px;
  z-index: 5;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-lo);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* Links ------------------------------------------------------------ */

.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) 0 calc(50% + .78em) / 100% 1.5px no-repeat;
  transition: background-size .45s var(--ease);
}
.link:hover {
  background-size: 0 1.5px;
  background-position: 100% calc(50% + .78em);
}

/* First screen ----------------------------------------------------- */

.hero {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 72svh;
  padding: clamp(18px, 3.2vw, 40px) var(--pad) clamp(14px, 2.4vw, 24px);
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: block;
  width: clamp(124px, 12.5vw, 176px);
  color: var(--white);
}
.logo img { display: block; width: 100%; height: auto; }

/* Round icon buttons: email and LinkedIn. */
.contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(255 255 255 / .1);
  color: var(--white);
  transition: background-color .25s, color .25s, transform .35s var(--ease);
}
.contact svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-fill svg {
  width: 17px;
  height: 19px;
  fill: currentColor;
  stroke: none;
}
.contact:hover { background: var(--white); color: var(--blue-lo); transform: translateY(-2px); }
.contact:active { transform: translateY(1px); transition-duration: .05s; }

/* Three game pieces, top right: small, close together, barely moving. */
.pieces {
  position: absolute;
  top: clamp(18px, 3.2vw, 40px);
  right: var(--pad);
  --s: clamp(88px, 8.4vw, 124px);    /* width of the pink piece */
  width: calc(var(--s) * 2.05);
  height: calc(var(--s) * 1.6);
  pointer-events: none;
}
.piece {
  position: absolute;
  left: calc(50% + var(--ox) * var(--s));
  top: calc(50% + var(--oy) * var(--s));
  width: calc(var(--s) * var(--w));
  translate: -50% -50%;
}
.piece img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}
.p1 { --ox: -.49; --oy: .10;  --w: 1; }
.p2 { --ox: .34;  --oy: -.47; --w: .58; }
.p3 { --ox: .72;  --oy: .49;  --w: .54; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: clamp(48px, 10vh, 120px);
}

h1 {
  font-size: clamp(2.5rem, 8.2vw, 6rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
h1 .line { display: block; }

.base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 6vh, 64px);
  min-height: 44px;
  color: var(--soft);
}
.base [hidden] { display: none; }

/* The riddle line: a step brighter and larger than the small print, so
   the eye finds it second, after the headline. */
.status {
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgb(255 255 255 / .9);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
}

/* The light. It is not a loader. White, in the shape of the "o" in the
   logo: a disc with one thin cut across it. It brightens and swells a
   little when it is on. */
.dot {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--white);
  opacity: .36;
  transition: opacity 120ms ease-out, transform 160ms var(--ease);
}
.dot svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.dot.on { opacity: 1; transform: scale(1.18); }
.still .dot { opacity: 1; }

/* In the page text for screen readers and link readers, not on screen. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.legal { font-size: .9375rem; }

/* Games ------------------------------------------------------------ */

/* Our games: its own section, set apart from the message above and the
   footer below by a rule, a large heading and solid white buttons. */
.games {
  padding: 0 var(--pad);
  margin-bottom: clamp(22px, 3vw, 40px);
}
.games-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
  padding-top: clamp(20px, 2.8vw, 36px);
  border-top: 1px solid rgb(255 255 255 / .22);
}
.games-head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  letter-spacing: -0.02em;
}

/* "Coming soon", beside the store buttons while they are switched off. */
.soon {
  margin-left: auto;
  color: var(--white);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  font-weight: 600;
  white-space: nowrap;
}
.soon[hidden] { display: none; }

h2 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* The two store buttons always share one width: the wider one's. */
.stores {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px 12px;
}
.stores [hidden] { display: none; }

/* Store buttons: the classic two-line badge, solid white on the blue. */
.store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 20px 9px 16px;
  border-radius: 16px;
  background: var(--white);
  color: var(--blue-lo);
  text-decoration: none;
  transition: background-color .25s, transform .35s var(--ease);
}
.store svg {
  flex: none;
  width: 24px;
  height: 26px;
  fill: currentColor;
}
.store-text {
  display: flex;
  flex-direction: column;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.store-pre {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.3;
}
.store:hover {
  background: #DCE4FF;
  transform: translateY(-3px);
}
.store:active { transform: translateY(1px); transition-duration: .05s; }

/* Switched off: an outline in place of the solid white, and no response. */
.store[aria-disabled="true"] {
  background: none;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .3);
  color: rgb(255 255 255 / .55);
  cursor: default;
  transform: none;
}

.store-small { min-height: 50px; padding: 8px 15px 8px 13px; border-radius: 14px; }
.store-small svg { width: 20px; height: 22px; }
.store-small .store-text { font-size: 1.0625rem; }
.store-small .store-pre { font-size: .75rem; }

.game-list {
  margin: clamp(14px, 2vw, 22px) 0 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid rgb(255 255 255 / .2);
}
.game-list[hidden] { display: none; }

.game {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px clamp(16px, 2.4vw, 28px);
  padding: 20px 0;
  border-top: 1px solid rgb(255 255 255 / .2);
}

.game-icon {
  width: clamp(60px, 7vw, 84px);
  aspect-ratio: 1;
  border-radius: 22%;
  object-fit: cover;
  background: rgb(255 255 255 / .1);
  transition: transform .45s var(--ease);
}
.game:hover .game-icon { transform: scale(1.04); }

.game-title {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.game-genre { color: var(--soft); }

/* Footer -----------------------------------------------------------
   One soft bar: copyright, legal links, and the two icons. */

.foot { padding: 0 var(--pad) clamp(12px, 1.8vw, 20px); }

.dock {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "legal links icons";
  align-items: center;
  gap: 8px clamp(14px, 1.8vw, 24px);
  padding: 8px 8px 8px clamp(18px, 2vw, 26px);
  border-radius: 20px;
  background: rgb(255 255 255 / .07);
}
.dock .legal {
  grid-area: legal;
  color: var(--soft);
  font-size: .9375rem;
}
.foot-links {
  grid-area: links;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0 clamp(14px, 1.8vw, 24px);
}
.foot-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--soft);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.foot-link:hover,
.foot-link[aria-current="page"] { color: var(--white); }
.foot-icons {
  grid-area: icons;
  display: flex;
  gap: 8px;
}

/* Legal pages ------------------------------------------------------ */

.doc-top { padding: clamp(18px, 3.2vw, 40px) var(--pad) 0; }

.doc {
  display: block;
  flex: 1;
  width: 100%;
  max-width: calc(70ch + var(--pad) * 2);
  padding: clamp(40px, 8vh, 88px) var(--pad) clamp(48px, 9vh, 96px);
}
.doc h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.08;
}
.doc-note {
  margin-top: 14px;
  color: var(--soft);
  font-size: .9375rem;
}
.doc h2 {
  margin-top: clamp(32px, 5vh, 48px);
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.doc p, .doc ul { margin-top: 12px; line-height: 1.6; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--white); text-underline-offset: 3px; }

/* Narrow screens --------------------------------------------------- */

@media (max-width: 640px) {
  .hero { min-height: 56svh; }
  .base { flex-direction: column; align-items: flex-start; }
  .pieces {
    top: 74px;
    --s: clamp(64px, 21vw, 88px);
  }
  .games { margin-bottom: 44px; }
  .games-head {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title  soon"
      "stores stores";
    align-items: baseline;
    gap: 20px 16px;
    padding-top: 30px;
  }
  .games-head h2 { grid-area: title; }
  .games-head .soon { grid-area: soon; margin-left: 0; }
  .games-head .stores {
    grid-area: stores;
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .games-head .store {
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    padding: 8px 10px;
  }
  .games-head .store svg { width: 21px; height: 23px; }
  .games-head .store-text { font-size: 1.0625rem; }
  /* On a phone the footer drops the bar: a line, the links, then the
     copyright with the two icons. Small and quiet under Our games. */
  .foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .dock {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "links links"
      "legal icons";
    gap: 6px 12px;
    padding: 14px 0 0;
    border-top: 1px solid rgb(255 255 255 / .22);
    border-radius: 0;
    background: none;
  }
  .foot-links {
    justify-self: start;
    gap: 0 24px;
  }
  .foot-icons { gap: 10px; }
  .game { grid-template-columns: auto minmax(0, 1fr); }
  .game .stores { grid-column: 1 / -1; }
}

/* Very narrow phones: stack the two store buttons so their text keeps
   room on each side. */
@media (max-width: 359px) {
  .games-head .stores { grid-template-columns: 1fr; }
}

/* Short phones: keep the pieces clear of the headline. */
@media (max-width: 640px) and (max-height: 700px) {
  .pieces {
    top: 64px;
    --s: 56px;
  }
}

/* Motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .intro h1 .line { animation: rise 1.1s var(--ease) both; }
  .intro h1 .line + .line { animation-delay: .09s; }
}

/* Each piece drifts on its own slow clock. */
@media (prefers-reduced-motion: no-preference) {
  .p1 img { animation: drift-a 53s ease-in-out infinite, turn-a 79s ease-in-out infinite; }
  .p2 img { animation: drift-b 61s ease-in-out infinite, turn-b 97s ease-in-out infinite; }
  .p3 img { animation: drift-c 47s ease-in-out infinite, turn-c 71s ease-in-out infinite; }
}
@keyframes drift-a {
  0%, 100% { translate: 0 0; }
  25% { translate: 3% -5%; }
  50% { translate: -2.5% -8%; }
  75% { translate: -4% -2%; }
}
@keyframes drift-b {
  0%, 100% { translate: 0 0; }
  30% { translate: -6% 7%; }
  60% { translate: 5% 10%; }
  80% { translate: 7% 3%; }
}
@keyframes drift-c {
  0%, 100% { translate: 0 0; }
  20% { translate: 7% -6%; }
  55% { translate: 3% -11%; }
  80% { translate: -6% -4%; }
}
@keyframes turn-a { 0%, 100% { rotate: -2deg; } 50% { rotate: 3deg; } }
@keyframes turn-b { 0%, 100% { rotate: 4deg; } 50% { rotate: -5deg; } }
@keyframes turn-c { 0%, 100% { rotate: -6deg; } 50% { rotate: 7deg; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(.28em); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
