/* Muskami Studio: one stylesheet for every page. Colours follow MyZikr's Night
   and Dawn themes (lib/core/tokens.dart). Fonts are self-hosted subsets, so
   no visitor request goes to a font service. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.ttf") format("truetype");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("fonts/amiri-subset.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #0e1620;
  --ink-raised: #141e2a;
  --gold: #c9a65e;
  --gold-text: #c9a65e;
  --lamplight: #e8c88a;
  --vellum: #e6dcc6;
  --faded: #9c9585;
  --rule: rgba(201, 166, 94, 0.28);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Amiri", "Geeza Pro", "Traditional Arabic", serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #f1e8d6;
    --ink-raised: #f7f0e1;
    --gold: #a9843e;
    --gold-text: #75581c;
    --lamplight: #fff4d8;
    --vellum: #2a2620;
    --faded: #665d52;
    --rule: rgba(169, 132, 62, 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--vellum);
  font: 400 1.125rem/1.65 var(--serif);
}

a { color: var(--gold-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--lamplight); }
@media (prefers-color-scheme: light) { a:hover { color: var(--vellum); } }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

/* Header and footer */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex; align-items: baseline; gap: 0.6rem;
  color: var(--vellum); text-decoration: none;
  font: 500 1.15rem/1 var(--serif); letter-spacing: 0.01em;
}
.brand { align-items: center; }
.brand img { width: 30px; height: 30px; display: block; }
.site-nav { display: flex; gap: 1.1rem; font: 500 0.8rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.site-nav a { color: var(--faded); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--gold-text); }

.site-foot {
  margin-top: 4rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule);
  color: var(--faded); font: 400 0.85rem/1.6 var(--sans);
}
.site-foot a { color: var(--faded); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--vellum); }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 2.5rem 0 0.5rem; }
h2 { font-size: 1.45rem; margin: 2.5rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.25rem; }
p, ul { margin: 0 0 1rem; }
ul { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--gold); }

.lede { font-style: italic; color: var(--faded); font-size: 1.2rem; }
.caps { font: 500 0.75rem/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); }
.meta { font: 400 0.85rem/1.5 var(--sans); color: var(--faded); }

/* Hero */
.hero { text-align: center; padding: 3.5rem 0 1rem; }
.hero .ar { font-family: var(--arabic); font-size: 2.4rem; color: var(--gold-text); line-height: 1.4; display: block; }
.hero h1 { margin-top: 0.25rem; }
.hero img { width: 112px; height: 112px; border-radius: 26px; display: block; margin: 0 auto 1.25rem; }
.hero img[src$=".svg"] { border-radius: 0; width: 120px; height: 120px; margin-bottom: 0.5rem; }

/* Framed panel, like MyZikr's ruled frames */
.frame {
  border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: 4px;
  background: var(--ink-raised); padding: 1.5rem; margin: 2rem 0;
}
.frame > :last-child { margin-bottom: 0; }

.app-card { display: flex; gap: 1.25rem; align-items: center; text-decoration: none; color: inherit; }
.app-card img { width: 72px; height: 72px; border-radius: 17px; flex: none; }
.app-card h2 { margin: 0; font-size: 1.35rem; }
.app-card p { margin: 0.2rem 0 0; color: var(--faded); }
.app-card:hover h2 { color: var(--gold-text); }

.badge {
  display: inline-block; margin-top: 1rem; padding: 0.55rem 1rem;
  border: 1px solid var(--gold); color: var(--gold-text);
  font: 500 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
}

.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font: 400 0.95rem/1.5 var(--sans); }

/* Policy pages */
.doc h2 { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.doc h2:first-of-type { border-top: 0; padding-top: 0; }

@media (max-width: 30rem) {
  .site-head { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .app-card { align-items: flex-start; }
}
