/* Elif Lam public pages: one stylesheet, system fonts, no external requests.
   Colours are the app's own palette: "Mihrab" (light) and "Obsidian" (dark).
   Every text/background pair meets WCAG AA; body text exceeds AAA. */

:root {
  color-scheme: light dark;
  --paper: #f3ede0;
  --surface: #fffcf6;
  --ink: #1d1b16;
  --ink-soft: #544b3e;
  --hairline: #ddd0b4;
  --accent: #7e5a14;
  --focus: #7e5a14;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #030304;
    --surface: #141418;
    --ink: #e8e4dc;
    --ink-soft: #b7b3ab;
    --hairline: #2e2e35;
    --accent: #c0a472;
    --focus: #c0a472;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: 0.5rem;
  z-index: 1;
}

.skip:focus {
  top: 1rem;
}

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  font-family: ui-serif, "New York", Georgia, "Times New Roman", serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  font-family: ui-serif, "New York", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  /* Very large text on a narrow phone: break long words at syllables where
     the browser has a dictionary, instead of anywhere. */
  hyphens: auto;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3125rem;
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.25rem;
}

p,
ul,
dl {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

main li + li {
  margin-top: 0.375rem;
}

.lead {
  font-size: 1.1875rem;
  color: var(--ink-soft);
}

.meta {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.summary ul {
  margin: 0;
}

dt {
  font-weight: 600;
  margin-top: 1rem;
}

dd {
  margin: 0.125rem 0 0;
  color: var(--ink-soft);
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--ink-soft);
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  h1 {
    font-size: 2.375rem;
  }
}

@media print {
  .skip,
  nav,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
