@font-face {
  font-family: Geologica;
  src: url(../fonts/geologica-latin-shrp-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Scheherazade New";
  src: url(../fonts/scheherazade-new-arabic-700-normal.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0020-0022, U+00A0, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC;
}
@font-face {
  font-family: "Scheherazade New";
  src: url(../fonts/scheherazade-new-arabic-400-normal.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0020-0022, U+00A0, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC;
}
@font-face {
  font-family: Beiruti;
  src: url(../fonts/beiruti-arabic-wght-normal.woff2) format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0020-0022, U+00A0, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC;
}
@font-face {
  font-family: "Geologica fallback";
  src: local(Arial);
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122, U+2190-2193;
}
@font-face {
  font-family: "Beiruti fallback";
  src: local(Tahoma), local("Noto Sans Arabic"), local("NotoSansArabic-Regular"), local("Noto Naskh Arabic"), local("NotoNaskhArabic-Regular");
  size-adjust: 92%;
  ascent-override: 105%;
  descent-override: 45%;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --ghor: #17392B;
  --ghor-deep: #0F2A1F;
  --feldspar: #F0CBBB;
  --brass: #D3A74C;
  --leaf: #8FB27B;
  --ishrin: #CB7650;
  --sand: #E5AC86;
  --granite: #1F1618;
  --mica: #4A3434;
  --rift: #7E3320;
  --ease-settle: cubic-bezier(.2, .7, .1, 1);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 20px; --s5: 32px; --s6: 52px; --s7: 84px; --s8: 136px;
  --margin: 16px;
  --gutter: 12px;
  --cols: 5;
  --latin: Geologica, "Geologica fallback", "Scheherazade New", Arial, sans-serif;
  --arabic: Beiruti, "Beiruti fallback", Geologica, Tahoma, sans-serif;
  --naskh: "Scheherazade New", "Times New Roman", serif;
  --naskh-num: "Scheherazade New", Geologica, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.08 0 0 0 0 0.09 0 0 0 1.4 -0.45'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (min-width: 768px) {
  :root { --margin: 32px; --gutter: 16px; --cols: 10; }
}
@media (min-width: 1100px) {
  :root { --margin: clamp(24px, 3.2vw, 56px); --gutter: 20px; --cols: 15; }
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: var(--ease-settle); }
.head { view-transition-name: header; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--granite); scrollbar-width: thin; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--latin);
  font-weight: 360;
  font-variation-settings: "SHRP" 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--granite);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 768px) { body { font-size: 18px; line-height: 1.62; } }
:lang(ar) { font-family: var(--arabic); }
html[lang=ar] body { font-family: var(--arabic); font-weight: 400; font-size: 18px; line-height: 1.85; word-spacing: .1em; }
html[lang=ar] :is(h1, h2, .now-main, .sb-ar, .mq-abjad) { word-spacing: .04em; }
@media (min-width: 768px) { html[lang=ar] body { font-size: 19px; line-height: 1.9; } }
[lang=en] { font-family: var(--latin); }
html[lang=ar] [lang=en] { font-weight: 360; word-spacing: 0; }
:lang(ar) { word-spacing: .1em; }

::selection { background: var(--brass); color: var(--granite); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd { font: inherit; }
.num, .cap .num { font-variant-numeric: tabular-nums lining-nums; }

.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 50;
  background: var(--feldspar); color: var(--granite); padding: 10px 14px; border-radius: 2px;
}
.skip:focus { top: 12px; }

/* grounds */
.g-ghor { background-color: var(--ghor); color: var(--feldspar); --line: var(--feldspar); --focus: var(--brass); --ul: color-mix(in srgb, var(--feldspar) 55%, transparent); --ul-hover: var(--feldspar); }
.g-ishrin { background-color: var(--ishrin); background-image: var(--grain); color: var(--granite); --line: var(--granite); --focus: var(--granite); --ul: var(--granite); --ul-hover: var(--granite); }
.g-sand { background-color: var(--sand); background-image: var(--grain); color: var(--granite); --line: var(--granite); --focus: var(--granite); --ul: var(--rift); --ul-hover: var(--granite); }
.g-granite { background-color: var(--granite); color: var(--feldspar); --line: var(--feldspar); --focus: var(--brass); --ul: color-mix(in srgb, var(--feldspar) 55%, transparent); --ul-hover: var(--feldspar); }
.g-ghor ::selection, .g-granite ::selection { background: var(--brass); color: var(--granite); }
html { scrollbar-color: color-mix(in srgb, var(--granite) 60%, transparent) var(--sand); }
.pg-home, .pg-maqamat { scrollbar-color: color-mix(in srgb, var(--feldspar) 40%, transparent) var(--ghor); }

:focus-visible { outline: 2px solid var(--focus, var(--granite)); outline-offset: 2px; }

/* grid: fifteen courses, ten, five */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  max-width: calc(1600px + 2 * var(--margin));
  margin-inline: auto;
}
.grid > * { grid-column: var(--m, 1 / -1); min-width: 0; }
@media (min-width: 768px) { .grid > * { grid-column: var(--t, 1 / -1); } }
@media (min-width: 1100px) { .grid > * { grid-column: var(--d, 1 / -1); } }

.sec { padding-block: calc(var(--pt) * .62) calc(var(--pb) * .62); }
@media (min-width: 768px) { .sec { padding-block: calc(var(--pt) * .8) calc(var(--pb) * .8); } }
@media (min-width: 1100px) { .sec { padding-block: var(--pt) var(--pb); } }

/* type */
h1 {
  font-weight: 620;
  font-variation-settings: "SHRP" 100;
  font-size: clamp(50px, 7.6vw, 132px);
  line-height: .9;
  letter-spacing: -.058em;
  margin-block-end: var(--s5);
}
h2 {
  font-weight: 460;
  font-variation-settings: "SHRP" 80;
  font-size: clamp(32px, 3.9vw, 62px);
  line-height: 1;
  letter-spacing: -.035em;
  margin-block-end: var(--s4);
}
h3 { font-weight: 560; font-variation-settings: "SHRP" 20; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.ar-term {
  font-family: var(--naskh); font-weight: 700; letter-spacing: 0; margin: 0;
  font-size: clamp(56px, 6.2vw, 100px); line-height: 1.5; margin-block-end: .25em; direction: rtl; text-align: end; align-self: end;
  color: color-mix(in srgb, var(--granite) 82%, transparent);
}
html[lang=ar] h1 { font-family: var(--naskh); font-weight: 700; letter-spacing: 0; line-height: 1.18; font-size: clamp(50px, 7vw, 120px); }
html[lang=ar] h2 { font-family: var(--naskh); font-weight: 700; letter-spacing: 0; line-height: 1.25; font-size: clamp(34px, 4.2vw, 64px); }
html[lang=ar] h3 { font-family: var(--arabic); font-weight: 700; font-size: 22px; line-height: 1.4; letter-spacing: 0; }
.lede { font-weight: 400; font-size: 19px; line-height: 1.5; }
@media (min-width: 768px) { .lede { font-size: 21px; } }
html[lang=ar] .lede { font-weight: 500; font-size: 20px; line-height: 1.75; }
@media (min-width: 768px) { html[lang=ar] .lede { font-size: 22px; } }
.cap { font-weight: 450; font-size: 14px; line-height: 1.45; letter-spacing: .004em; }
html[lang=ar] .cap { font-weight: 500; font-size: 15px; line-height: 1.6; letter-spacing: 0; }
.prose > p, .prose li { max-width: 64ch; }
html[lang=ar] .prose > p { max-width: 58ch; }

a:not([class]), .plink {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--ul);
  transition: text-decoration-color 120ms, text-decoration-thickness 120ms;
}
a:not([class]):hover, .plink:hover { text-decoration-thickness: 2px; text-decoration-color: var(--ul-hover); }
.plink { font-weight: 520; }

/* lever buttons */
.lever-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-weight: 520;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.g-sand .lever-btn, .g-ishrin .lever-btn { border-color: var(--granite); }
html[lang=ar] .lever-btn { font-family: var(--arabic); font-weight: 600; font-size: 15px; letter-spacing: 0; }
.lever-btn::before {
  content: "";
  position: absolute;
  inset-block: -1px;
  inset-inline-start: -1px;
  width: 3px;
  background: var(--brass);
  transform: scaleY(0);
  transition: transform 120ms var(--ease-settle);
}
.g-sand .lever-btn::before, .g-ishrin .lever-btn::before { background: var(--granite); }
.lever-btn:hover::before { transform: scaleY(1); }
.g-ghor .lever-btn:hover, .g-granite .lever-btn:hover { background: var(--ghor-deep); }
.g-sand .lever-btn:hover, .g-ishrin .lever-btn:hover { background: rgba(31, 22, 24, .06); }
.lever-btn:active { transform: translateY(1px); }
.lever-btn[aria-pressed=true] { background: var(--feldspar); color: var(--ghor); border-color: var(--feldspar); }
.g-sand .lever-btn[aria-pressed=true], .g-ishrin .lever-btn[aria-pressed=true] { background: var(--granite); color: var(--sand); }
.lever-btn[aria-pressed=true]:hover { background: var(--feldspar); }
.g-sand .lever-btn[aria-pressed=true]:hover { background: var(--granite); }
.textbtn {
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--ul);
}
.textbtn:hover { text-decoration-thickness: 2px; text-decoration-color: var(--ul-hover); }

