@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
}

/* Only the homepage Bismillah uses Amiri, so other pages never download it. */
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/amiri-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}

/* Dawn design system, taken from the app's lib/tokens.ts. The older token names are kept
   so the legal and guide rules below restyle without markup changes. */
:root {
  color-scheme: light;
  --emerald: #0e5c3a;
  --emerald-soft: #2d9c6b;
  --gold: #c9a84c;
  --gold-light: #e7c98a;
  --gold-ink: #8c7a2e;
  --cream: #f8f1e3;
  --card: #fff9ec;
  --text: #173b32;
  --secondary: #6f6046;
  --night: #06111f;
  --night-card: #0b1a2e;
  --night-text: #fff7df;
  --night-muted: #c6b089;
  --tint: #123558;
  --launch: #020814;

  --canvas: var(--cream);
  --surface: var(--card);
  --ink: var(--text);
  --graphite: #5c4f38;
  --quiet: var(--secondary);
  --line: rgba(23, 59, 50, 0.14);
  --line-soft: rgba(23, 59, 50, 0.08);
  --green: var(--emerald);
  --green-deep: #0a4a2e;
  --green-soft: #eef0e2;
  --focus: rgba(201, 168, 76, 0.7);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --shell: 1180px;
  --radius-sm: 12px;
  --radius-md: 22px;
  --z-focus: 20;
}

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

html {
  background: var(--canvas);
  color: var(--ink);
  scroll-padding-top: 1rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 680;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--gold-light);
  color: var(--ink);
}

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: var(--z-focus);
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--green-deep);
  color: var(--surface);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

.site-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand {
  min-height: 44px;
  min-width: 44px;
}

.brand img,
.footer-brand img {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(185, 149, 85, 0.2);
}

.brand-copy {
  display: grid;
  gap: 0.05rem;
}

.brand-copy strong {
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links,
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.6rem);
  margin-left: auto;
}

.nav-links a,
.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--graphite);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
}

.footer-links a {
  min-width: 44px;
  justify-content: center;
}

.nav-links a:hover,
.footer-links a:hover,
.prose a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.button-primary,
.button-nav {
  background: var(--green-deep);
  color: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.button-primary:hover,
.button-nav:hover {
  background: var(--green);
}

.button-nav {
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}

.footer-layout {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
}

.footer-layout > p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.79rem;
  text-align: right;
}

/* Legal, support, and utility pages */

.page-legal {
  background: var(--surface);
}

.page-legal .site-header {
  background: var(--surface);
}

