/* ───────────────────────────────────────────────────────────
   Landing page – hero that fits the viewport.
   The phone replicates the app's real counter screen
   (CounterScreen.tsx) and scales with container units.
   ─────────────────────────────────────────────────────────── */

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  overflow-x: clip;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: center;
  gap: clamp(16px, 3vw, 56px);
  width: 100%;
  max-width: 1280px;
  min-height: 0;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 72px);
}

/* ── Copy ───────────────────────────────────────────────── */
.copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 clamp(14px, 2.6dvh, 26px);
  padding: 6px 13px 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.005em;
}
.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, min(5.3vw, 8.4dvh), 80px);
  line-height: 0.98;
  font-weight: 650;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.hero h1 em {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: clamp(14px, 2.6dvh, 26px) 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(16px, min(1.35vw, 2.4dvh), 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-top: clamp(20px, 3.8dvh, 38px);
}
.store {
  display: block;
  border-radius: 10px;
  line-height: 0;
  transition:
    transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1),
    filter 0.25s;
  filter: drop-shadow(0 8px 14px rgb(15 23 42 / 0.18));
}
.store:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 14px 20px rgb(15 23 42 / 0.28));
}
.store img {
  display: block;
  height: 46px;
  width: auto;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: clamp(18px, 3.4dvh, 34px) 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 540;
  letter-spacing: -0.005em;
}
.facts svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Stage: ring + phone ────────────────────────────────── */
.stage {
  --ph: clamp(380px, calc(100dvh - 292px), 720px); /* phone height */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.rig {
  position: relative;
  width: calc(var(--ph) * 0.4615);
  height: var(--ph);
  flex: none;
  /* leave room for the bead ring that wraps the phone */
  margin-block: calc(var(--ph) * 0.045 + 16px);
}

/* Bead ring (tesbih) */
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  overflow: visible;
  pointer-events: none;
}
.ring .s-off-1 {
  stop-color: light-dark(#ffffff, #55555e);
}
.ring .s-off-2 {
  stop-color: light-dark(#bcc8dc, #1f1f24);
}
.ring .s-on-1 {
  stop-color: light-dark(#a5c8ff, #cfe2ff);
}
.ring .s-on-2 {
  stop-color: light-dark(#2563eb, #3b82f6);
}
.ring .halo {
  fill: var(--accent);
  opacity: 0;
  transition: opacity 0.5s;
}
.ring .off {
  fill: url(#bead-off);
  stroke: light-dark(rgb(15 23 42 / 0.1), rgb(255 255 255 / 0.07));
  stroke-width: 0.8;
}
.ring .on {
  fill: url(#bead-on);
  opacity: 0;
  transition: opacity 0.35s;
}
.ring .lit .halo {
  opacity: 0.2;
}
.ring .lit .on {
  opacity: 1;
}
.ring .pop .on {
  transform-box: fill-box;
  transform-origin: center;
  animation: bead-pop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.ring .imame .core {
  fill: var(--ink);
}
.ring .imame .rim {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: 0.55;
}
.ring .pul {
  fill: light-dark(#94a3b8, #52525b);
  transition: fill 0.35s;
}
.ring .lit .pul {
  fill: var(--accent);
}
.ring.pulse {
  animation: ring-pulse 0.9s ease-out;
}

/* Phone */
.phone {
  position: absolute;
  inset: 0;
  padding: 2.3%;
  border-radius: 14% / 6.46%;
  container-type: inline-size;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.22), transparent 28%),
    linear-gradient(160deg, #3b3b42, #0a0a0c 60%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1) inset,
    0 0 0 1.5px rgb(0 0 0 / 0.55),
    0 50px 90px -30px light-dark(rgb(30 41 90 / 0.55), rgb(0 0 0 / 0.9)),
    0 22px 40px -22px light-dark(rgb(15 23 42 / 0.5), rgb(0 0 0 / 0.8));
}
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, #2a2a30, #151518);
}
.phone::before {
  left: -1.1%;
  top: 17%;
  width: 1.5%;
  height: 4.6%;
  border-radius: 3px 0 0 3px;
}
.phone::after {
  right: -1.1%;
  top: 24%;
  width: 1.5%;
  height: 8.4%;
  border-radius: 0 3px 3px 0;
}

.screen {
  --app-bg: light-dark(#f1f5f9, #18181b);
  --app-btn: light-dark(#e2e8f0, #27272a);
  --app-text: light-dark(#0f172a, #ffffff);
  --app-main: light-dark(#18181b, #f1f5f9);
  --app-on-main: light-dark(#ffffff, #18181b);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 14.5cqw 4.6cqw 12.5cqw;
  overflow: hidden;
  border-radius: 11.6cqw;
  background: var(--app-bg);
  color: var(--app-text);
  transition:
    background 0.4s,
    color 0.4s;
  -webkit-tap-highlight-color: transparent;
}
.screen::after {
  /* home indicator */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2.6cqw;
  width: 34cqw;
  height: 1.4cqw;
  translate: -50% 0;
  border-radius: 99px;
  background: var(--app-text);
  opacity: 0.85;
}
.island {
  position: absolute;
  top: 3.2cqw;
  left: 50%;
  width: 27cqw;
  height: 7.8cqw;
  translate: -50% 0;
  border-radius: 99px;
  background: #000;
}
.gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, rgb(255 255 255 / 0.1), transparent 34%);
}

.bar {
  display: flex;
  gap: 2.7cqw;
}
.ib {
  appearance: none;
  display: grid;
  place-items: center;
  width: 11.7cqw;
  height: 11.7cqw;
  padding: 0;
  border: 0;
  border-radius: 3.7cqw;
  background: var(--app-btn);
  color: var(--app-text);
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.12s,
    background 0.4s;
}
.ib:active:not(:disabled) {
  transform: scale(0.92);
}
.ib:disabled {
  opacity: 0.38;
  cursor: default;
}
.ib svg,
.plus svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ib svg {
  width: 5.3cqw;
  height: 5.3cqw;
}

.dhikr {
  margin: 5.4cqw 1cqw 0;
  font-size: var(--ds, 6.1cqw);
  line-height: 1.4;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
  transition: font-size 0.35s cubic-bezier(0.3, 1.25, 0.5, 1);
}
.phone[data-size="s"] {
  --ds: 3.6cqw;
}
.phone[data-size="m"] {
  --ds: 4.6cqw;
}
.phone[data-size="l"] {
  --ds: 6.1cqw;
}
.phone[data-size="xl"] {
  --ds: 8.1cqw;
}

.count-area {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
}
.count {
  font-size: 40cqw;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.count[data-len="3"] {
  font-size: 32cqw;
}
.count[data-len="4"],
.count[data-len="5"] {
  font-size: 25cqw;
}

.plus {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 36cqw;
  padding: 0;
  border: 0;
  border-radius: 7cqw;
  background: var(--app-main);
  color: var(--app-on-main);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.12s,
    opacity 0.12s,
    background 0.4s;
}
.plus:active {
  transform: scale(0.97);
  opacity: 0.88;
}
.plus svg {
  width: 12.6cqw;
  height: 12.6cqw;
}
.plus::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.demo:not(.touched) .plus::after {
  animation: hint-pulse 2.4s ease-out 1.6s infinite;
}

/* "Text size" glass card */
.sizer {
  position: absolute;
  right: calc(100% - 44px);
  bottom: 15%;
  width: 208px;
  padding: 14px 14px 14px;
  border-radius: 22px;
  z-index: 2;
}
.sizer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 10px;
  font-size: 13px;
  line-height: 1.2;
}
.sizer-head b {
  font-weight: 650;
  letter-spacing: -0.01em;
}
.sizer-head span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sizer-opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 15px;
  background: light-dark(#e6ecf4, #26262b);
  border: 1px solid var(--line);
}
.sizer-opts button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}
.sizer-opts button[data-size="s"] {
  font-size: 12px;
}
.sizer-opts button[data-size="m"] {
  font-size: 14.5px;
}
.sizer-opts button[data-size="l"] {
  font-size: 18px;
}
.sizer-opts button[data-size="xl"] {
  font-size: 22px;
}
.sizer-opts button:hover {
  background: light-dark(rgb(15 23 42 / 0.06), rgb(255 255 255 / 0.07));
}
.sizer-opts button[aria-pressed="true"] {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgb(37 99 235 / 0.9);
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  transition:
    opacity 0.5s,
    transform 0.5s;
}
.hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
.demo.touched .hint {
  opacity: 0;
  transform: translateY(6px);
}

/* ── Motion ─────────────────────────────────────────────── */
@keyframes bead-pop {
  0% {
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes ring-pulse {
  0% {
    filter: drop-shadow(0 0 0 transparent);
  }
  35% {
    filter: drop-shadow(0 0 16px color-mix(in oklab, var(--accent) 80%, transparent));
  }
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
}
@keyframes hint-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 4.4cqw transparent;
  }
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.965);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }
  .stage-in {
    animation: stage-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
  }
}

/* ── Tablet & phone: stack, centre, let the page scroll ──── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
    padding-top: 6px;
    padding-bottom: 20px;
    text-align: center;
  }
  .copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero h1 {
    font-size: clamp(38px, 10.6vw, 64px);
  }
  .stores,
  .facts {
    justify-content: center;
  }
  .stage {
    --ph: min(124vw, 580px);
  }
  .sizer {
    display: none;
  }
  .store img {
    height: 44px;
  }
}

@media (max-width: 600px) {
  /* the lede already says the same thing; keep the phone higher up */
  .facts {
    display: none;
  }
}

@media (max-width: 420px) {
  .top {
    padding-inline: 16px;
  }
  .brand {
    font-size: 16px;
  }
  .controls {
    gap: 6px;
  }
}

/* Short landscape screens (phones turned sideways) */
@media (min-width: 901px) and (max-height: 620px) {
  .stage {
    --ph: 400px;
  }
}
