/* niyyati.app. One light look, on purpose (no dark mode): the app's Parchment theme for the
   page and its Emerald and Gold theme for the two panels. Colours are the app's own
   (Design/Themes.swift), and each has one job:
     gold   = the Quran's voice        green = hadith's voice
     emerald = the app itself (buttons, panels, tools) */
:root {
  color-scheme: light;
  --paper: #F5EFE3;
  --surface: #FBF7EE;
  --ink: #1B2426;
  --ink-2: #5C584F;
  --line: rgba(27, 36, 38, 0.13);
  --gold: #86652A;
  --hadith: #2B6A50;
  --hadith-surface: rgba(43, 106, 80, 0.08);
  --emerald: #0B2A22;
  --emerald-2: #12382E;
  --cream: #F4EEDD;
  --cream-2: #C7C0AA;
  --gold-bright: #E0BD6E;
  --bezel: #0B1416;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Amiri Quran", "Geeza Pro", "Noto Naskh Arabic", serif;

  --gutter: clamp(20px, 5vw, 40px);
  --radius: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1080px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--emerald); color: var(--cream); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; z-index: 10; }

/* Titles are the serif, brighter and larger than text, everywhere. */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.1; }
h3 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); line-height: 1.18; }

/* What kind of thing this is, in that thing's colour. */
.kind { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.kind.quran { color: var(--gold); }
.kind.hadith { color: var(--hadith); }
.kind.tool { color: var(--emerald-2); }

/* Header */
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 1.35rem/1 var(--serif); letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }
.top-link { font-size: 0.95rem; font-weight: 500; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.top-link:hover { color: var(--ink); border-color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(28px, 6vw, 64px) clamp(48px, 8vw, 96px); }
.hero-grid { display: grid; gap: clamp(36px, 6vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.pill { display: inline-flex; align-items: center; gap: 8px; font: 600 0.74rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
h1 { font-size: clamp(2.7rem, 8.4vw, 5rem); line-height: 1.02; letter-spacing: -0.025em; }
h1 em { font-style: italic; color: var(--gold); }
.lede { font-size: clamp(1.1rem, 2.4vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--emerald); color: var(--cream); font-weight: 600; font-size: 1rem; text-decoration: none; transition: background-color 0.2s ease, transform 0.2s ease; }
.btn:hover { background: var(--emerald-2); }
.btn:active { transform: scale(0.98); }
.btn.quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.quiet:hover { border-color: var(--ink); background: transparent; }
.btn.light { background: var(--gold-bright); color: var(--emerald); }
.btn.light:hover { background: var(--cream); }
.facts { display: grid; gap: 8px; color: var(--ink-2); font-size: 0.98rem; }
.facts li { display: flex; gap: 10px; align-items: baseline; }
.facts li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--hadith); transform: translateY(-2px); }

.tour { justify-self: center; width: min(100%, 340px); display: grid; gap: 12px; }
.tour-video { width: 100%; aspect-ratio: 9 / 16; border-radius: var(--radius); background: var(--bezel); box-shadow: 0 30px 60px -28px rgba(11, 42, 34, 0.55), 0 0 0 1px var(--line); }
.tour figcaption { font-size: 0.86rem; color: var(--ink-2); text-align: center; }

/* One screen, one ayah */
.screen { padding-block: clamp(40px, 7vw, 88px); }
.screen .wrap { display: grid; gap: 18px; justify-items: center; text-align: center; }
.section-lede { color: var(--ink-2); max-width: 34em; }
.ayah { width: 100%; margin-top: 14px; background: var(--emerald); color: var(--cream); border-radius: var(--radius); padding: clamp(36px, 8vw, 84px) clamp(20px, 6vw, 72px); display: grid; gap: clamp(20px, 3.4vw, 30px); justify-items: center; }
.ayah .kind.quran { color: var(--gold-bright); }
.arabic { font-family: var(--arabic); font-size: clamp(2.3rem, 8vw, 4.2rem); line-height: 2; }
.translation { font: 400 clamp(1.3rem, 3.2vw, 1.75rem)/1.4 var(--serif); max-width: 24em; position: relative; padding-top: clamp(20px, 3.4vw, 30px); }
.translation::before { content: ""; position: absolute; top: 0; left: 50%; width: 44px; height: 2px; margin-left: -22px; background: var(--gold-bright); border-radius: 2px; }
.ayah figcaption { font-size: 0.86rem; font-style: italic; color: var(--cream-2); }
.name-note { font: italic 400 1.1rem/1.4 var(--serif); color: var(--ink-2); margin-top: 6px; }

/* What's inside: one thing per row */
.inside { padding-block: clamp(40px, 7vw, 88px); }
.inside h2 { margin-bottom: clamp(8px, 2vw, 20px); }
.row { display: grid; gap: 28px; align-items: center; padding-block: clamp(36px, 6vw, 64px); border-top: 1px solid var(--line); }
.inside h2 + .row { border-top: 0; }
.row-copy { display: grid; gap: 14px; max-width: 30em; }
.row-copy p:last-child { color: var(--ink-2); }
.phone { justify-self: center; width: min(74%, 270px); border-radius: 40px; padding: 8px; background: var(--bezel); box-shadow: 0 30px 60px -30px rgba(11, 42, 34, 0.6); }
.phone img { border-radius: 32px; width: 100%; }

.also { display: grid; gap: 0; margin-top: clamp(12px, 3vw, 28px); border-top: 1px solid var(--line); }
.also div { display: grid; gap: 4px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.also dt { font: 500 1.2rem/1.3 var(--serif); }
.also dd { color: var(--ink-2); }

/* How it's made */
.made { padding-block: clamp(40px, 7vw, 88px); background: var(--surface); border-block: 1px solid var(--line); }
.principles { display: grid; gap: 28px; margin-top: clamp(24px, 4vw, 40px); counter-reset: principle; }
.principles li { display: grid; gap: 8px; counter-increment: principle; }
.principles li::before { content: counter(principle); font: 500 1rem/1 var(--serif); color: var(--gold); border: 1px solid var(--gold); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; }
.principles h3 { font-size: 1.4rem; }
.principles p { color: var(--ink-2); max-width: 34em; }
.sources { margin-top: clamp(36px, 6vw, 56px); padding-top: 28px; border-top: 1px solid var(--line); }
.sources h3 { font-size: 1.25rem; margin-bottom: 12px; }
.sources div { display: grid; gap: 2px; padding-block: 10px; }
.sources dt { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.sources a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.sources a:hover { text-decoration-color: currentColor; }

/* Closing */
.closing { padding-block: clamp(40px, 7vw, 88px); }
.closing .wrap > * { position: relative; }
.closing .wrap { display: grid; gap: 18px; justify-items: start; }
.closing { background: var(--emerald); color: var(--cream); }
.closing p { color: var(--cream-2); max-width: 32em; }

/* Footer */
.foot { background: var(--emerald); color: var(--cream-2); font-size: 0.92rem; border-top: 1px solid rgba(244, 238, 221, 0.14); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-block: 24px 32px; }
.foot a { color: var(--cream); text-decoration-color: rgba(244, 238, 221, 0.3); text-underline-offset: 3px; }
.foot span:last-child { margin-left: auto; }

/* Wider screens: copy beside the picture, rows alternate. */
@media (min-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
  .tour { justify-self: end; }
  .row { grid-template-columns: 1fr 1fr; gap: 48px; }
  .row:nth-of-type(even) .row-copy { order: 2; }
  .phone { width: min(100%, 290px); }
  .also { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .principles { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .sources dl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
}
@media (max-width: 560px) {
  .foot span:last-child { margin-left: 0; width: 100%; }
}

/* Rows rise into place as they scroll in, where the browser supports it. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .row, .ayah {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 38%;
    }
    @keyframes rise { from { opacity: 0.25; transform: translateY(26px); } to { opacity: 1; transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
