/* Guess the Flag website: one stylesheet for every page.
   The look follows the game: a dusk sky with bunting along the top, a plum hillside below,
   Lilita One for headings and Nunito for reading. Fonts are served from this site, so no
   visit ever calls another server. */

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lilita-one.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/nunito-600.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/nunito-700.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/nunito-800.ttf") format("truetype");
}

:root {
  color-scheme: light;
  --sky-top: #FFC488;
  --sky-bottom: #FFE6BF;
  --plum: #42203F;
  --plum-deep: #2B1230;
  --plum-soft: #653659;
  --mist: #D3B6C9;
  --sun: #FFC935;
  --sun-deep: #D98F0B;
  --cream: #FFF6E6;
  --cream-deep: #DDBFA3;
  --blue: #2F6DB0;
  --teal: #13928A;
  --orange: #EC6A24;
  --red: #D93A4E;
  --amber: #D48A12;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 5vw, 32px);
}

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

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

body {
  margin: 0;
  background: var(--plum);
  color: var(--cream);
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, svg { max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--plum-deep);
  outline-offset: 3px;
  border-radius: 8px;
}
.ground :focus-visible, .footer :focus-visible { outline-color: var(--sun); }
.sheet :focus-visible { outline-color: var(--plum); }

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

/* ---- Sky: bunting, brand and navigation ------------------------------------------------ */

.sky {
  overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-bottom) 72%);
  color: var(--plum);
}

.bunting {
  height: 46px;
  background: url("img/bunting.svg") repeat-x 0 0 / 288px 46px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 14px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1;
  text-decoration: none;
}
.brand img { display: block; width: 44px; height: 44px; }

.nav { display: flex; flex-wrap: wrap; gap: 12px; }

/* The game's one kind of button: a slab with a darker lip underneath that it sinks onto. */
.pill {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: 16px;
  background: var(--cream);
  color: var(--plum);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--cream-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
a.pill:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--cream-deep); }
a.pill:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cream-deep); }
.pill--sun { background: var(--sun); box-shadow: 0 4px 0 var(--sun-deep); }
a.pill--sun:hover { box-shadow: 0 5px 0 var(--sun-deep); }
a.pill--sun:active { box-shadow: 0 1px 0 var(--sun-deep); }
.pill--soft { background: transparent; box-shadow: inset 0 0 0 2px var(--plum); }
a.pill--soft:hover, a.pill--soft:active { box-shadow: inset 0 0 0 2px var(--plum); }

/* ---- Home: hero ------------------------------------------------------------------------ */

.hero {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding-block: clamp(18px, 4vw, 44px) 0;
}

.hero h1, .policy-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.94;
  text-shadow: 0 0.05em 0 var(--sun);
  text-wrap: balance;
}
.hero h1 { font-size: clamp(3.1rem, 12vw, 6rem); }

.lead {
  margin: 0;
  max-width: 33rem;
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  font-weight: 700;
  line-height: 1.5;
}

.cta { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 0; padding: 0; list-style: none; }
.pill--static { cursor: default; }

.hillside {
  display: block;
  width: 100%;
  height: clamp(240px, 60vw, 340px);
  margin-top: clamp(8px, 2vw, 24px);
  object-fit: cover;
  object-position: 50% 100%;
}

/* ---- Ground: everything below the hillside --------------------------------------------- */

.ground {
  background: var(--plum);
  color: var(--cream);
  padding-block: clamp(32px, 6vw, 64px) 0;
}

.section { padding-bottom: clamp(44px, 8vw, 80px); }

.section h2 {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.05;
  text-wrap: balance;
}

.howto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 28px clamp(28px, 6vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.howto li { position: relative; padding-left: 38px; }
/* Each point hangs from its own pennant, in a level's colour. */
.howto li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 24px;
  height: 28px;
  background: var(--c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.howto h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
}
.howto p { margin: 0; max-width: 30rem; }

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 3vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.phone {
  flex: 1 1 0;
  min-width: 0;
  max-width: 250px;
  margin: 0;
  overflow: hidden;
  border: clamp(2px, 0.6vw, 4px) solid var(--plum-soft);
  border-radius: clamp(14px, 3.6vw, 28px);
  background: var(--cream);
  box-shadow: 0 8px 0 var(--plum-deep);
}
.phone:nth-child(even) { margin-top: clamp(14px, 4vw, 34px); }
.phone img { display: block; width: 100%; height: auto; }
@media (max-width: 640px) {
  .phones { flex-wrap: wrap; }
  .phone { flex: 0 1 calc(50% - 8px); max-width: none; }
}

/* The promise, on a ribbon with a swallowtail cut at both ends, like the game's unlock ribbon. */
.ribbon {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px calc(28px + var(--gutter)) 36px;
  background: var(--sun);
  color: var(--plum);
  text-align: center;
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 50%, 100% 100%, 0 100%, 26px 50%);
}
.ribbon h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.05; }
.ribbon p { margin: 0; max-width: 34rem; font-weight: 700; }

/* ---- Policy pages ---------------------------------------------------------------------- */

.policy-head { padding-block: clamp(16px, 4vw, 36px) 0; }
.policy-head h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); }
.meta { margin: 12px 0 0; font-weight: 800; color: var(--plum-soft); }

.crest {
  height: 64px;
  margin: 20px -8% 0;
  background: var(--plum);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.ground--sheet { padding-block: 0 clamp(40px, 7vw, 72px); }

.sheet {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
  padding: clamp(22px, 5vw, 48px);
  border-radius: 22px;
  background: var(--cream);
  color: var(--plum);
  box-shadow: 0 8px 0 var(--cream-deep);
}
.sheet h2 {
  margin: 2.4rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.65rem;
  line-height: 1.1;
  text-wrap: balance;
}
.sheet h2:first-child { margin-top: 0; }
.sheet p { margin: 0 0 1rem; }
.sheet ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.sheet li { margin-bottom: 0.4rem; }
.sheet a { color: var(--blue); font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.tldr { font-size: 1.15rem; font-weight: 700; line-height: 1.55; }

/* What the game collects, in five words each, on flags in the level colours. */
.sheet .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.sheet .facts li {
  margin: 0;
  padding: 0.6rem 1.7rem 0.6rem 1rem;
  background: var(--c);
  color: var(--ink, var(--cream));
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%);
}

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

.footer {
  background: var(--plum-deep);
  color: var(--cream);
  padding-block: 30px 38px;
  font-size: 0.95rem;
}
.footer .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 28px; }
.footer a { font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.credits { flex-basis: 100%; margin: 6px 0 0; color: var(--mist); font-size: 0.88rem; }
.credits a { color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .pill { transition: none; }
}
