@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;700&display=swap');

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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rule: #d9d9d9;
  --soft: #3b3b3b;
  --tint: #f2f2f2;
  --mute: #8c8c8c;
  --gut: clamp(16px, 4vw, 44px);
  --shell: 1320px;
  --disp: "Noto Naskh Arabic", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --text: "Noto Sans Arabic", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--disp);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(var(--gut), calc((100vw - var(--shell)) / 2));
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.brand__text {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 2px;
}

.topbar__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 2px solid var(--ink);
}

.topbar__cta:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- sticky index bar ---------- */

.indexbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.indexbar__list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.indexbar__list li {
  flex: 0 0 auto;
}

.indexbar__list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
  border-right: 1px solid var(--rule);
}

.indexbar__list a::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.indexbar__list a:hover,
.indexbar__list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.indexbar__list a:hover::before,
.indexbar__list a:focus-visible::before {
  background: var(--paper);
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 45vh;
  padding: clamp(20px, 4vh, 40px) max(var(--gut), calc((100vw - var(--shell)) / 2)) clamp(28px, 6vh, 56px);
  border-bottom: 1px solid var(--ink);
}

.masthead::before {
  content: "01";
  position: absolute;
  right: 2vw;
  bottom: -0.18em;
  z-index: -1;
  font-family: var(--disp);
  font-size: clamp(96px, 24vw, 280px);
  font-weight: 700;
  line-height: 0.75;
  letter-spacing: -0.06em;
  color: var(--tint);
  pointer-events: none;
}

.masthead__media {
  grid-column: 1 / 8;
  grid-row: 1;
  margin: 0;
  min-height: clamp(200px, 34vh, 360px);
  background: var(--tint);
}

.masthead__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 86%);
}

.masthead__copy {
  grid-column: 8 / 13;
  grid-row: 1;
  align-self: end;
  text-align: right;
  padding-bottom: 6px;
}

.masthead__copy h1 {
  font-size: clamp(30px, 6.2vw, 74px);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  margin: 0;
}

.masthead__copy h1::before {
  content: "";
  display: block;
  width: 68px;
  height: 6px;
  margin: 0 0 18px auto;
  background: var(--ink);
}

/* ---------- dossier ---------- */

.dossier {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: clamp(28px, 5vh, 56px) max(var(--gut), calc((100vw - var(--shell)) / 2)) clamp(40px, 8vh, 80px);
}

.prose {
  min-width: 0;
}

.prose section {
  padding-bottom: clamp(28px, 5vh, 52px);
  margin-bottom: clamp(28px, 5vh, 52px);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 78px;
}

.prose section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.prose h2 {
  font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.14;
  margin: 0 0 14px;
}

.prose h3 {
  font-size: 20px;
  line-height: 1.32;
  margin: 28px 0 10px;
}

.prose p {
  margin: 0 0 18px;
  max-width: 70ch;
}

.prose ul,
.prose ol {
  margin: 0 0 20px;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-thickness: 3px;
}

.prose img {
  display: block;
  margin: 22px 0;
}

.prose figure {
  margin: 24px 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: #4a4a4a;
}

.prose blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--tint);
  border-left: 5px solid var(--ink);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 28px 0;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: var(--tint);
  padding: 1px 5px;
}

/* ---------- rail ---------- */

.rail {
  position: sticky;
  top: 78px;
  background: var(--ink);
  color: var(--paper);
  padding: 26px 22px 22px;
}

.rail__title {
  color: var(--paper);
  font-size: 22px;
  margin: 0 0 10px;
}

.rail__sub {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.6;
  color: #cfcfcf;
}

.rail__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: bar;
}

.rail__list li {
  counter-increment: bar;
  border-top: 1px solid var(--soft);
}

.rail__list li:last-child {
  border-bottom: 1px solid var(--soft);
}

.rail__list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
}

.rail__list a::before {
  content: counter(bar, decimal-leading-zero);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #9c9c9c;
  font-variant-numeric: tabular-nums;
}

.rail__list a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- footer ---------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px 40px;
  border-top: 2px solid var(--ink);
  padding: 32px max(var(--gut), calc((100vw - var(--shell)) / 2)) 44px;
  font-size: 16px;
}

.foot__brand {
  flex: 0 0 auto;
}

.foot__nav {
  flex: 1 1 auto;
}

.foot__nav dl {
  margin: 0;
  padding: 0;
  column-count: 2;
  column-gap: 28px;
  counter-reset: f;
}

.foot__nav dt {
  counter-increment: f;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  break-inside: avoid;
}

.foot__nav dt::before {
  content: counter(f, decimal-leading-zero);
}

.foot__nav dd {
  margin: 0 0 4px;
  break-inside: avoid;
}

.foot__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
}

.foot__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot__legal {
  align-self: flex-end;
  font-variant-numeric: tabular-nums;
}

.foot__top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- narrow ---------- */

@media (max-width: 860px) {
  .masthead {
    grid-template-columns: repeat(6, 1fr);
    min-height: 0;
  }

  .masthead__media {
    grid-column: 1 / 7;
    grid-row: 1;
    min-height: clamp(160px, 26vh, 240px);
  }

  .masthead__copy {
    grid-column: 1 / 7;
    grid-row: 2;
    text-align: left;
    padding-top: 20px;
    padding-bottom: 0;
  }

  .masthead__copy h1::before {
    margin-left: 0;
    width: 48px;
    height: 5px;
  }

  .dossier {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: 2;
  }

  .foot__nav {
    flex: 1 1 100%;
  }

  .foot__nav dl {
    column-count: 2;
  }
}

@media (max-width: 420px) {
  .topbar__cta {
    padding: 0 14px;
  }

  .indexbar__list a {
    padding: 0 14px;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
