/* =========================================================================
   دفتر — سایت شخصی
   رنگ‌ها از خود موضوع: مرکب، کاغذ زیر نور چراغ، و مس که از نشان قبلی مانده.
   ========================================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Naskh";
  src: url("fonts/NotoNaskhArabic.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Marcellus";
  src: url("fonts/Marcellus.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* زمینه، خودِ پتینه است: لایهٔ زنگارزده‌ای که همه‌چیز رویش می‌نشیند.
     مس جایی است که فلز از زیرش بیرون زده. */
  --void:      #132320;
  --void-2:    #0E1A18;
  --raise:     #1B2E2A;

  --paper:     #E9E2D6;
  --paper-dim: #A99F90;
  --dust:      #8A948F;

  --copper:    #B87333;
  --copper-lt: #E4B27E;
  --ember:     #7A4A28;
  --verdigris: #3E7A6E;

  --line:      rgba(184, 115, 51, 0.24);
  --line-soft: rgba(138, 148, 143, 0.20);

  --f-mark: "Marcellus", Georgia, serif;
  --f-nas:  "Naskh", "Vazirmatn", serif;
  --f-body: "Vazirmatn", system-ui, "Segoe UI", Tahoma, sans-serif;

  --wide:    64rem;
  --read:    44rem;
  --measure: 34rem;
  --pad:     clamp(1.15rem, 5vw, 3rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* خط فارسی letter-spacing نمی‌گیرد — اتصال حروف را می‌شکند.
   فاصله‌گذاری فقط روی لاتین. */

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 1px solid var(--copper); outline-offset: 4px; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 90;
  background: var(--copper); color: var(--void);
  padding: .6rem 1.1rem;
}
.skip:focus { inset-inline-start: 0; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==============================================================  سرصفحه  */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem var(--pad) 6rem;
  overflow: hidden;
  background:
    radial-gradient(62% 50% at 50% 42%, rgba(184, 115, 51, 0.12) 0%, rgba(19, 35, 32, 0) 72%),
    var(--void);
}

.hero__grain {
  position: absolute; inset: -50%;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 120s linear infinite;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-200px, -200px, 0); }
}

.hero__inner { position: relative; z-index: 1; width: 100%; }

/* ---- امضا: انگار همان لحظه نوشته می‌شود ----
   جهت آشکار شدن از راست به چپ است، یعنی جهت نوشتن فارسی. */
.sig {
  margin: 0 auto;
  max-width: min(30rem, 82vw);
  clip-path: inset(0 0 0 0);
  transition: clip-path 2.8s cubic-bezier(.25, .6, .25, 1);
}
.sig img { display: block; width: 100%; height: auto; }

.sig--type {
  font-family: var(--f-nas);
  font-weight: 400;
  font-size: clamp(2.1rem, 9vw, 3.6rem);
  line-height: 1.9;
  color: var(--paper);
  max-width: none;
}

/* حالت آغازین؛ جاوااسکریپت برش می‌دارد تا حرکت دیده شود */
.sig--unwritten { clip-path: inset(0 0 0 100%); }

.hero__line {
  margin: clamp(1.8rem, 5vw, 2.8rem) auto 0;
  max-width: 28rem;
  font-size: .9rem;
  color: var(--dust);
  line-height: 2.15;
}

/* نشانهٔ اسکرول قدیمی حذف شد؛ نسخهٔ ثابت پایین‌تر تعریف می‌شود */

/* ================================================================  نوار شناور  */

