@font-face {
  font-family: Quicksand;
  src: url("media/Quicksand_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Quicksand;
  src: url("media/Quicksand_500Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Quicksand;
  src: url("media/Quicksand_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Quicksand;
  src: url("media/Quicksand_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* App palette and control metrics from theme.ts, brandThemes.ts and ui.tsx. */
  --ink: #202020;
  --secondary: #61718b;
  --teal: #147d78;
  --teal-light: #ddf1ee;
  --teal-soft: #f1f7f7;
  /* The teal screen gradient from brandThemes.ts. */
  --screen-gradient: linear-gradient(180deg, #fff, #f8fcfb, #eef8f7);
  --white: #fff;
  --border: #e4ecf6;
  --screen-border: 4px solid #147d7840;
  --depth: 0 var(--card-depth) 0 var(--card-edge);
  --button-shadow: 0 5px 8px #116a663d;
  --gutter: 20px;
  --section-space: clamp(48px, 5vw, 72px);
  color: var(--ink);
  background: #eef8f7;
  font: 500 100%/1.5 Quicksand, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul { margin: 0; }
body { min-height: 100vh; background: var(--screen-gradient); }
img { display: block; max-inline-size: 100%; block-size: auto; }
a { color: inherit; }
a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
section[id] { scroll-margin-top: 24px; }

.wrap { width: min(100% - var(--gutter) * 2, 70rem); margin-inline: auto; }
.skip {
  position: fixed;
  z-index: 2;
  inset: 8px auto auto var(--gutter);
  padding: 8px 16px;
  background: var(--white);
  border-radius: 999px;
  transform: translateY(calc(-100% - 16px));
}
.skip:focus { transform: none; }

.masthead, .masthead nav { display: flex; align-items: center; }
.masthead { justify-content: space-between; gap: 8px 16px; padding-block: 16px; flex-wrap: wrap; }
.masthead nav { gap: clamp(12px, 3vw, 32px); }
.masthead:not(.footer) nav { gap: 8px; }
.masthead a { text-decoration: none; font-weight: 700; }
.footer nav a { color: var(--teal); padding-block: 10px; }
.footer nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.brand { font-size: 1.25rem; }

.hero {
  display: grid;
  gap: var(--section-space) 32px;
  padding-top: var(--section-space);
  border-bottom: 1px solid var(--border);
}
.hero-copy { display: grid; justify-items: start; align-self: center; }
h1 { font-size: clamp(1.875rem, 6vw, 3rem); line-height: 1.07; letter-spacing: -.05em; }
h1 span { color: var(--teal); }
.hero-copy > p { max-width: 32ch; margin-block: 16px 24px; color: var(--secondary); font-size: clamp(1rem, 2vw, 1.25rem); }
.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--button-height);
  min-width: var(--button-min-width);
  padding: 0 clamp(10px, 4vw, var(--button-padding));
  border: var(--button-border) solid transparent;
  border-radius: var(--button-radius);
  font-family: inherit;
  font-size: clamp(.875rem, 3.6vw, 1rem);
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
  text-decoration: none;
}
.app-button-primary {
  background: var(--teal);
  box-shadow: var(--button-shadow);
  color: var(--white);
}
.app-button-outline { border-color: #147d7866; color: var(--teal); }
.app-button:active { opacity: var(--pressed-opacity); }
.app-button-outline:active { border-color: var(--teal); background: var(--teal-soft); }

@media (hover: hover) {
  .app-button-primary:hover:not(:disabled) { filter: brightness(.94); }
  .app-button-outline:hover { border-color: var(--teal); }
  .app-button:active { filter: brightness(.91); }
}

.hero-art {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(12px, 2.4vw, 32px);
  align-self: end;
  min-width: 0;
  clip-path: inset(-20px -20px 0);
}
.screen {
  width: 100%;
  aspect-ratio: 1 / 1.92;
  object-fit: cover;
  object-position: top;
  border: var(--screen-border);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -3px 12px #163b7014;
}

h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.25; }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.25rem); line-height: 1.3; }
.games { padding-block: var(--section-space); }
.game-list { display: grid; gap: var(--section-space); list-style: none; padding: 0; }
.app-card { border: var(--card-border) solid var(--border); border-radius: var(--card-radius); background: var(--white); padding: var(--card-padding); box-shadow: var(--depth); }
@media (prefers-reduced-motion: no-preference) {
  .app-button { transition: opacity 140ms ease-out; }
}
.game-feature { display: grid; justify-items: center; align-items: center; gap: 16px; text-align: center; }
.game-copy { width: min(100%, 46ch); }
.game-copy p { margin-top: 8px; color: var(--secondary); }
.game-copy .game-name { margin: 0 0 4px; color: var(--teal); font-size: .875rem; line-height: 1.25rem; font-weight: 700; }
.game-screen { width: min(100%, 13rem); }

.section-space, .story { padding-block: var(--section-space); }
.story { display: grid; gap: 24px; align-items: center; }
.story-copy { max-width: 50ch; }
.story-copy p, .languages p, .download p { color: var(--secondary); }
.story-copy p { margin-top: 8px; }
.theme-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-previews figure { margin: 0; text-align: center; }
.theme-previews img { width: 100%; }
.game-screen, .theme-previews img, .settings-preview { border: var(--screen-border); border-radius: 14px; box-shadow: var(--depth); }
.theme-previews figcaption { margin-top: 8px; font-size: .875rem; }
.settings-preview { display: block; width: min(100%, 32rem); justify-self: center; }
.languages, .download { display: grid; gap: 8px; }
.language-list .app-button { gap: 8px; }
.language-list .app-button::after {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  background: currentColor;
  mask: url("media/play.svg") center / contain no-repeat;
}
.download .app-button { justify-self: start; }
.language-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; list-style: none; padding: 0; }
.language-list img { width: 24px; height: 16px; object-fit: contain; }
.footer { border-top: 1px solid var(--border); padding-block: 20px; }

@media (min-width: 700px) {
  :root { --gutter: 22px; }
  .hero { grid-template-columns: 1fr 1fr; min-height: clamp(34rem, 42vw, 40rem); }
  .hero-copy { padding-bottom: var(--section-space); }
  h1 { font-size: clamp(2.25rem, 4vw, 3rem); }
  .game-feature {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "screen copy";
    text-align: left;
  }
  .game-feature:nth-child(even) { grid-template-areas: "copy screen"; }
  .game-copy { grid-area: copy; width: 100%; }
  .game-screen { grid-area: screen; justify-self: start; width: min(100%, clamp(13rem, 22vw, 17rem)); }
  .game-feature:nth-child(even) .game-screen { justify-self: end; }
  .story { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

