/* =========================================================
   معصومه نخلی — Page & Section styles
   ========================================================= */

/* ============ HERO ============ */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 64px));
  padding-bottom: clamp(56px, 8vw, 110px);
  overflow: hidden;
  isolation: isolate;
}
.hero-deco { position: absolute; inset: 0; z-index: var(--z-deco); pointer-events: none; }
.hero-deco .blob-ink-1 {
  width: clamp(320px, 42vw, 620px);
  aspect-ratio: 1;
  inset-inline-end: -12%;
  top: -14%;
  background: var(--night);
  border-radius: 50%;
  opacity: .96;
}
.hero-deco .blob-sage-1 {
  width: clamp(260px, 34vw, 520px);
  aspect-ratio: 1;
  inset-inline-start: -16%;
  bottom: -22%;
  background: var(--sage);
  opacity: .5;
}
[data-theme="dark"] .hero-deco .blob-ink-1 { background: #2A241C; opacity: .7; }
[data-theme="dark"] .hero-deco .blob-sage-1 { opacity: .16; }

.hero-grid {
  position: relative;
  z-index: var(--z-content);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.hero-copy { max-width: 560px; }
.hero h1 { margin-block: var(--space-4) var(--space-5); }
.hero h1 .foil-text { display: inline-block; }
.hero .lead { margin-bottom: var(--space-6); }
.hero-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

.hero-stats {
  display: flex;
  gap: var(--space-7);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.hero-stat .n {
  font-family: var(--font-latin);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .hero-stat .n { color: var(--gold-soft); }
.hero-stat .l { font-size: .8rem; color: var(--fg-muted); margin-top: 6px; }

/* Author portrait composition */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1.02;
  display: grid;
  place-items: center;
}
.portrait-disc {
  position: relative;
  width: min(86%, 440px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--night-2);
  box-shadow: var(--e-4);
  z-index: 2;
}
.portrait-disc img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(1) sepia(.16) contrast(1.06) brightness(1.03);
  transition: filter var(--dur-4) var(--ease), transform var(--dur-4) var(--ease-out);
}
.hero-visual:hover .portrait-disc img { filter: grayscale(0) sepia(0) contrast(1.02); transform: scale(1.035); }
.portrait-ring {
  position: absolute;
  width: min(96%, 492px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: .45;
  z-index: 1;
}
.portrait-ring.r2 { width: min(104%, 536px); opacity: .22; border-style: dashed; }

.orb {
  position: absolute;
  border-radius: 50%;
  background: var(--foil);
  box-shadow: inset 0 -6px 18px rgba(140,100,32,.55), 0 10px 26px rgba(199,154,62,.3);
  z-index: 3;
}
.orb::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='o'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23o)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: .6;
}
.orb-1 { width: 30px; height: 30px; top: 12%;  inset-inline-start: 6%;  animation: float-y 6s var(--ease) infinite; }
.orb-2 { width: 18px; height: 18px; top: 40%;  inset-inline-start: -2%; animation: float-y 8s var(--ease) infinite .6s; }
.orb-3 { width: 46px; height: 46px; bottom: 12%; inset-inline-end: 4%;  animation: float-y 9s var(--ease) infinite .3s; }

/* Floating book beside portrait */
.hero-book {
  position: absolute;
  z-index: 4;
  bottom: 2%;
  inset-inline-start: -4%;
  width: min(42%, 200px);
  aspect-ratio: 2/3;
  border-radius: 3px 8px 8px 3px;
  box-shadow: var(--e-4);
  overflow: hidden;
  transform: rotate(-6deg);
  transition: transform var(--dur-4) var(--ease-out);
  animation: float-y 10s var(--ease) infinite;
}
.hero-book img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-book::after {
  content: '';
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(255,255,255,.14) 62%, rgba(0,0,0,.18));
  mix-blend-mode: multiply;
}
.hero-visual:hover .hero-book { transform: rotate(-2deg) translateY(-8px) scale(1.03); }