.nav {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem var(--pad);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.nav__lat {
  font-family: var(--f-mark);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: .82rem;
  color: var(--copper-lt);
  text-shadow: 0 1px 14px rgba(14, 26, 24, 0.7);
}
.nav__mark:hover .nav__lat { color: var(--paper); }

.nav__burger {
  width: 40px; height: 40px;
  border: none; background: none;
  cursor: pointer; padding: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 6px; align-items: center;
}
.nav__burger span {
  display: block; width: 22px; height: 1px;
  background: var(--copper-lt);
  box-shadow: 0 0 10px rgba(14, 26, 24, 0.8);
  transition: transform .35s ease, width .35s ease;
}
.nav__burger:hover span { width: 26px; }

.menu {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(19, 35, 32, 0.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: menuin .3s ease;
}
.menu[hidden] { display: none; }
@keyframes menuin { from { opacity: 0; } to { opacity: 1; } }
.menu__close {
  position: absolute; top: .9rem; inset-inline-end: calc(var(--pad) - .4rem);
  background: none; border: none; color: var(--dust);
  font-size: 2.4rem; line-height: 1; cursor: pointer; padding: .3rem .6rem;
}
.menu__close:hover { color: var(--copper-lt); }
.menu__list { list-style: none; margin: 0; padding: 0; text-align: center; }
.menu__list li { margin: .4rem 0; }
.menu__list a {
  display: inline-block;
  font-family: var(--f-nas);
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  line-height: 2;
  color: var(--paper);
  padding: .1rem 1rem;
  transition: color .3s ease;
}
.menu__list a:hover { color: var(--copper-lt); }
.menu__who { margin-top: 2rem; font-size: .8rem; color: var(--dust); }

/* صفحه‌هایی که هیرو ندارند، محتوا از زیر نوار شناور بیرون می‌آید */
body:not(.has-hero) main { padding-top: 5.5rem; }

/* ==============================================================  جریان  */

main { max-width: var(--wide); margin: 0 auto; padding: 0 var(--pad); }

.stream {
  list-style: none;
  margin: 0; padding: clamp(2.5rem, 8vw, 4.5rem) 0 0;
}

.entry { border-bottom: 1px solid var(--line-soft); }
.entry:last-child { border-bottom: none; }

.entry__link {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: clamp(1.1rem, 4vw, 2rem);
  align-items: start;
  padding: clamp(1.6rem, 4vw, 2.4rem) 0;
}

/* برگ: گوشهٔ بالای صفحهٔ دستنویس، در سایه.
   با نزدیک شدن توجه، روشن می‌شود. */
.entry__leaf {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--void-2);
  border: 1px solid var(--line-soft);
}
.entry__leaf img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: .52;
  filter: saturate(.75);
  transition: opacity .7s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1), filter .7s ease;
}
@media (hover: hover) {
  .entry__link:hover .entry__leaf img { opacity: 1; filter: none; transform: scale(1.03); }
}

.entry__date {
  font-family: var(--f-nas);
  font-size: .78rem;
  color: var(--dust);
  line-height: 1.6;
}
.entry__title {
  margin: .2rem 0 0;
  font-family: var(--f-nas);
  font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  font-weight: 400;
  line-height: 1.85;
  transition: color .4s ease;
}
.entry__link:hover .entry__title { color: var(--copper-lt); }
.entry__ex {
  margin: .35rem 0 0;
  font-size: .86rem;
  color: var(--paper-dim);
  line-height: 2;
}
.entry__tags { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }

.tag {
  display: inline-block;
  font-size: .66rem; line-height: 1.9;
  padding: 0 .5rem;
  border: 1px solid var(--line-soft);
  color: var(--dust);
}
.tag--lock { border-color: rgba(62, 122, 110, 0.5); color: var(--verdigris); }
.tag--draft { border-color: rgba(138, 75, 46, 0.5); color: var(--ember); }

