:root {
  --stone:#F2F4F0; --surface:#FFFFFF; --cypress:#2E4A3B; --ink:#1E2823;
  --muted:#5C6B62; --gilt:#A8843A; --line:#D9DFD8; --warn:#9B2C2C;
  color-scheme: light; box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  :root { --stone:#101A15; --surface:#16231C; --cypress:#A9C7B4; --ink:#E6ECE7;
          --muted:#9FB0A5; --gilt:#D2B56C; --line:#2A3A31; --warn:#E89B9B;
          color-scheme: dark; }
}
*,*::before,*::after{box-sizing:inherit}
[hidden]{display:none!important}
html{scroll-behavior:smooth}
body{margin:0;background:var(--stone);color:var(--ink);
     font-family:"EB Garamond",Georgia,"Times New Roman",serif;font-size:1.2rem;line-height:1.7}
img{max-width:100%;display:block}
a{color:var(--cypress)}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{
     outline:2px solid var(--gilt);outline-offset:3px}

/* ---------- language ---------- */
[lang="fa"]{font-family:Vazirmatn,"EB Garamond",Tahoma,sans-serif;direction:rtl;text-align:right}
[lang="fa"] h1,[lang="fa"] h2{font-family:Vazirmatn,"Cormorant Garamond",serif}
[lang="fa"] .hero,[lang="fa"] .passage,[lang="fa"] .closing,[lang="fa"] .gate,
[lang="fa"] .pagehead{text-align:center}
[lang="fa"] .terraces li{border-left:0;border-right:1px solid var(--gilt);
     padding:.9rem 1.25rem .9rem 0}
[lang="fa"] .terraces li:nth-child(2){margin:0 .6rem 0 0}
[lang="fa"] .terraces li:nth-child(3){margin:0 1.2rem 0 0}
[lang="fa"] .terraces li:nth-child(4){margin:0 1.8rem 0 0}
[lang="fa"] .terraces li:nth-child(5){margin:0 2.4rem 0 0}
[lang="fa"] .terraces li:nth-child(6){margin:0 3rem 0 0}
[lang="fa"] .card{border-left:0;border-right:2px solid var(--gilt)}
.edition{display:none}
.edition.active{display:block}

.gate{position:fixed;inset:0;z-index:60;background:var(--stone);
      display:grid;place-content:center;gap:1.5rem;text-align:center;padding:2rem}
