/* Public page. Layout: an emerald hero with the live numbers, the key card overlapping its
   bottom edge, then light cards on a soft mint page. Shared tokens and components are in styles.css. */
:root {
  --page: #f2f6f4;
  --hero-1: #0f6e4e;
  --hero-2: #0a4a37;
  --hero-ink: #ffffff;
  --hero-muted: #cfe3da;
  --glass: rgb(255 255 255 / .10);
  --glass-line: rgb(255 255 255 / .18);
  --ticket: #f7f3e6;
  --ticket-line: #d9c28a;
  --chip: #eef3f0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b110f; --hero-1: #0d4f39; --hero-2: #072a20; --hero-muted: #a8c7b9;
    --glass: rgb(255 255 255 / .06); --glass-line: rgb(255 255 255 / .12);
    --ticket: #1c1a12; --ticket-line: #6d5b2c; --chip: #18221e;
  }
}
:root[data-theme="dark"] {
  --page: #0b110f; --hero-1: #0d4f39; --hero-2: #072a20; --hero-muted: #a8c7b9;
  --glass: rgb(255 255 255 / .06); --glass-line: rgb(255 255 255 / .12);
  --ticket: #1c1a12; --ticket-line: #6d5b2c; --chip: #18221e;
}

body.home { background: var(--page); }
body.home::before { /* paints the phone's status-bar area in the hero colour */
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--hero-1);
}
body.home .wrap { max-width: 560px; }

