@font-face {
  font-family: 'InterVariable';
  src: url('/assets/fonts/inter-latin-variable.woff2') format('woff2-variations');
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: dark;
  --surface: #17161a;
  --sheet: #201f24;
  --bone: #f0ece4;
  --body: rgb(240 236 228 / 0.68);
  --meta: rgb(240 236 228 / 0.6);
  --hint: rgb(240 236 228 / 0.55);
  --hairline: rgb(240 236 228 / 0.14);
  --well: rgb(240 236 228 / 0.07);
  --control-border: rgb(240 236 228 / 0.22);
  --content: 1160px;
  --reading: 720px;
  --gap: clamp(40px, 6vw, 88px);
  --phone-radius: min(3.2vw, 34px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--surface);
  scroll-behavior: smooth;
}

body {
  background: var(--surface);
  color: var(--bone);
  font-family:
    'InterVariable',
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

a:focus-visible,
summary:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 4px;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.container {
  margin-inline: auto;
  max-width: var(--content);
  width: calc(100% - 48px);
}

.skip-link {
  background: var(--bone);
  color: var(--surface);
  left: 16px;
  padding: 12px 16px;
  position: fixed;
  top: -100px;
  z-index: 100;
}

.skip-link:focus {
  top: 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--hairline);
  position: relative;
  z-index: 20;
}

.header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
}

.brand-link {
  align-items: center;
  display: inline-flex;
  min-height: 48px;
}

.brand-link img {
  width: 118px;
}

.desktop-navigation nav,
.mobile-navigation nav {
  align-items: center;
  display: flex;
  gap: 28px;
}

.desktop-navigation a,
.mobile-navigation a {
  align-items: center;
  color: var(--meta);
  display: inline-flex;
  font-size: 15px;
  font-weight: 500;
  min-height: 48px;
  text-decoration: none;
}

.desktop-navigation a:hover,
.mobile-navigation a:hover,
.desktop-navigation a[aria-current='page'],
.mobile-navigation a[aria-current='page'] {
  color: var(--bone);
}

.mobile-navigation {
  display: none;
  position: relative;
}

.mobile-navigation summary,
.legal-toc-mobile summary {
  align-items: center;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  font-weight: 500;
  justify-content: center;
  list-style: none;
  min-height: 48px;
  padding-inline: 10px;
}

.mobile-navigation summary::-webkit-details-marker,
.legal-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.mobile-navigation-panel {
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  min-width: 210px;
  padding: 8px 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.mobile-navigation-panel nav {
  align-items: stretch;
  flex-direction: column;
  gap: 0;
}

/* Hero */

.hero {
  overflow: hidden;
  padding-block: clamp(56px, 8vw, 104px) 0;
}

.hero-grid {
  align-items: end;
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.hero-copy {
  padding-bottom: clamp(56px, 8vw, 112px);
}

.hadith-line {
  margin: 0 0 clamp(36px, 5vw, 56px);
}

.hadith-line img {
  height: auto;
  width: min(100%, 380px);
}

.hadith-line figcaption {
  color: var(--meta);
  font-size: 14px;
  margin-top: 16px;
}

.hero h1 {
  font-size: clamp(40px, 4.8vw, 70px);
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 18ch;
}

.lede {
  color: var(--body);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  margin: 28px 0 0;
  max-width: 44ch;
}

.store-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  text-decoration: none;
}

.button-primary {
  background: var(--bone);
  color: var(--surface);
}

.button-primary:hover {
  background: #ffffff;
}

.button-secondary {
  border: 1px solid var(--control-border);
  color: var(--bone);
}

.button-secondary:hover {
  background: var(--well);
}

.fine {
  color: var(--meta);
  font-size: 14px;
  margin: 20px 0 0;
}

.text-link {
  align-items: center;
  color: var(--bone);
  display: inline-flex;
  font-weight: 500;
  min-height: 48px;
  text-decoration-color: var(--control-border);
}

.text-link:hover {
  text-decoration-color: var(--bone);
}

/* Phones */

.phone {
  margin: 0;
}

.phone img {
  border-radius: var(--phone-radius);
  outline: 1px solid var(--hairline);
  outline-offset: -1px;
  width: 100%;
}

.hero-phone {
  margin-bottom: clamp(-160px, -12vw, -80px);
  max-width: 420px;
}

.hero-phone img {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.phone figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 20px;
}

.phone figcaption strong {
  font-weight: 600;
}

.phone figcaption span {
  color: var(--body);
}

/* Sections */

.section {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(72px, 10vw, 136px);
}

.section h2 {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  max-width: 18ch;
}

.split {
  align-items: center;
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
}

.split > .phone {
  max-width: 380px;
}

.split-copy-first {
  align-items: start;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.split-copy .text-link {
  margin-top: 24px;
}

.lines {
  margin: 0;
}

.section h2 + .lines {
  margin-top: 40px;
}

.lines > div {
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 8px 32px;
  grid-template-columns: minmax(160px, 0.4fr) minmax(0, 1fr);
  padding-block: 24px;
}

.lines > div:last-child {
  border-bottom: 1px solid var(--hairline);
}

.lines dt {
  font-weight: 600;
}

.lines dd {
  color: var(--body);
  margin: 0;
}

.trio {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 56px;
}

.trio .phone img {
  aspect-ratio: 9 / 14;
  object-fit: cover;
  object-position: top;
}

.closing-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 28px var(--gap);
  justify-content: space-between;
}

.closing-row .store-actions {
  margin-top: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 48px 56px;
}

.footer-grid {
  align-items: start;
  display: grid;
  gap: 32px var(--gap);
  grid-template-columns: 1.1fr 0.8fr 1fr;
}

.footer-brand img {
  width: 104px;
}

.site-footer p {
  color: var(--meta);
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0 0;
  max-width: 340px;
}

.footer-links {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-links a {
  align-items: center;
  color: var(--body);
  display: inline-flex;
  font-size: 15px;
  min-height: 44px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--bone);
}

/* Motion */

.reveal {
  animation: reveal 0.9s var(--ease) both;
}

.hero-copy .reveal:nth-child(2) {
  animation-delay: 0.08s;
}

.hero-copy .reveal:nth-child(3) {
  animation-delay: 0.16s;
}

.hero-copy .reveal:nth-child(4) {
  animation-delay: 0.24s;
}

.hero-copy .reveal:nth-child(5) {
  animation-delay: 0.3s;
}

.hero-phone.reveal {
  animation-delay: 0.2s;
  animation-duration: 1.1s;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    animation: none;
  }
}

