@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --panel: #fff;
  --ink: #101828;
  --muted: #4a5565;
  --line: #e5e7eb;
  --accent: #a84327;
  --brand: #ee6b4d;
  --gradient: linear-gradient(90deg, #ee6b4d 0%, #ff6900 50%, #fb2c36 100%);
  font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-inline-size: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #b94e2b; outline-offset: 3px; }
button, input { font: inherit; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-inline-size: 1200px; margin-inline: auto; padding-inline: clamp(18px, 5vw, 64px); }
.skip { position: absolute; top: 1rem; inset-inline-start: 1rem; z-index: 1; background: var(--panel); padding: 12px; transform: translateY(-180%); }
.skip:focus { transform: none; }

.header, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header { min-block-size: 94px; }
.brand img { object-fit: contain; }
.top-bar { background: #444645; color: #fff; font-size: .82rem; }
.top-bar-content { display: flex; align-items: center; justify-content: space-between; min-block-size: 32px; }
.top-bar a:hover { text-decoration: underline; }
.contact {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-block: 10px;
  font-size: .84rem;
}
.contact span { color: var(--muted); }
.contact bdi { font-weight: 700; letter-spacing: .045em; }
.contact:hover bdi { color: var(--accent); }

.site-footer { background: var(--ink); color: #fff; }
.footer { min-block-size: 105px; }
.footer .contact span { color: #d1d5dc; }
.footer .contact:hover bdi { color: #ffb393; }
.footer .brand img { padding: 4px; border-radius: 7px; background: #ffffff12; }

html.reader-open { overflow: hidden; }
.reader { inline-size: min(1100px, calc(100% - 24px)); block-size: min(94dvh, 1000px); max-inline-size: none; max-block-size: none; padding: 0; border: 0; border-radius: 13px; color: var(--ink); background: #fff; overflow: hidden; box-shadow: 0 25px 100px #0006; }
.reader[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.reader::backdrop { background: #101828cb; }
.reader-header, .reader-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 12px; background: white; }
.reader-header { border-block-end: 1px solid var(--line); }
.reader-brand { display: flex; align-items: center; gap: 12px; min-inline-size: 0; }
.reader-brand img { object-fit: contain; }
.reader-brand h2 { margin: 0; font-size: clamp(1rem, 2vw, 1.25rem); }
.reader-stage { display: flex; flex-direction: column; overflow: auto; background: #202735; padding: 8px; direction: ltr; touch-action: pan-y pinch-zoom; }
.reader-stage.is-zoomed { touch-action: pan-x pan-y pinch-zoom; }
.page-sheet { flex: none; margin: auto; width: fit-content; transform-origin: center; }
.page-sheet img { display: block; inline-size: 100%; block-size: auto; background: white; box-shadow: 0 6px 25px #0005; }
.page-sheet img:not([src]) { visibility: hidden; }
.page-sheet.turn-next { transform-origin: right center; animation: turn-next 275ms ease-out; }
.page-sheet.turn-previous { transform-origin: left center; animation: turn-previous 275ms ease-out; }
@keyframes turn-next { from { transform: perspective(1250px) rotateY(19deg); filter: brightness(.81); } }
@keyframes turn-previous { from { transform: perspective(1250px) rotateY(-19deg); filter: brightness(.81); } }
.reader-error { color: #fff; text-align: center; }
.reader-toolbar { border-block-start: 1px solid var(--line); flex-wrap: wrap; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
.reader-tools, .reader-nav { display: flex; align-items: center; gap: 5px; }
.reader-icon { min-inline-size: 44px; min-block-size: 44px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff7ed; color: var(--ink); cursor: pointer; font-weight: 750; }
.reader-icon:hover, .reader-icon[aria-expanded="true"], .reader-icon[aria-pressed="true"] { background: #ffe8d2; }
.reader-icon:disabled { opacity: .38; cursor: default; }
.reader-nav input, .model-search input { min-block-size: 44px; padding: 6px 8px; border: 1px solid #b8bdc5; border-radius: 8px; color: var(--ink); }
.reader-nav input { inline-size: 56px; text-align: center; appearance: textfield; }
.reader-nav input::-webkit-inner-spin-button { appearance: none; }
.reader-nav span { min-inline-size: 33px; font-size: .88rem; }
.reader-panel { position: absolute; inset-block: 61px 63px; inset-inline-start: 0; z-index: 2; inline-size: min(365px, 100%); padding: 12px; overflow: auto; background: #fff; box-shadow: 0 8px 30px #10182837; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { margin: 0; }
.model-search { margin-block: 12px; }
.model-search > div { display: flex; gap: 7px; margin-block-start: 5px; }
.model-search input { min-inline-size: 0; flex: 1; }
.panel-items { display: grid; gap: 8px; }
.panel-items.thumbnails { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-option { min-block-size: 44px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff8f1; color: var(--ink); cursor: pointer; }
.page-option img { inline-size: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.page-option:hover, .page-option[aria-current="page"] { border-color: var(--brand); }
.reader.immersive, .reader:fullscreen { inline-size: 100%; block-size: 100dvh; border-radius: 0; }
.reader:fullscreen { block-size: 100%; }

@media (prefers-reduced-motion: reduce) {
  .page-sheet.turn-next, .page-sheet.turn-previous { animation: none; }
}

@media (max-width: 720px) {
  .header { min-block-size: 75px; }
  .header .brand img { inline-size: 61px; block-size: auto; }
  .reader { inline-size: 100%; block-size: 100dvh; margin: 0; border-radius: 0; }
  .reader-stage { padding: 2px; }
  .reader-toolbar { justify-content: center; column-gap: 12px; }
  .reader-panel { inset-block-end: 105px; }
}

@media (max-width: 455px) {
  .header .contact span { display: none; }
}