/* ---- دعوت به ورود، پای جریان ---- */
.gate {
  margin: clamp(3rem, 9vw, 5rem) 0 0;
  padding-bottom: clamp(3rem, 9vw, 5rem);
  text-align: center;
}
.gate__rule {
  width: 3rem; height: 1px;
  background: var(--line);
  margin: 0 auto clamp(1.6rem, 4vw, 2.2rem);
}
.gate p { margin: 0 0 1.4rem; color: var(--dust); font-size: .88rem; }
.gate__acts { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================================  یک نوشته  */

.post { padding: clamp(2.5rem, 8vw, 4.5rem) 0 clamp(3rem, 9vw, 5rem); }

.post__head { text-align: center; max-width: var(--read); margin: 0 auto; }
.post__date { font-family: var(--f-nas); font-size: .8rem; color: var(--dust); }
.post__title {
  margin: .3rem 0 0;
  font-family: var(--f-nas);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 400;
  line-height: 1.75;
}
.post__admin { margin-top: .9rem; display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.tag--edit { border-color: var(--line); color: var(--copper); }

.prose {
  max-width: var(--measure);
  margin: clamp(2.2rem, 6vw, 3.2rem) auto 0;
  font-size: .96rem;
  line-height: 2.25;
  color: #D9D2C6;
}
.prose p { margin: 0 0 1.4em; }
.prose p:last-child { margin-bottom: 0; }

/* ---- صفحه‌های دستنویس ---- */
.pages {
  max-width: var(--read);
  margin: clamp(2.4rem, 7vw, 3.6rem) auto 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 5vw, 2.6rem);
}
.page { margin: 0; }
.page__btn {
  display: block; width: 100%;
  padding: 0; margin: 0; border: none;
  background: var(--void-2);
  font: inherit; color: inherit;
  -webkit-appearance: none; appearance: none;
  cursor: zoom-in;
  line-height: 0;
}
/* نسبت تصویر باید حفظ شود، مهم نیست صفت‌های width/height چه می‌گویند */
.page__btn img {
  display: block;
  width: 100%;
  height: auto;
}
.page__n {
  margin-top: .5rem;
  font-size: .72rem;
  color: var(--dust);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ============================================================  پردهٔ ورود  */

/* پیش‌فرض پنهان است. اگر جاوااسکریپت اجرا نشود، پرده اصلاً نمی‌آید
   و نوشته مستقیم خوانده می‌شود — به جای اینکه صفحه قفل بماند. */
.veil {
  position: fixed; inset: 0; z-index: 70;
  background: var(--void);
  display: none; align-items: center; justify-content: center;
  padding: 2rem;
  transition: opacity .8s ease;
}
.veil.is-on { display: flex; }
.veil.is-gone { opacity: 0; pointer-events: none; }
.veil__box { text-align: center; max-width: 26rem; }
.veil__date { font-family: var(--f-nas); font-size: .8rem; color: var(--dust); }
.veil__title {
  font-family: var(--f-nas);
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.9;
  margin-top: .3rem;
}
.veil__go {
  margin-top: 2rem;
  font-family: var(--f-nas);
  font-size: 1rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--copper-lt);
  padding: .6rem 2.6rem;
  cursor: pointer;
  transition: background .4s ease, border-color .4s ease;
}
.veil__go:hover { background: rgba(184, 115, 51, 0.12); border-color: var(--copper); }
.veil__hint { margin-top: 1rem; font-size: .74rem; color: var(--dust); }

/* ==============================================================  پخش صدا  */

.player {
  display: flex; align-items: center; gap: .9rem;
  max-width: var(--measure);
  margin: clamp(1.8rem, 5vw, 2.4rem) auto 0;
}
.player__btn {
  flex: none; width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent; cursor: pointer; position: relative;
  transition: border-color .3s ease, background .3s ease;
}
.player__btn:hover { border-color: var(--copper); background: rgba(184, 115, 51, 0.12); }
.player__icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
/* کنترل صدا عمداً چپ‌به‌راست است: قرارداد جهانی پخش‌کننده‌ها */
.player__icon--play {
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--copper);
  margin-left: 2px;
}
.player__icon--pause {
  width: 9px; height: 11px;
  border-left: 3px solid var(--copper);
  border-right: 3px solid var(--copper);
  display: none;
}
.player.is-playing .player__icon--play { display: none; }
.player.is-playing .player__icon--pause { display: block; }
.player__rule {
  flex: 1; height: 2px;
  background: rgba(138, 148, 143, 0.22);
  position: relative; overflow: hidden; cursor: pointer;
  direction: ltr;
}
.player__fill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0;
  background: linear-gradient(90deg, var(--ember), var(--copper-lt));
  transition: width .12s linear;
}
.player__time {
  flex: none; font-size: .74rem; color: var(--dust);
  min-width: 3.2em; text-align: left;
  font-variant-numeric: tabular-nums;
}

/* ============================================================  یادداشت‌ها  */

.talk { max-width: var(--measure); margin: clamp(3rem, 9vw, 5rem) auto 0; }
.talk__rule { height: 1px; background: var(--line-soft); margin-bottom: clamp(1.6rem, 5vw, 2.4rem); }
.talk__list { list-style: none; margin: 0 0 2rem; padding: 0; }