.hero-book-2 {
  bottom: auto; inset-inline-start: auto;
  top: 3%;
  inset-inline-end: -3%;
  width: min(29%, 132px);
  transform: rotate(7deg);
  animation: float-y 12s var(--ease) infinite 1.4s;
}
.hero-visual:hover .hero-book-2 { transform: rotate(3deg) translateY(-8px) scale(1.03); }
.hb-tag {
  position: absolute;
  inset-block-end: 8px;
  inset-inline: 8px;
  padding: 5px 6px;
  border-radius: var(--r-xs);
  background: rgba(14,12,10,.72);
  backdrop-filter: blur(6px);
  color: var(--gold-soft);
  font-size: .62rem;
  letter-spacing: .04em;
  text-align: center;
  z-index: 2;
}

/* Signature */
.signature { width: clamp(150px, 20vw, 230px); color: var(--ink); opacity: .85; }
.signature path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 2.6s var(--ease-out) .5s forwards;
}

/* Marquee ticker */
.ticker {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper-2);
  padding-block: var(--space-3);
  border-block: 1px solid var(--ink);
}
.ticker-track {
  display: flex;
  gap: var(--space-7);
  width: max-content;
  animation: ticker-move 34s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-display);
  font-size: 1.05rem;
  white-space: nowrap;
  opacity: .92;
}
.ticker span::after { content: '✦'; color: var(--gold); font-size: .8rem; }
@keyframes ticker-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .ticker-track { animation-name: ticker-move-rtl; }
@keyframes ticker-move-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ============ ONE PAGE (یک صفحه بخوان) ============ */
.onepage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 56px);
  box-shadow: var(--e-2);
  overflow: hidden;
}
.onepage::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 5px;
  background: var(--foil);
}
.onepage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.onepage-text {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
  line-height: 2.2;
  color: var(--ink-2);
  max-width: 62ch;
}
.onepage-text p + p { margin-top: var(--space-4); text-indent: 1.6em; }
.onepage-text::first-letter { }
.dropcap::first-letter {
  float: right;
  font-family: var(--font-display);
  font-size: 3.6em;
  line-height: .82;
  padding-inline-start: .12em;
  padding-block-start: .08em;
  color: var(--gold-deep);
  font-weight: 700;
}
[dir="ltr"] .dropcap::first-letter { float: left; }
.onepage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--border);
}
.read-time { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--fg-muted); }

