/* bayraq.com, coming soon.
   Colour and type follow Bayraq-Logo-Guidelines.pdf (Version 4):
   Ink and white lead, orange accents; DM Sans where Trap is not available. */

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}

:root {
  --ink: #171717;
  --white: #FFFFFF;
  --orange: #DA5101;
  --quiet: rgb(255 255 255 / 0.62);

  --pad: clamp(1.25rem, 3.6vw, 5.5rem);
  --track: 0.42em;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--ink);
  color: var(--white);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Two parts: the stage, where the logo and the words sit centred, and under
   it the band the banner flows through. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--orange);
  color: var(--white);
}

/* The banner: drawn by site.js, behind everything. */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(1.6rem, 4.4vh, 3.75rem);
  padding:
    max(var(--pad), env(safe-area-inset-top))
    max(var(--pad), env(safe-area-inset-right))
    0
    max(var(--pad), env(safe-area-inset-left));
  /* The pair sits a little below the stage's middle, nearer the banner. */
  padding-top: max(calc(var(--pad) + 9vh), env(safe-area-inset-top));
  text-align: center;
}

.band {
  height: clamp(8.5rem, 42vh, 36rem);
}

/* The kit's horizontal logo, reversed colourway, as supplied. Its clear
   space is 1X (the staff's width, 7.5% of the logo's); the gap to the words
   is always more than that. */
.logo {
  display: block;
  width: clamp(11rem, 19vw, 27rem);
  height: auto;
}

.home {
  display: block;
}

/* The words: small, wide-set capitals. The padding on the left balances the
   space the tracking leaves after the last letter, so they sit centred. */
.soon {
  margin: 0;
  padding-left: var(--track);
  font-size: clamp(0.875rem, 0.7rem + 0.44vw, 1.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--quiet);
}

/* A light passes along the words now and then, as it does along the banner. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .soon {
    background: linear-gradient(100deg, var(--quiet) 43%, var(--white) 50%, var(--quiet) 57%) 100% 0 / 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@media (forced-colors: active) {
  .soon {
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* The not-found page's way back: white words on an orange rule. Orange on
   Ink is under 4.5:1, so it never carries the words themselves. */
.back {
  margin-top: clamp(-1rem, -1.2vh, -0.25rem);
  font-size: clamp(0.875rem, 0.7rem + 0.3vw, 1.125rem);
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.back:hover {
  text-decoration-color: var(--white);
}

.back:focus-visible,
.home:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 6px;
}

/* A short, wide screen (a phone on its side). */
@media (max-height: 30rem) {
  .stage {
    gap: 1.25rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
  }

  .logo {
    width: clamp(8.5rem, 34vh, 12rem);
  }

  .band {
    height: 36vh;
  }
}

/* Arrival. Everything is visible without it. */
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    letter-spacing: 0.9em;
    padding-left: 0.9em;
  }
  to {
    opacity: 1;
    letter-spacing: var(--track);
    padding-left: var(--track);
  }
}

@keyframes sheen {
  0%,
  58% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.logo {
  animation: arrive 1.4s var(--ease) 0.15s both;
}

.soon {
  animation:
    settle 1.9s var(--ease) 0.75s both,
    sheen 9s linear 3.2s infinite;
}

.back {
  animation: arrive 1.2s var(--ease) 1.5s both;
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .soon,
  .back {
    animation: none;
  }
}
