/* Ma Charades website. Colours, fonts, and components follow the app's design system
   (docs/design-system.md). Light only, like the app. */

@font-face {
  font-family: "Pridi";
  font-weight: 300;
  font-display: swap;
  src: url(/fonts/Pridi-Light.woff2) format("woff2");
}
@font-face {
  font-family: "Pridi";
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/Pridi-Regular.woff2) format("woff2");
}
@font-face {
  font-family: "Pridi";
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/Pridi-Medium.woff2) format("woff2");
}
@font-face {
  font-family: "Itim";
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/Itim-Regular.woff2) format("woff2");
}

:root {
  color-scheme: light;
  --background: #95ddd4;
  --text: #000;
  --text-hint: #1f1f1f;
  --card: #fff;
  --stack-1: #d6f3f3;
  --stack-2: #b5eae8;
  --dark-blue: #1e3b4e;
  --turquoise: #1ebfba;
  --orange: #f7845d;
  --game-guessing: #fff8cc;
  --game-correct: #94ddd3;
  --game-passed: #f7845d;
  --radius: 15px;
  --content: min(100vw, 1020px);
}

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

* {
  margin: 0;
}

html {
  background: var(--background);
  color: var(--text);
  font-family: Pridi, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
}

/* Language: both languages sit in the page; the root's data-lang picks one.
   Without JS the page stays Thai. */
html:not([data-lang="en"]) body [lang="en"],
html[data-lang="en"] body [lang="th"] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- PopButton + BooButton ---------- */

.pop {
  display: inline-flex;
  transition: transform 100ms ease-in;
  -webkit-tap-highlight-color: transparent;
}
.pop:hover,
.pop:active {
  transform: scale(1.05);
}

/* A stadium with a darker lip at the bottom, layered like the app's BooButton: a
   stadium in the inner-shadow colour inside the border, then a smaller gradient
   stadium inset by s on the sides and 2s at the bottom, flush at the top. */
.boo {
  --border: #13787e;
  --face-0: #1ebfba;
  --face-1: #18b2b2;
  --lip: #0d9e9e;
  --s: 2px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--lip);
  color: #fff;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.boo::before {
  content: "";
  position: absolute;
  inset: 0 var(--s) calc(var(--s) * 2);
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(var(--face-0), var(--face-1));
}
.boo.thin {
  --s: 1.5px;
  border-width: 1px;
}
.boo.dark-blue {
  --border: #13787f;
  --face-0: #106a7c;
  --face-1: #114f65;
  --lip: #1e3b4e;
}
.boo.orange {
  --border: #be3418;
  --face-0: #f7845d;
  --face-1: #f05a23;
  --lip: #df4f21;
}
/* ---------- Header ---------- */

.site-header {
  padding: 16px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 20px;
  text-decoration: none;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 22%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--dark-blue);
}
.lang-switch button {
  border: 0;
  border-radius: 999px;
  padding: 3px 12px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--dark-blue);
}

/* ---------- Store badges ---------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.stores a {
  display: block;
  transition: transform 100ms ease-in;
}
.stores a:hover {
  transform: scale(1.05);
}
/* Both badges at the same width, each at its official aspect ratio (App Store
   119.66:40, Google Play 646:192), so neither looks bigger than the other. */
.stores img {
  width: auto;
  height: 48px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 24px 0 64px;
}
.hero .wrap {
  display: grid;
  gap: 32px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.25;
  margin-bottom: 16px;
}
.hero h1 .accent {
  color: #f05a23;
}
.hero .lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-hint);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-art {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.hero-art .dog {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 52%;
  transform: translateX(-50%);
}

/* A phone in landscape, showing the game screen. */
.phone {
  position: absolute;
  width: 42%;
  aspect-ratio: 2.1 / 1;
  border: 7px solid #111;
  border-radius: 22px;
  background: var(--game-guessing);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
  font-family: Itim, Pridi, sans-serif;
  overflow: hidden;
}
.phone .timer {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(11px, 2.4vw, 15px);
  line-height: 1.2;
}
.phone .word {
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1;
}
.phone.guess {
  top: 10%;
  left: -2%;
  transform: rotate(-10deg);
}
.phone.correct {
  background: var(--game-correct);
  top: 58%;
  right: -2%;
  transform: rotate(9deg);
}
.phone.correct .word {
  font-size: clamp(18px, 4vw, 27px);
}

@media (min-width: 820px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 1fr;
  }
}