/* ============ STORY ROOM ============ */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.mood-card {
  position: relative;
  min-height: 210px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
  color: #fff;
  text-align: start;
  isolation: isolate;
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.mood-card:hover { transform: translateY(-6px); box-shadow: var(--e-3); }
.mood-card::before {
  content: '';
  position: absolute; inset: 0; z-index: -2;
  background: var(--mood-bg, linear-gradient(160deg, #1b2440, #070a14));
  transition: transform var(--dur-4) var(--ease-out);
}
.mood-card:hover::before { transform: scale(1.06); }
.mood-card::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.08) 62%);
}
.mood-card h4 { color: #fff; font-family: var(--font-display); font-size: 1.22rem; }
.mood-card p { color: rgba(255,255,255,.78); font-size: .84rem; margin-top: 4px; }
.mood-card .mood-ic {
  position: absolute;
  top: var(--space-4);
  inset-inline-end: var(--space-4);
  width: 30px; height: 30px;
  color: rgba(255,255,255,.9);
}
.mood-card[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Reading stage */
.stage {
  position: relative;
  min-height: 70dvh;
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  color: var(--stage-fg, #EFE7D8);
  background: var(--stage-bg, linear-gradient(160deg, #10141f, #05070c));
  transition: background var(--dur-4) var(--ease), color var(--dur-4) var(--ease);
  isolation: isolate;
}
.stage-layer { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.stage-content { position: relative; max-width: 68ch; margin-inline: auto; }
.stage-content h2 { color: inherit; }
.stage-text {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.6vw, 1.34rem);
  line-height: 2.35;
  color: inherit;
  opacity: .94;
}
.stage-text p + p { margin-top: var(--space-5); }
.stage-bar {
  position: sticky;
  bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-7);
  padding: var(--space-3);
  border-radius: var(--r-pill);
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  width: fit-content;
  margin-inline: auto;
}
.stage-bar .icon-btn { color: #EFE7D8; width: 46px; height: 46px; }
.stage-bar .icon-btn:hover { background: rgba(255,255,255,.12); }
.stage-bar .icon-btn.is-active { background: var(--gold); color: #1a1508; }

/* حالت تمرکز — تمام‌صفحه، با نوار ابزار همیشه در دسترس */
.stage.is-focus {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: var(--space-7) calc(var(--space-9) + 32px);
  animation: stage-focus-in var(--dur-3) var(--ease-out);
}
@keyframes stage-focus-in { from { opacity: 0; } to { opacity: 1; } }
.stage.is-focus .stage-bar {
  position: fixed;
  inset-inline: 0;
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  margin-top: 0;
  box-shadow: var(--e-3);
}
.stage.is-focus .stage-hint { display: block; }
.stage-hint {
  display: none;
  margin-top: var(--space-5);
  text-align: center;
  font-size: .82rem;
  opacity: .5;
}

/* rain */
.rain-drops { position: absolute; inset: -10% 0 0; overflow: hidden; opacity: .5; }
.rain-drops i {
  position: absolute;
  top: -12%;
  width: 1px;
  height: 88px;
  background: linear-gradient(to bottom, transparent, rgba(210,225,245,.75));
  animation: rain-fall linear infinite;
}
@keyframes rain-fall { to { transform: translateY(125vh); } }
/* stars */
.stars i {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  animation: twinkle ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .15; } to { opacity: .95; } }
/* fire */
.fire-glow {
  position: absolute;
  inset-inline: 0;
  bottom: -30%;
  height: 70%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,146,46,.55), rgba(255,100,20,.14) 45%, transparent 72%);
  animation: fire-flicker 3.6s ease-in-out infinite alternate;
}
@keyframes fire-flicker { from { opacity: .6; transform: scaleY(.96); } to { opacity: 1; transform: scaleY(1.06); } }
.ember { position: absolute; bottom: 0; width: 3px; height: 3px; border-radius: 50%; background: #FFB25E; box-shadow: 0 0 8px #FF8A2B; animation: ember-rise linear infinite; }
@keyframes ember-rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  15%  { opacity: .9; }
  100% { transform: translateY(-60vh) translateX(var(--drift, 30px)); opacity: 0; }
}
/* sea */
.wave {
  position: absolute;
  inset-inline: -20%;
  bottom: 0;
  height: 44%;
  background: radial-gradient(ellipse at 50% 120%, rgba(120,190,210,.32), transparent 62%);
  animation: wave-move 9s ease-in-out infinite alternate;
}
.wave.w2 { height: 30%; opacity: .6; animation-duration: 13s; }
@keyframes wave-move { from { transform: translateX(-3%) scaleY(.96); } to { transform: translateX(3%) scaleY(1.05); } }

/* ============ WORLDS ============ */
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.world-card {
  position: relative;
  min-height: 400px;
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #F2ECE0;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.world-card:hover { transform: translateY(-6px); box-shadow: var(--e-4); }
.world-bg {
  position: absolute; inset: 0; z-index: -2;
  background: var(--wc-bg, linear-gradient(150deg, #1B2440, #07090F));
  transition: transform var(--dur-4) var(--ease-out);
}
.world-card:hover .world-bg { transform: scale(1.07); }
.world-card::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(6,7,11,.9) 8%, rgba(6,7,11,.25) 58%, transparent);
}
.world-card h3 { color: #fff; font-size: 1.7rem; }
.world-card p { color: rgba(242,236,224,.76); font-size: .92rem; margin-top: var(--space-2); }
.world-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-4); }
.world-tags .badge { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #E9E2D5; }
.world-card .enter {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--space-5);
  font-weight: 600; font-size: .9rem; color: var(--gold-soft);
}
.world-card .enter .ic { width: 17px; height: 17px; transition: transform var(--dur-2) var(--ease); }
.world-card:hover .enter .ic { transform: translateX(-5px); }

/* Constellation dots deco */
.constellation { position: absolute; inset: 0; z-index: -1; opacity: .5; }
.constellation i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px rgba(226,197,126,.8);
  animation: twinkle ease-in-out infinite alternate;
}

/* ============ DARK BAND (lab / listen) ============ */
.band-dark {
  position: relative;
  background: var(--night);
  color: #EFE8DA;
  overflow: hidden;
  isolation: isolate;
}
.band-dark h2, .band-dark h3 { color: #FAF5EA; }
.band-dark p { color: rgba(239,232,218,.72); }
.band-dark .eyebrow { color: var(--gold-soft); }
.band-glow {
  position: absolute;
  width: 720px; height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,154,62,.22), transparent 66%);
  z-index: -1;
  pointer-events: none;
  filter: blur(8px);
}

/* ============ LIBRARY ============ */
.lib-layout { display: grid; grid-template-columns: 268px 1fr; gap: var(--space-7); align-items: start; }
.lib-filters {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-5));
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  max-height: calc(100dvh - var(--nav-h) - var(--space-7));
  overflow-y: auto;
}
.filter-group + .filter-group { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-soft); }
.filter-group h5 { margin-bottom: var(--space-3); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.filter-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.f-chip {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  font-size: .82rem; color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}
.f-chip:hover { border-color: var(--gold); color: var(--fg); }
.f-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.lib-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.lib-toolbar .search-field { flex: 1 1 260px; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6) var(--space-5); }
.result-count { font-size: .88rem; color: var(--fg-muted); }
.active-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.active-filters .badge { cursor: pointer; }
.active-filters .badge:hover { border-color: var(--danger); color: var(--danger); }