/* ---------- hero ---------- */
.hero {
  position: relative; color: var(--hero-ink);
  background:
    radial-gradient(90% 60% at 85% 0%, rgb(232 196 110 / .22), transparent 60%),
    linear-gradient(165deg, var(--hero-1), var(--hero-2));
}
.hero::before { /* faint eight-point star lattice */
  content: ""; position: absolute; inset: 0; opacity: .07; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E") repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E") repeat;
}
.hero .wrap { position: relative; padding-block: 14px 0; display: grid; gap: 22px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-name small { color: var(--hero-muted); }
.hero h1 { font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.15; max-width: 18ch; }
.hero .lede { margin: 8px 0 0; color: var(--hero-muted); max-width: 40ch; }

.pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pill {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 16px; padding: 12px 12px 10px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); min-width: 0;
}
.pill b { display: block; font: 600 clamp(1.15rem, 5vw, 1.45rem)/1.1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pill span { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--hero-muted); margin-top: 4px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #5fe0a8; flex: none; box-shadow: 0 0 0 0 rgb(95 224 168 / .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgb(95 224 168 / 0); } 100% { box-shadow: 0 0 0 0 rgb(95 224 168 / 0); } }
.pill b.tick { animation: tick .5s ease; }
@keyframes tick { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- key card ---------- */
.stack { display: grid; gap: 14px; padding-block: 102px 40px; position: relative; }
.keycard {
  position: relative; z-index: 2; margin-bottom: -88px; margin-top: -22px;
  background: var(--surface); border-radius: 26px; padding: 22px 20px 18px; color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 24px 48px -18px rgb(8 50 37 / .45);
  border: 1px solid var(--line);
}
.kc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kc-head .eyebrow { color: var(--emerald); }
.kc-count { font-size: .8rem; color: var(--muted); }
.kc-count b { font-family: var(--f-mono); color: var(--ink); }
.ticket {
  margin: 14px 0 10px; background: var(--ticket); border: 1.5px dashed var(--ticket-line); border-radius: 16px;
  padding: 16px 14px; display: grid; gap: 4px; cursor: copy; text-align: start; width: 100%; color: inherit;
}
.ticket:hover { border-style: solid; }
.code-big { font: 600 clamp(1.75rem, 9vw, 2.4rem)/1.1 var(--f-mono); letter-spacing: .03em; direction: ltr; unicode-bidi: isolate; text-align: center; word-break: break-all; color: var(--tag-ink); }
.ticket small { text-align: center; font-size: .76rem; color: var(--muted); }
.code-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: .86rem; color: var(--muted); }
.code-meta .dot { opacity: .5; }
.keycard.swap .ticket { animation: swap .4s ease; }
@keyframes swap { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.btn-open {
  width: 100%; margin-top: 14px; min-height: 56px; font-size: 1.08rem; border-radius: 16px; color: var(--on-emerald);
  background: linear-gradient(180deg, color-mix(in srgb, var(--emerald) 88%, #fff), var(--emerald));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--emerald) 70%, transparent);
}
.btn-open:hover { background: var(--emerald-hover); }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.chip { background: var(--chip); border: 0; border-radius: 12px; min-height: 42px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.chip:hover { background: color-mix(in srgb, var(--emerald) 12%, var(--chip)); }
.chip.danger { color: var(--danger); }
.kc-foot { display: flex; justify-content: center; margin-top: 12px; font-size: .86rem; }
.kc-empty { text-align: center; padding: 18px 4px 6px; }
.kc-empty h3 { font-size: 1.15rem; }
.kc-empty p { color: var(--muted); margin: 6px 0 16px; }

/* ---------- cards ---------- */
body.home .card { border-radius: 22px; box-shadow: 0 1px 2px rgb(0 0 0 / .04); padding: 20px; }
body.home .card h2 { font-size: 1.2rem; }

/* home-screen widget */
.install { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
.install img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 6px 14px -6px rgb(8 50 37 / .5); }
.install h2 { margin-bottom: 4px; }
.install p { margin: 0; color: var(--muted); font-size: .92rem; }
.install .acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.install .acts .btn { width: 100%; }
.ios-steps { grid-column: 1 / -1; margin: 0; padding: 12px 14px; list-style: none; background: var(--chip); border-radius: 14px; display: grid; gap: 8px; font-size: .92rem; }
.ios-steps li { display: flex; gap: 10px; align-items: center; }
.ios-steps svg { width: 20px; height: 20px; flex: none; color: var(--emerald); }

/* how it works */
.how-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.how-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: s; font-size: .95rem; }
.how-steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--emerald); font: 600 .9rem var(--f-mono); }
.how-note { margin: 12px 0 0; font-size: .85rem; color: var(--muted); }

details.more { border: 0; padding: 0; }
details.more summary { padding: 2px 0; }



/* ---------- header Instagram link + maker card ---------- */
.bar-acts { display: flex; gap: 8px; align-items: center; }
.pill-btn.ig { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: .85rem; }
.pill-btn.ig svg { width: 16px; height: 16px; }
@media (max-width: 400px) { .pill-btn.ig span { display: none; } .pill-btn.ig { padding: 7px 9px; } }
.maker {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; align-items: center;
  background: linear-gradient(165deg, var(--hero-1), var(--hero-2)); color: var(--hero-ink);
  border-radius: 22px; padding: 16px 18px; text-decoration: none;
}
.maker:hover { filter: brightness(1.06); }
.maker-mono { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 600 1rem var(--f-display); background: var(--glass); border: 1px solid var(--glass-line); color: #f0d48e; grid-row: span 2; }
.maker-text { display: grid; line-height: 1.3; min-width: 0; }
.maker-text small { color: var(--hero-muted); font-size: .75rem; }
.maker-text b { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.maker-text span { color: var(--hero-muted); font-size: .85rem; }
.maker-ig { font-size: .82rem; color: #f0d48e; }
.maker-ig .mono { font-weight: 600; }

/* ---------- code pages ---------- */
.pager { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pager-info { text-align: center; font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 360px) { .pager [data-i18n="prevPage"] { display: none; } }

#moreList.loading { opacity: .5; transition: opacity .15s; }

/* ---------- two-mosque skyline, credit photo, guide links ---------- */
.skyline { display: block; width: 100%; height: auto; max-width: 100%; margin: -6px 0 -2px; pointer-events: none; user-select: none; }
/* drawn as a background so link-preview bots (Facebook, WhatsApp) never pick the photo */
.maker-photo { width: 56px; height: 56px; border-radius: 50%; background: #0a4a37 url("/img/shafi.jpg") center / cover no-repeat; grid-row: span 2; border: 2px solid rgb(240 212 142 / .7); display: block; }
.maker { grid-template-columns: 56px minmax(0, 1fr); }
.guide-link { display: inline-flex; gap: 6px; margin-top: 12px; font-weight: 600; text-decoration: none; }
.guide-link:hover { text-decoration: underline; }
[dir="rtl"] .arr { display: inline-block; transform: scaleX(-1); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 600; }
.foot-nav a { text-decoration: none; }

/* ---------- desktop layout ---------- */
.bar-nav { display: none; }
@media (min-width: 1000px) {
  body.home .wrap { max-width: 1180px; }
  .bar-nav { display: flex; gap: 4px; margin-inline-start: auto; margin-inline-end: 12px; }
  .bar-nav a { color: var(--hero-muted); text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
  .bar-nav a:hover, .bar-nav a[aria-current="page"] { color: var(--hero-ink); background: var(--glass); }

  /* hero: words and numbers on the left, the key card on the right, skyline along the bottom */
  .hero .wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 56px; row-gap: 26px;
    grid-template-areas: "bar bar" "copy card" "pills card" "sky sky";
    padding-block: 18px 0;
  }
  .hero .bar { grid-area: bar; }
  .hero-copy { grid-area: copy; align-self: end; padding-top: 24px; }
  .hero .pills { grid-area: pills; align-self: start; }
  .hero .keycard { grid-area: card; align-self: center; margin: 24px 0 0; padding: 26px 26px 22px; }
  .hero .skyline { grid-area: sky; max-width: 920px; justify-self: center; margin: 8px auto 0; }
  .hero h1 { font-size: clamp(2.3rem, 3.6vw, 3.2rem); max-width: 15ch; }
  .hero .lede { font-size: 1.1rem; }
  .pill { padding: 16px 18px 14px; }
  .pill b { font-size: 1.8rem; }

  /* page: codes list on the left, everything else stacked on the right */
  .stack {
    padding-block: 36px 56px; column-gap: 20px; row-gap: 20px; align-items: start;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas: "more share" "more how" "more install" "more faq" "maker maker" "foot foot";
  }
  .s-more { grid-area: more; }
  .s-share { grid-area: share; }
  .s-how { grid-area: how; }
  .s-install { grid-area: install; }
  .s-faq { grid-area: faq; }
  .stack > .maker { grid-area: maker; }
  .stack > footer.site { grid-area: foot; grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .stack > footer.site .foot-nav { grid-row: span 2; }
  .maker { grid-template-columns: 64px minmax(0, 1fr) auto; padding: 20px 26px; }
  .maker-photo { width: 64px; height: 64px; }
  .maker-ig { grid-column: 3; grid-row: 1 / span 2; align-self: center; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 10px 18px; }
  body.home .card { padding: 24px; }
  .list li { padding-block: 14px; }
}
@media (min-width: 1000px) and (max-width: 1100px) { .hero .wrap { column-gap: 36px; } }

/* ---------- guide page ---------- */
body.guide .hero .wrap { padding-block-end: 64px; }
body.guide .stack { padding-block-start: 0; margin-top: -48px; }
@media (min-width: 1000px) {
  body.guide .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; padding-block-end: 72px; }
  body.guide .hero h1 { max-width: 22ch; }
  body.guide .hero .lede { max-width: 60ch; }
  body.guide .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: none; margin-top: -56px; padding-block-start: 0; }
  body.guide .stack > .maker, body.guide .stack > footer.site { grid-column: 1 / -1; grid-area: auto; }
  body.guide .stack > .maker { grid-column: 1 / -1; }
  body.guide .stack > footer.site { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  body.guide .hero .wrap > * { grid-area: auto; }
  body.guide .hero .skyline { max-width: 820px; justify-self: center; }
  .hero .skyline { max-width: 820px; }
}
