/* Noto Sans draws Latin and Cyrillic, Noto Sans Armenian draws Armenian.
   Both are subset to the pages' text; see assets/fonts/ for the OFL licences. */
@font-face {
  font-family: "Noto Sans";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans";
  font-weight: 800;
  font-display: swap;
  src: url("fonts/NotoSans-ExtraBold.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans Armenian";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSansArmenian-Regular.woff2") format("woff2");
  unicode-range: U+0530-058F;
}

@font-face {
  font-family: "Noto Sans Armenian";
  font-weight: 800;
  font-display: swap;
  src: url("fonts/NotoSansArmenian-ExtraBold.woff2") format("woff2");
  unicode-range: U+0530-058F;
}

/* Values from lib/theme/app_colors.dart in the app. */
:root {
  --background: #1a1a1a;
  --primary: #ff6a00;
  --text: #f2f2f2;
  --text-secondary: #c9c9c9;

  --gutter: clamp(1rem, 4.5vw, 4.5rem);
  /* Keeps both badges on one row: together they are 6.37 times their height wide. */
  --badge-height: min(3rem, (100vw - 3rem) / 6.37);

  color-scheme: dark;
}

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

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

body {
  display: grid;
  grid-template-rows: auto auto minmax(13rem, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans", "Noto Sans Armenian", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem var(--gutter);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.wordmark img {
  display: block;
  width: 2rem;
  height: 2rem;
}

nav {
  display: flex;
  /* Lines the last language up with the gutter despite its tap padding. */
  margin-inline-end: -0.5rem;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

main {
  padding: 1.5rem var(--gutter) 2.5rem;
}

h1 {
  max-width: 13em;
  margin: 0;
  font-size: clamp(2.25rem, 1.25rem + 3.6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

.sentence {
  max-width: 28em;
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  text-wrap: pretty;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1rem;
  margin-top: 2rem;
}

.store {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  line-height: 1.3;
}

.store img {
  display: block;
  width: auto;
  height: var(--badge-height);
}

.store-status {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 800;
}

/* Only applies once a store button has been turned into a link at release. */
a.store img {
  transition: transform 0.15s ease-out;
}

a.store:hover img {
  transform: translateY(-2px);
}

/* One 404.html answers for every URL and the site has no scripts to pick a
   language, so the page says it in all three. */
.error-code {
  font-size: clamp(5.5rem, 4rem + 6vw, 9rem);
  line-height: 1;
}

.not-found {
  margin: 1.25rem 0 0;
  padding: 0;
  color: var(--text-secondary);
  list-style: none;
}

.not-found li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.625rem;
  min-height: 2.75rem;
}

.not-found a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.not-found a:hover {
  color: var(--text);
}

/* The rooster looks left, towards the copy, and runs off the panel's edge.
   Its shape comes from a mask so that it can be drawn in the background colour. */
.poster {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  container-type: size;
}

.poster::after {
  content: "";
  position: absolute;
  inset-block-start: 8%;
  inset-inline-start: 50%;
  width: 118%;
  width: min(118%, 130cqh);
  aspect-ratio: 1;
  background: var(--background);
  -webkit-mask: url("rooster.svg") center / contain no-repeat;
  mask: url("rooster.svg") center / contain no-repeat;
  transform: translateX(-46%);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* Narrow phones: the wordmark and all three languages still share one row. */
@media (max-width: 23.4rem) {
  .wordmark {
    gap: 0.25rem;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
  }

  .wordmark img {
    width: 1.5rem;
    height: 1.5rem;
  }

  nav {
    margin-inline-end: -0.375rem;
  }

  nav a {
    padding-inline: 0.375rem;
    font-size: 0.8125rem;
  }
}

@media (min-width: 52rem) {
  :root {
    --badge-height: 3.25rem;
  }

  body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  header {
    padding-block: 1.25rem;
  }

  main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 2rem 4rem;
  }

  .poster {
    grid-column: 2;
    grid-row: 1 / -1;
  }

  .poster::after {
    inset-block-start: 50%;
    inset-inline-start: -3%;
    width: min(146%, 125vh);
    transform: translateY(-50%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .poster::after {
    animation: settle 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes settle {
  from {
    scale: 1.06;
  }
}