/* ============ BOOK DETAIL ============ */
.book-hero { display: grid; grid-template-columns: 320px 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.book-hero .book-cover { box-shadow: var(--e-4); }
.book-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.fact { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.fact .k { font-size: .74rem; color: var(--fg-muted); letter-spacing: .08em; }
.fact .v { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-top: 4px; }

.why-list { display: grid; gap: var(--space-3); }
.why-list li {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.why-list .ic { width: 20px; height: 20px; color: var(--gold-deep); flex: none; margin-top: 3px; }
[data-theme="dark"] .why-list .ic { color: var(--gold-soft); }

.review {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.review-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-alt);
  font-weight: 700; color: var(--gold-deep);
  flex: none;
}
.stars-row { display: inline-flex; gap: 2px; color: var(--gold); }
.stars-row .ic { width: 15px; height: 15px; }

/* ============ WRITERS HOUSE ============ */
.spark-card {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 56px);
  background: linear-gradient(150deg, var(--night-2), var(--night));
  color: #F2ECE0;
  overflow: hidden;
  isolation: isolate;
}
.spark-card .quote-mark {
  position: absolute;
  top: -18px;
  inset-inline-end: 24px;
  font-family: var(--font-latin);
  font-size: 12rem;
  line-height: 1;
  color: rgba(199,154,62,.14);
  pointer-events: none;
}
.spark-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.85;
  max-width: 24ch;
}
.spark-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }

.tool-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.generator-out {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--space-5);
  background: var(--surface-alt);
  min-height: 140px;
  display: grid;
  gap: var(--space-3);
}
.gen-row { display: flex; gap: var(--space-3); align-items: flex-start; }
.gen-row .k {
  flex: none;
  width: 76px;
  font-size: .76rem;
  color: var(--fg-muted);
  padding-top: 4px;
  letter-spacing: .06em;
}
.gen-row .v { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.7; font-weight: 700; }
.gen-row.is-new .v { animation: fade-up var(--dur-3) var(--ease-out); }

/* Idea sentence output */
.idea-sentence {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 2;
  padding: var(--space-5);
  background: var(--surface-alt);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--r-sm);
}

/* ============ TIMELINE / STEPS ============ */
.steps { display: grid; gap: var(--space-5); position: relative; }
.steps::before {
  content: '';
  position: absolute;
  inset-inline-start: 21px;
  top: 12px; bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold), var(--border) 60%, transparent);
}
.step { display: flex; gap: var(--space-4); align-items: flex-start; position: relative; }
.step .dot {
  flex: none;
  width: 43px; height: 43px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-latin);
  font-weight: 600;
  color: var(--gold-deep);
  z-index: 1;
}
.step h4 { margin-bottom: 6px; }
.step p { color: var(--fg-muted); font-size: .94rem; }

