:root {
  --ink: #06305c;
  --ink-2: #0a3f75;
  --ink-3: #0d4f8f;
  --glass: rgba(6, 40, 78, .6);
  --glass-soft: rgba(255, 255, 255, .09);
  --glass-line: rgba(255, 255, 255, .28);
  --gold: #d9b56a;
  --gold-soft: #f0dcae;
  --cream: #fbf6ea;
  --paper: #f4ecd9;
  --text: #17302c;
  --muted: #55695f;
  --line: rgba(217, 181, 106, .32);
  /* Eslimi tile: one quarter of vines and leaves, mirrored on both axes. */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:x='http://www.w3.org/1999/xlink' width='200' height='200' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cg id='q' fill='none' stroke='%23d9b56a' stroke-opacity='.24' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M100 100C80 78 58 86 52 66C47 49 66 38 78 50C87 60 76 72 67 65C62 61 65 55 70 56'/%3E%3Cpath d='M52 66C34 62 20 44 8 44C16 62 32 76 52 66Z'/%3E%3Cpath d='M78 50C84 34 94 24 100 10C88 14 70 28 78 50Z'/%3E%3Cpath d='M0 0C20 6 30 18 32 34C20 30 8 20 0 0Z'/%3E%3Cpath d='M32 34C38 48 28 60 16 66'/%3E%3Cpath d='M32 34C46 40 58 30 66 18'/%3E%3Cpath d='M16 66C8 62 2 72 0 82C10 82 20 76 16 66Z'/%3E%3Cpath d='M66 18C62 10 72 4 82 0C82 10 76 20 66 18Z'/%3E%3C/g%3E%3C/defs%3E%3Cuse x:href='%23q'/%3E%3Cuse x:href='%23q' transform='matrix(-1 0 0 1 200 0)'/%3E%3Cuse x:href='%23q' transform='matrix(1 0 0 -1 0 200)'/%3E%3Cuse x:href='%23q' transform='matrix(-1 0 0 -1 200 200)'/%3E%3Cpath d='M100 86C110 92 110 108 100 114C90 108 90 92 100 86Z' fill='none' stroke='%23d9b56a' stroke-opacity='.3'/%3E%3C/svg%3E");
}

