/* Mihrab website: shares the app's palette and type. */

@font-face {
  font-family: "Readex Pro";
  src: url("/assets/fonts/readex-pro-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Readex Pro";
  src: url("/assets/fonts/readex-pro-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Amiri Quran";
  src: url("/assets/fonts/amiri-quran-verse.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f4eee3;
  --surface: #fffbf5;
  --surface-alt: #ede4d3;
  --ink: #1d2826;
  --muted: #5f635d;
  --line: #e0d5c2;
  --teal: #0f5f58;
  --teal-soft: #d3e9e4;
  --brass: #c38f2c;
  --brass-text: #7a5612;
  --brass-soft: #f3e3bd;
  --wall: #cfc2ab;
  --tile: #e9dfcd;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1615;
    --surface: #152120;
    --surface-alt: #1b2a28;
    --ink: #f1ece2;
    --muted: #a3ada7;
    --line: #263634;
    --teal: #5fc4b5;
    --teal-soft: #1c3b37;
    --brass: #e4b658;
    --brass-text: #f0d08e;
    --brass-soft: #3a3222;
    --wall: #3a4c49;
    --tile: #1f2f2d;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  line-height: 1.85;
}

/* Arabic letters must stay joined: no tracking anywhere in Arabic. */
html[lang="ar"] * {
  letter-spacing: 0 !important;
}

/* One page, two languages: show the half that matches <html lang>. */
html[lang="ar"] .en,
html[lang="en"] .ar {
  display: none !important;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(1080px, 100% - 40px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.lang-toggle {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 18px;
  cursor: pointer;
}
.lang-toggle:hover {
  border-color: var(--teal);
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(24px, 6vw, 72px) clamp(56px, 8vw, 104px);
}

.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  max-width: 14ch;
}
html[lang="ar"] .hero h1 {
  line-height: 1.35;
  max-width: 18ch;
}

h1,
h2,
.niche-caption {
  text-wrap: balance;
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
  margin: 0 0 32px;
}

.store-soon {
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 12px 22px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

/* The mihrab niche: the one bold element on the page. */
.niche {
  position: relative;
  width: min(420px, 100%);
  margin: 0 auto;
}
.niche svg {
  display: block;
  width: 100%;
  height: auto;
}
.niche-caption {
  position: absolute;
  inset-inline: 11%;
  bottom: 6.5%;
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.45;
  color: var(--ink);
}
html[lang="ar"] .niche-caption {
  line-height: 1.7;
}

.arch-fill {
  fill: var(--surface);
}
.arch-edge {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.6;
  stroke-dasharray: 1.5 6;
  stroke-linecap: round;
}
.tile {
  stroke: var(--tile);
  stroke-width: 1;
}
.room {
  fill: none;
  stroke: var(--wall);
  stroke-width: 9;
}
.touched {
  stroke: var(--teal);
  stroke-width: 9;
  stroke-linecap: round;
}
.phone {
  fill: var(--ink);
}
.ripple {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  opacity: 0.35;
  transform-box: view-box;
  transform-origin: 220px 165px;
}
.reference {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
  opacity: 0.6;
}
.ray {
  stroke: var(--brass);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.turn-arc {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.8;
  stroke-dasharray: 3 4;
}
.turn-label {
  fill: var(--brass-text);
  font-size: 15px;
  font-weight: 600;
}
.mat {
  transform-box: view-box;
  transform-origin: 220px 290px;
  transform: rotate(23deg);
}
.mat-body {
  fill: var(--brass-soft);
  stroke: var(--brass);
  stroke-width: 2;
}
.mat-line {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.kaaba {
  transform-box: view-box;
  transform-origin: 271px 169px;
}
.kaaba-block {
  fill: #1f2523;
}
.kaaba-band {
  fill: #d4a240;
}
@media (prefers-color-scheme: dark) {
  .kaaba-block {
    fill: #070b0a;
    stroke: var(--brass);
    stroke-width: 1.2;
  }
}

/* The single orchestrated moment: phone touches the wall, the Qibla appears,
   the prayer mat turns to face it. */
@media (prefers-reduced-motion: no-preference) {
  .ripple {
    animation: ripple 1.1s ease-out 0.3s 2 both;
  }
  .ripple.second {
    animation-delay: 0.6s;
  }
  .ray {
    stroke-dasharray: 68;
    animation: draw 0.7s ease-out 1.3s both;
  }
  .kaaba {
    animation: pop 0.45s ease-out 1.8s both;
  }
  .mat {
    animation: turn 1.1s cubic-bezier(0.45, 0, 0.2, 1) 1.5s both;
  }
  .turn-arc,
  .turn-label {
    animation: appear 0.4s ease-out 2.4s both;
  }
}

@keyframes ripple {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 68;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes turn {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(23deg);
  }
}
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* -------------------------------------------------------------- sections */

.section {
  padding-block: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 36px;
}
html[lang="ar"] .section h2 {
  line-height: 1.5;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  counter-reset: step;
}
.steps li {
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: block;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--brass-text);
  margin-bottom: 14px;
}
.steps h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

.methods {
  width: 100%;
  border-collapse: collapse;
}
.methods th,
.methods td {
  text-align: start;
  vertical-align: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.methods thead th {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  padding-top: 0;
}
.methods tbody th {
  font-weight: 600;
  width: 26%;
  padding-inline-end: 24px;
}
.methods .acc {
  width: 18%;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
  padding-inline-end: 24px;
}
.methods .acc.rough {
  color: var(--muted);
}
.methods td:last-child {
  color: var(--muted);
}

.note {
  max-width: 40em;
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.verse {
  text-align: center;
}
.verse blockquote {
  margin: 0;
}
.verse .ayah {
  font-family: "Amiri Quran", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 2;
  color: var(--teal);
  margin: 0;
}
.verse .meaning {
  margin: 8px 0 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px 48px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer p {
  margin: 0;
}

/* ------------------------------------------------------- document pages */

.doc {
  max-width: 68ch;
  padding-block: clamp(24px, 5vw, 56px) clamp(56px, 8vw, 96px);
}
.doc h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 8px;
}
html[lang="ar"] .doc h1 {
  line-height: 1.45;
}
.doc .updated {
  color: var(--muted);
  margin: 0 0 32px;
}
.doc h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 44px 0 12px;
}
.doc p,
.doc li {
  margin: 0 0 14px;
}
.doc ul {
  padding-inline-start: 1.3em;
  margin: 0 0 14px;
}
.doc .summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
  margin: 0 0 8px;
}
.doc .summary p {
  margin: 0;
}

.contact {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding-block: 4px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding-block: 14px;
  list-style-position: outside;
}
.faq details p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- small */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    max-width: none;
  }
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .methods thead {
    display: none;
  }
  .methods tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 16px;
    padding-block: 16px;
    border-bottom: 1px solid var(--line);
  }
  .methods th,
  .methods td {
    border: 0;
    padding: 0;
    width: auto;
  }
  .methods td:last-child {
    grid-column: 1 / -1;
  }
}
