/* The main page's whole look: clean, with a friendly face. One column in the system's own typeface on warm
   neutral greys; at the top a small picture with a sky of its own (a day sky in light mode, a night sky in
   dark), and under it the cards in two groups: the games, each tinted with its own colour, and the other
   apps as quieter rows. No web font is loaded and nothing comes from another origin (AGENTS.md, „The
   look"). */

:root {
  color-scheme: light dark;

  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1b1a18;
  --muted: #6b6862;
  --line: #e9e6e0;
  --line-strong: #d3cfc7;
  --focus: #2f6fed;

  /* A card's colour: its tint, its picture, its label. */
  --pink: #e0457f;
  --blue: #2f6fed;
  --yellow: #d79a00;
  --green: #1f9d61;
  --orange: #e8702a;

  /* The picture at the top (site/hero.svg): its sky, and what stands under it. */
  --sky: linear-gradient(165deg, #d3e4ff 0%, #e8f0ff 45%, #ffeedd 100%);
  --hero-ink: #1b1a18;
  --hero-muted: #55607a;
  --orb: #ffc369;
  --halo: rgb(255 205 130 / 0.45);
  --cloud: rgb(255 255 255 / 0.9);
  --berg: #c2d9fb;
  --berg-side: #a9c8f6;
  --hill: #e2edff;
  --snow: #ffffff;
  --shade: #cddffa;
  --p-body: #1b1a18;
  --p-belly: #ffffff;
  --p-warm: #f59e0b;
  --bubble: #ffffff;

  /* To use a font of your own: put its .woff2 in site/, add an @font-face here, and name it first. */
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1b1b19;
    --ink: #f2f0ec;
    --muted: #a5a29b;
    --line: #2a2927;
    --line-strong: #403e3a;
    --focus: #7aa7ff;

    --pink: #f472a8;
    --blue: #6f9dff;
    --yellow: #f2c14e;
    --green: #4fcf8f;
    --orange: #ff9655;

    /* night: two soft lights in the sky, a moon, stars */
    --sky: radial-gradient(55% 75% at 80% 28%, rgb(64 214 168 / 0.26), transparent 70%),
      radial-gradient(50% 70% at 48% 0%, rgb(140 124 255 / 0.28), transparent 72%),
      linear-gradient(165deg, #0d1830 0%, #13254a 60%, #1b3058 100%);
    --hero-ink: #f2f0ec;
    --hero-muted: #b4bfd6;
    --orb: #f6efd6;
    --halo: rgb(246 239 214 / 0.14);
    --berg: #2a4170;
    --berg-side: #223763;
    --hill: #314a7c;
    --snow: #cbd8ef;
    --shade: #a3b6d8;
    --p-body: #0b0f19;
    --p-belly: #f1f4fa;
    --bubble: #f2f0ec;
  }
}

.color-pink { --accent: var(--pink); }
.color-blue { --accent: var(--blue); }
.color-yellow { --accent: var(--yellow); }
.color-green { --accent: var(--green); }
.color-orange { --accent: var(--orange); }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  flex-direction: column;
  max-width: 46rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4.5vw, 2rem);
}

main {
  flex: 1;
}

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

/* ---- the top right: the page's other language and the way to the visitor's account, small and out of the
        cards' way ---- */

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: clamp(0.75rem, 3vw, 1.5rem);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0 0.875rem 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 160ms ease;
}
.nav__link:hover,
.nav__link:focus-visible {
  border-color: var(--line-strong);
}

/* a language has no picture before its name: the same room on both sides */
.nav__link--lang {
  padding: 0 0.875rem;
}

.nav__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.nav + .hero {
  margin-top: 0.75rem;
}