.speaker { width: 20px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.speaker path:first-child { fill: currentColor; stroke: none; }
.speaker .cross { display: none; }
[data-state=on] .speaker .waves, [aria-pressed=true] .speaker .waves { display: inline; }
.speaker .waves { display: none; }
[data-state=muted] .speaker .cross { display: inline; }

/* header */
.head { position: relative; z-index: 20; }
.head-in { align-items: center; padding-block: 18px; row-gap: 8px; }
.mark { --m: 1 / 3; display: inline-flex; align-items: baseline; gap: .4em; text-decoration: none; color: inherit; font-weight: 640; font-variation-settings: "SHRP" 100; letter-spacing: -.02em; font-size: 26px; line-height: 1; white-space: nowrap; }
.mark .wm-ar { font-family: var(--naskh); font-weight: 700; font-size: 112%; letter-spacing: 0; line-height: 1; }
.nav, .lang-head { display: none; }
.sound-toggle {
  --m: 3 / 5; justify-self: end;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent); border-radius: 2px; background: none; cursor: pointer;
  font-size: 13px; font-weight: 520; letter-spacing: .02em; white-space: nowrap;
}
html[lang=ar] .sound-toggle { font-weight: 600; font-size: 14px; letter-spacing: 0; }
.sound-toggle:hover { background: color-mix(in srgb, var(--line) 8%, transparent); }
.sound-toggle[aria-pressed=true] { border-color: var(--brass); }
.sound-toggle:not([aria-pressed=true]) .speaker .cross { display: inline; }
.g-sand .sound-toggle[aria-pressed=true], .g-ishrin .sound-toggle[aria-pressed=true] { border-color: var(--granite); background: rgba(31, 22, 24, .08); }
.menu-btn { --m: 5 / 6; justify-self: end; min-height: 40px; padding: 6px 0; border: 0; background: none; cursor: pointer; font-weight: 520; font-size: 14px; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--ul); }
.vh, .sound-toggle .vh-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 420px) { .sound-toggle [data-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .sound-toggle { --m: 4 / 5; } }
@media (min-width: 768px) {
  .mark { --t: 1 / 4; font-size: 28px; }
  .nav { --t: 4 / 9; display: flex; gap: 22px; justify-content: flex-start; }
  .lang-head { --t: 9 / 10; display: block; justify-self: end; }
  .sound-toggle { --t: 10 / 11; }
  .sound-toggle [data-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .menu-btn { display: none; }
}
@media (min-width: 1100px) {
  .mark { --d: 1 / 5; font-size: 30px; }
  .nav { --d: 6 / 12; gap: 28px; }
  .lang-head { --d: 12 / 14; }
  .sound-toggle { --d: 14 / 16; }
  .sound-toggle [data-label] { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}
@media (min-width: 768px) { .head-in.quiet .lang-head { --t: 10 / 11; } }
@media (min-width: 1100px) { .head-in.quiet .lang-head { --d: 15 / 16; } }
.nav a, .lang-head { text-decoration: none; font-weight: 520; font-size: 15px; padding-block: 6px; border-block-end: 2px solid transparent; }
html[lang=ar] .nav a, html[lang=ar] .lang-head { font-weight: 600; font-size: 16px; }
.nav a:hover, .lang-head:hover { border-block-end-color: color-mix(in srgb, var(--line) 40%, transparent); }
.nav a[aria-current=page] { border-block-end-color: currentColor; }
.lang-head[lang=ar] { font-family: var(--arabic); font-weight: 600; font-size: 17px; }

.sheet { position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: 24px var(--margin) 40px; display: flex; flex-direction: column; justify-content: space-between; }
.sheet[hidden] { display: none; }
.sheet-nav { display: flex; flex-direction: column; gap: 6px; padding-top: 56px; }
.sheet-nav a { font-size: 32px; font-weight: 580; font-variation-settings: "SHRP" 70; letter-spacing: -.02em; text-decoration: none; padding-block: 6px; }
html[lang=ar] .sheet-nav a { font-family: var(--naskh); font-weight: 700; font-size: 34px; letter-spacing: 0; }
.sheet-nav a:first-child { font-size: 17px; font-weight: 450; letter-spacing: 0; text-decoration: underline; text-decoration-color: var(--ul); text-underline-offset: .2em; margin-bottom: 16px; }
html[lang=ar] .sheet-nav a:first-child { font-family: var(--arabic); font-size: 18px; font-weight: 500; }
.sheet-nav a[aria-current=page] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 32px; }
.menu-open body { overflow: hidden; }

/* footer */
.foot { padding-block: 64px 28px; font-size: 15px; }
.foot-in { row-gap: 32px; }
.foot-concept p:first-child { font-weight: 450; font-size: 17px; line-height: 1.5; max-width: 46ch; }
html[lang=ar] .foot-concept p:first-child { font-weight: 500; font-size: 18px; line-height: 1.75; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { text-decoration: none; border-block-end: 1px solid var(--ul); }
.foot a:hover { border-block-end-color: var(--feldspar); }
.foot-base { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--feldspar) 22%, transparent); font-size: 13px; }
@media (min-width: 768px) {
  .foot-concept { --t: 1 / 6; }
  .foot-nav { --t: 6 / 9; }
}
@media (min-width: 1100px) {
  .foot-concept { --d: 1 / 8; }
  .foot-nav { --d: 9 / 12; }
}

/* ------------------------------------------------ hero instrument */
.hero { padding-block: clamp(12px, 2.6vh, 40px) 40px; outline: none; }
.hero-grid { row-gap: 0; }
.hero-text h1 { font-size: clamp(38px, 10.5vw, 50px); margin-block-end: 16px; letter-spacing: -.05em; }
html[lang=ar] .hero-text h1 { font-size: clamp(40px, 11vw, 54px); }
.hero-text .lede { margin-block-end: 10px; }
.lede-long { display: none; }
.concept { opacity: .82; margin-block-end: 20px; }
.now-head { margin-block-end: 14px; }
.now-line { margin: 0 0 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.now-main { font-weight: 480; font-variation-settings: "SHRP" 60; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.now-other { font-family: var(--naskh); font-weight: 700; font-size: 26px; line-height: 1.3; }
html[lang=ar] .now-main { font-family: var(--naskh); font-weight: 700; font-size: 32px; line-height: 1.6; letter-spacing: 0; }
html[lang=ar] .now-other { font-family: var(--latin); font-weight: 480; font-size: 16px; margin-top: .35em; }
.now-ajnas { opacity: .82; margin-block-end: 8px; }
.now-hold { color: var(--brass); margin-block-end: 2px; }
.now-status { min-height: 1.45em; margin: 0; opacity: .82; }
.now-sound { margin-block-end: 16px; }
.noaudio { padding: 12px 0; }

/* upper jins: a two-way switch under the ajnas line */
.upper { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.upper[hidden] { display: none; }
.upper legend { float: inline-start; padding: 0; margin: 0; font-weight: 500; font-size: 12.5px; letter-spacing: .02em; opacity: .86; }
html[lang=ar] .upper legend { font-family: var(--arabic); font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.up-col { display: inline-flex; border: 1px solid color-mix(in srgb, var(--feldspar) 40%, transparent); border-radius: 2px; }
.up-btn { border: 0; background: none; cursor: pointer; padding: 6px 10px; min-height: 32px; font-weight: 480; font-size: 13px; color: inherit; }
html[lang=ar] .up-btn { font-weight: 600; font-size: 14px; }
.up-btn + .up-btn { border-inline-start: 1px solid color-mix(in srgb, var(--feldspar) 40%, transparent); }
.up-btn:hover { background: var(--ghor-deep); }
.up-btn[aria-pressed=true] { background: var(--feldspar); color: var(--ghor); }

/* maqam selector: abjad tiles, the chosen one seated on a brass rail */
.maqam-pick { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.maqam-pick legend, .paths .legend { display: block; padding: 0; margin-bottom: 8px; font-weight: 500; font-size: 12.5px; letter-spacing: .02em; opacity: .86; }
html[lang=ar] .maqam-pick legend, html[lang=ar] .paths .legend { font-family: var(--arabic); font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.mq-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-block-end: 1px solid color-mix(in srgb, var(--feldspar) 30%, transparent); }
.mq {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-height: 56px; padding: 6px 8px 10px; border: 0; background: none; color: inherit; cursor: pointer; text-align: start;
  transition: background-color 120ms, color 120ms;
}
.mq::after { content: ""; position: absolute; inset-inline: 6px; bottom: -1px; height: 3px; background: var(--brass); transform: scaleX(0); transform-origin: var(--from, left); transition: transform 220ms var(--ease-settle); }
html[dir=rtl] .mq::after { --from: right; }
.mq:hover { background: var(--ghor-deep); }
.mq[aria-pressed=true]::after { transform: scaleX(1); }
.mq[aria-pressed=true] .mq-name { color: var(--feldspar); font-weight: 600; }
.mq-top { display: flex; align-items: baseline; gap: 6px; width: 100%; }
.mq-abjad { display: block; font-family: var(--naskh); font-weight: 700; font-size: 22px; line-height: 1.35; padding-bottom: 2px; color: var(--brass); }
.mq-name { display: block; font-size: 13.5px; font-weight: 480; line-height: 1.2; white-space: nowrap; color: color-mix(in srgb, var(--feldspar) 86%, transparent); }
html[lang=ar] .mq-name { font-size: 15px; font-weight: 600; }
.mq kbd { font-size: 11px; opacity: .55; display: none; }
@media (pointer: fine) { .mq kbd { display: inline; } }

/* moves: brass-tabbed, like a lever seated in its notch */
.paths { margin-bottom: 14px; }
.paths ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.path {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "to count" "move move";
  align-items: baseline; gap: 0 12px; text-align: start; padding: 5px 10px 6px 20px; min-height: 44px; line-height: 1.25;
  border: 0; border-radius: 2px; background: var(--ghor-deep); color: inherit; cursor: pointer;
}
html[dir=rtl] .path { padding: 5px 20px 6px 10px; }
.path:hover, .path.is-hi { background: #0B2219; }
.path:active { transform: translateY(1px); }
.path-to { grid-area: to; font-weight: 560; font-size: 14.5px; display: inline-flex; align-items: baseline; gap: 6px; }
html[lang=ar] .path-to { font-size: 16px; font-weight: 600; }
.path-abjad { font-family: var(--naskh); font-weight: 700; font-size: 17px; color: var(--brass); }
.path-move { grid-area: move; font-weight: 400; font-size: 12.5px; opacity: .92; letter-spacing: 0; }

.now-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-block: 18px 8px; }
.ctl { border: 0; padding: 0; margin: 0; min-width: 0; }
.ctl legend, .ctl > label, .legend { display: block; padding: 0; margin-bottom: 6px; font-weight: 500; font-size: 12.5px; line-height: 1.2; letter-spacing: .02em; opacity: .86; }
html[lang=ar] .ctl legend, html[lang=ar] .ctl > label, html[lang=ar] .legend { font-family: var(--arabic); font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.segs { display: flex; flex-wrap: nowrap; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; padding: 7px 10px; min-height: 34px; white-space: nowrap; border: 1px solid color-mix(in srgb, var(--feldspar) 45%, transparent);
  margin-inline-end: -1px; font-weight: 480; font-size: 12.5px; line-height: 1.4; transition: background-color 120ms;
}
html[lang=ar] .seg span { font-weight: 600; font-size: 13.5px; }
.seg:first-child span { border-start-start-radius: 2px; border-end-start-radius: 2px; }
.seg:last-child span { border-start-end-radius: 2px; border-end-end-radius: 2px; margin-inline-end: 0; }
.seg:hover span { background: var(--ghor-deep); }
.seg input:checked + span { background: var(--feldspar); color: var(--ghor); border-color: var(--feldspar); }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; position: relative; z-index: 1; }
.ctl.vol { grid-column: 1 / -1; }
.now-controls .ctl:nth-child(2), .now-controls .ctl:nth-child(3) { grid-column: 1 / -1; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; max-width: 220px; height: 28px; background: none; cursor: pointer; margin: 0;
  --v: 63%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 1px;
  background: linear-gradient(to right, color-mix(in srgb, var(--brass) 60%, transparent) var(--v), transparent var(--v)), var(--ghor-deep);
  border: 1px solid color-mix(in srgb, var(--feldspar) 40%, transparent);
}
input[type=range]::-moz-range-track { height: 6px; background: var(--ghor-deep); border: 1px solid color-mix(in srgb, var(--feldspar) 40%, transparent); }
input[type=range]::-moz-range-progress { height: 6px; background: color-mix(in srgb, var(--brass) 60%, transparent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 22px; margin-top: -9px; border-radius: 1px; background: var(--brass); border: 1px solid var(--granite); }
input[type=range]::-moz-range-thumb { width: 10px; height: 22px; border-radius: 1px; background: var(--brass); border: 1px solid var(--granite); }
.g-sand input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--granite) var(--v), transparent var(--v)), rgba(31,22,24,.08); border-color: var(--granite); }
.g-sand input[type=range]::-moz-range-track { background: rgba(31,22,24,.08); border-color: var(--granite); }
.g-sand input[type=range]::-moz-range-progress { background: var(--granite); }
html[dir=rtl] input[type=range] { direction: rtl; }
html[dir=rtl] input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to left, color-mix(in srgb, var(--brass) 60%, transparent) var(--v), transparent var(--v)), var(--ghor-deep); }
html[dir=rtl] .g-sand input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--granite) var(--v), transparent var(--v)), rgba(31,22,24,.08); }

