/* Layout: a black sheet with hairlines. English sits left, Arabic sits right, mirrored. One red. */
:root {
  --bg: #050505;
  --surface: #0b0b0b;
  --rule: #1c1c1c;
  --ink: #ebebeb;
  --soft: #9a9a9a;
  --faint: #666666;
  --red: #b30000;
  --fajr: #cdb4ac;
  --dhuhr: #ffffff;
  --asr: #ffa000;
  --maghrib: #ff3a00;
  --isha: #b00038;
  --display: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --arabic: "IBM Plex Sans Arabic", "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif;
  --arabic-display: "Noto Naskh Arabic", "Geeza Pro", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--display); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.wrap {
  max-width: 1200px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.mono b { color: var(--ink); font-weight: 500; }
[lang="ar"] { font-family: var(--arabic); letter-spacing: 0; text-transform: none; }
/* Arabic mirrors the English beside it: same size and weight, pinned to the right edge even when the row wraps. */
.pair > [lang="ar"] { margin-left: auto; text-align: right; }
.mono [lang="ar"], .mono[lang="ar"] { font-size: 12px; font-weight: 400; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-inline-end: 10px; }

/* English left, Arabic right. */
.pair { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; }
.bar { padding-block: 18px; border-bottom: 1px solid var(--rule); align-items: center; }
.bar [lang="ar"] { color: var(--soft); }
.bar a:hover { color: var(--ink); }
main { flex: 1; }
footer.pair { padding-block: 18px; border-top: 1px solid var(--rule); margin-top: 48px; }
footer a:hover { color: var(--ink); }

/* Home */
.hero { padding-block: clamp(48px, 12vw, 140px) clamp(40px, 9vw, 110px); display: grid; gap: 18px; }
.hero h1 { --h: clamp(56px, 13vw, 150px); margin: 0; font-weight: 700; font-size: var(--h); line-height: 1; letter-spacing: -.04em; }
.hero h1[lang="ar"] { letter-spacing: 0; line-height: 1.25; color: var(--red); }
/* Large Arabic is set in a calligraphic naskh; it runs small, so it is scaled up to sit level with the English. */
h1[lang="ar"], .work .title [lang="ar"] { font-family: var(--arabic-display); font-weight: 700; font-size: 1.16em; }
.hero h1[lang="ar"], .head h1[lang="ar"] { font-size: calc(1.16 * var(--h)); }
.names { align-items: center; }
.section { border-top: 1px solid var(--rule); padding-block: 14px; }
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.work { display: grid; gap: 14px; padding-block: 10px 0; }
.work .frame { border: 1px solid var(--rule); background: var(--bg); position: relative; }
.work .frame::before { content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px; border-top: 1px solid var(--red); border-left: 1px solid var(--red); }
.work img { width: 100%; height: auto; max-width: 620px; margin: 0 auto; aspect-ratio: 1; }
.work .title { font-weight: 700; font-size: clamp(20px, 3.4vw, 30px); letter-spacing: -.02em; }
.work:hover .go { color: var(--red); }
.work .go { transition: color .15s; }

/* Piece */
.head { padding-block: clamp(28px, 6vw, 64px) clamp(18px, 3vw, 28px); align-items: flex-end; }
.head h1 { --h: clamp(48px, 11vw, 124px); margin: 0; font-weight: 700; font-size: var(--h); line-height: .9; letter-spacing: -.04em; }
.head h1[lang="ar"] { letter-spacing: 0; line-height: 1; color: var(--red); }
.line { padding-bottom: 20px; color: var(--soft); font-size: 15px; }

.transport { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; border-block: 1px solid var(--rule); padding-block: 12px; }
.play { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: var(--red); border: 0; border-radius: 0; padding: 13px 18px 13px 15px; }
.play:hover { background: #d00000; }
.play svg { width: 11px; height: 11px; fill: currentColor; }
.clock { font-weight: 700; font-size: clamp(20px, 3vw, 28px); letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; min-width: 14ch; white-space: nowrap; }
.clock small { font: 400 10px var(--mono); letter-spacing: .14em; color: var(--faint); margin-left: 8px; }
.clock small { text-transform: uppercase; }
.clock small [lang="ar"] { font-size: 11px; }
.seg { display: flex; border: 1px solid var(--rule); }
.seg button { font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); background: transparent; border: 0; border-right: 1px solid var(--rule); border-radius: 0; padding: 10px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.seg button [lang="ar"] { font-size: 11px; line-height: 1; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.slide { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 0; white-space: nowrap; }
.slide input { flex: 1; min-width: 0; accent-color: var(--red); }

.stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-block: 16px; }
.panel { border: 1px solid var(--rule); background: var(--surface); padding: 12px; position: relative; min-width: 0; }
.panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px; border-top: 1px solid var(--red); border-left: 1px solid var(--red); }
.globe, .rose { position: relative; aspect-ratio: 1; width: 100%; max-width: 540px; margin: 0 auto; }
.globe canvas, .rose canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#g-top { cursor: grab; touch-action: none; }
/* The An disc is an image on black; screen blending lets the panel show through the black. */
#rose.blend { mix-blend-mode: screen; }

.key { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key i { width: 9px; height: 9px; display: inline-block; }
.key [lang="ar"] { color: var(--ink); }
.key b { font-variant-numeric: tabular-nums; min-width: 3.4ch; }
.key .makkah { margin-inline-start: auto; color: var(--ink); }

/* Close-ups of the print, under each piece. */
.details { margin-top: 48px; }
.zoom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-top: 10px; }
.zoom .frame { display: block; border: 1px solid var(--rule); position: relative; }
.zoom .frame::before { content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px; border-top: 1px solid var(--red); border-left: 1px solid var(--red); }
.zoom img { width: 100%; height: auto; aspect-ratio: 1; }

@media (max-width: 720px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .works { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .key .makkah { margin-inline-start: 0; flex-basis: 100%; }
  .hide-s { display: none; }
  .zoom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