/* ---- the top: the words, and the picture with its own sky ---- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  margin: clamp(1rem, 4.5vw, 2.5rem) 0 clamp(0.875rem, 3vw, 1.25rem);
  border-radius: 1.5rem;
  background: var(--sky);
  color: var(--hero-ink);
}

.hero__text {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 5vw, 2.25rem) clamp(1.5rem, 5vw, 2.25rem) 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero p {
  max-width: 30rem;
  margin: 0.6rem 0 0;
  color: var(--hero-muted);
  font-size: clamp(1.0625rem, 2.2vw, 1.125rem);
  text-wrap: pretty;
}

.hero__scene {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 24rem;
  margin-top: -0.25rem;
}
.hero__scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* The words alone, where a site has no picture. */
.hero--plain {
  background: none;
  color: inherit;
}
.hero--plain .hero__text {
  padding: clamp(1.5rem, 6vw, 3rem) 0 clamp(0.5rem, 2vw, 1rem);
}
.hero--plain p {
  color: var(--muted);
}

@media (min-width: 40rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: end;
  }
  .hero__text {
    align-self: center;
    padding-right: 0;
    padding-bottom: clamp(1.5rem, 5vw, 2.25rem);
  }
  .hero__scene {
    margin-top: 1.25rem;
  }
}

/* what the picture says: a bubble whose sharp corner points at the speaker */
.hero .hero__hello {
  position: absolute;
  right: 38%;
  bottom: 55%;
  margin: 0;
  padding: 0.3rem 0.8rem 0.35rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--bubble);
  color: #1b1a18;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  box-shadow: 0 6px 16px -8px rgb(20 40 90 / 0.45);
  transform-origin: 100% 100%;
}

/* the picture's parts (site/hero.svg) */
.s-halo { fill: var(--halo); }
.s-orb { fill: var(--orb); }
.s-stars { display: none; fill: #ffffff; }
.s-cloud { fill: var(--cloud); }
.s-berg { fill: var(--berg); }
.s-berg-side { fill: var(--berg-side); }
.s-hill { fill: var(--hill); }
.s-snow { fill: var(--snow); }
.s-shade { fill: var(--shade); }
.p-body { fill: var(--p-body); }
.p-belly { fill: var(--p-belly); }
.p-eye { fill: #ffffff; }
.p-blush { fill: #ff9db0; opacity: 0.85; }
.p-foot { fill: var(--p-warm); }
.p-beak {
  fill: var(--p-warm);
  stroke: var(--p-warm);
  stroke-width: 2;
  stroke-linejoin: round;
}

@media (prefers-color-scheme: dark) {
  .s-stars { display: inline; }
  .s-cloud { display: none; }
}

/* On a narrow screen the top is a third lower, so that the cards under it start sooner: the picture is
   smaller and stands low at the right, with its sky under the last of the words. For the words to stay
   on clear sky, the sun (or the moon) comes down behind whoever stands there, and the first cloud and
   the stars come down with it. These distances are the picture's own units (site/hero.svg). */
@media not all and (min-width: 40rem) {
  .hero__text {
    padding-top: 1.25rem;
  }
  .hero p {
    margin-top: 0.4rem;
  }
  .hero__scene {
    width: min(67%, 17rem);
    margin-top: max(-10%, -2.5rem);
  }
  .hero .hero__hello {
    right: 40%;
    bottom: 46%;
    padding: 0.2rem 0.65rem 0.25rem;
    font-size: 0.875rem;
  }
  .s-halo,
  .s-orb {
    translate: 8px 42px;
  }
  .s-cloud--a {
    translate: -6px 26px;
  }
  .s-stars {
    translate: 0 36px;
  }
}

/* The picture is a little alive: a wave when the page opens and when the pointer comes by, a blink now and
   then, clouds that drift, stars that twinkle. Nothing starts invisible, and under reduced motion nothing
   moves at all. */
@media (prefers-reduced-motion: no-preference) {
  .p-wave {
    transform-box: fill-box;
    transform-origin: 12% 88%;
    animation: wave 1.8s ease-in-out 0.5s 1 both;
  }
  .hero:hover .p-wave {
    animation: wave-again 1.8s ease-in-out 1 both;
  }
  .p-eye {
    transform-box: fill-box;
    transform-origin: center;
    animation: blink 5.4s 2s infinite;
  }
  .hero__hello {
    animation: pop 480ms cubic-bezier(0.2, 0.9, 0.3, 1.35) 0.35s both;
  }
  .s-cloud--a { animation: drift 26s ease-in-out infinite alternate; }
  .s-cloud--b { animation: drift 34s ease-in-out infinite alternate-reverse; }
  .s-stars circle:nth-child(odd) { animation: twinkle 3.4s ease-in-out infinite alternate; }
  .s-stars circle:nth-child(3n) { animation-delay: 1.3s; }
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-18deg); }
  40%, 80% { transform: rotate(9deg); }
}
@keyframes wave-again {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-18deg); }
  40%, 80% { transform: rotate(9deg); }
}
@keyframes blink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}
@keyframes pop {
  from { transform: scale(0.6); }
}
@keyframes drift {
  to { transform: translateX(12px); }
}
@keyframes twinkle {
  to { opacity: 0.25; }
}

