/* site/styles.css — the only stylesheet. Tokens copied from src/ui/theme.ts (colors,
   spacing, skyPalettes.maghrib[0..1]); the site has no build step, so they are values,
   not imports. Dark only, like the app. */

:root {
  color-scheme: dark;
  --bg: #0E1B17;
  --card: #16261F;
  --accent: #C9A96A;
  --text: #F2EFE9;
  --dim: #9BA8A0;
  --divider: #334A40;
  --danger: #C96A6A;
  --success: #6AC98F;
  --sky-0: #0E1B17;   /* skyPalettes.maghrib[0] */
  --sky-1: #12241D;   /* skyPalettes.maghrib[1] */
  --xs: 4px;
  --s: 8px;
  --m: 16px;
  --l: 24px;
  --xl: 32px;
  --serif: Charter, 'Iowan Old Style', Georgia, serif;
  --arabic: Amiri, var(--serif);
}

/* Only the 700 wordmark is Arabic, so only the Bold face ships. A regular face would be
   437 KB in the repo and zero on the wire; add it back with the first Arabic body copy. */
@font-face {
  font-family: Amiri;
  src: url('/fonts/Amiri-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font: 18px/1.6 var(--serif);
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* Rhythm: multiples of 8px. Measure: 62ch. */
.wrap { max-width: 62ch; margin-inline: auto; padding-inline: var(--m); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 var(--m); }
h1 { font-size: 1.953rem; }               /* 18px × 1.25³ */
h2 { font-size: 1.5625rem; margin-top: var(--xl); } /* 18px × 1.25² */
h3 { font-size: 1.25rem; margin-top: var(--l); }
p, ul, ol, dl, table { margin: 0 0 var(--m); }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--xs); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--text); }
strong { font-weight: 600; }
small, .dated { color: var(--dim); }
hr { border: 0; border-top: 1px solid var(--divider); margin: var(--xl) 0; }
section + section { border-top: 1px solid var(--divider); padding-top: var(--l); margin-top: var(--xl); }
[lang="ar"] { font-family: var(--arabic); }

/* Focus: accent outline, 2px offset, everywhere. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: var(--m); top: -100px;
  padding: var(--s) var(--m); background: var(--card); color: var(--text);
}
.skip:focus { top: var(--m); z-index: 1; }

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s) var(--l);
  max-width: 62ch; margin-inline: auto; padding: var(--m);
}
.brand { display: inline-flex; align-items: center; gap: var(--s); color: var(--text); text-decoration: none; }
.brand img { display: block; }
.wordmark { font-weight: 600; }
.site-header nav { display: flex; flex-wrap: wrap; gap: var(--m); }
.site-header nav a { color: var(--dim); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

/* Hero: the one gradient on the site, two maghrib stops. */
.hero {
  background: linear-gradient(180deg, var(--sky-1), var(--sky-0));
  border-bottom: 1px solid var(--divider);
  padding: var(--xl) 0;
  margin-bottom: var(--xl);
}
.hero-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--m); margin-bottom: var(--s); }
.wordmark-ar { font-family: var(--arabic); font-weight: 700; font-size: 1.953rem; color: var(--accent); }
.lede { font-size: 1.25rem; margin-bottom: var(--l); }
/* logo-mark.svg has no plate behind it, so it sits straight on the wash: nothing to round. */
.hero img { display: block; width: 96px; height: 96px; margin-bottom: var(--m); }

/* Buttons: 1px accent border, 6px radius, filled on hover. */
.buttons { display: flex; flex-wrap: wrap; gap: var(--s) var(--m); margin-bottom: var(--m); }
.button, button {
  display: inline-block; padding: var(--s) var(--m);
  font: inherit; font-weight: 600; line-height: 1.4;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 6px;
  text-decoration: none; cursor: pointer;
}
.button:hover, button:hover:not([disabled]) { background: var(--accent); color: var(--bg); }
button[disabled] { opacity: .6; cursor: default; }

/* Forms. */
form { margin: 0 0 var(--l); }
fieldset { border: 1px solid var(--divider); border-radius: 6px; padding: var(--s) var(--m); margin: 0 0 var(--m); }
legend { padding: 0 var(--xs); }
fieldset label { display: block; margin: var(--xs) 0; }
label { display: block; margin-bottom: var(--xs); }
textarea, input[type="text"], input[type="email"] {
  display: block; width: 100%; margin-bottom: var(--s);
  padding: var(--s); font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--divider); border-radius: 6px;
}
textarea { min-height: 10rem; resize: vertical; }
input[type="radio"] { accent-color: var(--accent); margin-right: var(--s); }
.count { color: var(--dim); font-size: .9rem; margin: 0 0 var(--m); }
.status { margin: var(--m) 0 0; min-height: 1.6em; }
.status.failed { color: var(--danger); }
.sent { color: var(--success); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Tables (the privacy policy's network table). */
.table-wrap { overflow-x: auto; margin-bottom: var(--m); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
/* Below ~36rem the four columns would collapse to one word each. The floor makes
   .table-wrap's overflow-x do the scrolling instead, and keeps the page itself unscrolled. */
.table-wrap table { min-width: 36rem; }
th, td { border-top: 1px solid var(--divider); padding: var(--s); text-align: left; vertical-align: top; }
th { color: var(--dim); font-weight: 600; }
tbody tr:last-child td { border-bottom: 1px solid var(--divider); }

/* Credits: one definition list per work. */
.credit { border-top: 1px solid var(--divider); padding-top: var(--m); }
.credit dt { font-weight: 600; }
.credit dd { margin: var(--xs) 0 0; }
.credit dd a { overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--divider); margin-top: var(--xl); padding-block: var(--l); color: var(--dim); }
.site-footer p { margin: 0 0 var(--xs); }
.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 400px) {
  body { font-size: 17px; }
  .hero img { width: 72px; height: 72px; }
}

/* FAQ: native <details name="faq"> — opening one closes the others (Chrome 120, Safari 17.2,
   Firefox 130 and later); older browsers simply allow several open. No script involved. */
.faq { border-top: 1px solid var(--divider); }
.faq summary { display: flex; align-items: baseline; justify-content: space-between; gap: var(--m);
  padding: var(--m) 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.125rem; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.25rem; line-height: 1; flex: none; }
.faq[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.faq > p { margin: 0 0 var(--m); }
.faq > p:last-child { margin-bottom: var(--l); }
