/* falaklabs.com/social/ — the totals on top, then a card per channel with a link to each of its accounts.
   Stands alone (no arcade styles) so it opens fast inside the TikTok and Instagram in-app browsers.
   Colours and type mirror games/hub.css: night ink, paper text, Bricolage Grotesque for display.
   The logo is a planet, its moon and its orbit, and every channel is drawn the same way: its picture is the
   planet and its accounts are the moons. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Falak Wordmark";       /* El Messiri, the logo's typeface, cut down to the letters of مختبرات فلك */
  src: url("../assets/fonts/el-messiri-arabic-falak-labs.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #080C1F;
  --ink-2: #0F1532;
  --ink-3: #182050;
  --paper: #F6F3EA;
  --dim: #AEB4D0;
  --faint: #7F86A8;
  --line: rgba(246, 243, 234, 0.13);
  --gold: #E8B65A;
  --glow: 36, 64, 184;                 /* the brand's ultramarine, as R, G, B */
  /* Arabic has no web font here: it falls through to the phone's own Arabic face, as on the rest of the site. */
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: clamp(16px, 4.2vw, 44px);
  --max: 1040px;
  --col: 4.6rem;                       /* width of one number column in the table by platform */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
@supports (overflow-x: clip) { body { overflow-x: clip; } }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: calc(var(--pad) + var(--safe-l));
  padding-right: calc(var(--pad) + var(--safe-r));
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; inset-inline-start: 12px; top: 12px; z-index: 20;
  padding: 10px 16px; border-radius: 999px; background: var(--paper); color: var(--ink);
  font-weight: 700; text-decoration: none; transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; gap: 10px; padding-top: calc(var(--safe-t) + 14px); padding-bottom: 14px; }
.top__brand { display: inline-flex; align-items: center; border-radius: 6px; color: #F2EAD8; text-decoration: none; }
.top__logo { height: 26px; width: auto; }
/* In Arabic the name is written out: the mark, then مختبرات فلك in the logo's own typeface.
   The mark is a background here, so it is only fetched when Arabic is on screen. */
.top__ar { display: none; align-items: center; gap: 9px; font-family: "Falak Wordmark", var(--text); font-weight: 600; font-size: 1.5rem; line-height: 1; }
.top__ar::before { content: ""; flex: none; width: 28px; height: 28px; background: url("../assets/brand/falak-mark.svg") center / contain no-repeat; }
html[lang="ar"] .top__logo { display: none; }
html[lang="ar"] .top__ar { display: inline-flex; }
.top__lang {
  min-height: 38px; margin-inline-start: auto; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.92rem; font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.top__lang:hover { background: rgba(246, 243, 234, 0.08); }
@media (max-width: 420px) { .top__logo { height: 22px; } .top__ar { font-size: 1.3rem; } .top__ar::before { width: 24px; height: 24px; } }
/* One stripe per kind of channel, in the order they appear below (the arcade's stripe has one per world). */
.stripe {
  height: 4px; background: linear-gradient(90deg, #D9741C 0 33.34%, #25A39A 33.34% 66.67%, #E5383B 66.67% 100%);
  transform-origin: 0 50%; animation: draw 0.9s var(--ease-out) both;
}
[dir="rtl"] .stripe { transform-origin: 100% 50%; }
@keyframes draw { from { transform: scaleX(0); } to { transform: none; } }

/* ---------------------------------------------------------------- the totals */
.open { position: relative; isolation: isolate; padding-top: clamp(20px, 4.4vw, 48px); padding-bottom: clamp(14px, 2.4vw, 26px); }
.open::before {                        /* the glow behind the logo on the brand board, here behind the numbers */
  content: ""; position: absolute; z-index: -1; top: -70px; bottom: -40px; left: 50%; width: 100vw; transform: translateX(-50%);
  background: radial-gradient(ellipse 70% 90% at 82% 8%, rgba(var(--glow), 0.34), rgba(var(--glow), 0) 72%);
  pointer-events: none;
}
[dir="rtl"] .open::before { background: radial-gradient(ellipse 70% 90% at 18% 8%, rgba(var(--glow), 0.34), rgba(var(--glow), 0) 72%); }

.sum { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 0 8px; }
.sum__item { display: flex; flex-direction: column; min-width: 0; }
.sum__value {
  order: 1; font-family: var(--display); font-weight: 800; font-stretch: 80%;
  font-size: clamp(2.4rem, 11.8vw, 4.8rem); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sum__label { order: 2; margin-top: 7px; color: var(--dim); font-size: 0.92rem; font-weight: 550; line-height: 1.3; }
.sum__plus { order: 3; min-height: 1.4em; color: var(--gold); font-size: 0.84rem; font-weight: 650; line-height: 1.4; white-space: nowrap; }
@media (min-width: 600px) { .sum { justify-content: start; gap: 0 clamp(40px, 7vw, 88px); } }

/* A number is a row of columns, one per digit; a digit changes by rolling its column, like a counter. */
.odo { display: inline-flex; align-items: flex-end; direction: ltr; line-height: 1; }
.odo__col { display: block; height: 1em; overflow: hidden; }
.odo__strip { display: block; transition: transform 1.2s var(--ease-out); will-change: transform; }
.odo__strip span { display: block; height: 1em; text-align: center; }
.odo__sep { display: block; height: 1em; }

.open__note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; min-height: 22px; margin-top: 12px; color: var(--dim); font-size: 0.86rem; }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.live__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--gold); animation: live 2.4s var(--ease-out) infinite; }
.live.is-old .live__dot { background: var(--faint); }
.live.is-old .live__dot::after { display: none; }
@keyframes live { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.4); opacity: 0; } }
/* On a phone the links are small pictures, so this line says once which picture is which platform. */
.legend { display: flex; flex-wrap: wrap; gap: 4px 13px; margin-inline-start: auto; color: var(--faint); font-weight: 550; }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend svg { flex: none; width: 14px; height: 14px; }
@media (min-width: 600px) { .legend { display: none; } }

