/* QuranHover site. Colours come from the app icon: deep teal on mint. */
:root {
  --ink: #14292b;          /* text */
  --ink-soft: #4b6163;     /* secondary text */
  --deep: #142e30;         /* icon base */
  --teal: #145e57;         /* icon highlight, links, primary action */
  --mint: #e3faf0;         /* icon stroke, popup accents */
  --paper: #f1f5f3;        /* page */
  --sheet: #ffffff;        /* the reading pane in the demo */
  --rule: #cfdcd8;
  --select: #b9e3d4;       /* text selection in the demo */

  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --serif: "Literata", Georgia, serif;
  --arabic: "Noto Naskh Arabic", "Geeza Pro", serif;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--sans); color: var(--deep); margin: 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
p { margin: 0 0 0.9em; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.4em;
  font: 600 0.85em/1.5 var(--sans);
  text-align: center;
  color: var(--deep);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-bottom-width: 3px;
  border-radius: 6px;
  margin: 0 0.08em;
}
code {
  font: 500 0.92em/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  background: #e2ebe8;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
code[lang="ar"] { font-family: var(--arabic); font-size: 1.05em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); padding: 0.5rem 0.75rem; z-index: 10; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem var(--gutter);
  max-width: 76rem; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--deep); font-weight: 700; font-size: 1.1rem; }
.site-header nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--deep); }

