:root {
  --bg: #f6f1ea;
  --ink: #1c1917;
  --muted: #44403c;
  --accent: #7c2d12;
  --card: #fffdf9;
  --line: #d6d3d1;
  --focus: #0c4a6e;
  --space: 1.25rem;
  --max: 68rem;
  --font: "Source Sans 3", "Noto Naskh Arabic", "Segoe UI", sans-serif;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

html[lang="ar"] body {
  font-family: "Noto Naskh Arabic", "Source Sans 3", sans-serif;
  line-height: 1.85;
}

img,
video,
audio {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  color: var(--ink);
  transform: translateY(-200%);
  z-index: 10;
}

.skip:focus {
  transform: none;
}

.site-header,
.site-main,
.site-footer {
  width: min(var(--max), calc(100% - 2 * var(--space)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.25rem;
}

.site-main {
  padding-block: 2rem 3rem;
}

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}

h1 {
  font-size: clamp(1.75rem, 2vw + 1.25rem, 2.35rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  flex: none;
  align-self: start;
  background: #e7e5e4;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem 1.1rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
}

.kind {
  color: var(--muted);
  font-size: 0.95rem;
}

.artist {
  color: var(--ink);
}

.langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.langs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.work-header .byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.cover {
  display: block;
  width: min(100%, 42rem);
  margin-block: 0 1.5rem;
  background: #e7e5e4;
}

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 1.25rem;
}

.player {
  margin-bottom: 1.5rem;
}

.player h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.player audio,
.player video {
  display: block;
  width: 100%;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  max-width: 42rem;
}

.prose a {
  text-decoration-thickness: 0.08em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card img {
    transition: opacity 160ms ease;
  }

  .card:hover img,
  .card:focus-visible img {
    opacity: 0.92;
  }
}
