/* Didogi coming-soon. Flat colour only: a black field and a red "on air" field. Mobile first; tablet ≥768; desktop ≥1024.
   Opening (s): tally blinks 0.3 → logo 0.9 → headline pulls into focus 1.2–2.4 → lead 2.9 → red field wipes up 3.2 →
   announce 3.7 → meter 3.9, levels jump to the progress 4.4–6.4. Tap skips it. */

@font-face {
  font-family: "Vazirmatn";
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/vazirmatn-arabic.woff2") format("woff2");
  unicode-range: 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: "Vazirmatn";
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/vazirmatn-latin.woff2") format("woff2");
  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;
}

:root {
  --black: #0b0b0d;
  --paper: #f4f1ef;
  --red: #ea181f;      /* brand red, on black (large type only) */
  --field: #d91419;    /* red field: white text on it is 5.2:1 */
  --field-dim: #a30d12;
  --pad: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--black); color-scheme: dark; }
body { font-family: "Vazirmatn", system-ui, sans-serif; color: #fff; -webkit-font-smoothing: antialiased; }

/* ---------- Opening ---------- */
@keyframes up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes focus {
  from { opacity: 0; filter: blur(16px); transform: translateY(0.3em) scale(1.06); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes level-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes eq { from { transform: scaleY(var(--s)); } to { transform: scaleY(var(--s2)); } }

.o { animation: up 0.9s var(--ease) var(--d, 0s) both; }
.w { display: inline-block; animation: focus 1.1s var(--ease) var(--d, 0s) both; }
.field { clip-path: inset(100% 0 0 0); animation: wipe 1s cubic-bezier(0.7, 0, 0.2, 1) 3.2s forwards; }
.logo.o, .tally.o { animation-name: level-in; }

html[data-intro="skip"] .o, html[data-intro="skip"] .w, html[data-intro="skip"] .field, html[data-intro="skip"] .level {
  animation-delay: 0s !important;
  animation-duration: 1ms !important;
}

/* ---------- Layout (mobile) ---------- */
.soon { min-height: 100svh; display: flex; flex-direction: column; }

.top {
  padding: calc(20px + env(safe-area-inset-top)) var(--pad) 36px;
  display: flex;
  flex-direction: column;
}
.bar { display: flex; align-items: center; justify-content: space-between; }
.logo { display: block; width: 112px; height: auto; }
.tally { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; }
.tally i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1.4s steps(1) infinite; }

.top-body { margin-top: clamp(40px, 9svh, 84px); }
.h1 {
  margin: 0;
  font-size: clamp(2.5rem, 11.6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.3;
  text-wrap: balance;
}
.l { display: block; }
.l2 { color: var(--red); }
.lead { margin: 22px 0 0; max-width: 26rem; font-size: 1.0625rem; line-height: 1.9; color: #dedad8; text-wrap: balance; }

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--field);
  padding: 40px var(--pad) calc(28px + env(safe-area-inset-bottom));
}
.announce { margin: 0; font-size: clamp(2rem, 9.4vw, 2.8rem); font-weight: 900; line-height: 1.3; }
.tagline { margin: 12px 0 0; max-width: 26rem; font-size: 1.0625rem; line-height: 1.9; text-wrap: balance; }

/* Progress as a live signal meter: the lit levels are the percentage */
.meter { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 36px; }
.pct { margin: 0; display: flex; align-items: baseline; gap: 2px; line-height: 1; }
.pct strong { font-size: clamp(4.2rem, 22vw, 6.4rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.pct b { font-size: clamp(2rem, 10vw, 3rem); font-weight: 900; }
.pct span { margin-inline-start: auto; font-size: 0.9375rem; font-weight: 600; }

.levels { margin-top: 18px; flex: 1; min-height: 88px; max-height: 320px; display: grid; grid-template-columns: repeat(40, 1fr); grid-template-rows: 1fr; gap: 3px; align-items: end; }
.level {
  height: 100%;
  border-radius: 2px;
  background: var(--field-dim);
  transform-origin: 50% 100%;
  transform: scaleY(0.14);
  opacity: 0;
  animation: level-in 0.4s ease-out var(--bd, 4.2s) forwards;
}
.level.on { background: #fff; transform: scaleY(var(--s)); animation: level-in 0.4s ease-out var(--bd, 4.2s) forwards, eq var(--dur, 1.2s) ease-in-out var(--ed, 0s) infinite alternate; }

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  :root { --pad: 48px; }
  .logo { width: 140px; }
  .top { padding-top: 36px; padding-bottom: 56px; }
  .h1 { font-size: 5rem; }
  .lead { font-size: 1.3125rem; max-width: 34rem; }
  .field { padding-top: 56px; }
  .announce { font-size: 3.2rem; }
  .tagline { font-size: 1.25rem; max-width: 34rem; }
  .pct strong { font-size: 7.5rem; }
  .pct b { font-size: 3.6rem; }
  .pct span { font-size: 1.0625rem; }
  .levels { min-height: 120px; gap: 5px; }
}

/* ---------- Desktop: two halves ---------- */
@media (min-width: 1024px) {
  :root { --pad: 72px; }
  .soon { flex-direction: row; }
  .top { flex: 1 1 50%; padding-top: 48px; padding-bottom: 56px; }
  .logo { width: 150px; }
  .top-body { margin-block: auto; padding-block: 48px; }
  .h1 { font-size: clamp(3.8rem, 5.6vw, 6.6rem); }
  .l { white-space: nowrap; }
  .lead { font-size: 1.375rem; max-width: 32rem; }
  .field { flex: 1 1 50%; padding-top: 48px; padding-bottom: 56px; }
  .announce { font-size: clamp(2.6rem, 3.8vw, 4rem); }
  .tagline { font-size: 1.375rem; max-width: 32rem; }
  .meter { padding-top: 56px; }
  .pct strong { font-size: clamp(7rem, 10vw, 11rem); }
  .pct b { font-size: clamp(3.4rem, 5vw, 5.5rem); }
  .levels { min-height: 160px; max-height: none; gap: 6px; }
}
@media (min-width: 1024px) and (max-height: 720px) {
  .h1 { font-size: 3.6rem; }
  .pct strong { font-size: 6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tally i { animation: none; }
  .level.on { animation: level-in 1ms forwards; }
}

/* Short phones (e.g. 360×640): tighter rhythm so the meter stays on the first screen */
@media (max-width: 767px) and (max-height: 700px) {
  .top { padding-bottom: 24px; }
  .top-body { margin-top: 28px; }
  .h1 { font-size: 2.3rem; }
  .lead { margin-top: 14px; font-size: 1rem; line-height: 1.8; }
  .field { padding-top: 26px; }
  .announce { font-size: 1.75rem; }
  .tagline { margin-top: 8px; font-size: 1rem; line-height: 1.8; }
  .meter { padding-top: 20px; }
  .pct strong { font-size: 3.6rem; }
  .levels { margin-top: 12px; min-height: 64px; }
}