.bed-wrap { margin-block: 6px 16px; }
.bed {
  position: relative; height: min(66svh, 580px); min-height: 420px; outline: none;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  cursor: url(../img/risha.svg) 4 3, crosshair;
}
.bed[data-orient=horizontal] { touch-action: none; }
.bed[data-lever=true] { cursor: grab; }
.bed[data-grab=true] { cursor: grabbing; }
.bed canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.bed .rosette { position: absolute; color: color-mix(in srgb, var(--feldspar) 42%, transparent); pointer-events: none; overflow: visible; }
.bed:focus-visible { outline: none; }

.hint-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; padding-top: 2px; }
.hint { margin: 0; opacity: .82; max-width: 80ch; }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) { .hint-fine { display: none; } .hint-touch { display: inline; } }
html[data-touch] .hint-fine { display: none; }
html[data-touch] .hint-touch { display: inline; }
.where-h, .where-v { display: none; }
html:not([data-bed=vertical]) .where-h, html[data-bed=vertical] .where-v { display: inline; }
.hint-btns { display: flex; gap: 20px; margin: 0; font-size: 14px; }
html[lang=ar] .hint-btns { font-size: 15px; }
.textbtn[hidden] { display: none; }
.string-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; padding-top: 14px; }
.string-buttons[hidden] { display: none; }
.sb { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 10px; min-height: 64px; }
.sb-abjad { font-family: var(--naskh); font-size: 13px; opacity: .7; }
.sb-ar { font-family: var(--naskh); font-weight: 700; font-size: 18px; line-height: 1.25; }
.sb-lat { font-size: 11.5px; opacity: .85; }
.sb.is-qarar { border-color: var(--brass); }
.sb.is-qarar .sb-ar { color: var(--brass); }

/* the two hero columns only exist on wide screens; below that their parts join the hero grid */
.hero-left, .hero-right { display: contents; }
.hero-left > *, .hero-right > * { grid-column: var(--m, 1 / -1); min-width: 0; }
@media (min-width: 768px) { .hero-left > *, .hero-right > * { grid-column: var(--t, 1 / -1); } }

/* phones: text, now, sound, the bed, then what changes it */
.hero-text { order: 1; }
.now-head { order: 2; }
.now-sound { order: 3; }
.bed-wrap { order: 4; }
.maqam-pick { order: 5; }
.paths { order: 6; }
.now-controls { order: 7; }
.hint-row { order: 8; }
.string-buttons { order: 9; }