/* ---- the cards, in two groups: the games first, then the other apps ---- */

.group {
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
}
.group:first-child {
  margin-top: clamp(0.5rem, 2vw, 0.875rem);
}

.group__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A card lies on its side: its picture, then its name with its label, and one line about it. Each wears
   its colour lightly. */
.app__link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  height: 100%;
  padding: 1.125rem;
  border: 1px solid var(--line);
  border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--line));
  border-radius: 1.125rem;
  background: var(--surface);
  background: color-mix(in oklab, var(--accent) 6%, var(--surface));
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.app__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  background: color-mix(in oklab, var(--accent) 20%, var(--surface));
}
.app__icon svg {
  width: 1.75rem;
  height: 1.75rem;
}
/* A picture is two layers of one colour: the first pale, the second full. */
.app__icon .a {
  fill: color-mix(in oklab, var(--accent) 45%, transparent);
}
.app__icon .a.line {
  fill: none;
  stroke: color-mix(in oklab, var(--accent) 45%, transparent);
  stroke-width: 11;
  stroke-linecap: round;
}
.app__icon .b {
  fill: var(--accent);
}

.app__body {
  flex: 1;
  min-width: 0;
}

/* the name, and the label at the far end of its line: a long name wraps beside the label, never under it */
.app__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.625rem;
}

.app__name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.app__go {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.app__blurb {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9688rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.app__tag {
  flex: none;
  margin-top: 0.0625rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--line);
  background: color-mix(in oklab, var(--accent) 16%, var(--surface));
  color: var(--muted);
  color: color-mix(in oklab, var(--accent) 58%, var(--ink));
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.app__link:hover,
.app__link:focus-visible {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
  box-shadow: 0 12px 26px -16px color-mix(in oklab, var(--accent) 70%, transparent);
  transform: translateY(-2px);
}
.app__link:hover .app__go,
.app__link:focus-visible .app__go {
  transform: translateX(3px);
}

/* The games are what the page is for. Where there is room they stand side by side, each upright: the
   picture on top, the label in the corner. */
@media (min-width: 44rem) {
  .group--games .cards {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  }
  .group--games .app__link {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.25rem;
  }
  .group--games .app__icon {
    margin-bottom: 1rem;
  }
  .group--games .app__tag {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    margin: 0;
  }
}

/* The other apps are easy to find and stay out of the games' way: a smaller heading, and plain rows that
   keep their colour for the picture, the label and the arrow. */
.group--apps .group__title {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.group--apps .cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 0.625rem;
}
.group--apps .app__link {
  align-items: center;
  padding: 0.875rem 1rem;
  border-color: var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.group--apps .app__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
}
.group--apps .app__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.group--apps .app__name {
  font-size: 1.0625rem;
}
.group--apps .app__blurb {
  margin-top: 0.125rem;
  font-size: 0.9375rem;
}
.group--apps .app__link:hover,
.group--apps .app__link:focus-visible {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
}

/* ---- the rest ---- */

.hero .back {
  margin-top: 1.1rem;
  font-size: 1rem;
}
.back a {
  color: var(--hero-ink);
  font-weight: 600;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  text-underline-offset: 0.25em;
}
.back a:hover {
  text-decoration-color: currentColor;
}
.hero--plain .back a {
  color: inherit;
}

.foot {
  margin-top: clamp(2.5rem, 8vw, 4.5rem);
  padding: 1.25rem 0 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.foot p {
  margin: 0;
}

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