/* ---------- Sections ---------- */

section.block {
  padding: 56px 0;
}
.section-head {
  text-align: center;
  margin-bottom: 32px;
}
.section-head .boo {
  font-size: 16px;
  padding: 4px 16px;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: clamp(28px, 4.5vw, 40px);
}
.section-head p {
  font-size: 18px;
  color: var(--text-hint);
  margin-top: 8px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
}

/* How to play */
.steps {
  display: grid;
  gap: 20px;
}
@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
.step {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.step .art {
  height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}
/* These SVGs have only a viewBox, so they need a definite height to size. */
.step .art img {
  height: 160px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.step .art.pair img {
  height: 96px;
  max-width: 48%;
}
.step .num {
  width: 36px;
  height: 36px;
  font-size: 18px;
  padding: 0;
}
.step h3 {
  font-size: 22px;
}
.step p {
  font-size: 17px;
  color: var(--text-hint);
}

/* Collections teaser */
.collections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (min-width: 640px) {
  .collections {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 960px) {
  .collections {
    grid-template-columns: repeat(6, 1fr);
  }
}
/* The app's collection card: a white deck card in front of two tinted layers. */
.collection {
  position: relative;
  aspect-ratio: 0.74;
}
.collection::before,
.collection::after {
  content: "";
  position: absolute;
  border-radius: var(--radius);
  border: 0.5px solid #fff;
}
.collection::before {
  inset: 0 16px auto;
  height: 50%;
  background: var(--stack-2);
}
.collection::after {
  inset: 8px 8px auto;
  height: 50%;
  background: var(--stack-1);
}
.collection .front {
  position: absolute;
  inset: 16px 0 0;
  z-index: 1;
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
}
.collection .front img {
  border-radius: var(--radius);
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
}
.collection .front span {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
}
.more {
  text-align: center;
  margin-top: 28px;
}
.more .boo {
  font-size: 17px;
  padding: 6px 20px;
}

/* Final call to action */
.cta {
  text-align: center;
  padding: 64px 0 56px;
}
.cta .cta-icon {
  width: 128px;
  height: 128px;
  margin: 0 auto 20px;
  border-radius: 22%;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}
.cta h2 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 20px;
}
.cta .stores {
  justify-content: center;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  padding: 24px 0 32px;
  font-size: 15px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.social {
  display: flex;
  align-items: center;
  gap: 8px;
}
.social a {
  transition: transform 100ms ease-in;
}
.social a:hover {
  transform: scale(1.08);
}
.social img {
  width: 36px;
  height: 36px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

/* ---------- Privacy policy ---------- */

.doc {
  padding: 8px 0 48px;
}
.doc article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
}
.doc h1 {
  font-size: clamp(28px, 5vw, 38px);
  margin-bottom: 4px;
}
.doc .updated {
  color: #40848e;
  margin-bottom: 24px;
}
.doc h2 {
  font-size: 22px;
  margin: 32px 0 8px;
}
.doc h3 {
  font-size: 18px;
  margin: 20px 0 4px;
}
.doc p,
.doc li {
  font-size: 17px;
  overflow-wrap: break-word;
}
.doc p + p {
  margin-top: 10px;
}
.doc ul {
  padding-left: 1.3em;
  margin: 8px 0;
}
.doc li + li {
  margin-top: 4px;
}
.doc strong {
  font-weight: 500;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 16px;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--stack-2);
}
.doc th {
  font-weight: 500;
  background: var(--stack-1);
}
.table-scroll {
  overflow-x: auto;
}

.not-found {
  text-align: center;
  padding: 48px 0;
}
.not-found img {
  width: 180px;
  margin: 0 auto 16px;
}
.not-found h1 {
  font-size: 32px;
  margin-bottom: 20px;
}
.not-found .boo {
  font-size: 18px;
  padding: 6px 24px;
}
