/*
 * The coming-soon page (kadr.club): the app's "Golden Age" look, CSS only.
 *
 * Colours are the app's own tokens, copied from packages/ui/src/styles/theme.css with the same
 * names (build.test.mjs fails if they drift). Light is cream paper; dark follows the phone.
 * Fonts are the app's free set (D-052), self-hosted: Aref Ruqaa and Newsreader for the name,
 * Beiruti for the text. The one moment: a row of marquee bulbs lights up once.
 */

/* ------------------------------------------------------------------ fonts */
/* Arabic range: the Arabic blocks plus the word space (apps/web/app/components/fonts). */
@font-face {
  font-family: "Kadr Display Arabic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/aref-ruqaa-arabic-700-normal.woff2") format("woff2");
  unicode-range:
    U+0020, U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Kadr Text Arabic";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/beiruti-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0020, U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Kadr Display Latin";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Beiruti's Latin also draws the full stops inside Arabic lines (Ruq'ah has none). */
@font-face {
  font-family: "Kadr Text Latin";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/beiruti-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ colours */
:root {
  color-scheme: light dark;
  --color-page: #f5ecdb;
  --color-surface: #fbf5e9;
  --color-fg: #23141a;
  --color-muted: #5b474a;
  --color-accent-text: #7b1c2b;
  --color-rule: #b4873a;
  --color-bulb-on: #7b1c2b;
  --color-bulb-off: #dccbb0;
  --color-bulb-glow: rgba(180, 135, 58, 0.5);
  --ease-lights: cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-page: #140b11;
    --color-surface: #1e121a;
    --color-fg: #f6eadb;
    --color-muted: #cebcaf;
    --color-accent-text: #e7bd6e;
    --color-rule: #8a6a3a;
    --color-bulb-on: #f6d590;
    --color-bulb-off: #3a2631;
    --color-bulb-glow: rgba(246, 205, 130, 0.55);
  }
}

/* ------------------------------------------------------------------ type */
[lang="ar"] {
  --font-display: "Kadr Display Arabic", "Kadr Text Latin", serif;
  --font-text: "Kadr Text Arabic", "Kadr Text Latin", sans-serif;
}
[lang="en"] {
  --font-display: "Kadr Display Latin", serif;
  --font-text: "Kadr Text Latin", sans-serif;
}

/* ------------------------------------------------------------------ page */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-block-size: 100svh;
  display: grid;
  place-items: center;
  padding-block: 2rem;
  padding-inline: 1.25rem;
  background-color: var(--color-page);
  background-image: radial-gradient(
    ellipse 80% 60% at 50% 45%,
    var(--color-surface),
    var(--color-page) 75%
  );
  color: var(--color-fg);
  font-family: var(--font-text);
}

.stage {
  inline-size: min(100%, 30rem);
  text-align: center;
}

.block p,
.block h1 {
  margin: 0;
  text-wrap: balance;
}

.name {
  font-family: var(--font-display);
  color: var(--color-fg);
}
[lang="ar"] .name {
  font-size: clamp(5rem, 3rem + 8vw, 7.5rem);
  font-weight: 700;
  line-height: 1.3;
}
[lang="en"] .name {
  font-size: clamp(3.5rem, 2rem + 6vw, 5.5rem);
  font-weight: 480;
  line-height: 1.05;
  letter-spacing: -0.012em;
}

.soon {
  margin-block-start: 0.25rem;
  color: var(--color-accent-text);
  font-weight: 600;
}
[lang="ar"] .soon {
  font-size: 1.5rem;
  line-height: 1.5;
}
[lang="en"] .soon {
  font-size: 1.375rem;
  line-height: 1.3;
}

.block .tagline {
  margin-block-start: 1rem;
}
[lang="ar"] .tagline {
  font-size: 1.25rem;
  line-height: 1.6;
}
[lang="en"] .tagline {
  font-size: 1.125rem;
  line-height: 1.4;
}

.block .about {
  margin-block-start: 0.25rem;
  color: var(--color-muted);
}
[lang="ar"] .about {
  font-size: 1.125rem;
  line-height: 1.7;
}
[lang="en"] .about {
  font-size: 1rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ the marquee */
/* Gold double rules either side of a short row of bulbs, between the two languages. */
.marquee {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  inline-size: min(100%, 18rem);
  margin-block: 2rem;
  margin-inline: auto;
}

.rule {
  flex: 1;
  block-size: 5px;
  border-block: 1px solid var(--color-rule);
  opacity: 0.75;
}

.bulbs {
  display: flex;
  gap: 0.5rem;
}

.bulbs span {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 9999px;
  background-color: var(--color-bulb-on);
  box-shadow: 0 0 0.5rem 0.125rem var(--color-bulb-glow);
  animation: bulb-on 480ms var(--ease-lights) backwards;
}

/* From the middle outwards, so the order reads the same in both directions. */
.bulbs span:nth-child(4) {
  animation-delay: 350ms;
}
.bulbs span:nth-child(3),
.bulbs span:nth-child(5) {
  animation-delay: 500ms;
}
.bulbs span:nth-child(2),
.bulbs span:nth-child(6) {
  animation-delay: 650ms;
}
.bulbs span:nth-child(1),
.bulbs span:nth-child(7) {
  animation-delay: 800ms;
}

@keyframes bulb-on {
  from {
    background-color: var(--color-bulb-off);
    box-shadow: none;
  }
}

/* Less motion: the bulbs are simply lit. */
@media (prefers-reduced-motion: reduce) {
  .bulbs span {
    animation: none;
  }
}