.note {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.note:last-child { border-bottom: none; }
.note__who {
  font-size: .82rem; color: var(--copper);
  display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap;
}
.note__when { font-size: .72rem; color: var(--dust); }
.note__body { margin-top: .25rem; font-size: .9rem; color: var(--paper-dim); line-height: 2.05; }

.talk__form { margin-top: 1rem; }
.talk__label { display: block; font-size: .8rem; color: var(--dust); margin-bottom: .4rem; }
.talk__form textarea {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  color: var(--paper);
  font: inherit; line-height: 2;
  padding: .6rem .8rem;
  resize: vertical;
  margin-bottom: .8rem;
}
.talk__form textarea:focus { border-color: var(--line); outline: none; }
.talk__hint { margin: .8rem 0 0; font-size: .76rem; color: var(--dust); }
.talk__hint a { color: var(--copper); }

/* =================================================================  فرم  */

.sheet {
  max-width: 24rem;
  margin: clamp(3rem, 10vw, 6rem) auto;
  padding-bottom: 4rem;
}
.sheet__title {
  margin: 0 0 1.4rem;
  font-family: var(--f-nas);
  font-size: 1.5rem; font-weight: 400;
}
.sheet__sub { margin: -.9rem 0 1.5rem; font-size: .86rem; color: var(--dust); }
.sheet__foot { margin-top: 1.6rem; font-size: .8rem; color: var(--dust); }
.sheet__foot a { color: var(--copper); }

.field { display: block; margin-bottom: 1.1rem; }
.field__label { display: block; font-size: .8rem; color: var(--dust); margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  color: var(--paper);
  font: inherit;
  padding: .55rem .7rem;
}
.field textarea { line-height: 2; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--line); outline: none; }

.btn {
  display: inline-block;
  font-family: var(--f-body); font-size: .85rem;
  padding: .6rem 1.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--copper-lt);
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.btn:hover { background: rgba(184, 115, 51, 0.12); border-color: var(--copper); }
.btn--go { background: var(--copper); border-color: var(--copper); color: #17110D; font-weight: 500; }
.btn--go:hover { background: var(--copper-lt); border-color: var(--copper-lt); color: #17110D; }
.btn--go:disabled { opacity: .45; cursor: not-allowed; }
.btn--quiet { color: var(--dust); border-color: var(--line-soft); }
.btn--quiet:hover { color: var(--paper); }

.msg {
  border-inline-start: 3px solid;
  padding: .7rem 1rem;
  margin-bottom: 1.2rem;
  font-size: .86rem; line-height: 1.9;
  border-radius: 3px;
}
.msg--ok  { background: rgba(184, 115, 51, 0.12); border-color: var(--copper); }
.msg--err { background: rgba(138, 75, 46, 0.18);  border-color: var(--ember); }

.hollow-page {
  text-align: center;
  padding: clamp(4rem, 16vw, 9rem) 0;
  color: var(--dust);
}
.hollow-page p { margin: 0 0 1.6rem; font-family: var(--f-nas); font-size: 1.1rem; }
.hollow-page__sub { font-family: var(--f-body) !important; font-size: .86rem !important; }

/* ===============================================================  پیمایش  */

.pager {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.4rem;
  max-width: var(--read);
  margin: clamp(3.5rem, 10vw, 6rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: .8rem;
}
.pager__side { max-width: 40%; }
.pager__side--end { text-align: left; }
.pager__dir { display: block; color: var(--dust); font-size: .72rem; }
.pager__name {
  display: block; font-family: var(--f-nas); color: var(--paper);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .3s ease;
}
.pager__side:hover .pager__name { color: var(--copper-lt); }
.pager__all { color: var(--dust); }
.pager__all:hover { color: var(--copper); }

/* ================================================================  پانویس  */

.foot { max-width: var(--wide); margin: 0 auto; padding: 0 var(--pad) clamp(2.5rem, 7vw, 4rem); }
.foot__rule { height: 1px; background: var(--line-soft); margin-bottom: 1.4rem; }
.foot__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.foot__lat {
  font-family: var(--f-mark); text-transform: uppercase;
  letter-spacing: .26em; font-size: .74rem;
  color: var(--copper); opacity: .65;
}
.foot__year { font-size: .74rem; color: var(--dust); font-family: var(--f-nas); }

/* ============================================================  تصویر بزرگ  */

.viewer {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 18, 16, 0.985);
  display: flex; align-items: center; justify-content: center;
  padding: 3.2rem .6rem;
  overflow: auto;
}
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; height: auto; }
.viewer__close {
  position: fixed; top: .4rem; inset-inline-end: 1rem;
  background: none; border: none; color: var(--dust);
  font-size: 2.4rem; line-height: 1; cursor: pointer; padding: .3rem .6rem;
  z-index: 2;
}
.viewer__close:hover { color: var(--copper); }

/* ================================================================  حرکت  */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .sig { transition: none; }
  .hero__grain, .hero__cue span { animation: none; }
  .entry__leaf img { transition: none; opacity: .85; }
  .veil { transition: none; }
}