/* ---------------------------------------------------------------- the channels: two next to each other, three columns when there is room */
.channels { padding-top: 2px; padding-bottom: clamp(22px, 3.4vw, 40px); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* A kind of channel: a short heading in its colour, then its channels. */
.kind {
  --accent: var(--gold);
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 8px;
  font-family: var(--display); font-weight: 750; font-stretch: 88%; font-size: 1rem; line-height: 1.2;
}
.kind:first-child { margin-top: 0; }
.kind::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.kind:empty { display: none; }
html[lang="ar"] .kind { font-stretch: 100%; line-height: 1.4; }
@media (min-width: 980px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  /* Every kind has the same number of channels: one column per kind, its channels under its heading. */
  .cards.is-even { grid-template-columns: repeat(var(--kinds), minmax(0, 1fr)); grid-template-rows: auto repeat(var(--per), auto); grid-auto-flow: column; }
  .cards.is-even .kind { grid-column: auto; margin-top: 0; font-size: 1.15rem; }
}

.ch {
  --accent: var(--gold);
  display: grid; align-content: space-between; gap: 12px; min-width: 0; padding: 12px; border-radius: 18px;
  background: var(--ink-2); scroll-margin-top: 16px;
}
.ch.is-here { box-shadow: inset 0 0 0 1.5px var(--gold); }
.ch__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ch__names { min-width: 0; }
.ch__name { font-family: var(--display); font-weight: 750; font-stretch: 86%; font-size: 1rem; line-height: 1.14; overflow-wrap: anywhere; }
.ch__native { display: block; margin-top: 2px; color: var(--dim); font-family: var(--text); font-weight: 500; font-size: 0.88rem; line-height: 1.3; }
@media (min-width: 600px) { .ch { padding: 16px; gap: 16px; } .ch__name { font-size: 1.2rem; } }

/* The picture is the planet. The ring is its orbit, and each account is a moon on it. */
.planet { --size: 58px; position: relative; flex: none; width: var(--size); height: var(--size); }
.planet::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  animation: ring 0.9s var(--ease-out) both;
}
.planet__pic {
  position: absolute; inset: 8px; display: grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--ink-3); font-family: var(--display); font-weight: 800; font-size: 1.15rem;
}
.planet__pic img { width: 100%; height: 100%; object-fit: cover; }
.planet__orbit { position: absolute; inset: 0; animation: orbit 22s linear infinite; }
.planet__orbit i {
  position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2.5px var(--ink-2);
  transform: rotate(calc(var(--n, 0) * 120deg)) translateY(calc(var(--size) / -2));
  transition: background-color 0.2s linear, box-shadow 0.2s linear;
}
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes ring { from { transform: scale(0.62); opacity: 0; } to { transform: none; opacity: 1; } }
/* An account that has just grown: its moon lights up, then settles. */
.planet__orbit i.is-up { animation: flare 2.6s var(--ease-out); }
@keyframes flare {
  0%, 30% { background: var(--gold); box-shadow: 0 0 0 2.5px var(--ink-2), 0 0 0 7px rgba(232, 182, 90, 0.4); }
  100% { background: var(--accent); box-shadow: 0 0 0 2.5px var(--ink-2), 0 0 0 2.5px rgba(232, 182, 90, 0); }
}
@media (min-width: 600px) { .planet { --size: 70px; } .planet__pic { inset: 9px; } .planet__orbit i { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; } }

