:root {
  --bg: #07080d;
  --bg-2: #0e1018;
  --ink: #ece9f2;
  --mute: #9a96a8;
  --line: rgba(236, 233, 242, 0.12);
  --violet: #7c5cff;
  --coral: #ff7a59;
  --gold: #ffd166;
  --paper: #171a25;
  --frame: #b88a4a;
  --font: 'Bricolage Grotesque', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  color-scheme: dark;
}
[lang='fa'] { --font: 'Vazirmatn', system-ui, sans-serif; --serif: 'Vazirmatn', serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
/* No browser tap rectangle anywhere; each control shows its own round feedback instead. */
* { -webkit-tap-highlight-color: transparent; }
svg.loop g, svg.loop g:focus { outline: none; }
bdi { unicode-bidi: isolate; }

/* ---------- symbols ---------- */
.i { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.brand .i { width: 30px; height: 30px; color: var(--gold); }

/* ---------- top bar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(var(--bg) 30%, transparent);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-mark { animation: sway 4s ease-in-out infinite; transform-origin: 50% 90%; }
.top nav { display: flex; gap: 8px; align-items: center; }
.top nav a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--mute); font-size: 20px; transition: color .2s, border-color .2s, transform .2s;
}
.top nav a:hover { color: var(--ink); transform: rotate(-8deg) scale(1.08); }
.top nav a.on { color: var(--gold); border-color: rgba(255,209,102,.5); }
@keyframes sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- home: the ∞ ride ---------- */
html:has(.loop-page), html:has(.loop-page) body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.loop-page { position: fixed; inset: 0; overflow: hidden; display: grid; grid-template-rows: 100%; touch-action: none; --below: 190px; }
.sky {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 25% 35%, rgba(124,92,255,.18), transparent 70%),
    radial-gradient(35% 30% at 75% 60%, rgba(255,122,89,.14), transparent 70%),
    radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 51%) 0 0 / 120px 120px,
    radial-gradient(1px 1px at 70% 80%, #fff5 50%, transparent 51%) 0 0 / 170px 170px,
    var(--bg);
  animation: drift 60s linear infinite;
}
@keyframes drift { to { transform: translate3d(-120px, -170px, 0); } }
.flower { position: relative; min-height: 0; display: flex; justify-content: center; padding: 20px 12px var(--below); }
svg.loop { width: 100%; height: 100%; overflow: visible; }
.track { fill: none; stroke: url(#g); stroke-width: 3; stroke-linejoin: round; opacity: .55; }
.track-glow { fill: none; stroke: url(#g); stroke-width: 10; opacity: .22; }
.track-flow { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 2 26; stroke-linecap: round; opacity: .45; animation: flow 3s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -112; } }
.tips g { cursor: pointer; color: var(--mute); transition: color .3s; }
.tips .arc { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 22; stroke-linecap: round; transition: stroke .3s; }
.tips g.on .arc { stroke: rgba(255,209,102,.16); }
.tips circle { fill: transparent; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 5; }
.tips g.on { color: var(--gold); }
.tips g.on circle { stroke: rgba(255,209,102,.6); }
.stations g { cursor: pointer; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.stations .seat { fill: var(--paper); stroke: var(--line); stroke-width: 2; }
.stations .b { color: #d9c7a8; }
.stations .held { fill: #241f2e; stroke: var(--line); stroke-width: 1.5; }
.stations .h { color: var(--ink); }
.stations g.faded { opacity: .5; }
.stations g.home { opacity: .35; filter: grayscale(1); }
.stations g.home.on { opacity: 0; }
.stations g:hover { transform: scale(1.15); }
.stations g:active { transform: scale(1.25); }
.stations g:active .seat { stroke: var(--gold); }
.tips g:active circle { stroke: var(--gold); stroke-dasharray: none; }
.top nav a:active, .socials a:active, .btn:active { transform: scale(.92); }
.stations g.on { transform: scale(1.4); }
.stations g.on .seat { stroke: var(--gold); stroke-width: 3; fill: #241f2e; }
.stations g.on .held { fill: var(--gold); stroke: none; }
.stations g.on .h { color: #160f05; }
.traveler circle { fill: var(--gold); filter: drop-shadow(0 0 14px rgba(255,209,102,.7)); }
.traveler use { color: #160f05; }

.scenes { position: absolute; inset: 0; perspective: 1200px; container-type: size; pointer-events: none; }
/* The ∞ fills the screen. Only the station's picture stands over the middle of the ∞; name, status and links sit at the bottom. */
.scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding: 0 24px 22px; pointer-events: none;
  opacity: 0; transform-origin: 50% 50%; transform: rotateX(-80deg);
  transition: opacity .35s ease, transform .6s cubic-bezier(.2,1.4,.4,1);
}
.scene.on { opacity: 1; transform: none; }
.scene.on > * { pointer-events: auto; }
/* --H is the bonobo's height: its own size, but never more than a share of the screen. --cx/--cy is the crossing, set by loop.js. */
.scene { --h: 210px; --H: max(90px, min(var(--h), calc(100cqh * .27))); }
.scene:has(.host) { --h: 280px; --H: max(90px, min(var(--h), calc(100cqh * .34))); }
.pop {
  position: absolute; left: var(--cx, 50%); top: var(--cy, calc((20px + 100% - var(--below)) / 2)); translate: -50% -50%; margin: 0;
}
/* A light shade behind the picture, so the ∞ under it still shows through. */
.pop::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--H) * 2.1); height: calc(var(--H) * 2.1); translate: -50% -50%; border-radius: 50%; background: radial-gradient(closest-side, rgba(7,8,13,.6), rgba(7,8,13,.3) 65%, transparent); z-index: -1; pointer-events: none; }
/* A die-cut paper card, as in a pop-up book: white cut edge, a fold shadow on the page under it. */
.paper-card {
  position: relative; display: block; width: 150px; height: 150px; border-radius: 26px; padding: 7px;
  background: #ece4d4; transform: rotate(-3deg);
  box-shadow: 0 26px 30px -18px rgba(0,0,0,.95), 0 2px 0 #cfc5b1;
  animation: breathe 3.4s ease-in-out infinite;
}
.paper-card::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -16px; height: 12px; border-radius: 50%; background: rgba(0,0,0,.55); filter: blur(6px); z-index: -1; }
.paper-face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 20px; background: linear-gradient(160deg, #2a2438, #171a25); }
.paper-face .face { width: 92px; height: 92px; color: #e7d6b8; }
.badge {
  position: absolute; inset-inline-end: -18px; bottom: -14px; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; color: #160f05;
  background: linear-gradient(135deg, var(--gold), var(--coral)); border: 5px solid #ece4d4;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-4px); } }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-8px) rotate(8deg); } }
.cutout { position: relative; animation: rise 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.cutout img { display: block; width: auto; height: var(--H); filter: drop-shadow(0 22px 18px rgba(0,0,0,.75)); user-select: none; }
.cutout::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: -10px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.6); filter: blur(7px); z-index: -1; }
.cutout .badge { inset-inline-end: -6px; bottom: 6px; }
/* Pop-up: the piece swings up off the page when its station arrives, then breathes. */
.scene .cutout { transform: perspective(700px) rotateX(70deg); transition: transform .9s cubic-bezier(.2,1.6,.4,1) .1s; }
.scene.on .cutout { transform: none; }
@keyframes rise { 0%,100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.traveler circle { fill: var(--gold); }
.fan { position: relative; display: block; width: 260px; height: 190px; }
.fan-frame {
  position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; padding: 11px; border-radius: 3px;
  background: linear-gradient(135deg, #6b4a22, var(--frame) 30%, #5a3d1a 60%, #a07838);
  box-shadow: 0 24px 40px -16px rgba(0,0,0,.95);
  transform: translate(-50%, -50%) translateX(calc(var(--k) * 66px)) rotate(calc(var(--k) * 9deg)) translateY(calc(var(--k) * var(--k) * 10px));
  transition: transform .5s cubic-bezier(.2,1.4,.4,1);
}
.fan-frame .frame-inner { box-shadow: inset 0 0 0 6px #ece4d4; }
.fan-frame .frame-inner img { padding: 6px; }
.fan:hover .fan-frame { transform: translate(-50%, -50%) translateX(calc(var(--k) * 92px)) rotate(calc(var(--k) * 13deg)) translateY(calc(var(--k) * var(--k) * 14px)); }
.btn .i + .i { margin-inline-start: -4px; }
.orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; color: var(--mute); --R: calc(var(--H) * .41); }
.orbit span { position: absolute; font-size: 24px; animation: orbit var(--d, 9s) linear infinite; animation-delay: var(--delay, 0s); opacity: .85; }
/* The radius sits outside the keyframes: iPhone browsers do not resolve a size variable inside an animation. */
.orbit span .i { display: block; transform: translate(-50%, -50%); translate: calc(var(--R) * var(--r, .96) * var(--k, 1)) 0; animation: orbit-back var(--d, 9s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes orbit { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes orbit-back { from { rotate: 0deg; } to { rotate: -360deg; } }
/* Around the standing host the orbit is an upright ellipse, so the props circle him instead of crossing his arms. */
.orbit.tall { --k: 1.3; --R: calc(var(--H) * .27); transform: scaleY(1.55); }
.orbit.tall span .i { transform: translate(-50%, -50%) scaleY(calc(1 / 1.55)); }
.s-name { margin: 0 0 12px; font-size: clamp(30px, 4.6vw, 56px); font-weight: 800; letter-spacing: -.01em; line-height: 1.1; display: flex; gap: .35em; align-items: center; justify-content: center; flex-wrap: wrap; }
.s-name.small { font-size: clamp(22px, 2.8vw, 34px); max-width: 16em; }
.s-name .g { font-size: .55em; color: var(--gold); display: inline-grid; }
[lang='fa'] .s-name { font-weight: 900; letter-spacing: 0; }
/* Both names side by side: English on the left, Persian on the right, the ∞ between them. */
.s-name.duo { direction: ltr; gap: .4em; flex-wrap: nowrap; }
.s-name.duo [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; font-weight: 900; letter-spacing: 0; }
.s-name.duo .g { font-size: .45em; }
/* Under the name: the roles, then the proverb with English and Persian facing each other, like the name. */
.s-roles { margin: -4px 0 8px; display: flex; gap: .6em; justify-content: center; align-items: center; font-size: 14px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.s-roles i { font-style: normal; color: var(--mute); }
.s-proverb { direction: ltr; display: flex; gap: .55em; align-items: center; justify-content: center; margin: 0 0 14px; font-size: 18px; color: #d9d4e6; }
.s-proverb [lang='en'] { font-family: var(--serif); font-style: italic; }
.s-proverb [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; font-weight: 700; }
.s-proverb .g { color: var(--gold); font-size: .7em; display: inline-grid; }
/* His sayings take turns in one fixed-height line under the proverb. */
.s-say { position: relative; width: min(92vw, 760px); height: 2.9em; margin: -4px 0 12px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--mute); }
.say { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; }
.say.on { opacity: 1; transform: none; }
.chip { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--mute); }
.chip .i { font-size: 16px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #5ee39a; box-shadow: 0 0 0 0 rgba(94,227,154,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(94,227,154,0); } 100% { box-shadow: 0 0 0 0 rgba(94,227,154,0); } }
.btn {
  display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 700; font-size: 15px; direction: ltr;
  padding: 11px 18px; border-radius: 999px; color: #160f05;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  box-shadow: 0 8px 24px -8px rgba(255,122,89,.6);
  transition: transform .2s;
}
.btn .i { font-size: 19px; }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.addr-only { color: var(--mute); cursor: default; user-select: text; }
.btn.addr-only:hover { transform: none; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); font-size: 19px; color: var(--ink); transition: transform .2s, color .2s; }
.socials a:hover { transform: scale(1.15) rotate(-8deg); color: var(--gold); }

@media (max-height: 900px) and (min-aspect-ratio: 1/1) {
  .loop-page { --below: 160px; }
  .paper-card { width: 116px; height: 116px; }
  .paper-face .face { width: 70px; height: 70px; }
  .badge { width: 50px; height: 50px; font-size: 25px; }
  .s-name { margin-bottom: 8px; }
}
@media (max-aspect-ratio: 85/100) {
  /* Tablet held upright: the ∞ stands, so less room below it. */
  .loop-page { --below: 160px; }
}
@media (max-aspect-ratio: 62/100) {
  /* Phone: the ∞ fills the screen and the station shows in one place, over the middle of the ∞. */
  .flower { padding: 12px 8px var(--below); }
  .scene { padding: 0 8px 12px; }
  .scene { --h: 96px; }
  .pop::before { width: 210px; height: 210px; }
  .scene:has(.host) { --h: 120px; }
  .s-name { font-size: 24px; margin-bottom: 8px; }
  .chip { font-size: 12px; padding: 4px 9px; }
  .btn { font-size: 13px; padding: 8px 14px; }
  .socials { gap: 6px; }
  .socials a { width: 36px; height: 36px; font-size: 16px; }
  .paper-card { width: 80px; height: 80px; border-radius: 18px; padding: 5px; }
  .paper-face { border-radius: 14px; }
  .paper-face .face { width: 50px; height: 50px; }
  .badge { width: 34px; height: 34px; font-size: 17px; border-width: 3px; }
  .fan { width: 180px; height: 120px; }
  .fan-frame { width: 84px; height: 84px; padding: 7px; }
  .orbit span { font-size: 16px; }
  .loop-page { --below: 126px; }
}

/* Under each station: only its address, with a small status mark. */
a.pop { text-decoration: none; cursor: pointer; }
a.pop:hover .cutout img, a.pop:hover .paper-card { filter: drop-shadow(0 22px 18px rgba(0,0,0,.75)) brightness(1.08); }
/* The address hangs from the station's picture like a museum label on a thread, in the group's colour,
   right where the eye already is. It drops in after the picture pops up, and a light sweeps across it now and then. */
.s-addr {
  position: absolute; left: var(--cx, 50%); top: calc(var(--cy, 45%) + 140px); translate: -50% 0;
  margin: 0; z-index: 2; letter-spacing: .01em; white-space: nowrap;
  opacity: 0; transform: translateY(-14px) scale(.9); transition: opacity .3s ease, transform .5s cubic-bezier(.2,1.6,.4,1);
}
.scene.on .s-addr { opacity: 1; transform: none; transition-delay: .35s; }
.s-thread { position: absolute; left: var(--cx, 50%); width: 2px; translate: -50% 0; border-radius: 2px; pointer-events: none; background: linear-gradient(rgba(255,209,102,.15), rgba(255,209,102,.8)); transform-origin: 50% 0; transform: scaleY(0); transition: transform .5s cubic-bezier(.2,1,.3,1); }
.scene.on .s-thread { transform: none; transition-delay: .3s; }
.s-addr::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 2px; height: var(--thread, 22px); translate: -50% 0; border-radius: 2px; background: linear-gradient(hsl(var(--hue) 75% 65% / .15), hsl(var(--hue) 75% 65% / .85)); pointer-events: none; z-index: -1; }
.s-addr a {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px;
  font-size: 21px; font-weight: 700; text-decoration: none; padding: 10px 18px;
  color: hsl(var(--hue) 90% 88%); border-radius: 999px;
  background: hsl(var(--hue) 45% 13% / .88); border: 1.5px solid hsl(var(--hue) 75% 62% / .75);
  box-shadow: 0 0 22px -4px hsl(var(--hue) 80% 55% / .55), 0 14px 30px -12px rgba(0,0,0,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .2s, box-shadow .2s, color .2s;
}
.s-addr a::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, hsl(var(--hue) 90% 85% / .28) 50%, transparent 65%); translate: -120% 0; animation: sweep 4.5s ease-in-out 1.2s infinite; pointer-events: none; }
@keyframes sweep { 0%, 55% { translate: -120% 0; } 85%, 100% { translate: 120% 0; } }
.s-addr a:hover { transform: translateY(-2px) scale(1.04); color: #fff; box-shadow: 0 0 32px -2px hsl(var(--hue) 85% 60% / .8), 0 14px 30px -12px rgba(0,0,0,.9); }
.s-addr .go { font-size: .9em; opacity: .75; transition: translate .2s; }
.s-addr a:hover .go { translate: 2px -2px; opacity: 1; }
.scene.past .s-addr a { color: hsl(var(--hue) 25% 80%); background: hsl(var(--hue) 15% 12% / .88); border-color: hsl(var(--hue) 25% 55% / .6); box-shadow: 0 14px 30px -12px rgba(0,0,0,.9); }
.scene.past .s-addr a::after { display: none; }
.st { display: inline-grid; place-items: center; color: currentColor; opacity: .8; font-size: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- a project's own page ---------- */
.proj { --acc: hsl(var(--hue) 70% 62%); position: relative; min-height: 100vh; padding: 84px clamp(16px, 5vw, 64px) 64px; overflow: hidden; }
.proj .sky { position: fixed; z-index: -1; }
.proj .sky::after { content: ''; position: absolute; inset: 0; background: radial-gradient(38% 32% at 50% 38%, hsl(var(--hue) 70% 50% / .22), transparent 70%); }
.p-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.p-pop { position: relative; --H: min(300px, 38vh); margin: 18px 0 6px; }
.p-pop::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--H) * 1.9); height: calc(var(--H) * 1.9); translate: -50% -50%; border-radius: 50%; background: radial-gradient(closest-side, hsl(var(--hue) 70% 55% / .25), transparent); z-index: -1; }
.p-pop .cutout { animation: rise 3.6s ease-in-out infinite, popin .9s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes popin { from { transform: perspective(700px) rotateX(70deg); } }
.p-pop .orbit { color: var(--acc); }
.p-hero h1 { font-size: clamp(40px, 8vw, 76px); line-height: 1; margin: 6px 0 0; font-weight: 800; }
.p-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 0; }
.p-meta [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; }
.p-hero .btn { background: var(--acc); box-shadow: 0 10px 30px -10px hsl(var(--hue) 70% 50% / .8); }
/* A former project's address: shown, but no longer a door. */
.p-hero .btn.addr-only { background: transparent; color: var(--mute); border: 1px dashed var(--line); box-shadow: none; font-weight: 600; }
.book { max-width: 1040px; margin: 48px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 20px; background: rgba(14,16,24,.72); backdrop-filter: blur(6px); }
.leaf { padding: 32px clamp(20px, 3.5vw, 44px); font-size: 19px; line-height: 1.75; color: #ddd9e6; }
.leaf[lang='en'] { font-family: var(--serif); border-inline-end: 1px solid var(--line); }
.leaf[lang='fa'] { font-size: 18px; line-height: 2.05; }
.leaf p { margin: 0 0 1em; }
.leaf p:first-child { color: var(--ink); font-size: 1.12em; }
.leaf p:last-child { margin-bottom: 0; }
.p-foot { display: flex; justify-content: center; margin-top: 44px; }
.works { max-width: 1040px; margin: 40px auto 0; }
.works h2 { margin: 0 0 16px; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.works ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.work {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: start; height: 100%;
  padding: 22px 24px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: hsl(var(--hue) 40% 12% / .72); border: 1.5px solid hsl(var(--hue) 70% 60% / .45);
  box-shadow: 0 0 26px -10px hsl(var(--hue) 80% 55% / .6); backdrop-filter: blur(6px);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.work:hover { transform: translateY(-3px); border-color: hsl(var(--hue) 75% 65% / .85); box-shadow: 0 0 36px -6px hsl(var(--hue) 85% 60% / .75); }
.w-sym { grid-row: span 4; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 26px; color: #160f05; background: linear-gradient(135deg, var(--gold), var(--coral)); }
.w-name { font-size: 22px; font-weight: 800; }
.w-desc { color: #cfcadb; font-size: 16px; line-height: 1.6; }
.w-desc[lang='en'] { font-family: var(--serif); }
.w-desc[lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; line-height: 1.9; }
.w-name [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; }
.w-addr { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 15px; font-weight: 700; color: hsl(var(--hue) 90% 82%); }
.w-addr .go { font-size: .95em; transition: translate .2s; }
.work:hover .w-addr .go { translate: 2px -2px; }
.back { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); font-size: 30px; transition: transform .2s; }
.back .i { animation: sway 4s ease-in-out infinite; }
.back:hover { transform: scale(1.1); }
@media (max-width: 760px) {
  .book { grid-template-columns: 1fr; }
  /* One column: Persian first, English under it (Bahman). */
  .leaf[lang='en'] { order: 2; border-inline-end: 0; }
  .leaf[lang='fa'] { order: 1; border-bottom: 1px solid var(--line); }
  .leaf { font-size: 17px; }
  .leaf[lang='fa'] { font-size: 16.5px; }
  .p-pop { --H: min(220px, 32vh); }
}

/* ---------- gallery ---------- */
.read { padding: 96px clamp(16px, 5vw, 64px) 120px; max-width: 1240px; margin: 0 auto; }
.frame-inner { display: block; position: relative; width: 100%; height: 100%; background: #0c0d12; box-shadow: inset 0 0 0 10px #ece4d4; }
.frame-inner img {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: cover;
  transform: translate(-50%, -50%); padding: 10px;
  transition: width .7s cubic-bezier(.2,1,.3,1), height .7s cubic-bezier(.2,1,.3,1), padding .4s, box-shadow .7s, border-radius .7s;
  z-index: 1;
}

/* ---------- article ---------- */
.read { max-width: 820px; }
.r-head { text-align: center; }
.r-kicker { color: var(--gold); font-size: 22px; margin: 18px 0 10px; display: flex; gap: 14px; justify-content: center; align-items: center; }
.r-kicker a { display: inline-grid; color: var(--mute); }
.r-kicker a:hover { color: var(--gold); }
.r-kicker span { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--mute); }
.r-head h1 { font-size: clamp(32px, 6vw, 58px); line-height: 1.1; margin: 0 0 10px; font-weight: 800; }
[lang='fa'] .r-head h1 { font-weight: 900; line-height: 1.35; }
.r-deck { color: var(--mute); font-size: 19px; margin: 0 0 16px; }
.r-pdf { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.r-pdf a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.r-cover { margin: 40px auto 48px; max-width: 560px; aspect-ratio: 1; padding: 16px; position: relative;
  background: linear-gradient(135deg, #6b4a22, var(--frame) 30%, #5a3d1a 60%, #a07838); border-radius: 4px; }
.r-cover .frame-inner img { animation: breakout 1.6s .3s cubic-bezier(.2,1,.3,1) forwards; }
@keyframes breakout { to { width: 122%; height: 110%; padding: 0; border-radius: 6px; box-shadow: 0 40px 80px -20px #000; } }

.prose { font-family: var(--serif); font-size: 19px; line-height: 1.8; color: #ddd9e6; }
[lang='fa'] .prose { font-size: 18px; line-height: 2.05; }
.prose h2 { font-family: var(--font); font-size: 28px; line-height: 1.3; margin: 2.2em 0 .6em; color: var(--ink); }
.prose h3 { font-family: var(--font); }
.prose p { margin: 0 0 1.2em; }
.prose a { color: var(--gold); }
.prose sup a { text-decoration: none; }
.prose blockquote, .prose .dedication {
  margin: 0 0 2em; padding: 18px 22px; border-inline-start: 3px solid var(--gold);
  background: rgba(255,209,102,.05); border-radius: 0 12px 12px 0; font-style: italic; color: var(--mute);
}
[lang='fa'] .prose blockquote, [lang='fa'] .prose .dedication { border-radius: 12px 0 0 12px; font-style: normal; }
.prose .callout {
  margin: 1.6em 0; padding: 18px 22px; border-radius: 16px; font-family: var(--font); font-weight: 700; font-size: 18px; line-height: 1.7;
  background: linear-gradient(135deg, rgba(124,92,255,.14), rgba(255,122,89,.10)); border: 1px solid var(--line); color: var(--ink);
}
.prose .callout .c-sym { color: var(--gold); font-size: 22px; margin-inline-end: 8px; vertical-align: -0.2em; }
.prose figure { margin: 2em 0 1em; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; display: block; margin: 0 auto; }
.prose .toc { padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; margin: 0 0 2em; font-family: var(--font); font-size: 16px; }
.prose .toc h3 { margin: 0 0 8px; font-size: 16px; color: var(--gold); }
.prose .toc a { color: var(--ink); text-decoration: none; }
.prose .references, .prose .refs { font-size: 14px; line-height: 1.7; color: var(--mute); border-top: 1px solid var(--line); margin-top: 3em; padding-top: 1em; }
.prose .references a, .prose .refs a { word-break: break-all; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.r-foot .btn { font-size: 22px; padding: 12px 16px; }
.r-foot { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }

/* ---------- riding the loop from a project page ---------- */
/* Story-style ride: the page follows the finger with a slight turn, then slides away; the next one slides in. */
.proj { transform-origin: 50% 40vh; }
.proj.drag { transition: none; }
.proj.leave { transition: transform .26s cubic-bezier(.4,0,.6,1), opacity .26s; }
.proj.snap { transition: transform .35s cubic-bezier(.2,1.4,.4,1), opacity .35s; }
html.enter-fwd .proj { animation: ride-in .45s cubic-bezier(.2,1,.3,1) both; }
html.enter-back .proj { animation: ride-in-back .45s cubic-bezier(.2,1,.3,1) both; }
@keyframes ride-in { from { opacity: 0; transform: perspective(1400px) translateX(40%) rotateY(-28deg); } }
@keyframes ride-in-back { from { opacity: 0; transform: perspective(1400px) translateX(-40%) rotateY(28deg); } }
html:has(.proj) { overflow-x: hidden; background: var(--bg); }
.proj { touch-action: pan-y; }
.p-nav {
  position: fixed; top: 50%; z-index: 15; translate: 0 -50%; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%; text-decoration: none; color: var(--ink);
  background: hsl(var(--hue) 40% 14% / .8); border: 1.5px solid hsl(var(--hue) 70% 60% / .55);
  box-shadow: 0 0 22px -6px hsl(var(--hue) 80% 55% / .6); backdrop-filter: blur(6px);
  transition: transform .25s cubic-bezier(.2,1.6,.4,1), box-shadow .2s;
}
.p-nav.prev { left: clamp(8px, 2vw, 28px); }
.p-nav.next { right: clamp(8px, 2vw, 28px); }
.p-nav img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.p-nav .face { width: 30px; height: 30px; color: #e7d6b8; }
.p-arrow { position: absolute; bottom: -6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 15px; color: #160f05; background: linear-gradient(135deg, var(--gold), var(--coral)); }
.p-nav.prev .p-arrow { left: -6px; }
.p-nav.next .p-arrow { right: -6px; }
.p-nav:hover { transform: scale(1.12); box-shadow: 0 0 30px -4px hsl(var(--hue) 85% 60% / .8); }
.p-nav.prev:hover .p-arrow { animation: nudge-l .6s ease-in-out infinite; }
.p-nav.next:hover .p-arrow { animation: nudge-r .6s ease-in-out infinite; }
@keyframes nudge-l { 50% { translate: -3px 0; } }
@keyframes nudge-r { 50% { translate: 3px 0; } }
.mini { position: relative; display: grid; place-items: center; }
.mini > svg { width: min(340px, 86vw); height: auto; overflow: visible; }
.mini path { fill: none; stroke: rgba(236,233,242,.18); stroke-width: 1.4; }
.mini circle { fill: hsl(var(--hue) 70% 62% / .75); transition: r .2s; }
.mini a:hover circle { fill: hsl(var(--hue) 85% 72%); }
.mini a.on circle { fill: var(--gold); stroke: rgba(255,209,102,.35); stroke-width: 5; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 50% { stroke-width: 9; stroke: rgba(255,209,102,.12); } }
.mini-home { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); color: var(--gold); font-size: 20px; transition: transform .2s; }
.mini-home:hover { transform: scale(1.12); }
@media (max-width: 760px) {
  .p-nav { top: auto; bottom: 16px; translate: none; width: 52px; height: 52px; }
  .p-nav img { width: 40px; height: 40px; }
}

@media (max-aspect-ratio: 62/100) {
  .s-roles { font-size: 11px; margin: -4px 0 4px; }
  .s-proverb { font-size: 13px; margin-bottom: 8px; }
  .s-say { font-size: 13px; margin-bottom: 6px; }
}

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

@media (max-aspect-ratio: 62/100) {
  .s-addr a { font-size: 15px; padding: 7px 13px; gap: 7px; }
}

/* ---------- Mardomak: photos on the ∞, the chosen one in the pupil ---------- */
/* On home: the station is a pupil with his photos taking turns inside it. */
.pupil { position: relative; display: block; width: var(--H); height: var(--H); border-radius: 50%; overflow: hidden; background: #111;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 9px rgba(255,209,102,.14), 0 0 60px rgba(255,209,102,.22); transform: scale(.55); opacity: 0; transition: transform .9s cubic-bezier(.2,1.5,.4,1) .1s, opacity .5s ease .1s; }
.scene.on .pupil { transform: none; opacity: 1; }
.pupil img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: mk-turn calc(var(--n) * 3s) linear infinite; animation-delay: calc(var(--k) * 3s); }
.pupil img:first-child { opacity: 1; }
@keyframes mk-turn { 0% { opacity: 0; transform: scale(1.08); } 3% { opacity: 1; } 12.5% { opacity: 1; } 16% { opacity: 0; transform: scale(1); } 100% { opacity: 0; } }
.pop > .badge { position: absolute; inset-inline-end: -4px; bottom: 4px; }

html:has(main.mk), body:has(main.mk) { overflow: hidden; }
.mk { position: relative; overflow: hidden; touch-action: none; height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-top: 64px; box-sizing: border-box; }
.mk-stage { position: relative; z-index: 1; min-height: 0; }
.mk-loop { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-loop .track, .mk-loop .track-glow { stroke: url(#mkg); }
/* The beads: every photo of the series, round, on the loop. */
.bead { position: absolute; width: var(--b, 48px); height: var(--b, 48px); translate: -50% -50%; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  border: 2px solid rgba(255,255,255,.22); background: #15131c; box-shadow: 0 8px 18px -6px rgba(0,0,0,.9); transition: transform .35s cubic-bezier(.2,1.6,.4,1), border-color .3s, box-shadow .3s; }
.bead img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.55) brightness(.75); transition: filter .3s; }
.bead:hover { transform: scale(1.18); z-index: 2; }
.bead:hover img, .bead.on img { filter: none; }
.bead.on { transform: scale(1.28); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,209,102,.18), 0 0 24px rgba(255,209,102,.45); z-index: 3; }
/* The eye at the crossing: an iris of fine golden strokes around the pupil that holds the photo. */
.mk-eye { position: absolute; left: 50%; top: 50%; width: var(--E, 260px); height: var(--E, 260px); translate: -50% -50%; padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; z-index: 4; }
.mk-eye::before { content: ''; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(closest-side, rgba(7,8,13,.75), rgba(7,8,13,.35) 60%, transparent); z-index: -2; pointer-events: none; }
.mk-iris { position: absolute; inset: -11%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,209,102,.6) 0 .9deg, transparent .9deg 3.6deg);
  -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 81%, #000 97%, transparent 98%); mask: radial-gradient(closest-side, transparent 80%, #000 81%, #000 97%, transparent 98%);
  animation: mk-spin 90s linear infinite; }
.mk-iris::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,209,102,.7); }
@keyframes mk-spin { to { rotate: 360deg; } }
.mk-pupil { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #0d0c12;
  box-shadow: 0 0 0 3px var(--gold), 0 0 70px rgba(255,209,102,.28), inset 0 0 40px rgba(0,0,0,.6); transition: transform .3s cubic-bezier(.3,0,.2,1), filter .3s; }
.mk-pupil img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease-out; }
.mk-eye:hover .mk-pupil img { transform: scale(1.06); }
/* Meeting light: the pupil contracts while the photo changes, then opens again. */
.mk-eye.blink .mk-pupil { transform: scale(.8); filter: brightness(1.7) blur(3px); }
.mk-open { position: absolute; inset-inline-end: 2%; bottom: 2%; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; font-size: 22px;
  color: #241a08; background: linear-gradient(135deg, #ffe39a, var(--gold) 55%, #e0a93a); box-shadow: 0 6px 16px rgba(0,0,0,.6); transition: transform .3s; }
.mk-eye:hover .mk-open { transform: scale(1.12) rotate(-8deg); }

.mk-cap { position: relative; z-index: 1; text-align: center; padding: 6px 16px 24px; }
.mk-series { direction: ltr; display: flex; flex-wrap: wrap; gap: .5em; align-items: center; justify-content: center; margin: 0 0 6px; font-size: 15px; color: var(--mute); }
.mk-series [lang='en'] { font-family: var(--serif); font-style: italic; }
.mk-series [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; }
.mk-series .g, .mk-title .g { color: var(--gold); display: inline-grid; }
.mk-series .g { font-size: .8em; }
.mk-title { direction: ltr; display: flex; gap: .45em; align-items: center; justify-content: center; margin: 0; font-size: clamp(30px, 4.6vw, 54px); font-weight: 800; line-height: 1.15; color: #fff; white-space: nowrap; }
.mk-title [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; font-weight: 900; }
.mk-title .g { font-size: .5em; }
.mk-meta { direction: ltr; margin: 8px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.mk-meta .mk-n { color: var(--gold); }
/* Writings have long titles: they may wrap, a little smaller. */
.mk-writings .mk-cap .mk-title { white-space: normal; flex-wrap: wrap; row-gap: 0; font-size: clamp(24px, 3.6vw, 44px); }
.mk-writings .mk-words .mk-title { white-space: normal; flex-wrap: wrap; }
/* Two ways into a writing, to pick at a glance: the full text, or the same piece in pictures. English is a small badge. */
.mk-ways { margin: 4px 0 40px; text-align: center; }
.wy-cards { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.wy-card { width: 230px; height: 200px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 18px; border-radius: 20px;
  color: #fff; text-decoration: none; font: inherit; font-family: 'Vazirmatn', system-ui, sans-serif; cursor: pointer;
  background: rgba(255,209,102,.06); border: 1.5px solid rgba(255,209,102,.35); transition: transform .25s cubic-bezier(.2,1.6,.4,1), border-color .25s, background .25s; }
.wy-card:hover { transform: translateY(-4px) scale(1.03); border-color: var(--gold); background: rgba(255,209,102,.1); }
.wy-see { background: rgba(255,122,89,.06); border-color: rgba(255,122,89,.4); }
.wy-see:hover { border-color: var(--coral); background: rgba(255,122,89,.1); }
.wy-card b { font-size: 20px; font-weight: 800; }
.wy-card small { font-size: 13px; color: var(--mute); }
.wy-ic { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: auto; border-radius: 50%; font-size: 40px; color: #160f05; background: linear-gradient(135deg, var(--gold), var(--coral)); }
.wy-fan { position: relative; display: block; width: 100%; height: 96px; margin-bottom: auto; }
.wy-fan img { position: absolute; left: 50%; top: 0; height: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; translate: -50% 0; box-shadow: 0 10px 20px -8px #000;
  transform: translateX(calc(var(--k) * 50%)) rotate(calc(var(--k) * 9deg)); transform-origin: 50% 120%; transition: transform .35s cubic-bezier(.2,1.5,.4,1); }
.wy-see:hover .wy-fan img { transform: translateX(calc(var(--k) * 62%)) rotate(calc(var(--k) * 13deg)) translateY(-4px); }
.wy-en { display: inline-flex; gap: 6px; align-items: center; margin-top: 22px; padding: 6px 12px; border-radius: 999px; font: 600 13px/1 var(--font); color: var(--mute); text-decoration: none; border: 1px solid var(--line); transition: color .2s, border-color .2s; }
.wy-en:hover { color: #fff; border-color: rgba(255,209,102,.5); }
@media (max-width: 760px) {
  .wy-cards { gap: 12px; }
  .wy-card { width: calc(50% - 6px); height: 170px; padding: 14px 10px; }
  .wy-card b { font-size: 16px; }
  .wy-card small { font-size: 11.5px; }
  .wy-ic { width: 64px; height: 64px; font-size: 30px; }
  .wy-fan, .wy-fan img { height: 76px; }
}
/* The slide viewer, on top of everything. */
.mk-ss { direction: ltr; position: fixed; inset: 0; z-index: 80; background: #050508; display: grid; place-items: center; touch-action: none; }
.mk-ss-frame { height: 100svh; width: 100vw; display: grid; place-items: center; padding: 64px 70px 24px; box-sizing: border-box; }
.mk-ss-frame img { max-width: 100%; max-height: calc(100svh - 92px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 60px -20px #000; }
.mk-ss-top { position: fixed; top: 0; left: 50%; translate: -50% 0; width: min(560px, 100vw - 120px); padding-top: 14px; z-index: 2; text-align: center; }
.mk-ss-bars { display: flex; gap: 4px; direction: ltr; }
.mk-ss-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.22); }
.mk-ss-bars i.done, .mk-ss-bars i.on { background: var(--gold); }
.mk-ss-name { margin: 8px 0 0; font-family: 'Vazirmatn', system-ui, sans-serif; font-size: 13px; color: var(--mute); }
.mk-ss-x, .mk-ss-go { position: fixed; z-index: 2; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(20,18,28,.75); border: 1px solid rgba(255,255,255,.14); font: 400 28px/1 system-ui; }
.mk-ss-x { top: 12px; right: 12px; width: 44px; height: 44px; }
.mk-ss-go { top: 50%; translate: 0 -50%; width: 50px; height: 50px; font-size: 34px; }
.mk-ss-go.prev { left: 12px; }
.mk-ss-go.next { right: 12px; }
.mk-ss-x:hover, .mk-ss-go:hover { color: var(--gold); border-color: rgba(255,209,102,.5); }
@media (max-width: 760px) {
  .mk-ss-frame { padding: 56px 0 0; }
  .mk-ss-frame img { max-height: calc(100svh - 60px); border-radius: 0; }
  .mk-ss-go { display: none; }
}
.mk-meta i { font-style: normal; margin: 0 .4em; opacity: .6; }
.mk-meta [lang="fa"] { unicode-bidi: isolate; letter-spacing: 0; font-family: 'Vazirmatn', system-ui, sans-serif; }

/* The open photo: the pupil dilates into the whole picture, the story below like an open book. */
.mk-lock, .mk-lock body { overflow: hidden; }
.mk-view { position: fixed; inset: 0; z-index: 60; touch-action: pan-y; }
/* The dark behind the opened photo is its own layer, so fading it in is a cheap opacity change. */
.mk-dim { position: fixed; inset: 0; background: #07080d; pointer-events: none; }
.mk-scroll { position: relative; }
.mk-lock .mk-iris { animation-play-state: paused; }
.mk-view[hidden] { display: none; }
.mk-scroll { height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.mk-photo { margin: 0; padding: 70px 72px 0; display: flex; justify-content: center; }
.mk-photo img { display: block; width: auto; height: auto; max-width: min(1300px, 100%); max-height: calc(100svh - 150px); border-radius: 6px; box-shadow: 0 40px 80px -30px #000, 0 0 0 1px rgba(255,209,102,.18); }
.mk-words { max-width: 1080px; margin: 0 auto; padding: 30px 84px 90px; }
.mk-words .mk-title { font-size: clamp(28px, 4vw, 46px); margin-bottom: 26px; }
.mk-book { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 40px; align-items: start; margin-bottom: 34px; }
.mk-book article { margin: 0; color: #e3deef; }
.mk-book article p { margin: 0 0 1em; }
.mk-book [lang='en'] { font-family: var(--serif); font-size: 19px; line-height: 1.7; }
.mk-book [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; font-size: 18px; line-height: 2.05; text-align: right; }
.mk-spine { align-self: stretch; background: linear-gradient(transparent, rgba(255,209,102,.55), transparent); }
.mk-view.no-words .mk-book { display: none; }
.mk-x, .mk-step { position: fixed; z-index: 2; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--ink, #fff);
  background: rgba(20,18,28,.75); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(8px); transition: transform .25s, color .25s, border-color .25s; }
.mk-x { top: 14px; right: 14px; width: 46px; height: 46px; font-size: 22px; }
.mk-step { top: 50%; translate: 0 -50%; width: 72px; height: 72px; padding: 0; overflow: visible; border: 2px solid rgba(255,209,102,.55); box-shadow: 0 0 22px -6px rgba(255,209,102,.6); }
.mk-step img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 50%; display: block; }
.mk-step .p-arrow { font-size: 15px; }
.mk-step.prev .p-arrow { left: -6px; }
.mk-step.next .p-arrow { right: -6px; }
.mk-step.prev:hover .p-arrow { animation: nudge-l .6s ease-in-out infinite; }
.mk-step.next:hover .p-arrow { animation: nudge-r .6s ease-in-out infinite; }
.mk-scroll { transform-origin: 50% 40vh; }
.mk-step.prev { left: 12px; }
.mk-step.next { right: 12px; }
.mk-x:hover, .mk-step:hover { color: var(--gold); border-color: rgba(255,209,102,.5); transform: scale(1.08); }

@media (max-width: 760px) {
  .mk { padding-top: 56px; }
  .mk-cap { padding-bottom: 16px; }
  .mk-series { font-size: 12px; }
  .mk-title { font-size: 28px; }
  .mk-meta { font-size: 10px; }
  .mk-open { width: 36px; height: 36px; font-size: 18px; }
  .mk-photo { padding: 64px 0 0; }
  .mk-photo img { border-radius: 0; max-height: 72svh; }
  .mk-words { padding: 22px 18px 110px; }
  .mk-book { grid-template-columns: 1fr; gap: 22px; }
  .mk-spine { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,209,102,.55), transparent); }
  .mk-book [lang='fa'] { order: -2; }
  .mk-spine { order: -1; }
  .mk-step { top: auto; bottom: 18px; translate: none; width: 56px; height: 56px; }
  .mk-step.prev { left: 16px; }
  .mk-step.next { right: 16px; }
}
/* Writings are mostly for Persian readers: the English title steps back. */
.mk-writings .mk-title [lang='en'] { font-size: .5em; font-weight: 600; color: var(--mute); }
.mk-writings .mk-title { flex-direction: row-reverse; }

/* SEO/speed: <picture> wraps an <img> only to offer a WebP twin; it must not change layout. */
picture { display: contents; }
h1.mk-series { font-weight: inherit; }

/* The second way Bahman writes his name, under the name: Bahman Reshadipour ∞ بهمن رشادی پور. */
.s-alias { direction: ltr; display: flex; gap: .55em; align-items: center; justify-content: center; margin: -6px 0 10px; font-size: 15px; color: var(--mute); }
.s-alias [lang='en'] { font-family: var(--serif); font-style: italic; }
.s-alias [lang='fa'] { font-family: 'Vazirmatn', system-ui, sans-serif; }
.s-alias .g { color: var(--gold); font-size: .7em; display: inline-grid; }
/* Byline of a writing. */
.r-by { margin: -4px 0 14px; font-size: 15px; }
.r-by a { color: var(--mute); text-decoration: none; }
.r-by a:hover { color: var(--gold); }
/* About: the projects, group by group. */
.about .a-groups { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px; }
.about .a-group > h3 { display: flex; gap: .5em; align-items: center; justify-content: center; font-size: 17px; color: var(--mute); margin: 0 0 12px; }
.about .a-group > ul { list-style: none; padding: 0; margin: 0; }
.about .s-name { margin-top: 6px; }
/* قاب‌به‌قاب on its own page: the slides sit in a list, one shown at a time; li and figure step aside so the picture
   is laid out exactly as it was in the overlay. */
ol.mk-ss-frame { margin: 0; list-style: none; }
.mk-ss-frame > li:not([hidden]), .mk-ss-frame figure { display: contents; }
a.mk-ss-x { text-decoration: none; }