@media (max-width: 34rem) {
  .entry__link { grid-template-columns: 5.2rem 1fr; gap: 1rem; }
  .pager { flex-direction: column; gap: 1rem; align-items: stretch; }
  .pager__side, .pager__side--end { max-width: none; text-align: start; }
}


/* ==========================================================  هیرو با تصویر  */

.hero--image {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  text-align: start;
  padding: 0;
  isolation: isolate;          /* بلندینگ لایهٔ رنگ به بیرون هیرو نشت نکند */
  background: var(--void);
}

.hero__pic {
  position: absolute; inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero__pic img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 40% 32%;   /* چهره کمی چپ‌تر از مرکز، در نیمهٔ بالایی */
}

/* نوسان مس ↔ زنگار.
   یک لایهٔ رنگ مسی روی دو ناحیه (پایین‌چپ و بالا‌راست) می‌نشیند و
   hue آن آرام تا زنگار می‌چرخد و برمی‌گردد. mix-blend-mode: color یعنی
   فقط رنگ عوض می‌شود، روشنایی تصویر دست‌نخورده می‌ماند. */
.hero__tint {
  position: absolute; inset: 0;
  pointer-events: none;
  mix-blend-mode: color;
  opacity: .8;
  background:
    radial-gradient(75% 70% at 22% 62%, var(--copper) 0%, rgba(184, 115, 51, 0) 72%),
    radial-gradient(60% 45% at 62% 12%, var(--copper) 0%, rgba(184, 115, 51, 0) 74%);
  animation: oxidize 20s ease-in-out infinite alternate;
  will-change: filter;
}
/* نیمهٔ اول چرخه روی رنگ اصلی می‌ماند، بعد آرام تا زنگار می‌رود و کوتاه آنجا می‌ایستد.
   با alternate، برگشت هم همین‌طور است؛ در مجموع سه برابرِ زنگار، روی رنگ اصلی است. */
@keyframes oxidize {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(0deg); }
  85%  { filter: hue-rotate(150deg); }
  100% { filter: hue-rotate(150deg); }
}

/* محو شدن به زمینه: موبایل از پایین، دسکتاپ از راست و کمی از پایین */
.hero__pic::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19, 35, 32, 0) 42%, var(--void) 100%);
}

.hero--image .hero__grain { z-index: 1; }

.hero__text {
  position: relative; z-index: 2;
  padding: 0 var(--pad) clamp(3.5rem, 9vw, 5rem);
  max-width: 30rem;
}
.hero__title {
  margin: 0;
  font-family: var(--f-nas);
  font-weight: 400;
  font-size: clamp(2rem, 7.5vw, 3.2rem);
  line-height: 1.75;
  color: var(--paper);
}
.hero__sub {
  margin: .6rem 0 0;
  font-size: .92rem;
  line-height: 2.1;
  color: var(--paper-dim);
  max-width: 24rem;
}
.hero__dash {
  width: 3rem; height: 1px;
  background: var(--copper);
  margin-top: 1.6rem;
}
.hero__sub.reveal  { transition-delay: .18s; }
.hero__dash.reveal { transition-delay: .32s; }