.legal-main {
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

.legal-hero {
  padding-top: clamp(4.5rem, 9vw, 8rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}

.legal-hero .legal-kicker {
  margin-bottom: 1.1rem;
  color: var(--green);
  font-weight: 680;
}

.legal-hero h1,
.not-found h1 {
  max-width: 860px;
  margin-bottom: 0;
  font-size: clamp(2.7rem, 5.8vw, 4.75rem);
  letter-spacing: -0.01em;
  line-height: 1;
}

.legal-hero .legal-summary {
  max-width: 700px;
  margin: 1.5rem 0 0;
  color: var(--graphite);
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.65;
}

.legal-meta {
  margin-top: 1.25rem;
  color: var(--quiet);
  font-size: 0.875rem;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  justify-content: space-between;
  gap: clamp(3rem, 9vw, 8rem);
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.legal-nav {
  align-self: start;
}

.legal-nav p {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
}

.legal-nav a {
  min-inline-size: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--graphite);
  font-size: 0.875rem;
  text-decoration: none;
}

.legal-nav a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.prose {
  min-width: 0;
}

.prose section {
  padding-bottom: 2.4rem;
  scroll-margin-top: 1rem;
}

.prose h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  letter-spacing: -0.005em;
  line-height: 1.15;
}

.prose h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.prose p,
.prose li {
  color: #45534d;
  font-size: 1rem;
  line-height: 1.72;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul,
.prose ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.3rem;
}

.prose li + li {
  margin-top: 0.55rem;
}

.prose a {
  color: var(--green);
  font-weight: 620;
  text-underline-offset: 0.2em;
}

.prose a.button-primary,
.prose a.button-primary:hover,
.prose a.button-primary:focus-visible {
  color: var(--surface);
  text-decoration: none;
}

.prose strong {
  color: var(--ink);
}

.policy-note,
.support-contact {
  margin: 1.5rem 0 2rem;
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}

.policy-note p,
.support-contact p {
  margin-bottom: 0;
  color: #334c42;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  color: var(--green);
  font-size: 1.4rem;
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details > div {
  padding: 0 2rem 1.5rem 0;
}

.faq-list details p:last-child {
  margin-bottom: 0;
}

/* People-first Islamic search guides */

.guide-main {
  background:
    radial-gradient(circle at 82% 5%, rgba(185, 149, 85, 0.1), transparent 24rem),
    var(--surface);
}

.breadcrumbs {
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 1.25rem;
  color: var(--quiet);
  font-size: 0.82rem;
}

.breadcrumbs a,
.guide-text-link {
  color: var(--green);
  font-weight: 620;
  text-underline-offset: 0.2em;
}

.breadcrumbs a {
  min-inline-size: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.guide-header-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--graphite);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.guide-header-link:hover,
.guide-header-link:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.guide-hero {
  max-width: 920px;
  padding-top: clamp(3rem, 7vw, 6rem);
}

.guide-hero h1 {
  max-width: 14ch;
}

.guide-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-top: 2rem;
}

.guide-text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.guide-layout {
  grid-template-columns: 210px minmax(0, 780px);
}

.guide-nav {
  position: sticky;
  top: 1.25rem;
}

.guide-prose > section {
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.guide-prose h2 {
  max-width: 25ch;
}

.guide-prose p,
.guide-prose li {
  max-width: 72ch;
}

.guide-callout,
.guide-cta {
  margin: 1.5rem 0 2rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(18, 61, 50, 0.12);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}

.guide-callout > strong {
  display: block;
  margin-bottom: 0.35rem;
}

.guide-callout p,
.guide-cta p {
  margin-bottom: 0;
  color: #334c42;
}

.guide-table-wrap {
  width: 100%;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.guide-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.prayer-table {
  min-width: 900px;
}

.guide-table th,
.guide-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--graphite);
  vertical-align: top;
}

.guide-table th {
  background: var(--green-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-table td strong {
  color: var(--ink) !important;
}

.city-link-list {
  columns: 2 250px;
  column-gap: 2rem;
}

.city-link-list li {
  break-inside: avoid;
}

.related-guides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.related-guides a {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.related-guides a:hover,
.related-guides a:focus-visible {
  border-color: rgba(18, 61, 50, 0.35);
  background: var(--green-soft);
}

.related-guides span {
  margin-top: 0.2rem;
  color: var(--quiet);
  font-size: 0.79rem;
}

.city-guides {
  margin-top: 1.5rem;
}

.guide-faq details > div p {
  max-width: 68ch;
}

.guide-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 0;
}

.guide-cta p {
  max-width: 52ch;
}

.guide-cta .button {
  flex: 0 0 auto;
}

.not-found {
  min-height: calc(100dvh - 168px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
  padding-bottom: 6rem;
}

.not-found img {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
}

.not-found p {
  max-width: 50ch;
  margin: 1.25rem 0 2rem;
  color: var(--graphite);
  font-size: 1.0625rem;
}

/* Homepage: one continuous day, Fajr to Isha. The layout is identical with or without
   the WebGL scene; html.has-3d only fades the fallback figures and shows the canvas. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body.home {
  background: var(--launch);
}

.scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.has-3d .scene {
  opacity: 1;
}

/* A lost WebGL context leaves a blank canvas; hide it at once rather than fading. */
.scene-lost .scene {
  display: none;
}

.home main,
.home .site-footer {
  position: relative;
  z-index: 1;
}

.home-header {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  background: transparent;
  border-bottom: 0;
}

.home-header .brand,
.home-header .header-link {
  color: var(--night-text);
}

.home-header .brand-copy small {
  color: var(--night-muted);
}

.header-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.beat {
  position: relative;
  min-height: 110svh;
  display: grid;
  align-items: center;
  padding: clamp(4.5rem, 9vh, 7rem) 0;
  scroll-margin-top: 0;
}

.beat--hero {
  min-height: 100svh;
  padding-top: 6.5rem;
}

.beat--fajr { background: linear-gradient(180deg, #0a1230 0%, #1e2f5c 62%, #3f7f86 100%); }
.beat--dhuhr { background: linear-gradient(180deg, #fbf6ea 0%, #f5eedc 60%, #efe3c4 100%); }
.beat--asr { background: linear-gradient(165deg, #f3e2bd 0%, #ebc989 58%, #8fa3b3 130%); }
.beat--maghrib { background: linear-gradient(180deg, #3a2b4f 0%, #6e3f5c 55%, #e07a5f 92%, #f4b183 120%); }
.beat--isha { background: linear-gradient(180deg, #081528 0%, #0f2340 60%, #1d3f66 100%); }
.beat--night-deep { background: linear-gradient(180deg, #071224 0%, #0c1d36 60%, #1a3558 100%); }
.beat--dawn { background: linear-gradient(180deg, #0a1230 0%, #163060 60%, #3f6f86 100%); }

.has-3d .beat {
  background: transparent;
}

.beat-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.beat-copy {
  max-width: 34rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-radius: 24px;
}

.beat--night .beat-copy {
  background: rgba(6, 17, 31, 0.78);
  box-shadow: inset 0 0 0 1px rgba(231, 201, 138, 0.2);
  color: var(--night-text);
}

.beat--day .beat-copy {
  background: rgba(255, 249, 236, 0.9);
  box-shadow: inset 0 0 0 1px rgba(140, 122, 46, 0.2), 0 24px 60px rgba(111, 96, 70, 0.12);
  color: var(--text);
}

.beat h1,
.beat h2,
.beat h3 {
  color: inherit;
}

.beat h1 {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 5.4vw, 4.6rem);
  line-height: 1.02;
}

.beat h1 em {
  display: block;
  color: var(--gold-light);
  font-style: italic;
  font-weight: 500;
}

.beat h2 {
  margin-bottom: 1rem;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.beat p,
.beat li {
  font-size: 1.02rem;
  line-height: 1.6;
}

.beat--night p,
.beat--night li {
  color: rgba(255, 247, 223, 0.86);
}

.beat--day p,
.beat--day li {
  color: var(--graphite);
}

.beat .bismillah {
  margin-bottom: 0.9rem;
  color: var(--gold-light);
  font-family: "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  line-height: 1.5;
}

.beat .beat-summary {
  max-width: 44ch;
  margin: 1.4rem 0 0;
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
}

.beat .beat-kicker {
  margin-bottom: 0.9rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.beat--night .beat-kicker {
  color: var(--gold-light);
}

.beat--day .beat-kicker {
  color: var(--emerald);
}

.beat--day :focus-visible {
  outline-color: var(--emerald);
}

.beat-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.beat-list li {
  position: relative;
  padding-left: 1.4rem;
}

.beat-list li + li {
  margin-top: 0.5rem;
}

.beat-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0.2rem;
  width: 0.42rem;
  height: 0.42rem;
  background: var(--gold);
  transform: rotate(45deg);
}

.beat-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 650;
  text-underline-offset: 0.22em;
}

.beat--night .beat-link {
  color: var(--gold-light);
}

.beat--day .beat-link {
  color: var(--emerald);
}

.beat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  margin-top: 1.8rem;
}

.button-ghost {
  color: var(--night-text);
  box-shadow: inset 0 0 0 1px rgba(231, 201, 138, 0.6);
}

.button-ghost:hover {
  background: rgba(231, 201, 138, 0.12);
}

.beat .beat-note {
  margin: 1.1rem 0 0;
  color: var(--night-muted);
  font-size: 0.86rem;
}

/* Fallback figures: the real app screens in a CSS phone, a CSS mihrab, an SVG astrolabe. */

.beat-media {
  position: relative;
  height: min(78svh, 700px);
  display: grid;
  place-items: center;
  margin: 0;
  transition: opacity 0.6s ease;
}

.has-3d .fallback {
  opacity: 0;
}

.phone {
  width: clamp(170px, 19vw, 260px);
  aspect-ratio: 960 / 2080;
  padding: 7px;
  border-radius: 36px;
  background: linear-gradient(145deg, #3a3e46, #111317 60%);
  box-shadow: 0 30px 70px rgba(2, 8, 20, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.phone img {
  width: 100%;
  height: 100%;
  border-radius: 29px;
  object-fit: cover;
}

.phone--small {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: clamp(110px, 12vw, 170px);
}

.beat-media--pair {
  grid-auto-flow: column;
  gap: 1.2rem;
}

.beat-media--pair .phone:first-child { transform: rotate(-4deg) translateY(1.5rem); }
.beat-media--pair .phone:last-child { transform: rotate(4deg); }

.mihrab-frame {
  width: clamp(250px, 30vw, 400px);
  aspect-ratio: 300 / 420;
  display: grid;
  place-items: end center;
  padding-bottom: 8%;
  border: 2px solid var(--gold);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
  background: radial-gradient(circle at 50% 38%, rgba(45, 156, 107, 0.4), rgba(14, 92, 58, 0.18) 45%, transparent 70%);
  box-shadow: inset 0 0 0 10px rgba(201, 168, 76, 0.08);
}

.mihrab-frame--lattice {
  background:
    linear-gradient(30deg, transparent 47%, rgba(231, 201, 138, 0.3) 48%, rgba(231, 201, 138, 0.3) 50%, transparent 51%),
    linear-gradient(-30deg, transparent 47%, rgba(231, 201, 138, 0.3) 48%, rgba(231, 201, 138, 0.3) 50%, transparent 51%),
    radial-gradient(circle at 50% 40%, rgba(45, 156, 107, 0.55), rgba(14, 92, 58, 0.25) 60%, transparent 80%);
  background-size: 40px 69px, 40px 69px, auto;
}

.astrolabe {
  width: clamp(230px, 30vw, 390px);
  height: auto;
  overflow: visible;
}

.astro-disc { fill: var(--night-card); }
.astro-rim { fill: none; stroke: var(--gold); stroke-width: 2; }
.astro-dash { fill: none; stroke: var(--gold); stroke-width: 0.8; stroke-dasharray: 3 3; opacity: 0.45; }
.astro-line { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.astro-faint { fill: none; stroke: rgba(201, 168, 76, 0.45); stroke-width: 0.8; }
.needle-gold { fill: var(--gold-light); stroke: var(--gold); stroke-width: 0.8; }
.needle-emerald { fill: var(--emerald); opacity: 0.9; }
.astro-pin { fill: var(--night-card); stroke: var(--gold); stroke-width: 1; }

/* Decorative prayer rail, shown only with the scene. */

.prayer-rail {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: clamp(0.6rem, 1.6vw, 1.6rem);
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}

.has-3d .prayer-rail {
  display: grid;
  gap: 0.9rem;
}

.prayer-rail li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 247, 223, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.prayer-rail li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.4s ease;
}

.prayer-rail li.is-active {
  color: var(--gold-light);
}

.prayer-rail li.is-active::before {
  transform: scale(1.7);
}

.is-day .prayer-rail li { color: rgba(23, 59, 50, 0.72); }
.is-day .prayer-rail li.is-active { color: var(--emerald); }

/* Android waitlist: native POST works without JS; :target shows the result. */

.waitlist {
  position: relative;
  margin-top: 2.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid rgba(231, 201, 138, 0.25);
}

.waitlist h3 {
  margin-bottom: 0.4rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}

.waitlist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.waitlist input[type="email"] {
  min-height: 48px;
  flex: 1 1 14rem;
  padding: 0 1.1rem;
  border: 1px solid rgba(231, 201, 138, 0.5);
  border-radius: 999px;
  background: rgba(255, 247, 223, 0.08);
  color: var(--night-text);
}

.waitlist input[type="email"]::placeholder {
  color: rgba(198, 176, 137, 0.8);
}

.waitlist-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The live region stays in the accessibility tree while empty so results are announced. */
.waitlist-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.waitlist-status,
.waitlist-msg {
  margin: 1rem 0 0;
  font-weight: 600;
}

.waitlist-msg {
  display: none;
}

.waitlist-msg:target {
  display: block;
}

.beat .waitlist-msg--ok,
.beat .waitlist-status.is-ok {
  color: var(--gold-light);
}

.beat .waitlist-msg--error,
.beat .waitlist-status.is-error {
  color: #f4b183;
}

.beat .waitlist-fine {
  margin: 0.9rem 0 0;
  color: var(--night-muted);
  font-size: 0.82rem;
}

.waitlist-fine a {
  color: inherit;
}

.home .site-footer {
  background: var(--card);
}

/* Live Qibla finder (/qibla). Rendered from first paint (no layout shift) and hidden
   when scripting is off; the guide below works without it. */

.qibla-tool {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: 0 0 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-md);
  background: var(--night);
  color: var(--night-text);
}

@media (scripting: none) {
  .qibla-tool {
    display: none;
  }
}

.qibla-tool h2 {
  margin: 0 0 0.6rem;
  color: var(--night-text);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
}

.qibla-dial svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.qibla-cardinal {
  fill: var(--night-muted);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}

.qibla-north {
  fill: var(--gold-light);
}

.qibla-kaaba {
  fill: #1a1a1a;
  stroke: var(--gold);
  stroke-width: 1.5;
}

.qibla-aura {
  fill: none;
  stroke: var(--emerald-soft);
  stroke-width: 8;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qibla-tool[data-state="aligned"] .qibla-aura {
  opacity: 0.9;
}

.qibla-tool[data-state="aligned-soft"] .qibla-aura {
  opacity: 0.4;
}

.qibla-tool .qibla-readout {
  margin: 0 0 0.5rem;
  color: var(--night-text);
  font-size: 1.05rem;
}

.qibla-tool .qibla-instruction {
  min-height: 1.6em;
  margin: 0 0 1rem;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}

/* Sentences (no compass, calibration) read as body text, not the big instruction. */
.qibla-tool[data-state="static"] .qibla-instruction,
.qibla-tool[data-state="calibrating"] .qibla-instruction {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.qibla-tool .qibla-hint {
  margin: 0 0 0.6rem;
  color: var(--night-muted);
  font-size: 0.95rem;
}

.qibla-tool .qibla-privacy,
.qibla-tool .qibla-cta {
  margin: 1rem 0 0;
  color: var(--night-muted);
  font-size: 0.9rem;
}

.qibla-tool .qibla-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(231, 201, 138, 0.25);
  color: var(--night-text);
}

.qibla-tool .guide-text-link,
.qibla-manual summary {
  color: var(--gold-light);
}

.qibla-manual {
  display: grid;
  max-width: 28rem;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.qibla-manual label {
  color: var(--night-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.qibla-manual select,
.qibla-manual input {
  min-height: 44px;
  width: 100%;
  padding: 0 0.8rem;
  border: 1px solid rgba(231, 201, 138, 0.5);
  border-radius: var(--radius-sm);
  background: var(--night-card);
  color: var(--night-text);
  font: inherit;
}

.qibla-manual summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

.qibla-coords {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 0.6rem;
}

.qibla-tool :focus-visible {
  outline-color: var(--gold-light);
}

@media (max-width: 899px) {
  .qibla-tool {
    grid-template-columns: 1fr;
  }

  .qibla-dial {
    width: min(78vw, 300px);
    margin: 0 auto;
  }

  .qibla-coords {
    grid-template-columns: 1fr 1fr;
  }

  .qibla-coords .button {
    grid-column: 1 / -1;
  }

  .beat {
    min-height: 100svh;
    align-items: start;
    padding: 5.5rem 0 3rem;
  }

  .beat-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .beat-media {
    order: -1;
    height: 44svh;
  }

  .phone {
    width: min(40vw, 19svh);
    border-radius: 26px;
    padding: 5px;
  }

  .phone img {
    border-radius: 21px;
  }

  .mihrab-frame,
  .astrolabe {
    width: min(64vw, 31svh);
  }

  .phone--small {
    width: min(24vw, 12svh);
  }

  .beat-copy {
    max-width: none;
  }

  .has-3d .prayer-rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .footer-layout {
      grid-template-columns: 1fr;
      justify-items: center;
      gap: 0.35rem;
      padding: 1.4rem 0;
    }

  .footer-layout > p {
      text-align: center;
    }

  .legal-layout {
      grid-template-columns: 1fr;
    }

  .legal-nav {
      display: flex;
      gap: 0.2rem 1.15rem;
      overflow-x: auto;
      padding-bottom: 0.5rem;
    }

  .legal-nav p {
      display: none;
    }

  .legal-nav a {
      flex: 0 0 auto;
      text-decoration: underline;
      text-underline-offset: 0.2em;
    }

  .guide-nav {
      position: static;
    }

  .guide-nav a[href="#questions"],
    .guide-nav a[href="#related"] {
      display: none;
    }
}

@media (max-width: 700px) {
  .shell {
      width: min(100% - 1.5rem, var(--shell));
    }

  .site-nav {
      min-height: 68px;
    }

  .brand img {
      width: 40px;
      height: 40px;
    }

  .guide-header-link {
      display: none;
    }

  .guide-hero {
      padding-top: 3rem;
    }

  .guide-hero h1 {
      font-size: clamp(2.6rem, 13vw, 4rem);
    }

  .related-guides {
      grid-template-columns: 1fr;
    }

  .guide-cta {
      align-items: stretch;
      flex-direction: column;
    }

  .guide-cta .button {
      width: 100%;
    }
}

@media (max-width: 480px) {
  .brand-copy small {
      display: none;
    }

  .button-nav {
      padding-inline: 1rem;
    }

  .legal-hero h1,
    .not-found h1 {
      font-size: clamp(2.35rem, 12vw, 3.4rem);
    }
}

@media (max-width: 480px) {
  .header-link {
    display: none;
  }

  .beat-actions .button,
  .waitlist-row .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qibla-aura,
  .scene,
  .beat-media,
  .prayer-rail li {
    transition: none;
  }

  *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
    }
}