.gate h1{font-size:clamp(1.8rem,5vw,2.6rem);margin:0 0 .25rem}
.gate p{color:var(--muted);margin:0 0 1rem;font-size:1.05rem}
.gate .choices{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.gate button{font:inherit;font-size:1.1rem;padding:.8rem 2rem;cursor:pointer;
      background:var(--surface);color:var(--ink);
      border:1px solid var(--cypress);border-radius:2rem}
.gate button:hover{background:var(--cypress);color:var(--stone)}
.fa-label{font-family:Vazirmatn,sans-serif}

.topbar{position:sticky;top:0;z-index:40;background:var(--stone);
      border-bottom:1px solid var(--line);padding:.5rem 1rem;
      display:flex;align-items:center;justify-content:center;gap:1.5rem;flex-wrap:wrap}
.topbar nav{display:flex;gap:1rem}
.topbar nav a{font-size:1rem;text-decoration:none;color:var(--muted);
      padding:.3rem .6rem;border-radius:1rem}
.topbar nav a:hover{color:var(--ink)}
.topbar nav a[aria-current="page"]{color:var(--ink);background:var(--surface);
      border:1px solid var(--line)}
.langpick{display:flex;gap:.25rem}
.langpick button{font:inherit;font-size:.95rem;background:none;border:0;cursor:pointer;
      color:var(--muted);padding:.3rem .8rem;border-radius:1rem}
.langpick button[aria-pressed="true"]{color:var(--ink);background:var(--surface);
      border:1px solid var(--line)}

/* ---------- hero ---------- */
.hero{text-align:center;padding:4rem 1.5rem 3rem}
.star{width:118px;height:118px;margin:0 auto 2rem}
.star .ink{fill:none;stroke:var(--gilt);stroke-width:1.5;
     stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;
     animation:draw 2.2s ease-out forwards}
.star .solid{fill:var(--gilt);opacity:0;animation:fillin 1.1s ease-out 1.7s forwards}
.star.sm{width:62px;height:62px;margin-bottom:1.25rem}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes fillin{to{opacity:1}}
@media (prefers-reduced-motion:reduce){
  .star .ink{animation:none;stroke-dashoffset:0}
  .star .solid{animation:none;opacity:1}
}
.portrait{width:180px;height:180px;margin:0 auto 2rem;border-radius:50%;
     border:1px solid var(--gilt);padding:6px}
.portrait>div,.portrait img{width:100%;height:100%;border-radius:50%;object-fit:cover;
     background:var(--surface);display:grid;place-items:center;
     font-family:"Cormorant Garamond",serif;font-size:3rem;color:var(--muted)}
h1{font-family:"Cormorant Garamond",Georgia,serif;font-weight:400;
   font-size:clamp(2.6rem,8vw,4.5rem);line-height:1.05;margin:0 0 .5rem;color:var(--cypress);
   text-wrap:balance}
.role{margin:0 0 1rem;font-size:1.15rem}
.dates{color:var(--muted);margin:0;font-size:1.15rem}
.ascended{font-style:italic;color:var(--muted);margin:.25rem 0 0}

.pagehead{text-align:center;padding:3.5rem 1.5rem 1rem}
.pagehead h1{font-size:clamp(2rem,6vw,3.2rem)}
.pagehead .kicker{color:var(--muted);margin:0;font-size:1.1rem}

main{max-width:38rem;margin:0 auto;padding:0 1.5rem 4rem}
section{padding:3rem 0;border-top:1px solid var(--line)}
section:first-of-type{border-top:0}
h2{font-family:"Cormorant Garamond",Georgia,serif;font-weight:500;font-size:2rem;
   color:var(--cypress);margin:0 0 1.25rem;text-wrap:balance}
h3{font-family:"Cormorant Garamond",Georgia,serif;font-weight:500;font-size:1.3rem;
   color:var(--cypress);margin:1.75rem 0 .5rem}
p{margin:0 0 1.1rem}

/* ---------- service card ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-left:2px solid var(--gilt);
      padding:1.5rem;margin:0 0 1.5rem}
.card .when{font-size:1.35rem;color:var(--cypress);margin:0 0 .35rem}
.card .where{margin:0 0 .25rem}
.card .tel{color:var(--muted);font-size:1.05rem;margin:0}
.actions{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.25rem}
.btn{display:inline-block;padding:.7rem 1.4rem;border:1px solid var(--cypress);
     border-radius:2rem;text-decoration:none;font-size:1.05rem;background:none;
     color:var(--cypress);font-family:inherit;cursor:pointer}
.btn:hover{background:var(--cypress);color:var(--stone)}
.btn-solid{background:var(--cypress);color:var(--stone)}
.btn-solid:hover{opacity:.9}
.route{margin:0 0 1.25rem;padding-inline-start:1.25rem}
.route li{margin-bottom:.4rem}
.note{font-size:1rem;color:var(--muted);font-style:italic}

.feature{margin:1.5rem 0 0}
.feature .ph{aspect-ratio:3/2;background:var(--surface);border:1px solid var(--line);
     display:grid;place-items:center;text-align:center;color:var(--muted);
     font-size:.95rem;padding:1rem}
.feature figcaption{font-size:.95rem;color:var(--muted);padding-top:.5rem}

.passage{margin:2rem 0 0;padding:2rem 1.5rem;text-align:center;font-size:1.3rem;
     font-style:italic;line-height:1.8;border-top:1px solid var(--gilt);
     border-bottom:1px solid var(--gilt)}
.passage cite{display:block;margin-top:1rem;font-size:1rem;font-style:normal;color:var(--muted)}

.terraces{list-style:none;margin:0;padding:0}
.terraces li{padding:.9rem 0 .9rem 1.25rem;border-left:1px solid var(--gilt)}
.terraces li:nth-child(2){margin-left:.6rem}
.terraces li:nth-child(3){margin-left:1.2rem}
.terraces li:nth-child(4){margin-left:1.8rem}
.terraces li:nth-child(5){margin-left:2.4rem}
.terraces li:nth-child(6){margin-left:3rem}
.terraces .year{display:block;color:var(--gilt);font-size:1rem}

.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.75rem}
.gallery figure{margin:0}
.gallery .ph{aspect-ratio:4/5;background:var(--surface);border:1px solid var(--line);
     display:grid;place-items:center;color:var(--muted);font-size:.95rem;text-align:center;padding:.5rem}
.gallery figcaption{font-size:.95rem;color:var(--muted);padding-top:.35rem}

.memory{margin:0 0 2rem}
.memory p{margin-bottom:.4rem}
.memory footer{color:var(--muted);font-size:1rem}

/* ---------- form ---------- */
.mform{background:var(--surface);border:1px solid var(--line);padding:1.5rem;margin-top:1.5rem}
.mfield{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}
.mfield label{font-size:1rem;color:var(--muted)}
.mfield .opt{opacity:.7}
.mfield input[type=text],.mfield input[type=email],.mfield textarea{
     font:inherit;font-size:1.05rem;padding:.65rem .75rem;
     border:1px solid var(--line);border-radius:4px;background:var(--stone);color:var(--ink);
     width:100%}
.mfield textarea{min-height:120px;resize:vertical}
/* No directional offset: `left:-9999px` lands INSIDE the scroll area in RTL. */
.mhp{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
     clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

.drop{border:1px dashed var(--line);border-radius:6px;padding:1.25rem;text-align:center;
     background:var(--stone);cursor:pointer}
.drop:hover,.drop.over{border-color:var(--gilt);background:var(--surface)}
.drop p{margin:0;font-size:1rem;color:var(--muted)}
.drop input[type=file]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;
     overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));
     gap:.6rem;margin-top:.9rem}