/* ============ AUDIO PLAYER ============ */
.audio-card {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  transition: box-shadow var(--dur-3) var(--ease), transform var(--dur-3) var(--ease-out);
}
.audio-card:hover { box-shadow: var(--e-3); transform: translateY(-3px); }
.audio-art {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: linear-gradient(150deg, #241F18, #0E0C0A);
  display: grid; place-items: center;
}
.audio-art .play {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.92);
  color: var(--night);
  box-shadow: var(--e-3);
  transition: transform var(--dur-2) var(--spring), background-color var(--dur-2) var(--ease);
}
.audio-card:hover .play { transform: scale(1.08); background: var(--gold); }
.audio-art .play .ic { width: 22px; height: 22px; }
.wavebars { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: var(--space-3); }
.wavebars i {
  width: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: height var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
.audio-card.is-playing .wavebars i { background: var(--gold); animation: wave-bar 1.1s ease-in-out infinite alternate; }
@keyframes wave-bar { from { height: 20%; } to { height: 100%; } }

/* ============ SHOP ============ */
.product-card { display: flex; flex-direction: column; gap: var(--space-4); }
.product-card .price { font-family: var(--font-latin); font-size: 1.3rem; font-weight: 600; color: var(--gold-deep); }
.product-card .price s { font-size: .85rem; color: var(--ink-4); margin-inline-start: 8px; }
[data-theme="dark"] .product-card .price { color: var(--gold-soft); }

/* ============ ABOUT ============ */
.about-hero { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.about-photo {
  position: relative;
  border-radius: var(--r-xl) var(--r-xl) 200px 200px;
  overflow: hidden;
  aspect-ratio: 3/4;
  box-shadow: var(--e-4);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: grayscale(.25) contrast(1.04); }
.skill-row { display: grid; gap: var(--space-4); }
.skill { display: grid; gap: var(--space-2); }
.skill-head { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; }
.skill-head span:last-child { color: var(--gold-deep); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .skill-head span:last-child { color: var(--gold-soft); }

/* ============ CTA STRIP ============ */
.cta-strip {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(32px, 5vw, 68px);
  background: var(--sage);
  overflow: hidden;
  isolation: isolate;
}
[data-theme="dark"] .cta-strip { background: #1E2A24; }
.cta-strip h2 { max-width: 20ch; }
.cta-strip .blob-ink {
  width: 340px; height: 340px;
  inset-inline-end: -80px; top: -120px;
  opacity: .92;
}

/* ============ PAGE HEADER ============ */
.page-head {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(32px, 5vw, 72px));
  padding-bottom: clamp(28px, 4vw, 56px);
  overflow: hidden;
}
.page-head .blob-sage {
  width: 420px; height: 420px;
  inset-inline-end: -140px;
  top: -180px;
  opacity: .42;
}
[data-theme="dark"] .page-head .blob-sage { opacity: .12; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--fg-muted); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--gold-deep); }
.breadcrumb .sep { opacity: .5; }

/* ============ LAB (metaverse) ============ */
.lab-stage {
  position: relative;
  min-height: 72dvh;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, #16233F 0%, #090C16 55%, #05060B 100%);
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 64px);
  isolation: isolate;
}
.lab-grid-floor {
  position: absolute;
  inset-inline: -30%;
  bottom: -10%;
  height: 60%;
  background-image:
    linear-gradient(rgba(199,154,62,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199,154,62,.22) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(560px) rotateX(66deg);
  mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  animation: floor-move 16s linear infinite;
  z-index: -1;
}
@keyframes floor-move { to { background-position: 0 62px; } }
.gate-ring {
  position: relative;
  width: min(340px, 74vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(199,154,62,.16), transparent 62%);
  border: 1px solid rgba(226,197,126,.4);
  animation: pulse-ring 3.4s ease-out infinite;
}
.gate-ring::before, .gate-ring::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(226,197,126,.3);
}
.gate-ring::before { inset: -22px; animation: spin-slow 28s linear infinite; }
.gate-ring::after  { inset: -46px; border-style: solid; border-color: rgba(226,197,126,.14); animation: spin-slow 44s linear infinite reverse; }
.gate-inner { text-align: center; color: #F3ECDD; padding: var(--space-5); }
.gate-inner h3 { color: #fff; }

.portal-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: var(--space-4); }
.portal {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: #EDE6D8;
  cursor: pointer;
  text-align: start;
  transition: all var(--dur-3) var(--ease-out);
  overflow: hidden;
}
.portal:hover { background: rgba(199,154,62,.12); border-color: rgba(226,197,126,.5); transform: translateY(-4px); }
.portal h4 { color: #FFF8E9; }
.portal p { font-size: .84rem; color: rgba(237,230,216,.66); margin-top: 6px; }
.portal .ic { width: 22px; height: 22px; color: var(--gold-soft); margin-bottom: var(--space-3); }
.portal[aria-checked="true"], .portal.is-picked {
  background: rgba(199,154,62,.16);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(226,197,126,.35);
}
.portal.is-locked { opacity: .52; cursor: not-allowed; }
.portal.is-locked:hover { transform: none; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.portal-lock {
  position: absolute;
  top: var(--space-4); inset-inline-end: var(--space-4);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.16);
  font-size: .68rem;
  color: var(--gold-soft);
}
.portal-lg {
  padding: var(--space-6);
  min-height: 210px;
  background-image: var(--pbg);
  background-size: cover;
  box-shadow: inset 0 0 0 999px rgba(4,6,11,.34), inset 0 -70px 80px -30px rgba(0,0,0,.7);
}
.portal-emoji { display: block; font-size: 2rem; line-height: 1; margin-bottom: var(--space-3); }
.portal-emoji.big { font-size: 3.2rem; }
.portal-go {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-4);
  font-size: .76rem;
  color: var(--gold-soft);
  letter-spacing: .04em;
}

/* --- Lab HUD --- */
.lab-hud {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--r-lg);
  background: var(--night-2);
  border: 1px solid rgba(255,255,255,.1);
  color: #EDE6D8;
}
.hud-avatar {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: none; border: 0; cursor: pointer; color: inherit;
  padding: 4px; border-radius: var(--r-pill);
}
.hud-avatar:hover .hud-glyph { transform: scale(1.06); }
.hud-glyph {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #120E07;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: transform var(--dur-2) var(--ease-out);
}
.hud-meta { display: grid; text-align: start; line-height: 1.3; }
.hud-name { font-weight: 700; font-size: .95rem; }
.hud-role { font-size: .74rem; color: var(--gold-soft); }
.hud-path {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  flex: 1 1 240px;
  font-size: .84rem;
}
.hud-path button {
  background: none; border: 0; cursor: pointer;
  color: rgba(237,230,216,.7);
  padding: 4px 2px;
  border-radius: var(--r-xs);
}
.hud-path button:hover { color: var(--gold-soft); }
.hud-path .sep { color: rgba(237,230,216,.35); }
.hud-path .now { color: #FFF8E9; font-weight: 600; }
.hud-tools { display: flex; gap: 6px; margin-inline-start: auto; }
.hud-tools .icon-btn { color: #EFE7D8; border-color: rgba(255,255,255,.14); }
.hud-tools .icon-btn:hover { background: rgba(255,255,255,.1); }
.hud-tools .icon-btn.is-active { background: var(--gold); color: #1a1508; border-color: var(--gold); }
.hud-tools .icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* --- Lab view --- */
.lab-stage { transition: background var(--dur-4) var(--ease); }
.lab-view { position: relative; width: 100%; }
.lab-view.is-in { animation: fade-up var(--dur-4) var(--ease-out); }
.lab-view h2, .lab-view h3, .lab-view h4 { color: #FFF8E9; }
.lab-view .eyebrow { color: var(--gold-soft); }
.lab-panel {
  margin-inline: auto;
  padding: clamp(20px, 3vw, 38px);
  border-radius: var(--r-lg);
  background: rgba(10,12,20,.5);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
}
.lab-panel .stage-text { border-inline-start: 2px solid var(--gold); padding-inline-start: var(--space-5); }
.lab-input {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: #F4EFE4;
}
.lab-input::placeholder { color: rgba(237,230,216,.4); }
.lab-input:focus-visible { border-color: var(--gold); }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px,1fr)); gap: var(--space-3); }
.avatar-opt {
  display: grid; gap: 8px; justify-items: center;
  padding: var(--space-4) var(--space-2);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease-out);
}
.avatar-opt:hover { border-color: rgba(226,197,126,.5); transform: translateY(-3px); }
.avatar-opt[aria-checked="true"] { background: rgba(199,154,62,.16); border-color: var(--gold); }
.av-glyph {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #120E07;
  box-shadow: 0 8px 20px rgba(0,0,0,.42);
}
.av-name { font-size: .78rem; color: rgba(237,230,216,.72); }