main > section { max-width: 76rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-top: clamp(1.5rem, 4vw, 3.5rem) !important;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
  max-width: 15ch;
}
.lede { font-size: 1.2rem; color: var(--ink); max-width: var(--measure); }
.ref-inline { background: var(--select); border-radius: 3px; padding: 0 0.15em; white-space: nowrap; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.8rem 0 1rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.35rem; border-radius: 12px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none;
}
.button.primary { background: var(--teal); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.button.primary:hover { background: var(--deep); color: #fff; }
.button.quiet { color: var(--deep); border: 1.5px solid var(--rule); }
.button.quiet:hover { border-color: var(--teal); }
.fineprint { font-size: 0.92rem; color: var(--ink-soft); max-width: var(--measure); }

/* Demo: a reading pane with the QuranHover popup */
.demo { margin: 0; }
.window {
  background: var(--sheet);
  border-radius: 14px;
  border: 1px solid var(--rule);
  box-shadow: 0 30px 60px -30px rgba(20, 46, 48, 0.45);
  overflow: hidden;
}
.window-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid #e6eeeb; background: #f8fbfa; }
.window-bar span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #d3dedb; }
.window-bar p { margin: 0 auto; padding-right: 2.5rem; font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
.page {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.4rem, 3.5vw, 2.6rem) clamp(5.5rem, 10vw, 7rem);
  font: 400 1.08rem/1.75 var(--serif);
  color: #233638;
}
.page p { margin-bottom: 1.1em; }
.page .arabic { font: 400 1.35rem/1.9 var(--arabic); text-align: right; }

.cite, .nowrap { white-space: nowrap; }
.ref {
  font: inherit; color: inherit;
  background: none; border: 0; padding: 0 0.1em; margin: 0;
  border-radius: 3px; cursor: pointer;
  text-decoration: underline dotted rgba(20, 94, 87, 0.55);
  text-underline-offset: 0.22em;
  transition: background-color 180ms ease;
}
.ref:hover { background: #e3f1ec; }
.ref.is-selected { background: var(--select); text-decoration: none; }

.popup {
  position: absolute;
  width: min(21rem, calc(100% - 2rem));
  background: var(--deep);
  color: var(--mint);
  border-radius: 12px;
  padding: 0.65rem;
  font: 400 0.95rem/1.4 var(--sans);
  box-shadow: 0 18px 40px -12px rgba(10, 30, 31, 0.55);
  z-index: 2;
}
.popup[hidden] { display: none; }
.popup.is-entering { animation: pop 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.popup-head { display: flex; align-items: center; gap: 0.45rem; padding: 0.1rem 0.3rem 0.55rem; font-size: 0.8rem; font-weight: 600; color: #a9d6c8; }
.popup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.popup-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.6rem 0.7rem; border-radius: 8px;
  background: rgba(227, 250, 240, 0.08);
  color: var(--mint); text-decoration: none;
}
.popup-list a:hover, .popup-list a:focus-visible { background: rgba(227, 250, 240, 0.18); color: #fff; }
.popup-list strong { font-weight: 600; white-space: nowrap; }
.popup-list span { font-size: 0.8rem; color: #a9d6c8; white-space: nowrap; }

.demo figcaption { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; font-size: 0.92rem; color: var(--ink-soft); }
.keys { display: inline-flex; flex: none; }
.keys kbd.is-pressed { transform: translateY(2px); border-bottom-width: 1px; background: var(--mint); }

/* Formats */
.band { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1.5rem clamp(2rem, 5vw, 4.5rem); align-items: start; }
.band-intro p { color: var(--ink-soft); max-width: 30rem; margin-top: 0.9rem; }
.band .note { grid-column: 2; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; padding: 0 0.9rem 0.6rem 0; border-bottom: 1.5px solid var(--deep); }
td { padding: 0.8rem 0.9rem 0.8rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.note { font-size: 0.92rem; color: var(--ink-soft); max-width: 44rem; margin-top: 1.2rem; }

/* Install steps: a real sequence, so they are numbered */
.install { border-top: 1px solid var(--rule); }
.section-lede { color: var(--ink-soft); max-width: var(--measure); margin-top: 0.9rem; }
.steps { list-style: none; counter-reset: step; margin: 2.6rem 0 0; padding: 0; display: grid; gap: 2.4rem 3.5rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.steps > li { counter-increment: step; position: relative; padding-left: 3.4rem; max-width: 34rem; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.15rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--deep); color: var(--mint);
  font: 700 1rem/1 var(--sans);
}
.steps h3 { margin-bottom: 0.45rem; }
.steps p { color: #2f4446; }
.steps .aside { font-size: 0.92rem; color: var(--ink-soft); }

.os-tabs { margin: 0.4rem 0 0.9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); }
.os-tabs [role="tablist"] { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.os-tabs [role="tab"] {
  flex: 1 1 auto; font: 500 0.88rem/1.2 var(--sans); color: var(--ink-soft);
  background: none; border: 0; padding: 0.7rem 0.8rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.os-tabs [role="tab"][aria-selected="true"] { color: var(--deep); font-weight: 600; border-bottom-color: var(--teal); }
.os-tabs [role="tabpanel"] { padding: 0.9rem 1rem 0.2rem; font-size: 0.98rem; }

/* Mac / Windows switch above the install steps */
.platforms > [role="tablist"] { display: inline-flex; gap: 0.25rem; margin: 1.4rem 0 0.4rem; padding: 0.25rem; background: #e2ebe8; border-radius: 12px; }
.platforms > [role="tablist"] [role="tab"] {
  font: 600 0.98rem/1.2 var(--sans); color: var(--ink-soft);
  background: none; border: 0; border-radius: 9px; padding: 0.55rem 1.3rem; cursor: pointer;
}
.platforms > [role="tablist"] [role="tab"][aria-selected="true"] { background: var(--sheet); color: var(--deep); box-shadow: 0 1px 3px rgba(20, 46, 48, 0.18); }

/* Downloads */
.downloads { border-top: 1px solid var(--rule); }
.files { margin-top: 2rem; }
.files td:first-child a { font-weight: 600; }
.files .hint { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.files code { font-size: 0.78rem; background: none; padding: 0; color: var(--ink-soft); }

/* Help */
.help { border-top: 1px solid var(--rule); }
.help h2 { margin-bottom: 0.6rem; }
.help h3 { margin: 1.8rem 0 0.2rem; font-size: 1rem; color: var(--ink-soft); }
details { border-bottom: 1px solid var(--rule); max-width: 50rem; }
summary { cursor: pointer; padding: 1rem 0; font-weight: 600; color: var(--deep); list-style-position: inside; }
details p { color: #2f4446; padding-bottom: 0.4rem; max-width: 44rem; }

.privacy { border-top: 1px solid var(--rule); }
.privacy p { max-width: 44rem; margin-top: 1rem; color: #2f4446; }

.site-footer {
  max-width: 76rem; margin: 0 auto; padding: 2rem var(--gutter) 3rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.92rem; color: var(--ink-soft);
  border-top: 1px solid var(--rule);
}
.site-footer p { margin: 0; }

@media (max-width: 860px) {
  .hero, .band { grid-template-columns: 1fr; }
  .band .note { grid-column: 1; }
}
@media (max-width: 560px) {
  .site-header nav { gap: 1rem; }
  .files th:nth-child(3), .files td:nth-child(3) { display: none; }
  .steps > li { padding-left: 2.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .popup.is-entering { animation: none; }
  .ref { transition: none; }
}