/* One link per account, always in the same order. */
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; justify-items: center; }
.key {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: min(46px, 100%); aspect-ratio: 1; border-radius: 999px;
  background: var(--ink-3); color: var(--paper); font-size: 0.84rem; font-weight: 650; text-decoration: none;
  touch-action: manipulation; transition: background-color 0.15s linear, color 0.15s linear, transform 0.2s var(--ease-out);
}
.key svg { flex: none; width: 19px; height: 19px; }
.key__word { display: none; }
.key:active { transform: scale(0.94); background: var(--accent); color: var(--ink); }
@media (hover: hover) { a.key:hover { background: var(--accent); color: var(--ink); } }
@media (min-width: 600px) { .key { width: 100%; aspect-ratio: auto; height: 44px; gap: 6px; font-size: 0.8rem; } .key__word { display: inline; } .key svg { width: 14px; height: 14px; } }
/* The moon of the account under the finger answers. */
.ch:has(.key--youtube:is(:active, :focus-visible)) .moon--youtube,
.ch:has(.key--tiktok:is(:active, :focus-visible)) .moon--tiktok,
.ch:has(.key--instagram:is(:active, :focus-visible)) .moon--instagram {
  background: var(--gold); box-shadow: 0 0 0 2.5px var(--ink-2), 0 0 0 6px rgba(232, 182, 90, 0.4);
}
@media (hover: hover) {
  .ch:has(.key--youtube:hover) .moon--youtube,
  .ch:has(.key--tiktok:hover) .moon--tiktok,
  .ch:has(.key--instagram:hover) .moon--instagram {
    background: var(--gold); box-shadow: 0 0 0 2.5px var(--ink-2), 0 0 0 6px rgba(232, 182, 90, 0.4);
  }
}

/* ---------------------------------------------------------------- the same numbers, by platform */
.by { padding-top: clamp(6px, 1.4vw, 16px); padding-bottom: clamp(22px, 3vw, 36px); }
.by__title { font-family: var(--display); font-weight: 800; font-stretch: 84%; font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem); line-height: 1.1; }
html[lang="ar"] .by__title { line-height: 1.3; font-stretch: 100%; }
.by__table { max-width: 520px; margin-top: 8px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, var(--col)); column-gap: 6px; align-items: center; }
.cols { padding: 0 2px 5px; color: var(--faint); font-size: 0.76rem; font-weight: 600; }
.cols span { text-align: end; }
.by__row { padding: 11px 2px; border-top: 1px solid var(--line); }
.row__platform { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1rem; }
.row__platform svg { flex: none; width: 16px; height: 16px; color: var(--dim); }
.row__num { text-align: end; font-weight: 650; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__num.is-none { color: var(--faint); font-weight: 500; }
.row__num.is-fresh { animation: fresh 1.6s var(--ease-out); }
@keyframes fresh { from { color: var(--gold); } to { color: inherit; } }

/* ---------------------------------------------------------------- states */
.wait { padding-block: 20px 50px; color: var(--dim); }
.wait a { text-underline-offset: 3px; }
.plain { display: grid; gap: 4px; margin-top: 12px; }
.plain a { text-underline-offset: 3px; }

/* ---------------------------------------------------------------- the arcade, then the footer */
.also { padding-top: clamp(18px, 2.6vw, 28px); padding-bottom: clamp(22px, 3.4vw, 40px); border-top: 1px solid var(--line); }
.also__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.also__text { color: var(--paper); font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: 1.25rem; line-height: 1.2; }
html[lang="ar"] .also__text { font-stretch: 100%; line-height: 1.4; }
.also__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: 1.05rem;
  text-decoration: none; transition: transform 0.2s var(--ease-out), box-shadow 0.2s linear;
}
.also__btn:active { transform: scale(0.97); }
@media (hover: hover) { .also__btn:hover { box-shadow: 0 0 0 6px rgba(246, 243, 234, 0.16); } }

.foot { padding-top: 22px; padding-bottom: calc(var(--safe-b) + 30px); color: var(--dim); font-size: 0.93rem; }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }
.foot__mark { display: inline-flex; border-radius: 6px; }
.foot__mark img { height: 24px; width: auto; }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-inline-start: auto; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--paper); }
.foot__small { margin-top: 14px; color: var(--faint); font-size: 0.86rem; }

@media (max-width: 359px) { :root { --col: 3.9rem; } .cards { gap: 8px; } .ch { padding: 10px; } .planet { --size: 52px; } .keys { gap: 4px; } }
@media (prefers-reduced-motion: reduce) {
  .stripe, .planet::before, .planet__orbit, .planet__orbit i.is-up, .live__dot::after, .row__num.is-fresh { animation: none; }
  .odo__strip, .key, .also__btn, .planet__orbit i { transition: none !important; }
}