.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: var(--space-4); }
.char-card {
  padding: var(--space-5);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}
.char-ic {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(199,154,62,.16);
  color: var(--gold-soft);
  margin-bottom: var(--space-3);
}
.char-ic .ic { width: 19px; height: 19px; }
.char-role { font-size: .74rem; color: var(--gold-soft); margin-top: 4px; }
.char-line {
  font-family: var(--font-display);
  font-size: .98rem;
  line-height: 1.85;
  color: rgba(242,236,223,.82);
  margin-top: var(--space-3);
}

.lab-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--r-lg);
  background: rgba(199,154,62,.1);
  border: 1px solid rgba(226,197,126,.28);
}

/* ============ EN (LTR) ============ */
.en-body { direction: ltr; text-align: left; }
.en-body h1, .en-body h2, .en-body h3 { font-family: var(--font-latin); letter-spacing: -.02em; }
.en-body h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.06; }
.en-body .lead, .en-body p, .en-body body { font-family: var(--font-latin-ui); }
.en-body .stage-text, .en-body .onepage-text { font-family: var(--font-latin); font-size: clamp(1.12rem, 1.7vw, 1.4rem); }

.en-cover {
  display: block;
  border-radius: 3px 8px 8px 3px;
  overflow: hidden;
  background: var(--night);
  box-shadow: var(--e-3);
  aspect-ratio: 2/3;
}
.en-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.en-cover.lg { aspect-ratio: auto; box-shadow: var(--e-4); }
.en-book-mini { display: flex; flex-direction: column; gap: var(--space-4); }
.en-book-mini .en-cover { width: 110px; }