@media (min-width: 768px) {
  .lede-long { display: block; }
  .lede-short { display: none; }
  .hero-text { --t: 1 / 11; }
  .hero-text h1 { font-size: clamp(48px, 7.4vw, 80px); }
  html[lang=ar] .hero-text h1 { font-size: clamp(52px, 8vw, 92px); }
  .now-head { --t: 1 / 7; order: 2; }
  .now-sound { --t: 7 / 11; order: 3; align-self: start; }
  .maqam-pick { --t: 1 / 11; order: 4; }
  .mq-row { grid-template-columns: repeat(8, minmax(max-content, 1fr)); }
  .paths { --t: 1 / 11; order: 5; }
  .paths ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bed-wrap { order: 6; }
  .hint-row { --t: 1 / 11; order: 7; }
  .now-controls { --t: 1 / 11; order: 8; display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: end; margin-block: 22px 0; }
  .string-buttons { order: 9; }
  .bed { height: clamp(320px, 46vh, 480px); min-height: 0; }
}
@media (min-width: 1100px) {
  .hero-left { --d: 1 / 9; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(14px, 2.4vh, 32px); padding-top: clamp(4px, 1.6vh, 28px); }
  .hero-right { --d: 10 / 16; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding-top: clamp(4px, 1.6vh, 28px); }
  .hero-text h1 { font-size: clamp(44px, min(4.6vw, 7.4vh), 104px); max-width: 11em; margin-block-end: clamp(12px, 2vh, 24px); }
  html[lang=ar] .hero-text h1 { font-size: clamp(46px, min(4.6vw, 7vh), 104px); line-height: 1.12; }
  .hero-text .lede { max-width: 60ch; font-size: clamp(18px, 1.25vw, 21px); }
  .concept { margin-block-end: 0; }
  .now-head { margin-block-end: 0; }
  .now-main { font-size: 28px; }
  .now-other { font-size: 32px; }
  html[lang=ar] .now-main { font-size: 40px; }
  .now-sound { margin-block-end: 0; align-self: stretch; }
  .maqam-pick, .paths { margin: 0; }
  .bed-wrap { --d: 1 / -1; grid-row: 2; margin-block: clamp(12px, 2vh, 24px) 14px; }
  .bed { height: clamp(320px, 41vh, 520px); }
  .hint-row { --d: 1 / -1; grid-row: 3; }
  .now-controls { --d: 1 / -1; grid-row: 4; }
  .string-buttons { --d: 1 / -1; grid-row: 5; }
}
@media (min-width: 1100px) and (max-height: 860px) {
  .hero { padding-top: 4px; }
  .now-line { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
  .now-status { min-height: 0; }
  .hero-text, .now-head { padding-top: 0; }
  .lede-long { display: none; }
  .lede-short { display: block; }
  .now-other { font-size: 26px; }
  .now-main { font-size: 24px; }
  html[lang=ar] .now-main { font-size: 32px; }
  .sound-btn { min-height: 42px; padding-block: 6px; }
  .mq { min-height: 50px; padding-block: 4px 8px; }
  .mq-abjad { font-size: 19px; }
  .path { min-height: 40px; padding-block: 5px 6px; }
  .bed { height: clamp(280px, 38vh, 520px); }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .bed { height: 62svh; min-height: 0; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .mq-row { grid-template-columns: repeat(8, minmax(max-content, 1fr)); }
  .maqam-pick, .paths { --t: 1 / 11; }
}

/* ------------------------------------------------ sections */
.div-wrap { padding-block: 0; }
.divider { height: 28px; color: color-mix(in srgb, var(--granite) 55%, transparent); position: relative; }
.g-ghor .divider { color: color-mix(in srgb, var(--feldspar) 46%, transparent); }
.divider canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.drawing { margin: 0; }
.drawing figcaption { margin-top: 12px; max-width: 60ch; }
.dwg { width: 100%; height: auto; overflow: visible; direction: ltr; --k: 1; }
.dwg .dw, .neighbours line, .minibed path { fill: none; }
.dwg .dw { stroke: currentColor; stroke-width: calc(1.25px * var(--k)); stroke-linecap: round; stroke-linejoin: round; }
.dwg .thin { stroke-width: calc(.9px * var(--k)); }
.dwg .hair { stroke-width: calc(.6px * var(--k)); opacity: .7; }
.dwg .dim, .dwg .ext, .dwg .lead { stroke-width: calc(.75px * var(--k)); }
.dwg .ext { opacity: .55; }
.dwg .hidden { stroke-dasharray: 4 3; stroke-width: calc(.9px * var(--k)); }
.dwg .str { stroke-width: calc(.9px * var(--k)); }
.dwg .ring, .dwg .brass-line { stroke: var(--rift); }
.g-ghor .dwg .ring, .g-ghor .dwg .brass-line { stroke: var(--brass); }
.dwg .trace { stroke: var(--rift); }
.dwg .ht { stroke: currentColor; stroke-width: .75; opacity: .7; }
.dwg .hatch { stroke: none; }
.dwg .paper { fill: var(--sand); stroke: none; }
.g-ghor .dwg .paper { fill: var(--ghor); }
.dwg .brass { fill: var(--brass); stroke: var(--granite); stroke-width: calc(1px * var(--k)); }
.dwg .key-fill { fill: var(--sand); }
.dwg .dot { fill: currentColor; }
.dwg .gl { fill: none; stroke: currentColor; stroke-width: calc(.5px * var(--k)); }
.dwg text { fill: currentColor; font-family: var(--latin); font-weight: 450; }
.dwg .lbl { font-size: calc(13px * var(--k)); }
.dwg .lbl.small { font-size: calc(12px * var(--k)); }
.dwg .lbl.key { font-size: 13px; font-weight: 520; }
html[lang=ar] .dwg .lbl { font-family: var(--arabic); font-weight: 500; font-size: calc(14px * var(--k)); }
html[lang=ar] .dwg .lbl.small { font-size: calc(13px * var(--k)); }
html[lang=ar] .dwg .lbl.key { font-family: var(--latin); }
.dwg .lbl-bg { fill: var(--sand); }
.g-ghor .dwg .lbl-bg { fill: var(--ghor); }
.dwg .abjad-t { font-family: var(--naskh); font-weight: 700; font-size: 14px; }
.dwg .tick { stroke-width: 1.2px; }
.dwg-keys { max-width: 600px; }
.drawing.wide .dwg { max-width: 1180px; }
.entry-other { text-align: left; }
html[dir=rtl] .entry-other { text-align: right; }
.on-ghor .dwg { color: var(--feldspar); }
.dwg .rosette-dw { color: currentColor; }
.dwg .rosette-dw g:first-child circle { stroke: currentColor; }
.dwg .rosette-dw g + g circle { fill: currentColor; stroke: none; }
.dwg .pin-at { fill: none; stroke: none; }

/* stroke-draw entrance */
.js:not(.rm) svg[data-in=draw] .dw { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1200ms var(--ease-settle); }
.js:not(.rm) svg[data-in=draw] .dw.hidden { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0; transition: opacity 600ms 600ms; }
.js:not(.rm) svg[data-in=draw] :is(text, .hatch, .brass, .key-fill, .dot, .gl, .rosette-dw, .paper) { opacity: 0; transition: opacity 500ms 700ms; }
.js:not(.rm) svg[data-in=draw].is-in .dw { stroke-dashoffset: 0; }
.js:not(.rm) svg[data-in=draw].is-in :is(text, .hatch, .brass, .key-fill, .dot, .gl, .rosette-dw, .paper, .dw.hidden) { opacity: 1; }
.dwg-batch .brass { transform: translateY(var(--dy, 0px)); }
.js:not(.rm) .dwg-batch .brass { transition: transform 460ms cubic-bezier(.3, 1.45, .5, 1); }
.js:not(.rm) .dwg-levers [data-lever] { transition: transform 170ms cubic-bezier(.34, 1.56, .64, 1); }
.dwg-batch .course-t:not(.is-q) { opacity: .5; }
.dwg .notch-name, html[lang=ar] .dwg .notch-name { font-family: var(--naskh); font-weight: 700; font-size: calc(15px * var(--k)); }
.dwg-batch .course-t { font-size: 16px; transition: opacity 200ms linear; }
.js:not(.rm) [data-in=photo] img { opacity: 0; transform: scale(1.03); transition: opacity 900ms var(--ease-settle), transform 900ms var(--ease-settle); }
.js:not(.rm) [data-in=photo].is-in img { opacity: 1; transform: none; }
.js:not(.rm) [data-in=fade] { opacity: 0; transition: opacity 500ms linear; }
.js:not(.rm) [data-in=fade].is-in { opacity: 1; }

.scroll-x { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.scroll-x[data-more=true] { -webkit-mask-image: linear-gradient(to var(--fade-end, right), #000 78%, transparent); mask-image: linear-gradient(to var(--fade-end, right), #000 78%, transparent); }
html[dir=rtl] .scroll-x { --fade-end: left; }
.scroll-x:focus-visible { outline-offset: -2px; }
figure[data-pans=true] figcaption::after { content: var(--pan-hint, " Drag sideways for the rest of the drawing."); opacity: .8; }
html[lang=ar] figure[data-pans=true] figcaption::after { --pan-hint: " اسحب جانباً لترى بقية الرسم."; }
@media (max-width: 767px) {
  .scroll-x .dwg-wide { min-width: 640px; }
  .scroll-x { margin-inline: calc(-1 * var(--margin)); padding-inline: var(--margin); }
}

.photo { margin: 0; }
.ph { aspect-ratio: var(--ratio); overflow: hidden; background: var(--granite); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--granite); color: var(--mica); max-width: 60ch; }
.g-ishrin .photo figcaption { color: var(--granite); }

/* home sections */
.howto h2 { margin-bottom: 0; align-self: end; }
.howto-text { margin-top: 18px; }
.howto-text p { max-width: 54ch; }
@media (min-width: 1100px) { .howto-text { margin-top: 0; padding-top: 10px; } }
.keyboard { position: relative; display: grid; gap: 18px 36px; margin-top: 44px; }
.keys-fig { margin: 0; }
.keys-fig .dwg-keys { max-width: 600px; }
.keys-fig figcaption { margin-top: 10px; }
.kn { margin: 0; padding-top: 12px; border-top: 1px solid var(--granite); max-width: 46ch; }
.kn-leads { display: none; }
@media (min-width: 768px) { .keyboard { grid-template-columns: 1fr 1fr; } .keys-fig { grid-column: 1 / -1; } }
@media (min-width: 1100px) {
  .keyboard { direction: ltr; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) minmax(0, 4fr); column-gap: clamp(48px, 6vw, 112px); row-gap: 0; align-items: start; margin-top: 64px; }
  .keys-fig { grid-column: 2; grid-row: 1 / 3; }
  .keys-fig .dwg-keys { max-width: none; }
  .kn { border-top: 0; padding-top: 0; max-width: 34ch; }
  html[dir=rtl] .keyboard > * { direction: rtl; }
  .kn-num { grid-column: 1; grid-row: 1; margin-top: 4px; }
  .kn-home { grid-column: 1; grid-row: 2; align-self: end; margin-bottom: 64px; }
  .kn-reach { grid-column: 3; grid-row: 1; margin-top: 52px; }
  .kn-damp { grid-column: 3; grid-row: 2; align-self: end; margin-bottom: 24px; }
  .kn-leads { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .kn-leads path { fill: none; stroke: var(--granite); stroke-width: .8px; }
  .kn-leads circle { fill: var(--granite); }
}
.dwg-keys .key-fill { transition: fill 140ms linear; }
.dwg-keys .key-fill.is-down { fill: var(--brass); }
.swipe-fig { display: none; margin-top: 24px; }
.swipe-fig .dwg { max-width: 420px; }
@media (pointer: coarse) and (max-width: 767px) {
  .keyboard { display: none; }
  .swipe-fig { display: block; }
}
@media (max-width: 767px) {
  html[data-touch] .keyboard { display: none; }
  html[data-touch] .swipe-fig { display: block; }
}
.parts { list-style: none; margin: 26px 0 26px; padding: 0; }
.parts li { position: relative; margin: 0 0 16px; padding-inline-start: 26px; font-size: 16px; line-height: 1.55; }
.parts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .78em; width: 16px; border-top: 1px solid color-mix(in srgb, var(--feldspar) 55%, transparent); transition: border-color 160ms linear, width 160ms var(--ease-settle); }
.parts li b { display: block; font-weight: 600; font-size: 14px; letter-spacing: .004em; }
html[lang=ar] .parts li { font-size: 17px; line-height: 1.8; }
html[lang=ar] .parts li b { font-size: 16px; }
html[lang=ar] .parts li::before { top: .9em; }
.parts li.is-hot::before { border-top-color: var(--brass); width: 20px; }
.parts li.is-hot b { color: var(--brass); }
.parts li:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.dwg-top .part, .dwg-top .part-label { transition: opacity 200ms linear, color 200ms linear; }
.dwg-top[data-hot] .part:not(.is-hot), .dwg-top[data-hot] .part-label:not(.is-hot) { opacity: .25; }
.dwg-top .is-hot { color: var(--brass); }
.batch-run { margin-bottom: 36px; }
.batch-run .dwg { width: 100%; }
.batch h2 { margin: 0; }
.batch-text .lede { margin-bottom: 18px; }
.batch-run figcaption { margin-top: 12px; max-width: 70ch; }

/* instrument page */
.rooms { display: grid; gap: 10px; margin-top: 28px; }
@media (min-width: 768px) { .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.room-btn { display: grid; gap: 8px; padding: 0 0 10px; border: 0; border-bottom: 1px solid var(--granite); background: none; color: inherit; cursor: pointer; text-align: start; }
.room-btn .impulse { width: 100%; height: auto; color: var(--granite); }
.room-btn .impulse path { fill: none; stroke: currentColor; stroke-width: 1; }
.room-btn .impulse .hair { opacity: .75; }
.room-l { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; }
html[lang=ar] .room-l { font-family: var(--arabic); font-weight: 600; font-size: 16px; }
.room-btn:hover .impulse { color: var(--rift); }
.room-btn:active { transform: translateY(1px); }
.room-btn .room-t { margin-inline-start: auto; opacity: .75; font-weight: 400; }
.back-sec .leaves { font-weight: 400; font-size: 21px; line-height: 1.5; max-width: 40ch; }
html[lang=ar] .back-sec .leaves { font-weight: 500; font-size: 22px; }
.tuning-sec .dawr .dw, .tuning-sec .dawr { color: var(--feldspar); }
.tuning-sec .dawr-name { fill: color-mix(in srgb, var(--feldspar) 70%, transparent); }
.tuning-sec .dawr-name.is-big { fill: var(--feldspar); }
.tuning-sec .dawr-poly, .tuning-sec .dawr-open { stroke: var(--feldspar); fill: none; }
.tuning-sec .dawr-dots circle { fill: var(--brass); stroke: var(--ghor-deep); }
.tuning-sec .dawr-dots circle.is-q { fill: var(--feldspar); }
.tuning-sec .dawr-arcs path { stroke: var(--leaf); opacity: 1; stroke-width: 1.5; }
.tuning-sec .dawr-arcs text { fill: var(--leaf); }
.tuning-sec .mq-s .mq-abjad { color: var(--brass); }
.tuning-sec .mq-s[aria-pressed=true] .mq-abjad { color: var(--ghor); }
.head-sec h1 { margin-bottom: 24px; }
.drawing.wide { margin-bottom: 32px; }
.loop-ctl { display: flex; flex-wrap: wrap; align-items: end; gap: 18px 36px; margin-block: 0 28px; }
.ctl.range label { display: block; font-weight: 520; font-size: 12.5px; letter-spacing: .02em; margin-bottom: 4px; }
html[lang=ar] .ctl.range label { font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.loop-dot { fill: var(--rift); stroke: none; opacity: 0; }
.dawr-fig { margin-bottom: 40px; }
.dawr { width: 100%; max-width: 520px; height: auto; direction: ltr; overflow: visible; }
.dawr .dw { fill: none; stroke: currentColor; stroke-width: 1.25px; }
.dawr .thin { stroke-width: .9px; }
.dawr .hair { stroke-width: .6px; opacity: .6; }
.dawr-name { font-family: var(--naskh); font-weight: 400; font-size: 12px; fill: var(--mica); }
.dawr-name.is-big { font-weight: 700; font-size: 15px; fill: var(--granite); }
.dawr-poly, .dawr-open { fill: none; stroke: var(--granite); stroke-width: 1.25; }
.dawr-poly { fill: none; }
.dawr-dots circle { fill: var(--rift); stroke: var(--granite); stroke-width: 1; }
.dawr-dots circle.is-q { fill: var(--granite); }
.dawr-arcs path { fill: none; stroke: var(--granite); stroke-width: 2; opacity: .55; }
.dawr-arcs text { font-family: var(--latin); font-size: 12px; fill: var(--granite); font-weight: 520; }
html[lang=ar] .dawr-arcs text { font-family: var(--arabic); font-size: 13px; font-weight: 600; }
.dawr-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; max-width: 560px; }
.mq-s { padding: 8px 10px; min-height: 40px; gap: 6px; }
.mq-s .mq-abjad { color: var(--granite); font-size: 17px; line-height: 1.2; padding: 0; }
.mq-s[aria-pressed=true] .mq-abjad { color: var(--feldspar); }
.hear { margin-inline-start: 8px; }
.rooms { display: grid; gap: 8px; align-content: start; margin-top: 8px; }
.room-btn { justify-content: flex-start; }
.room-t { margin-inline-start: auto; opacity: .7; font-weight: 450; }

/* maqamat */
.pg-maqamat main { background: var(--ghor); }
.glossary { margin: 8px 0 0; display: grid; gap: 14px; align-self: start; }
.glossary div { border-top: 1px solid color-mix(in srgb, var(--feldspar) 22%, transparent); padding-top: 10px; }
.glossary dt { font-weight: 600; font-size: 16px; }
html[lang=ar] .glossary dt { font-family: var(--naskh); font-weight: 700; font-size: 20px; }
.glossary dd { margin: 2px 0 0; font-weight: 450; font-size: 14px; line-height: 1.45; }
html[lang=ar] .glossary dd { font-weight: 500; font-size: 15px; line-height: 1.6; }
@media (min-width: 1100px) { .glossary { grid-row: 2 / 4; margin-top: 0; } }
.entries-in { row-gap: 0; }
.entry {
  display: grid; grid-template-columns: subgrid; grid-column: 1 / -1;
  padding-block: 56px; border-top: 1px solid color-mix(in srgb, var(--feldspar) 22%, transparent);
  scroll-margin-top: 24px;
}
.entry > * { grid-column: 1 / -1; }
.entry-names h2 { margin: 0; font-size: clamp(38px, 4.4vw, 72px); font-weight: 340; }
.entry-link { color: inherit; text-decoration: underline 1px color-mix(in srgb, var(--feldspar) 30%, transparent); text-underline-offset: .14em; text-decoration-skip-ink: auto; transition: text-decoration-color 120ms linear; }
.entry-link:hover { text-decoration-color: var(--feldspar); }
.entry-link:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
.entry-other { font-family: var(--naskh); font-weight: 700; font-size: 32px; line-height: 1.3; margin: 2px 0 0; }
html[lang=ar] .entry-other { font-family: var(--latin); font-weight: 480; font-size: 18px; }
.entry-q { opacity: .82; margin: 8px 0 18px; }
.entry-strip { display: block; width: 100%; margin: 0 0 20px; padding: 10px 12px 2px; border: 0; border-radius: 2px; background: none; color: inherit; font: inherit; text-align: start; cursor: url(../img/risha.svg) 4 3, pointer; transition: background-color 160ms linear; }
.entry-strip:hover, .entry-strip[aria-pressed=true] { background: var(--ghor-deep); }
.entry-strip:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.entry-strip:hover .st-lever { fill: #E2BC6A; }
.entry-strip:hover .st-slot { stroke: color-mix(in srgb, var(--feldspar) 70%, transparent); }
.strip { width: 100%; max-width: 680px; height: auto; direction: ltr; overflow: visible; }
.st-rule { stroke: color-mix(in srgb, var(--feldspar) 38%, transparent); stroke-width: 1; }
.st-jawab { stroke: color-mix(in srgb, var(--feldspar) 45%, transparent); stroke-width: 1; stroke-dasharray: 3 3; }
.st-open { fill: none; stroke: var(--leaf); stroke-width: 1; stroke-dasharray: 2 3; }
.st-note-open, .st-dim-t { font-family: var(--latin); font-weight: 480; font-size: 12px; fill: var(--leaf); }
html[lang=ar] :is(.st-note-open, .st-dim-t) { font-family: var(--arabic); font-weight: 600; font-size: 13px; }
.st-dim { fill: none; stroke: var(--leaf); stroke-width: 1; }
.st-abjad { font-family: var(--naskh); font-weight: 700; font-size: 20px; fill: var(--brass); }
.st-slot { fill: none; stroke: color-mix(in srgb, var(--feldspar) 40%, transparent); stroke-width: 1; }
.st-tick { stroke: color-mix(in srgb, var(--feldspar) 50%, transparent); stroke-width: 1; }
.st-lever { fill: var(--brass); transition: fill 200ms; }
.st-acc { fill: none; stroke: var(--feldspar); stroke-width: .9; }
.st-ar { font-family: var(--naskh); font-weight: 700; font-size: 17px; fill: var(--feldspar); }
.st-lat { font-family: var(--latin); font-weight: 450; font-size: 12.5px; fill: color-mix(in srgb, var(--feldspar) 78%, transparent); }
.st-note.is-q .st-ar { fill: var(--brass); }
.st-note.is-lit .st-lever { fill: #F2D488; }
.st-note.is-lit .st-ar, .st-note.is-lit .st-lat { fill: #F2D488; }
.st-note.is-lit .st-slot { stroke: var(--brass); }
.st-bracket { fill: none; stroke: var(--leaf); stroke-width: 1; }
.st-jins { font-family: var(--latin); font-weight: 480; font-size: 13px; fill: var(--leaf); }
html[lang=ar] .st-jins { font-family: var(--arabic); font-weight: 600; font-size: 13px; }
.entry-text p { max-width: 56ch; }
.entry-ajnas { opacity: .82; }
@media (min-width: 768px) {
  .entry > * { grid-column: auto; }
  .entry-names { grid-column: 1 / 5; grid-row: 1; }
  .entry-strip { grid-column: 5 / 11; grid-row: 1; align-self: start; }
  .entry-text { grid-column: 1 / 11; grid-row: 2; }
}
@media (min-width: 1100px) {
  .entry { padding-block: 64px; }
  .entry-names { grid-column: 1 / 4; grid-row: 1; padding-top: 18px; }
  .entry-strip { grid-column: 4 / 11; grid-row: 1; }
  .entry-text { grid-column: 11 / 16; grid-row: 1; padding-top: 22px; }
}
.neighbours { width: 100%; max-width: 600px; height: auto; direction: ltr; overflow: visible; }
.nb-line { stroke: color-mix(in srgb, var(--feldspar) 55%, transparent); stroke-width: 1; transition: stroke 160ms, stroke-width 160ms, opacity 160ms; }
.nb-line.is-zero { stroke: var(--brass); }
.nb-pill rect { fill: var(--ghor-deep); stroke: color-mix(in srgb, var(--feldspar) 40%, transparent); }
.nb-pill.is-zero rect { stroke: var(--brass); }
.nb-pill text { font-family: var(--latin); font-weight: 520; font-size: 12px; fill: var(--feldspar); }
html[lang=ar] .nb-pill text { font-family: var(--arabic); font-size: 13px; }
.nb-node circle { fill: var(--ghor); stroke: var(--feldspar); stroke-width: 1; }
.nb-node .nb-core { fill: var(--brass); stroke: none; }
.nb-node .nb-name { font-family: var(--latin); font-weight: 520; font-size: 15px; fill: var(--feldspar); }
html[lang=ar] .nb-node .nb-name { font-family: var(--arabic); font-weight: 600; font-size: 17px; }
.nb-node { cursor: pointer; outline: none; }
.nb-node:focus-visible circle, .nb-node:hover circle { stroke: var(--brass); stroke-width: 2; }
.neighbours.is-focus .nb-line:not(.is-on), .neighbours.is-focus .nb-pill:not(.is-on) { opacity: .18; }
.neighbours .nb-line.is-on { stroke-width: 2; stroke: var(--feldspar); }
.neighbours .nb-line.is-on.is-zero { stroke: var(--brass); }
.nb-moves { min-height: 3em; margin-top: 8px; color: var(--brass); }
.nb-fig { margin-bottom: 40px; }

/* workshop */
.ws-concept { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--granite); max-width: 54ch; font-size: 16px; line-height: 1.55; }
html[lang=ar] .ws-concept { font-size: 17px; line-height: 1.8; }
.credits h3 { font-size: 17px; margin: 22px 0 6px; }
html[lang=ar] .credits h3 { font-size: 19px; }
.credit-lists { font-size: 15px; }
.credit-intro { max-width: 60ch; margin: 0 0 8px; }
.credit-lists { display: grid; gap: 0 48px; }
@media (min-width: 1100px) { .credit-lists { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 5fr); } }
.credit-lists p, .credit-lists li { max-width: 72ch; }
.cr { margin: 0 0 14px; padding-inline-start: 20px; display: grid; gap: 4px; }
.cr-title { font-style: italic; }
html[lang=ar] .cr-title { font-style: normal; }

/* waitlist */
.inbox { align-self: start; padding-top: 6px; border-top: 1px solid var(--granite); margin-top: 28px; }
@media (min-width: 768px) { .inbox { margin-top: 8px; } }
.inbox h3 { margin: 8px 0 6px; }
.concept-line { margin-top: 6px; }
.wl { display: grid; gap: 22px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.field > label, .field > legend { font-weight: 560; font-size: 15px; padding: 0; margin-bottom: 2px; }
html[lang=ar] .field > label, html[lang=ar] .field > legend { font-weight: 600; font-size: 16px; }
.field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; background: var(--feldspar); color: var(--granite);
  border: 1px solid var(--granite); border-radius: 2px; font-size: 16px;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--granite) 50%), linear-gradient(135deg, var(--granite) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
html[dir=rtl] .field select { background-position: 13px 21px, 18px 21px; }
.field :focus-visible { outline: 2px solid var(--granite); outline-offset: 2px; }
.field .hint { margin: 0; color: var(--mica); font-size: 14px; opacity: 1; }
.err { margin: 0; font-weight: 520; font-size: 14px; color: var(--granite); }
[aria-invalid=true] { box-shadow: inset 3px 0 0 var(--rift); }
html[dir=rtl] [aria-invalid=true] { box-shadow: inset -3px 0 0 var(--rift); }
.summary { border: 1px solid var(--granite); border-inline-start: 4px solid var(--rift); padding: 12px 16px; font-weight: 520; }
.summary[hidden] { display: none; }
.submit { background: var(--granite); color: var(--sand); }
.submit:hover { background: #33262A !important; }
.total { align-self: start; padding-top: 10px; border-top: 1px solid var(--granite); margin-top: 32px; }
.total-line { font-weight: 450; font-size: 19px; line-height: 1.45; margin: 0; }
html[lang=ar] .total-line { font-weight: 500; font-size: 20px; line-height: 1.7; }
@media (min-width: 768px) { .total { position: sticky; top: 24px; margin-top: 0; } }
.confirm h2 { margin-bottom: 18px; outline: none; }
.confirm p { max-width: 60ch; }
.confirm .actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media (max-width: 767px) {
  .mq { padding: 6px 6px 9px; }
  .mq-name { font-size: 13px; }
  html[lang=ar] .mq-name { font-size: 14px; }
}

/* ------------------------------------------------ tells-finish: one sheet, engraved legends, the instrument's own controls */
:root { --eng-rule: color-mix(in srgb, currentColor 45%, transparent); }

/* spec headings, set the way the panel legends are engraved, running into a leader line */
h2.eng { display: flex; align-items: center; gap: 12px; font-weight: 600; font-variation-settings: "SHRP" 30; font-size: 18px; line-height: 1.3; letter-spacing: .004em; margin: 0 0 var(--s5); text-wrap: initial; }
h2.eng::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
h2.eng::after { content: ""; flex: 1 1 auto; min-width: 32px; border-top: 1px solid var(--eng-rule); }
html[lang=ar] h2.eng { font-family: var(--naskh); font-weight: 700; font-size: 24px; line-height: 1.5; }
h1 { text-shadow: 0 1px 0 rgba(255, 238, 226, .26); }
.g-ghor h1 { text-shadow: 0 1px 0 rgba(240, 203, 187, .1); }
html[lang=ar] .dwg .lbl.num { font-family: var(--naskh-num); font-weight: 700; font-size: calc(15px * var(--k)); }
html[lang=ar] .dwg .lbl.small.num { font-size: calc(14px * var(--k)); }

/* notes hung on drawings */
.pin { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--eng-rule); }
.pin > p { max-width: 52ch; margin-bottom: 0; }
.pin > p + p { margin-top: 1em; }
.pin-leads { display: none; }
@media (min-width: 1100px) {
  [data-pins] { position: relative; }
  .pin:not([data-from=side]):not(.who) { margin-top: 52px; }
  .pin-leads { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .pin-leads path { fill: none; stroke: currentColor; stroke-width: .8px; }
  .pin-leads circle { fill: currentColor; }
  /* captions go above a pinned drawing, so the leaders never cross them */
  [data-pins] > .drawing { display: flex; flex-direction: column; }
  [data-pins] > .drawing figcaption { order: -1; margin: 0 0 18px; }
}
.pins-col { display: grid; align-content: start; gap: 0; }
.pins-col .pin:first-child { margin-top: 0; }
.pin-free { border-top-style: dotted; }

/* home: why levers */
.lever-fig .dwg { max-width: 980px; margin-inline: auto; }
.lever-fig figcaption { margin-inline: auto; max-width: 980px; }
.why h2.eng { margin-bottom: var(--s6); }

/* home: the rift, one wide column under the word, the cleft running off the page */
.rift .wide-photo { margin-bottom: 40px; }
.rift .wide-photo figcaption { max-width: 46ch; }
@media (max-width: 767px) { .rift .wide-photo .ph { aspect-ratio: 4 / 3; } }
.rift-col { align-self: start; }
.rift-term { text-align: start; margin: 0 0 .12em; font-size: clamp(88px, 13vw, 220px); line-height: 1.3; direction: rtl; color: color-mix(in srgb, var(--granite) 88%, transparent); }
html[dir=ltr] .rift-term { text-align: left; }
.rift-h { margin-bottom: 28px; }
.rift-a p { max-width: 68ch; }
.qarar-p { margin-top: 48px; font-size: 21px; max-width: 46ch; }
@media (min-width: 1100px) { .qarar-p { margin-top: 72px; font-size: 26px; line-height: 1.42; font-weight: 340; } }
html[lang=ar] .qarar-p { font-size: 22px; font-weight: 500; }
.cleft { margin: 40px 0 0; }
.bleed .ph, .bleed-start .ph { width: 100%; }
@media (min-width: 768px) {
  .cleft { margin-top: 30%; align-self: start; }
  .bleed { margin-inline-end: calc(-1 * var(--margin) - max(0px, (100vw - 1600px - 2 * var(--margin)) / 2)); }
  .bleed figcaption { margin-inline-end: var(--margin); }
}

/* home: what is inside */
.inside-lede { max-width: 52ch; margin-bottom: 36px; }
.inside-fig .dwg { max-width: 940px; }
.inside-text .parts { margin-top: 0; }
@media (min-width: 1100px) { .inside-text { padding-top: 40px; } }

/* home: the batch row, all fifteen levers on a phone too */
.batch-run .dwg-batch.is-compact { display: none; }
@media (max-width: 767px) {
  .batch-run .dwg-batch.is-wide { display: none; }
  .batch-run .dwg-batch.is-compact { display: block; }
  .dwg-batch.is-compact .course-t { font-size: 14px; }
  .batch-text { margin-top: 20px; }
}

/* instrument: one long sheet */
.sheet-sec h2.eng { margin-bottom: var(--s4); }
.body-fig .dwg { max-width: 920px; }
.course-fig .dwg { max-width: 640px; }
.dwg .abjad-col { font-size: min(calc(14px * var(--k)), 17px); }
.dwg .abjad-col.is-this { fill: var(--rift); }
.levers-text { margin-top: 28px; }
.levers-text p { max-width: 48ch; }
@media (min-width: 1100px) { .levers-text { margin-top: 0; padding-top: 24px; } .body-fig ~ .pin { margin-top: 64px; } }
.dwg-section [data-seat] { transition: transform 260ms cubic-bezier(.34, 1.56, .64, 1); }
.dwg-section [data-seat].is-up { transform: translateY(-46px); }
.loop-fig .dwg { max-width: none; }
.room-text { max-width: 62ch; }
.tuning-sec h2.eng, .drone-sec h2.eng { margin-bottom: var(--s5); }
.back-sec .leaves { margin-top: 28px; }
@media (min-width: 1100px) { .back-sec .leaves { margin-top: 52px; padding-top: 12px; } }

/* maqamat: on a phone, one maqam at a time */
.entry-pick { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; border-block-end: 1px solid color-mix(in srgb, var(--feldspar) 30%, transparent); }
.entry-pick[hidden] { display: none; }
.is-folded .entry:not(.is-shown) { display: none; }
.is-folded .entry { border-top: 0; padding-top: 28px; }
.moving h2.eng { margin-bottom: var(--s6); }

/* workshop: the bench with its people standing on the floor below it */
.bench-fig .dwg { max-width: none; }
.bench-fig { position: relative; margin-bottom: 0; }
.floor { display: grid; gap: 0 var(--gutter); }
.who h3 { margin-bottom: 2px; }
.who .role { color: var(--mica); margin-bottom: 10px; }
.who p:last-child { max-width: 46ch; }
.bench-prose { order: -1; margin-top: 28px; }
.bench-prose p { max-width: 56ch; }
@media (min-width: 768px) and (max-width: 1099px) {
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench-prose { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .floor { grid-template-columns: repeat(15, minmax(0, 1fr)); margin-top: 36px; }
  .bench-prose { order: 0; grid-column: 6 / 10; grid-row: 1; margin-top: 0; }
  .who-s { grid-column: 1 / 6; grid-row: 1; }
  .who-y { grid-column: 10 / 13; grid-row: 1; }
  .who-d { grid-column: 13 / 16; grid-row: 1; }
  .who { margin-top: 0; }
  .bench-prose h2.eng { margin-bottom: var(--s3); }
  .bench-fig figcaption { position: absolute; inset-inline-start: 0; bottom: -30px; margin: 0; direction: ltr; }
  html[dir=rtl] .bench-fig figcaption { direction: rtl; left: 0; right: auto; }
}

/* workshop: a batch on one lever slot */
.batch-made h2 { margin-bottom: var(--s4); }
.run-intro { max-width: 46ch; margin: 0; }
.slot5 { margin-top: 56px; }
.slot5-rail {
  position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gutter);
  height: 34px; border: 1px solid var(--granite); border-radius: 3px;
  background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(31, 22, 24, .24) 3px 4px);
}
.slot5-notch { justify-self: start; width: 30px; height: 22px; margin: -1px 0 0 14px; background: var(--sand); border: 1px solid var(--granite); border-top: 0; border-radius: 0 0 15px 15px; }
html[dir=rtl] .slot5-notch { margin: -1px 14px 0 0; }
.slot5-lever { position: absolute; left: 0; top: -16px; width: 16px; height: 36px; translate: -50% 0; background: var(--brass); border: 1px solid var(--granite); border-radius: 2px; transition: transform 240ms cubic-bezier(.3, 1.45, .5, 1); }
.slot5-stages { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gutter); }
.slot5-stages li { padding-inline-start: 14px; }
.notch-gl { width: 12px; height: 17px; margin: 0 0 8px 9px; fill: none; stroke: var(--granite); stroke-width: .9; overflow: visible; }
html[dir=rtl] .notch-gl { margin: 0 9px 8px 0; }
.slot5-stages h3 { font-size: 18px; font-weight: 600; font-variation-settings: "SHRP" 30; margin: 0 0 6px; transition: opacity 160ms linear; }
.slot5-stages p { margin: 0; font-size: 16px; line-height: 1.55; max-width: 30ch; }
html[lang=ar] .slot5-stages p { font-size: 17px; line-height: 1.75; }
.slot5-stages li:not(.is-at) h3 { opacity: .62; }
@media (max-width: 767px) {
  .slot5 { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: repeat(5, auto); column-gap: 18px; margin-top: 36px; }
  .slot5-rail { grid-column: 1; grid-row: 1 / -1; height: auto; grid-template-columns: none; grid-template-rows: subgrid; }
  .slot5-notch, html[dir=rtl] .slot5-notch { grid-row: auto; align-self: start; justify-self: start; width: 22px; height: 30px; margin: 18px 0 0 -1px; border: 1px solid var(--granite); border-inline-start: 0; border-radius: 0 15px 15px 0; }
  html[dir=rtl] .slot5-notch { margin: 18px -1px 0 0; border-inline-start: 1px solid var(--granite); border-inline-end: 0; border-radius: 15px 0 0 15px; justify-self: end; }
  .slot5-lever { left: 50%; top: 0; width: 36px; height: 16px; translate: -50% -50%; }
  .slot5-stages { grid-column: 2; grid-row: 1 / -1; display: grid; grid-template-columns: none; grid-template-rows: subgrid; margin: 0; }
  .slot5-stages li { padding: 14px 0 28px; }
  .notch-gl { margin: 0 0 6px; }
}

/* workshop: the street, its notes set on a plate over the photo */
.street { margin-bottom: 0; }
@media (min-width: 768px) {
  .bleed-start { margin-inline-start: calc(-1 * var(--margin) - max(0px, (100vw - 1600px - 2 * var(--margin)) / 2)); }
  .bleed-start figcaption { margin-inline-start: var(--margin); }
}
@media (max-width: 1099px) { .street-plate { margin-top: 36px; } }
@media (min-width: 1100px) {
  .street-sec .street, .street-sec .street-plate { grid-row: 1; }
  .street-plate { position: relative; z-index: 1; align-self: end; margin-bottom: -96px; padding: 28px 32px 32px; background: var(--sand); background-image: var(--grain); border-top: 1px solid var(--granite); }
}
.credits h2.eng { margin-bottom: var(--s4); }

/* waitlist: switches and toggles drawn like the instrument's own */
.sw { display: grid; border: 1px solid var(--granite); border-radius: 2px; }
@media (min-width: 560px) { .sw { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; cursor: pointer; }
.sw-opt + .sw-opt { border-top: 1px solid var(--granite); }
@media (min-width: 560px) { .sw-opt + .sw-opt { border-top: 0; border-inline-start: 1px solid var(--granite); } }
.sw-opt input, .tog input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sw-notch { position: relative; flex: none; width: 16px; height: 22px; border: 1px solid var(--granite); border-top: 0; border-radius: 0 0 8px 8px; }
.sw-notch::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 10px; height: 16px; translate: -50% 0; background: var(--brass); border: 1px solid var(--granite); border-radius: 1px; transform: translateY(-22px); opacity: 0; transition: transform 220ms cubic-bezier(.34, 1.56, .64, 1), opacity 80ms linear; }
.sw-opt:has(input:checked) { background: rgba(31, 22, 24, .07); }
.sw-opt input:checked + .sw-notch::after { transform: none; opacity: 1; }
.sw-opt:hover { background: rgba(31, 22, 24, .05); }
.sw-l, .tog-l { font-weight: 480; font-size: 15px; line-height: 1.35; }
html[lang=ar] :is(.sw-l, .tog-l) { font-weight: 500; font-size: 16px; line-height: 1.6; }
.sw-opt:has(input:focus-visible), .tog:has(input:focus-visible) { outline: 2px solid var(--granite); outline-offset: 2px; }
.togs { display: grid; gap: 4px; }
.tog { position: relative; display: flex; align-items: center; gap: 14px; min-height: 44px; padding-block: 4px; cursor: pointer; }
.tog-slot { position: relative; flex: none; width: 46px; height: 18px; border: 1px solid var(--granite); border-radius: 2px; background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(31, 22, 24, .18) 3px 4px); }
.tog-slot::before, .tog-slot::after { content: ""; position: absolute; top: -5px; width: 1px; height: 4px; background: var(--granite); }
.tog-slot::before { left: 9px; }
.tog-slot::after { right: 9px; }
.tog-lever { position: absolute; top: -4px; left: 2px; width: 14px; height: 24px; background: var(--feldspar); border: 1px solid var(--granite); border-radius: 2px; transition: transform 220ms cubic-bezier(.34, 1.56, .64, 1), background-color 120ms linear; }
.tog input:checked + .tog-slot .tog-lever { transform: translateX(26px); background: var(--brass); }
html[dir=rtl] .tog-lever { left: auto; right: 2px; }
html[dir=rtl] .tog input:checked + .tog-slot .tog-lever { transform: translateX(-26px); }
.tog:hover .tog-slot { background-color: rgba(31, 22, 24, .06); }
.tog input[aria-invalid=true] + .tog-slot { box-shadow: 0 0 0 2px var(--rift); }
.lever-card { border-top: 1px solid var(--granite); padding-top: 10px; }
.lever-card svg { width: 100%; max-width: 360px; height: auto; margin: 10px 0; direction: ltr; }
.lc-slot { fill: none; stroke: var(--granite); stroke-width: 1; }
.lc-lever { fill: var(--granite); }
.lc-lever.is-q { fill: var(--rift); }
.lc-n { font-family: var(--naskh); font-weight: 700; font-size: 13px; fill: var(--mica); }
.lc-n.is-q { fill: var(--granite); }
.lc-line { font-weight: 450; font-size: 19px; margin: 0; }
html[lang=ar] .lc-line { font-weight: 500; font-size: 20px; }
.total[hidden] { display: none; }

/* footer: the concept line, then one run of links with the language last */
.foot-in { align-items: start; }
.foot .foot-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.foot-lang[lang=ar] { font-family: var(--arabic); font-weight: 600; font-size: 17.5px; line-height: 1; }
.foot-lang[lang=en] { font-family: var(--latin); font-size: 15px; }
@media (min-width: 768px) { .foot-concept { --t: 1 / 6; } .foot-nav { --t: 6 / 11; } }
@media (min-width: 1100px) { .foot-concept { --d: 1 / 8; } .foot-nav { --d: 9 / 16; align-self: start; padding-top: 3px; } }

/* hero: the sound knob */
.knob { position: relative; border: 0; margin: 0; padding: 0; width: 180px; height: 86px; direction: ltr; min-width: 0; }
.knob-dial { position: absolute; left: 58px; top: 20px; width: 64px; height: 64px; overflow: visible; cursor: pointer; }
.knob-dial circle { fill: var(--ghor-deep); stroke: color-mix(in srgb, var(--feldspar) 70%, transparent); stroke-width: 1; }
.knob-knurl { fill: none; stroke: color-mix(in srgb, var(--feldspar) 32%, transparent); stroke-width: 1; }
.knob-ptr { stroke: var(--brass); stroke-width: 2.6; stroke-linecap: round; }
.knob-marks { stroke: var(--feldspar); stroke-width: 1.2; }
.knob-cap { transform-origin: 32px 32px; transform: rotate(var(--a, -55deg)); transition: transform 170ms cubic-bezier(.34, 1.56, .64, 1); }
.knob[data-pos="1"] .knob-cap { --a: 0deg; }
.knob[data-pos="2"] .knob-cap { --a: 55deg; }
.kp { position: absolute; cursor: pointer; padding: 2px 3px; font-weight: 520; font-size: 12.5px; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; color: color-mix(in srgb, var(--feldspar) 72%, transparent); border-radius: 2px; }
html[lang=ar] .kp { font-family: var(--arabic); font-weight: 600; font-size: 13.5px; letter-spacing: 0; }
.kp input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kp:has(input:checked) { color: var(--feldspar); font-weight: 640; }
.kp:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: 2px; }
.kp-0 { right: 118px; top: 26px; }
.kp-1 { left: 90px; top: 0; translate: -50% 0; }
.kp-2 { left: 124px; top: 26px; }
.knob:has(input:disabled) { opacity: .45; }
.now-sound { margin-block: 4px 18px; }
@media (min-width: 1100px) {
  .hero-right { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 20px; align-content: space-between; }
  .now-head { grid-column: 1; grid-row: 1; }
  .now-sound { grid-column: 2; grid-row: 1; margin: 0; align-self: start; }
  .paths { grid-column: 1 / -1; grid-row: 2; align-self: end; }
}

/* hero: moves drawn as engraved switches, the lever count in brass ticks */
.paths ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid color-mix(in srgb, var(--feldspar) 26%, transparent); border-radius: 2px; }
.paths li + li { border-inline-start: 1px solid color-mix(in srgb, var(--feldspar) 26%, transparent); }
.paths li:nth-child(3) { border-inline-start: 0; }
.paths li:nth-child(n+3) { border-top: 1px solid color-mix(in srgb, var(--feldspar) 26%, transparent); }
.path, html[dir=rtl] .path { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "to ticks" "move move"; padding: 7px 10px 8px; min-height: 52px; background: none; border-radius: 0; height: 100%; }
.path:hover, .path.is-hi { background: var(--ghor-deep); }
.path.is-hi { box-shadow: inset 3px 0 0 var(--brass); }
html[dir=rtl] .path.is-hi { box-shadow: inset -3px 0 0 var(--brass); }
.path-ticks { grid-area: ticks; align-self: center; display: inline-flex; gap: 3px; direction: ltr; }
.path-ticks i { display: block; width: 3px; height: 12px; background: var(--brass); border-radius: .5px; }
.path-ticks i.q { width: 9px; height: 9px; background: none; border: 1.5px solid var(--brass); border-radius: 50%; }
@media (min-width: 768px) and (max-width: 1099px) { .paths ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } .paths li:nth-child(3) { border-inline-start: 1px solid color-mix(in srgb, var(--feldspar) 26%, transparent); } .paths li:nth-child(n+3) { border-top: 0; } }

/* maqamat: the phone mini-bed packs the octave tighter, with larger names */
.strip.is-compact { display: none; }
@media (max-width: 767px) {
  .strip.is-wide { display: none; }
  .strip.is-compact { display: block; max-width: none; }
  .strip.is-compact .st-ar { font-size: 15px; }
  .strip.is-compact .st-lat { font-size: 11px; }
  .strip.is-compact .st-abjad { font-size: 18px; }
  .entry-strip { padding-inline: 4px; }
}
@media (max-width: 767px) { .scroll-x .dwg-back { min-width: 860px; } }
.nw { white-space: nowrap; }
@media (min-width: 1100px) { .drone-sec .pin { grid-row: 3; } }
/* the people stand under their own benches, which are drawn the same way in both languages */
@media (min-width: 1100px) {
  html[dir=rtl] .floor { direction: ltr; }
  html[dir=rtl] .floor > * { direction: rtl; }
}
.dwg-course .lbl { font-size: min(calc(13px * var(--k)), 18px); }
html[lang=ar] .dwg-course .lbl { font-size: min(calc(14px * var(--k)), 19px); }