@font-face {
  font-family: IranNastaliq;
  src: url("fonts/IranNastaliq.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 400 17px/1.8 Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: Vazirmatn, "Noto Naskh Arabic", Tahoma, sans-serif; }
html[lang="en"] body { font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.65; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

/* Top bar */
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 18px clamp(16px, 4vw, 48px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-soft);
  font-weight: 700;
  text-decoration: none;
}
.topbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nav-give {
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.nav-give:hover { background: var(--gold-soft); }
.langs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.langs button {
  border: 0;
  border-radius: 999px;
  padding: 4px 13px;
  background: transparent;
  color: var(--gold-soft);
  font: 500 14px/1.6 Vazirmatn, Tahoma, sans-serif;
  cursor: pointer;
}
.langs button.is-active { background: var(--gold); color: var(--ink); }

/* Hero */
.hero {
  display: flex;
  justify-content: center;
  padding: 104px 16px 0;
  background: var(--pattern), radial-gradient(ellipse at 50% 35%, var(--ink-3), var(--ink) 70%);
}
.arch {
  width: min(760px, 100%);
  padding: clamp(56px, 9vw, 96px) clamp(20px, 6vw, 72px) clamp(52px, 7vw, 80px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 380px 380px 0 0;
  background: linear-gradient(180deg, rgba(217, 181, 106, .1), rgba(7, 31, 29, 0) 75%);
  color: var(--cream);
  text-align: center;
}
.rider {
  display: block;
  width: min(300px, 72vw);
  height: auto;
  margin: 0 auto 18px;
  border: 2px solid var(--gold);
  border-radius: 150px 150px 14px 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}
.invite { max-width: 560px; margin: 12px auto 22px; color: #dfe8e2; }
.hero-coins {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.hero-coins .coin-icon { width: 30px; height: 30px; }
.hadith {
  margin:22px 0 28px;
  padding: 22px clamp(14px, 3vw, 28px) 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 31, 29, .55);
}
.hadith-body { min-height: 208px; }
.hadith-body.is-in { animation: fade .7s ease; }
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hadith blockquote {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font: 400 clamp(21px, 3.4vw, 27px)/1.9 Amiri, "Traditional Arabic", serif;
}
.hadith-mean { color: #dfe8e2; font-size: 16px; }
.hadith figcaption { margin-top: 8px; color: var(--gold); font-size: 13px; }
.hadith-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.hadith-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.hadith-nav button:hover { background: rgba(217, 181, 106, .16); }
.hadith-count { color: #a9bcb3; font: 500 13px Inter, sans-serif; }
.hadith-bar {
  height: 2px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(217, 181, 106, .18);
}
.hadith-bar span { display: block; width: 100%; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.hadith-bar span.is-running { animation: progress 22s linear; }
.hadith.is-paused .hadith-bar span { animation: none; }
#hadithPause { font-size: 13px; }
@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.prayer {
  margin-bottom: 18px;
  color: var(--gold);
  font: 400 clamp(22px, 4vw, 30px)/1.9 Amiri, "Traditional Arabic", serif;
}
h1 {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
}
html[lang="en"] h1, html[lang="en"] h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
}
.lead {
  max-width: 560px;
  margin: 20px auto 32px;
  color: #cfdcd4;
}
.cta {
  display: inline-block;
  padding: 11px 34px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.cta:hover { background: var(--gold-soft); transform: translateY(-2px); }

/* Sections */
.wrap { width: min(1080px, 100%); margin: 0 auto; }
.band, .give { padding: clamp(60px, 9vw, 100px) 16px; }
.give { background: var(--pattern), var(--ink); color: var(--cream); }
.eyebrow { color: #96742c; font-size: 14px; font-weight: 600; }
.give .eyebrow { color: var(--gold); }
h2 { margin-top: 4px; font-size: clamp(26px, 4vw, 38px); font-weight: 700; line-height: 1.35; }
.sub { margin-top: 8px; color: #cfdcd4; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 36px;
}
.card {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
}
.num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: #96742c;
  font-weight: 700;
}
.card h3 { margin-bottom: 6px; font-size: 20px; line-height: 1.5; }
.card p { color: var(--muted); font-size: 16px; }

/* Donate */
.donate {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
}
.coins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.coin {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--cream);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.coin:hover { background: rgba(217, 181, 106, .09); }
.coin.is-active { border-color: var(--gold); background: rgba(217, 181, 106, .16); }
.coin-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--coin);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 2px 6px rgba(0, 0, 0, .3);
}
.coin-icon svg {
  width: 70%;
  height: 70%;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coin-icon svg .solid { fill: #fff; stroke: none; }
.coin-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; text-align: left; }
.coin-label strong { font-family: Inter, "Segoe UI", sans-serif; font-size: 15px; }
.coin-label small { color: #a9bcb3; font-family: Inter, "Segoe UI", sans-serif; font-size: 12.5px; }
.coin-soon {
  margin-inline-start: auto;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.panel {
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--cream);
  color: var(--text);
  text-align: center;
}
.panel-coin { font-size: 21px; font-weight: 700; }
.panel-network { color: var(--muted); font-size: 14.5px; }
.qr {
  width: min(230px, 100%);
  margin: 16px auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.qr svg { display: block; width: 100%; height: auto; }
.addr {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  font: 500 13.5px/1.6 Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
  text-align: left;
}
.copy {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--ink-2);
  color: var(--gold-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.copy:hover { background: var(--ink-3); }
.copy.is-done { background: #1f7a5a; color: #fff; }
.warn { margin-top: 12px; color: #8a4b12; font-size: 13.5px; line-height: 1.7; text-align: start; }
.pending {
  margin-top: 18px;
  padding: 44px 16px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  color: var(--muted);
}

/* Safety */
.safe {
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.safe li {
  position: relative;
  padding-inline-start: 30px;
}
.safe li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .45em;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 0 100% 0 100%;
}

.band-safe { padding-top: 0; }

/* Poems */
.poems { padding: clamp(60px, 9vw, 100px) 16px; }
.poem-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 24px;
}
.poem-tools input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--text);
  font: inherit;
}
.poem-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.poem-filters button {
  padding: 7px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-soft);
  color: var(--cream);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.poem-filters button.is-active { border-color: var(--gold); background: var(--gold); color: var(--ink); font-weight: 700; }
.poem-count { margin-top: 10px; color: var(--gold-soft); font-size: 14px; }
.poem-list { display: grid; gap: 16px; margin-top: 14px; }
.poem {
  padding: clamp(20px, 3.5vw, 34px) clamp(14px, 4vw, 40px);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: var(--glass-soft);
  text-align: center;
}
.poem-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 12px; margin-bottom: 16px; }
.poem-head h3 { color: var(--gold); font-size: 21px; }
.poem-head span { color: var(--gold-soft); font-size: 14.5px; }
.beit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin-bottom: 8px;
  color: #fff;
  font: 400 clamp(30px, 3.4vw, 40px)/1.75 IranNastaliq, Amiri, Tahoma, serif;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.beit span:only-child { grid-column: 1 / -1; }
.poem-toggle { margin-top: 10px; }
.poem-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 20px; }
.poem-more {
  padding: 9px 26px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.poem-more:hover { background: rgba(217, 181, 106, .18); }
.poem-none { padding: 30px 10px; color: var(--gold-soft); text-align: center; }

/* Visitors' words */
.talk { padding: clamp(60px, 9vw, 100px) 16px; }
.challenge {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: var(--ink-2);
  color: var(--cream);
}
.challenge-label { color: var(--gold); font-size: 14px; font-weight: 600; }
.challenge p { margin: 4px 0 8px; font-size: clamp(19px, 2.6vw, 24px); font-weight: 500; line-height: 1.6; }
.link-btn { padding: 0; border: 0; background: none; color: var(--gold-soft); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.talk-form { display: grid; gap: 14px; margin-top: 22px; }
.talk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.talk-form label { display: grid; gap: 4px; font-size: 15px; font-weight: 500; }
.talk-form input[type="text"], .talk-form select, .talk-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9b78d;
  border-radius: 10px;
  background: #fffdf7;
  color: var(--text);
  font: inherit;
}
.talk-form textarea { resize: vertical; }
.talk-form .check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.talk-note { color: var(--muted); font-size: 14px; }
.talk-form .cta { justify-self: start; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.talk-form .cta:disabled { opacity: .6; cursor: default; }
.talk-status { min-height: 1.6em; color: #1f7a5a; font-size: 15px; }
.talk-status.is-error { color: #a33a22; }
.comments { display: grid; gap: 12px; margin-top: 20px; }
.comment { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf7; }
.comment.is-poem { background: var(--paper); }
.comment-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 14px; }
.comment-head span { color: var(--muted); }
.comment-text { margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.comment.is-poem .comment-text { font: 400 28px/1.9 IranNastaliq, Amiri, Tahoma, serif; }.comments-empty { color: var(--muted); }

/* Footer */
.foot {
  padding: 40px 16px;
  background: var(--ink);
  color: #cfdcd4;
  text-align: center;
  font-size: 15px;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.foot-links a { color: var(--gold-soft); }
.foot-prayer { color: var(--gold); }

a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Glass theme: the blue tile stays still behind frosted panels. */
body { background: var(--ink); color: var(--cream); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("pattern-blue.jpg") 0 0 / 400px;
}
.hero, .give, .band, .talk, .poems { background: none; }
.band, .give, .talk, .poems { padding: 14px 16px; }
.hero { padding-bottom: 14px; }
.foot { margin-top: 14px; }
.topbar, .arch, .give > .wrap, .band > .wrap, .talk > .wrap, .poems > .wrap {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 8px 30px rgba(0, 20, 50, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.topbar { padding-block: 12px; border-bottom: 1px solid var(--glass-line); }
.arch { border: 1px solid var(--glass-line); border-radius: 380px 380px 22px 22px; }
.give > .wrap, .band > .wrap, .talk > .wrap, .poems > .wrap {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
}
.eyebrow { color: var(--gold); }
.sub, .invite, .hadith-mean { color: #eef4f8; }
.hadith { border-color: var(--glass-line); background: rgba(4, 28, 58, .45); }
.hadith-count, .coin-label small { color: #cfe0ee; }
.card, .comment, .challenge { border-color: var(--glass-line); background: var(--glass-soft); }
.card p { color: #e6eef4; }
.num { color: var(--gold-soft); }
.coin { border-color: var(--glass-line); background: var(--glass-soft); }
.talk-note, .comment-head span { color: #d5e2ec; }
.talk-status { color: #9be8c4; }
.talk-status.is-error { color: #ffc1ae; }
.talk-form input[type="text"], .talk-form select, .talk-form textarea { background: rgba(255, 255, 255, .94); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(6, 40, 78, .92); }
}

@media (max-width: 820px) {
  .cards, .donate { grid-template-columns: minmax(0, 1fr); }
  .hadith-body { min-height: 290px; }
}
@media (max-width: 640px) {
  .beit { grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; font-size: 30px; }
}
@media (max-width: 460px) {
  .coin { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .coin-icon { width: 32px; height: 32px; font-size: 16px; }
  .coin-soon { width: 100%; margin: 0; }
  .talk-row { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 124px; }
  .arch { border-radius: 170px 170px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hadith-body.is-in, .hadith-bar span.is-running { animation: none; }
  .cta { transition: none; }
}