.en-book {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(24px, 4vw, 60px);
  align-items: start;
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.en-book:last-child { border-bottom: 0; padding-bottom: 0; }

.en-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-md);
  background: rgba(199,154,62,.1);
  border: 1px solid rgba(199,154,62,.3);
  font-size: .92rem;
}
.en-status .ic { width: 19px; height: 19px; color: var(--gold-deep); flex: none; }
[data-theme="dark"] .en-status .ic { color: var(--gold-soft); }

.en-story { scroll-margin-top: calc(var(--nav-h) + 24px); transition: background var(--dur-4) var(--ease), color var(--dur-4) var(--ease); }
.en-story.is-mood { border-color: rgba(255,255,255,.12); }
.en-story.is-mood .onepage-text { color: inherit; }
.en-story.is-mood h3 { color: inherit; }
.en-story.is-mood .small.muted { color: rgba(255,255,255,.6); }
.en-story.is-mood .onepage-foot { border-top-color: rgba(255,255,255,.14); }
.en-story.is-mood .read-time { color: rgba(255,255,255,.62); }
.en-story.is-mood .btn-ghost { --btn-fg: #F2ECE0; border-color: rgba(255,255,255,.24); }
.en-story.is-mood .dropcap::first-letter { color: var(--gold-soft); }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: none; order: 2; }
  .hero-visual { order: 1; max-width: 480px; margin-inline: auto; width: 100%; }
  .lib-layout { grid-template-columns: 1fr; }
  .lib-filters { position: static; max-height: none; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .world-grid { grid-template-columns: repeat(2, 1fr); }
  .about-hero { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .book-hero { grid-template-columns: 240px 1fr; }
}
@media (max-width: 900px) {
  /* هر چیدمان دوستونی که ستون‌هایش درون‌خطی تعریف شده، در موبایل تک‌ستونه شود */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid[style*="position:sticky"] > aside,
  .grid > aside[style*="sticky"] { position: static !important; }
}
@media (max-width: 820px) {
  .mood-grid { grid-template-columns: repeat(2, 1fr); }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .world-grid { grid-template-columns: 1fr; }
  .book-hero { grid-template-columns: 1fr; }
  .book-hero .book-cover { max-width: 260px; }
  .audio-card { grid-template-columns: 96px 1fr; }
  .hero-stats { gap: var(--space-5); }
  .en-book { grid-template-columns: 1fr; }
  .en-cover.lg { max-width: 240px; }
  .lab-hud { gap: var(--space-3); }
  .hud-path { order: 3; flex-basis: 100%; }
  .hud-tools { margin-inline-start: 0; }
}
@media (max-width: 520px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5) var(--space-4); }
  .mood-grid { grid-template-columns: 1fr 1fr; }
  .hero-book { width: 38%; }
  .hero-book-2 { width: 26%; }
  .stage { padding: var(--space-5); }
  .lab-stage { padding: var(--space-5) var(--space-4); }
  .char-grid { grid-template-columns: 1fr; }
  .lab-cta { flex-direction: column; align-items: flex-start; }
}