/* Legal pages */

.legal-shell {
  display: grid;
  gap: clamp(48px, 8vw, 104px);
  grid-template-columns: 220px minmax(0, var(--reading));
  justify-content: center;
  padding-block: clamp(64px, 9vw, 112px);
}

.legal-toc {
  align-self: start;
  position: sticky;
  top: 32px;
}

.legal-toc > p {
  color: var(--meta);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 12px;
}

.legal-toc ol,
.legal-toc-mobile ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-toc a,
.legal-toc-mobile a {
  color: var(--meta);
  display: block;
  font-size: 14px;
  line-height: 1.45;
  padding-block: 7px;
  text-decoration: none;
}

.legal-toc a:hover,
.legal-toc-mobile a:hover {
  color: var(--bone);
}

.legal-toc-mobile {
  display: none;
}

.prose {
  min-width: 0;
}

.prose h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.04;
  margin: 0 0 24px;
}

.prose h2 {
  border-top: 1px solid var(--hairline);
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 64px 0 20px;
  padding-top: 32px;
  scroll-margin-top: 24px;
}

.prose h3 {
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 40px 0 16px;
  scroll-margin-top: 24px;
}

.heading-link {
  color: var(--control-border);
  font-size: 0.7em;
  margin-left: 0.4em;
  text-decoration: none;
}

.heading-link:hover,
.heading-link:focus-visible {
  color: var(--bone);
}

.prose p,
.prose li {
  color: var(--body);
  line-height: 1.75;
}

.prose p {
  margin: 0 0 20px;
}

.prose h1 + p {
  color: var(--meta);
  font-size: 15px;
  margin-bottom: 36px;
}

.prose ul,
.prose ol {
  margin: 0 0 28px;
  padding-left: 24px;
}

.prose li + li {
  margin-top: 8px;
}

.prose strong {
  color: var(--bone);
  font-weight: 600;
}

.prose a {
  color: var(--bone);
  text-decoration-color: var(--control-border);
  text-decoration-thickness: 1px;
}

.prose a:hover {
  text-decoration-color: var(--bone);
}

.prose code {
  background: var(--well);
  border-radius: 4px;
  color: var(--bone);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 0.15em 0.35em;
}

.table-scroll {
  margin-block: 32px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.prose table {
  border-collapse: collapse;
  min-width: 560px;
  width: 100%;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--hairline);
  color: var(--body);
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--bone);
  font-weight: 600;
}

/* 404 */

.error-page {
  padding-block: clamp(80px, 12vw, 160px);
}

.error-page .kicker {
  color: var(--meta);
  font-size: 14px;
  margin: 0 0 16px;
}

.error-page h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.04;
}

.error-page p:not(.kicker) {
  color: var(--body);
  margin: 20px 0 32px;
  max-width: 48ch;
}

.error-page .button-primary {
  align-items: center;
  background: var(--bone);
  border-radius: 999px;
  color: var(--surface);
  display: inline-flex;
  font-weight: 600;
  min-height: 52px;
  padding: 12px 22px;
  text-decoration: none;
}

/* Responsive */

@media (max-width: 960px) {
  .hero-grid,
  .split,
  .split-copy-first {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    align-items: start;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .hero-phone {
    margin: 8px 0 clamp(-140px, -22vw, -60px);
  }

  .split > .phone {
    max-width: 360px;
  }

  #hadith .split > .phone {
    order: 2;
  }

  .trio {
    gap: 40px var(--gap);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-content: start;
  }

  .legal-toc {
    display: none;
  }

  .legal-toc-mobile {
    border: 1px solid var(--hairline);
    border-radius: 14px;
    display: block;
    padding: 4px 16px;
  }

  .legal-toc-mobile ol {
    padding-bottom: 8px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .container {
    width: calc(100% - 40px);
  }

  .desktop-navigation {
    display: none;
  }

  .mobile-navigation {
    display: block;
  }

  .trio {
    grid-template-columns: minmax(0, 1fr);
  }

  .trio .phone {
    max-width: 320px;
  }

  .lines > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-actions .button {
    flex: 1 1 100%;
  }

  .closing-row {
    align-items: start;
    flex-direction: column;
  }
}