.thumbs:empty{display:none}
.thumb{position:relative;margin:0}
.thumb img{aspect-ratio:1;object-fit:cover;border-radius:4px;border:1px solid var(--line);
     width:100%}
.thumb button{position:absolute;top:-7px;inset-inline-end:-7px;width:24px;height:24px;
     border-radius:50%;border:1px solid var(--line);background:var(--surface);
     color:var(--ink);font:inherit;font-size:1rem;line-height:1;cursor:pointer;padding:0}
.thumb figcaption{font-size:.8rem;color:var(--muted);padding-top:.2rem;
     overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.mform button[type=submit]{font:inherit;font-size:1.05rem;padding:.75rem 1.6rem;cursor:pointer;
     background:var(--cypress);color:var(--stone);border:0;border-radius:2rem}
.mform button[type=submit]:disabled{opacity:.6;cursor:default}
.mstatus{margin:.9rem 0 0;font-size:1rem;min-height:1.4em}
.mstatus.ok{color:var(--cypress)}
.mstatus.err{color:var(--warn)}

.closing{text-align:center;color:var(--muted);padding:3rem 1.5rem 4rem;font-size:1rem}
.closing svg{width:36px;height:36px;margin:0 auto 1rem;display:block}
.closing polygon{fill:none;stroke:var(--gilt);stroke-width:2}
.closing a{display:inline-block;margin-top:.75rem}

/* ---------- share ---------- */
.sharebtn{font:inherit;font-size:1rem;background:none;border:1px solid var(--line);
     color:var(--muted);padding:.3rem .9rem;border-radius:1rem;cursor:pointer}
.sharebtn:hover{color:var(--ink);border-color:var(--cypress)}
dialog.sharebox{border:1px solid var(--line);border-radius:8px;background:var(--surface);
     color:var(--ink);padding:0;max-width:30rem;width:calc(100% - 2rem)}
dialog.sharebox::backdrop{background:rgba(20,30,25,.55)}
.sharebox .inner{padding:1.5rem}
.sharebox h2{font-size:1.5rem;margin:0 0 .5rem}
.sharebox p{font-size:1.05rem}
.sharebox .x{position:absolute;inset-inline-end:.6rem;top:.5rem;margin:0}
.sharebox .x button{font:inherit;font-size:1.4rem;line-height:1;background:none;border:0;
     color:var(--muted);cursor:pointer;padding:.2rem .5rem}
.sharelinks{display:flex;flex-wrap:wrap;gap:.6rem;margin:0 0 1.5rem}
.sharelinks .btn{font-size:1rem;padding:.55rem 1.1rem}
.sharebox .mform{margin:0;padding:1.25rem;border:0;border-top:1px solid var(--line);
     background:var(--stone)}
.sharebox .mform p:first-child{margin:0 0 1rem;color:var(--muted);font-size:1rem}

/* ---------- giving ---------- */
.vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
    clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
.findform{display:flex;gap:.6rem;flex-wrap:wrap;margin:1.25rem 0 0}
.findform input{flex:1 1 16rem;min-width:0;font:inherit;font-size:1.05rem;
    padding:.65rem .75rem;border:1px solid var(--line);border-radius:4px;
    background:var(--surface);color:var(--ink)}
.findform .btn{flex:0 0 auto}
.everybox{margin:1rem 0 0}
.everybox .btn{font-size:1.1rem;padding:.8rem 1.8rem}

/* real photographs in the gallery, not placeholders */
.gallery a{display:block}
.gallery img{aspect-ratio:4/5;object-fit:cover;width:100%;border:1px solid var(--line);
     background:var(--surface)}
.gallery a:hover img{border-color:var(--gilt)}