@media (min-width: 60rem) {
  .hero--image { justify-content: center; }
  /* تصویر فیزیکاً سمت چپ؛ ۲۶٪ راست برای متن. با جهت RTL قاطی نشود. */
  .hero__pic { left: 0; right: 26%; top: 0; bottom: 0; }
  .hero__pic::after {
    background:
      linear-gradient(180deg, rgba(19, 35, 32, 0) 72%, var(--void) 100%),
      linear-gradient(to right, rgba(19, 35, 32, 0) 60%, var(--void) 100%);
  }
  .hero__text {
    padding: 0 clamp(2rem, 6vw, 5rem);
    max-width: 34rem;
    margin-inline-start: 0;
    margin-inline-end: auto;
  }
  .hero__title { font-size: clamp(2.4rem, 4vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__tint { animation: none; filter: hue-rotate(70deg); }
}


/* ============================================================  نشانهٔ اسکرول  */

.cue {
  position: fixed; bottom: 1.6rem; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: .6rem .9rem;
  border-radius: 999px;
  background: rgba(14, 26, 24, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .5s ease, transform .5s ease;
}
.cue__line {
  display: block; width: 1px; height: 22px;
  background: linear-gradient(180deg, transparent, var(--copper-lt));
  transform-origin: top;
  animation: sink 2.4s ease-in-out infinite;
}
.cue__chev {
  display: block; width: 12px; height: 12px;
  border-right: 1px solid var(--copper-lt);
  border-bottom: 1px solid var(--copper-lt);
  transform: rotate(45deg);
  margin-top: -6px;
  animation: chev 2.4s ease-in-out infinite;
}
@keyframes sink {
  0%, 100% { transform: scaleY(.3); opacity: .3; }
  50%      { transform: scaleY(1);  opacity: .9; }
}
@keyframes chev {
  0%, 100% { opacity: .5; transform: rotate(45deg) translate(0, 0); }
  50%      { opacity: 1;  transform: rotate(45deg) translate(2px, 2px); }
}
.is-scrolled .cue { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .cue__line, .cue__chev { animation: none; opacity: .8; }
}


/* ============================================================  چند صفحه: محو به بعدی  */

.slides {
  max-width: var(--read);
  margin: clamp(2.4rem, 7vw, 3.6rem) auto 0;
}
.slides__frame {
  position: relative;
  width: 100%;
  background: var(--void-2);
  overflow: hidden;
  touch-action: pan-y;
}
.slide {
  position: absolute; inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .9s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.slide.is-on { opacity: 1; pointer-events: auto; z-index: 1; }
.slide .page__btn { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.slide .page__btn img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.slides__arrow {
  position: absolute; top: 50%; z-index: 2;
  width: 44px; height: 44px;
  transform: translateY(-50%);
  border: none; background: rgba(14, 26, 24, 0.45);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s ease, background .3s ease;
}
.slides__arrow::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 10px; height: 10px;
  border-left: 1px solid var(--copper-lt);
  border-bottom: 1px solid var(--copper-lt);
}
/* جهت خواندن راست‌به‌چپ است: «بعد» سمت چپ، «قبل» سمت راست */
.slides__arrow--next { left: .6rem; }
.slides__arrow--next::before { transform: translate(-35%, -50%) rotate(45deg); }
.slides__arrow--prev { right: .6rem; }
.slides__arrow--prev::before { transform: translate(-65%, -50%) rotate(-135deg); }
.slides__frame:hover .slides__arrow,
.slides__arrow:focus-visible { opacity: 1; }
@media (hover: none) { .slides__arrow { opacity: .8; } }
.slides__arrow:hover { background: rgba(14, 26, 24, 0.75); }
.slides__arrow[disabled] { opacity: 0 !important; pointer-events: none; }

.slides__bar {
  margin-top: .55rem;
  text-align: center;
  font-size: .74rem; color: var(--dust);
  font-variant-numeric: tabular-nums;
}

/* ============================================================  موسیقی صفحهٔ اصلی  */

/* دکمهٔ مسی گرد، کمی پایین‌تر از نشان لاتین (بالا راست). ثابت می‌ماند تا هنگام
   خواندن هم بشود موسیقی را نگه داشت. */
.tune {
  position: fixed;
  top: 4.9rem;
  inset-inline-start: var(--pad);   /* در RTL یعنی راست */
  z-index: 35;
  width: 44px; height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 6px 22px rgba(14, 26, 24, 0.55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s ease, transform .3s ease;
}
.tune:hover { background: var(--copper-lt); transform: scale(1.05); }
.tune:active { transform: scale(.97); }

/* مثلث پخش، مثل یوتیوب؛ کمی به راست تا از نظر بصری وسط بنشیند */
.tune__play {
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #14100D;
  margin-left: 3px;
}
.tune__pause {
  width: 12px; height: 14px;
  border-left: 4px solid #14100D;
  border-right: 4px solid #14100D;
  display: none;
}
.tune.is-playing .tune__play { display: none; }
.tune.is-playing .tune__pause { display: block; }

.tune__ring {
  position: absolute; inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--copper-lt);
  opacity: 0;
  pointer-events: none;
}
.tune.is-playing .tune__ring { animation: ring 2.2s ease-out infinite; }
@keyframes ring {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tune.is-playing .tune__ring { animation: none; opacity: .6; }
  .slide { transition: none; }
}
