@font-face { font-family: "Lalezar"; src: url("/fonts/lalezar.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0c0a08;
  --surface: #181512;
  --surface-2: #231f1a;
  --line: #3a342d;
  --ink: #ffffff;
  --muted: #b4ada4;
  --accent: #c9a45a;
  --accent-ink: #0c0a08;

  --display: "Barlow Condensed", "Lalezar", system-ui, sans-serif;
  --text: "Barlow", "Vazirmatn", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1rem + 3.6vw, 4.25rem);

  --margin: clamp(20px, 2.4vw, 32px);
  --section: clamp(96px, 12vw, 160px);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: var(--step-body);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; }
h1, h2, h3, .trip__lede, .hero__line, .intro__note, .feature__text { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
html { scrollbar-color: var(--line) var(--bg); }
textarea, input { caret-color: var(--accent); }
[tabindex="-1"]:focus { outline: none; }
p { margin: 0; }
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; inset-inline-start: var(--margin); top: -100px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; }
.skip:focus { top: var(--margin); }
.print-head { display: none; }

.link { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.link:hover { color: var(--accent); }

/* ---------- لایه‌ی ماه و مدار ---------- */

#moon {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.orbit { position: fixed; inset: 0; pointer-events: none; }
.orbit--back { z-index: 1; }
.orbit--front { z-index: 4; }

.frame {
  position: absolute; left: 0; top: 0;
  width: max-content; min-width: 168px; max-width: 260px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: auto;
  will-change: transform;
  direction: ltr;
  text-align: left;
}
.orbit--back .frame { pointer-events: none; }
.frame:hover, .frame:focus-visible { background: var(--surface-2); }
.frame__label { display: block; color: var(--muted); font-family: var(--text); font-size: 13px; margin-bottom: 6px; }
.frame code { font-family: var(--mono); font-size: 12.5px; white-space: pre; color: #efe6d6; }
.frame--fa { direction: rtl; text-align: right; }
.frame__chat { display: flex; align-items: center; gap: 10px; }
.frame .frame__chat svg { flex: none; width: 34px; height: 34px; fill: var(--accent); }
.frame .frame__chat svg .h { fill: none; stroke: var(--accent); stroke-width: 3.5; }
.frame .frame__chat svg .e { fill: #fff; }
.frame__chat > span { font-size: 13px; line-height: 1.65; color: #efe6d6; text-wrap: balance; }
.frame__big { display: block; font-family: var(--display); font-size: 30px; line-height: 1.05; }

/* ---------- نوار بالا ---------- */

.topbar {
  position: absolute; z-index: 7;
  inset-inline: 0; top: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: var(--margin);
  font-size: 15px;
}
.wordmark { text-decoration: none; font-weight: 500; }
.topnav { display: flex; gap: clamp(14px, 2vw, 28px); }
.topnav a { text-decoration: none; color: var(--ink); }
.topnav a:hover { color: var(--accent); }

/* ---------- هیرو ---------- */

.hero {
  position: relative;
  min-height: 100svh;
}
.hero__title { margin: 0; font-weight: 400; }

.monument {
  position: absolute; z-index: 3;
  inset-inline: 0;
  top: 47%;
  display: flex; justify-content: center;
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
}
.monument__word {
  display: inline-flex;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 30vw;
  line-height: 1;
  white-space: nowrap;
}
.monument__mah, .monument__yar { display: inline-block; }
.mask { display: inline-block; overflow: hidden; padding: 0.08em 0.14em 0.18em; margin-inline: -0.14em; vertical-align: top; }
.mask__inner { display: inline-block; }
.js .mask__inner { transform: translateY(115%); }
/* تا JS اندازه‌ی کلمه‌ی بزرگ رو تنظیم نکرده پنهان می‌مونه، تا صفحه جابه‌جا نشه (CLS) */
.js:not(.is-fitted) .monument__word { visibility: hidden; }

.hero__caption {
  position: absolute; z-index: 5;
  inset-inline-start: var(--margin);
  bottom: var(--margin);
  max-width: 42ch;
  display: grid; gap: 6px;
}
.hero__meaning { font-family: var(--display); font-size: var(--step-lead); line-height: 1.3; }
.hero__role { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 1.7vw, 28px); line-height: 1.25; }
.hero__line { color: var(--muted); font-size: 15.5px; line-height: 1.8; }
.hero__name { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.02em; color: var(--accent); text-align: right; }
.js .hero__caption, .js .topbar { opacity: 0; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 18px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 500; font-size: 15px; text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: #d8b673; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--surface-2); color: var(--accent); }

/* ---------- چت (یار) ---------- */

.chat {
  position: absolute; z-index: 6;
  inset-inline-end: var(--margin);
  bottom: var(--margin);
  background: var(--surface);
  padding: 18px 20px 20px;
  display: grid; gap: 14px;
}
.chat__head { display: grid; grid-template-columns: auto auto 1fr auto; align-items: end; column-gap: 14px; }

/* ربات یار */
.robot { width: clamp(52px, 4.6vw, 70px); align-self: end; margin-bottom: 6px; }
.robot svg { display: block; width: 100%; height: auto; overflow: visible; }
.robot__head { fill: var(--surface-2); stroke: var(--accent); stroke-width: 2.5; }
.robot__stem { fill: var(--accent); }
.robot__tip { fill: var(--accent); transform-origin: 32px 6px; }
.robot__eyes { transform: translate(var(--eye-x, 0px), var(--eye-y, 0px)); transition: transform 0.25s ease; }
.robot__eye { fill: #ffffff; transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.robot__mouth rect { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes talk { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(2.4); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.chat.is-thinking .robot__tip { animation: pulse 0.7s infinite; }
.chat.is-thinking .robot__eyes { --eye-y: -4px; }
.chat.is-talking .robot__mouth rect { animation: talk 0.32s infinite; }
.chat.is-talking .robot__mouth rect:nth-child(2) { animation-delay: 0.08s; }
.chat.is-talking .robot__mouth rect:nth-child(3) { animation-delay: 0.16s; }
.chat.is-talking .robot__mouth rect:nth-child(4) { animation-delay: 0.24s; }
.chat__name {
  margin: 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(56px, 5.4vw, 84px);
  line-height: 1;
  padding-block: 0.08em 0;
}
.chat__intro { font-size: 15px; line-height: 1.7; color: var(--muted); padding-bottom: 10px; }
.chat__mode { font-size: 13px; color: var(--accent); }
.chat__close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 2px; font-size: 14px; align-self: start; }
.chat__close:hover { color: var(--ink); }

.chat__log { display: none; max-height: min(44vh, 400px); overflow-y: auto; gap: 14px; padding-inline-end: 4px; }
.chat.has-log .chat__log { display: grid; }
.chat.has-log .chat__chips { display: none; }

.msg { display: grid; gap: 2px; font-size: 16px; line-height: 1.85; }
.msg__who { font-size: 13px; color: var(--muted); }
.msg--user .msg__text { background: var(--surface-2); padding: 8px 12px; justify-self: start; }
.msg--bot .msg__who { color: var(--accent); }
.msg--error .msg__text { color: var(--muted); }
.msg__text { white-space: pre-wrap; overflow-wrap: anywhere; }

.chat__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chat:not(.is-docked):not(:focus-within):not(.has-log) .chat__chips { display: none; }
.chat:not(.is-docked) { width: min(440px, calc(100% - 2 * var(--margin))); }
.msg__retry { justify-self: start; margin-top: 6px; background: var(--surface-2); border: 0; cursor: pointer; padding: 6px 12px; font-size: 14px; color: var(--ink); min-height: 36px; }
.msg__retry:hover { color: var(--accent); }
.chip {
  background: var(--surface-2); border: 0; cursor: pointer;
  padding: 7px 12px; font-size: 14.5px; line-height: 1.6; text-align: start;
}
.chip:hover { color: var(--accent); }

.chat__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat__form textarea {
  resize: none;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
  min-height: 48px; max-height: 140px;
  line-height: 1.7;
  font-size: 16px;
}
.chat__form textarea::placeholder { color: #948d84; }
/* dir=auto برای جعبه‌ی خالی چپ‌به‌راست حساب می‌شه و متن نمونه‌ی فارسی به‌هم می‌ریزه */
:root[dir="rtl"] .chat__form textarea:placeholder-shown { direction: rtl; }
.chat__send {
  background: var(--accent); color: var(--accent-ink);
  border: 0; cursor: pointer;
  padding: 0 22px; font-weight: 500; font-size: 16px;
}
.chat__send:hover { background: #d8b673; }
.chat__send:disabled { background: var(--surface-2); color: var(--muted); cursor: wait; }
.chat__noscript { font-size: 15px; color: var(--muted); }

.js .chat { opacity: 0; }
.js .chat__name { visibility: hidden; }

.chat.is-docked {
  position: fixed; z-index: 30;
  inset-inline-end: var(--margin);
  bottom: calc(var(--margin) + 76px + env(safe-area-inset-bottom, 0px));
  width: min(460px, calc(100vw - 2 * var(--margin)));
  max-height: calc(100svh - 140px);
  overflow-y: auto;
  box-shadow: 0 0 0 1px var(--line);
}
.chat.is-docked .chat__close { display: block; }
.chat.is-docked .chat__name { font-size: 48px; }

.dock {
  position: fixed; z-index: 31;
  inset-inline-end: var(--margin);
  bottom: calc(var(--margin) + env(safe-area-inset-bottom, 0px));
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  padding: 9px;
  /* حلقه‌ی تیره تا روی فوتر طلایی هم شکل دکمه دیده بشه */
  box-shadow: 0 0 0 2px var(--accent-ink), 0 4px 14px rgb(0 0 0 / 0.35);
}
.dock svg { display: block; width: 100%; height: 100%; fill: var(--accent-ink); }
.dock .dock__head { fill: var(--accent-ink); }
.dock .dock__eye { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.dock:hover { background: #d8b673; }

/* ترمینال مخفی */
.term {
  position: fixed; z-index: 60;
  inset-inline: max(var(--margin), calc(50% - 380px));
  top: 12vh;
  height: min(520px, 76vh);
  display: grid; grid-template-rows: auto 1fr auto;
  background: #070605;
  box-shadow: 0 0 0 1px var(--line);
  font: 14px/1.7 var(--mono);
  color: #efe6d6;
}
.term[hidden] { display: none; }
.term__bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: var(--surface); color: var(--muted); font-size: 13px; }
.term__close { background: none; border: 0; color: var(--muted); cursor: pointer; font-family: var(--text); }
.term__close:hover { color: var(--ink); }
.term__out { overflow-y: auto; padding: 14px; white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, "Vazirmatn", monospace; }
.term__out .cmd { color: var(--accent); }
.term__form { display: flex; gap: 8px; padding: 10px 14px 14px; }
.term__prompt { color: var(--accent); }
.term__form input { flex: 1; background: none; border: 0; outline: none; color: #efe6d6; font: inherit; }
.footer__term { background: none; border: 0; padding: 0; text-align: start; cursor: pointer; color: #2e2618; font: inherit; }
.footer__term:hover { color: var(--bg); }
.footer__term kbd { font-family: var(--mono); font-size: 0.85em; }
.dock[hidden] { display: none; }

/* ---------- عنوان‌ها ---------- */

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-head);
  line-height: 1.12;
}

section:not(.hero):not(.path):not(.chat) {
  position: relative; z-index: 5;
  background: var(--bg);
  padding: var(--section) var(--margin);
}

/* ---------- درباره ---------- */

.intro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  row-gap: 48px;
}
.intro .section-title { grid-column: 1 / -1; }
.intro__text {
  grid-column: 1 / 8;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.75;
  text-indent: 3em;
}
.facts { grid-column: 1 / 8; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
/* ۸ کارت: تعداد ستون‌ها همیشه بر ۸ بخش‌پذیره تا ردیف آخر جای خالی نداشته باشه */
@media (max-width: 1400px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 16px; line-height: 1.7; }
.intro__note {
  grid-column: 10 / 13;
  align-self: end;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- مسیر (pin) ---------- */

.path { position: relative; z-index: 3; }
.film {
  position: absolute; z-index: 4;
  inset-inline-end: var(--margin);
  top: calc(var(--margin) + 56px);
  margin: 0;
  display: grid; justify-items: end; gap: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.film.is-on { opacity: 1; }
.film__year {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: clamp(64px, 7.5vw, 120px);
  line-height: 0.9;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.film__cap { font-size: 15px; color: var(--muted); }
.no-js .film { display: none; }
.no-js .monument { display: none; }
.path__inner {
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-content: center;
  padding: var(--margin);
}
.path__text { grid-column: 1 / 7; display: grid; align-content: start; gap: 14px; }
.path .section-title { font-size: clamp(2rem, 1rem + 2.4vw, 3.1rem); }
.path__lede { color: var(--muted); max-width: 48ch; font-size: 17px; }

.rule { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.rule__step {
  display: grid;
  grid-template-columns: 64px 1fr;
  column-gap: 18px;
  padding: 7px 0;
  color: var(--muted);
  transition: color 0.4s ease;
}
.rule__kw {
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.6;
  direction: ltr;
  text-align: right;
  transition: color 0.4s ease;
}
.rule__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.rule__role { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 1.9vw, 30px); line-height: 1.2; }
.rule__when { font-size: 16px; }
.rule__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s cubic-bezier(.2, .7, .2, 1); }
.rule__more > div { overflow: hidden; }
.rule__more p { font-size: 15.5px; line-height: 1.75; max-width: 60ch; padding-top: 4px; }
.rule__lead { color: var(--muted); }
.rule.is-measuring, .rule.is-measuring * { transition: none !important; }
.rule__dots { display: none; }
.rule__dots[hidden] { display: none !important; }
.rule__lead--scale { color: var(--ink); font-weight: 500; }
.rule__list { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 3px; max-width: 64ch; }
.rule__list li { position: relative; padding-inline-start: 18px; font-size: 15px; line-height: 1.7; color: #e6dfd4; }
.rule__list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.95em; width: 8px; height: 1px; background: var(--accent); }
.rule__org { color: var(--accent); }
.rule__step.is-active { color: var(--ink); }
.rule__step.is-active .rule__kw { color: var(--accent); }
.rule__step.is-active .rule__more { grid-template-rows: 1fr; }
.no-js .rule__more, .rule.is-static .rule__more { grid-template-rows: 1fr; }
.no-js .rule__step, .rule.is-static .rule__step { color: var(--ink); }
/* جمله‌های روایت فیلم («رک سرورها بالا میاد…») فقط کنار فیلم معنی دارن */
.no-js .rule__lead:not(.rule__lead--scale), .rule.is-static .rule__lead:not(.rule__lead--scale) { display: none; }

/* دسکتاپ: فقط وقتی پنل کامل توی صفحه جا نشه کوتاه می‌شه (main.js با اندازه‌گیری is-tight / is-tighter می‌ذاره) */
.js .path.is-tight:not(.is-static) .path__lede, .js .path.is-tight:not(.is-static) .rule__lead:not(.rule__lead--scale) { display: none; }
.js .path.is-tight:not(.is-static) .rule__list li:nth-child(n+5) { display: none; }
.js .path.is-tighter:not(.is-static) .rule__list li:nth-child(n+4) { display: none; }
@media (min-width: 901px) and (max-height: 740px) {
  .rule__step { padding: 5px 0; }
}

/* ---------- کارها ---------- */

.cases { margin-top: 56px; display: grid; gap: 6px; }
.case { background: var(--surface); }
.case summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 16px;
  padding: 24px clamp(18px, 2vw, 28px);
}
.case summary::-webkit-details-marker { display: none; }
.case__title { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 2.6vw, 42px); line-height: 1.25; }
.case__tags { color: var(--muted); font-size: 14px; }
.case[open] .case__tags { color: var(--accent); }
.case summary:hover .case__title { color: var(--accent); }
.case__body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px;
  padding: 0 clamp(18px, 2vw, 28px) 30px;
}
.case__body > p { max-width: 60ch; line-height: 1.9; }
.case--feature { padding-bottom: 6px; }
.case__head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 16px; padding: 24px clamp(18px, 2vw, 28px); }
.case__head .case__title { margin: 0; }
.case--feature .case__tags { color: var(--accent); }
.par { margin: 0; display: grid; gap: 14px; align-content: start; }
.par div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; }
.par dt { color: var(--accent); font-size: 14.5px; line-height: 1.9; }
.par dd { margin: 0; line-height: 1.85; }
.case__links { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0 clamp(18px, 2vw, 28px) 24px; }
.case__inline-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.case__links--note { color: var(--muted); font-size: 14.5px; line-height: 1.8; padding-top: 0; }
.more { margin-top: 6px; }
.more > summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 60px; padding: 0 clamp(18px, 2vw, 28px);
  background: var(--surface); font-weight: 500;
}
.more > summary::-webkit-details-marker { display: none; }
.more[open] .plus::after { transform: rotate(0deg); }
.cases--more { margin-top: 6px; }
.cases--more .case { background: var(--bg); box-shadow: inset 0 0 0 1px var(--surface-2); }
.cases--more .case__title { font-size: clamp(22px, 2vw, 30px); }
.case__body pre {
  margin: 0; background: var(--bg); padding: 16px 18px; overflow-x: auto;
  direction: ltr; text-align: left;
  font: 14px/1.7 var(--mono); color: #efe6d6;
}

/* ---------- نوشته‌ها ---------- */

.feature {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 28px;
  margin-top: 56px; padding: 26px clamp(18px, 2vw, 28px);
  background: var(--surface-2); text-decoration: none;
  transition: background-color 0.2s ease;
}
.feature:hover { background: #2b2620; }
.feature__name { justify-self: start; font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 700; font-size: clamp(28px, 3vw, 44px); line-height: 1; color: var(--accent); }
.feature__text { color: var(--muted); max-width: 62ch; line-height: 1.8; }
.feature__go { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.feature__go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s ease; }
.feature:hover .feature__go { color: var(--accent); }
.feature:hover .feature__go svg { transform: translateX(-4px); }
.pubs { width: 100%; border-collapse: collapse; margin-top: 40px; }
.pubs .link { display: inline-block; padding-block: 3px; }
.pubs td { padding: 16px clamp(12px, 1.6vw, 20px); vertical-align: top; font-size: 17px; line-height: 1.7; }
.pubs tr:nth-child(odd) { background: var(--surface); }
.pubs td:first-child { width: 58%; }
.pubs td:not(:first-child) { color: var(--muted); }
.pubs td:last-child { text-align: end; }

/* ---------- مهارت ---------- */

.skills__inner { max-width: 640px; margin-inline: auto; }
.skills__inner--wide { max-width: 1120px; }
.skillset { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 6px; margin-top: 24px; }
.skillset__group { background: var(--surface); padding: 20px 22px 22px; }
.skillset__group--core { background: var(--surface-2); }
.skillset__group:last-child { grid-column: 1 / -1; }
.skillset__title { margin: 0 0 12px; font-size: 17px; font-weight: 500; color: var(--ink); }
.skillset__group--core .skillset__title { color: var(--accent); }
.skillset__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skillset__list li { padding: 3px 10px; background: var(--bg); color: #d6cfc6; font-size: 14.5px; line-height: 1.7; }
.skills__word { margin: 0; font-family: "Lalezar", system-ui, sans-serif; font-weight: 400; line-height: 1.05; text-align: center; }
.skills__fit { display: inline-block; white-space: nowrap; font-size: 160px; }
/* آیکون + و − برای «کار دیگه» و بقیه‌ی بخش‌های بازشونده */
.plus { position: relative; flex: none; width: 14px; height: 14px; }
.plus::before, .plus::after { content: ""; position: absolute; inset: 6px 0 auto; height: 2px; background: currentColor; transition: transform 0.35s ease; }
.plus::after { transform: rotate(90deg); }

/* ---------- یار چطور ساخته شده ---------- */

/* سفر یک سؤال: یه ریل عمودی که «پکت» با اسکرول روش پایین میاد و ایستگاه‌ها رو روشن می‌کنه */
.trip__lede { margin-top: 20px; color: var(--muted); max-width: 52ch; font-size: var(--step-body); }
.trip {
  --rail: 28px;
  position: relative;
  list-style: none; margin: 56px 0 0; padding: 0; padding-inline-start: calc(var(--rail) + 28px);
  display: grid; gap: clamp(56px, 9vw, 120px);
}
.trip::before, .trip::after {
  content: ""; position: absolute; top: 10px; bottom: 10px;
  inset-inline-start: calc(var(--rail) / 2 - 1px);
  width: 2px; background: var(--line);
}
.trip::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--fill, 0)); }
.trip__packet {
  position: absolute; z-index: 1;
  inset-inline-start: calc(var(--rail) / 2 - 7px); top: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ffe3a6;
  box-shadow: 0 0 0 5px rgb(201 164 90 / 0.22), 0 0 0 11px rgb(201 164 90 / 0.08);
  transform: translateY(var(--y, 10px));
}
.trip__stop {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px clamp(24px, 4vw, 64px); align-items: start;
  color: var(--muted);
  transition: color 0.5s ease;
}
.trip__stop::before {
  content: ""; position: absolute; top: 10px;
  inset-inline-start: calc(-1 * (var(--rail) + 28px) + var(--rail) / 2 - 8px);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}
.trip__stop.is-lit { color: var(--ink); }
.trip__stop.is-lit::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.trip__name { margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.2; color: inherit; }
.trip__stop.is-lit .trip__name { color: var(--accent); }
.trip__text p { line-height: 1.9; max-width: 52ch; }
.trip__code {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--surface); text-align: left;
  font: 14px/1.75 var(--mono); color: #efe6d6;
  opacity: 0.72; transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1);
}
.trip__stop.is-lit .trip__code, .trip__stop.is-lit .trip__chat { opacity: 1; transform: none; }
.c-k { color: var(--accent); }
.c-s { color: #e8c47a; }
.c-m { color: #a39c94; }
.trip__chat {
  display: grid; gap: 10px; padding: 18px 20px; background: var(--surface);
  opacity: 0.72; transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1);
}
.trip__q { justify-self: start; background: var(--surface-2); padding: 8px 12px; color: var(--ink); }
.trip__a { line-height: 1.85; color: var(--ink); }
.trip__who { display: block; font-size: 13px; color: var(--accent); }
.trip__end { margin-top: 56px; padding-inline-start: calc(var(--rail, 28px) + 28px); }
.no-js .trip__stop, .trip.is-static .trip__stop { color: var(--ink); }
.no-js .trip__code, .no-js .trip__chat, .trip.is-static .trip__code, .trip.is-static .trip__chat { opacity: 1; transform: none; }
.trip.is-static::after { transform: none; }
.no-js .trip__packet, .trip.is-static .trip__packet { display: none; }

/* ---------- تماس ---------- */

.rows { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 6px; max-width: 880px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  min-height: 72px;
  padding: 12px 20px;
  background: var(--surface);
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.2;
  transition: background-color 0.2s ease;
}
.row__label { display: inline-flex; align-items: center; gap: 12px; }
.row__icon { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a.row:hover { background: var(--surface-2); }
.rows li:nth-child(even) .row { background: var(--surface-2); }
a.row:hover .row__label { color: var(--accent); }
.row__value {
  font-family: "Barlow", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: left;
}
.row.is-empty .row__value { font-family: var(--text); font-weight: 400; font-size: 15px; }
.row--hello { align-items: center; padding-top: 18px; background: var(--accent) !important; color: var(--accent-ink); }
.row--hello .round { background: var(--accent-ink); color: var(--accent); }
.round {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
}
.round svg { width: 42%; height: 42%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- فوتر ---------- */

main > section:last-child { margin-bottom: 0; }
.footer {
  position: relative; z-index: 5;
  min-height: min(100svh, 720px);
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: 40px var(--margin) calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--accent);
  color: var(--accent-ink);
}
.footer a { text-decoration: none; color: #2e2618; }
.footer a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; font-size: 16px; }
.footer__cols > div { display: grid; align-content: start; gap: 4px; }
.footer__head { color: var(--bg); font-weight: 500; }
.footer__mark { grid-row: 3; text-align: center; font-family: "Lalezar", system-ui, sans-serif; line-height: 1; overflow: hidden; }
.footer__fit { display: inline-block; white-space: nowrap; font-size: 30vw; padding-block: 0.06em 0.12em; }
.footer__legal { grid-row: 4; font-size: 13px; color: #2e2618; padding-top: 12px; }
.footer :focus-visible { outline-color: var(--accent-ink); }
.row--hello :focus-visible { outline-color: var(--accent-ink); }
.dock:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- موبایل ---------- */

@media screen and (max-width: 900px), screen and (max-height: 560px) {
  .topbar { font-size: 14px; }
  .topnav__more { display: none !important; }

  .hero { display: flex; flex-direction: column; min-height: 100svh; padding: 0 var(--margin) var(--margin); }
  .monument { position: relative; top: auto; inset: auto; margin-top: 28svh; }
  .hero__caption { position: relative; inset: auto; margin-top: 0; max-width: none; order: 3; }
  .hero__meaning { font-size: 20px; }
  .hero__line { font-size: 14px; line-height: 1.7; }
  .hero__cta .btn { flex: 1; justify-content: center; }
  .film { inset-inline-end: auto; inset-inline-start: var(--margin); top: 64px; bottom: auto; justify-items: start; }
  .film__year { font-size: 40px; }
  .film__cap { display: none; }
  .topnav a { display: inline-flex; align-items: center; min-height: 44px; }
  .chat__close, .term__close { min-width: 44px; min-height: 44px; }
  .term { height: min(520px, 60dvh); }
  .term__form input { font-size: 16px; }
  .footer { padding-bottom: calc(18px + 64px + var(--margin) + env(safe-area-inset-bottom, 0px)); }
  .chat { position: relative; inset: auto; width: 100%; margin-top: 14px; padding: 14px; order: 4; gap: 12px; }
  .chat__intro { font-size: 14px; padding-bottom: 6px; }
  .chip { font-size: 14px; padding: 8px 12px; min-height: 44px; }
  .chat__head { grid-template-columns: auto 1fr auto; }
  .chat__name { font-size: 52px; }

  .frame { width: 132px; padding: 9px 10px; }
  .frame code { font-size: 11px; }
  .frame__big { font-size: 24px; }

  .intro { display: block; }
  .intro .section-title { margin-bottom: 32px; }
  .intro__text { text-indent: 0; font-size: 21px; }
  .intro__note { margin-top: 40px; max-width: 32ch; }

  .path__inner { align-content: end; padding-bottom: 92px; }
  .path__text { grid-column: 1 / -1; gap: 10px; }
  .path__lede { display: none; }
  .rule__step { grid-template-columns: 46px 1fr; padding: 3px 0; column-gap: 12px; }
  .rule__kw { font-size: 18px; }
  .rule__role { font-size: 21px; }
  .rule__when { font-size: 13.5px; }
  .rule__more p { font-size: 14px; line-height: 1.7; }
  .path .section-title { font-size: 30px; }
  .js .path:not(.is-static) .rule__lead:not(.rule__lead--scale) { display: none; }
  .chat:not(.is-docked) { width: 100%; }
  /* گوشی: اگه پنل کامل جا نشه، هر مرحله با دو بولت (متن انگلیسی بلندتره) */
  .js .path.is-tight:not(.is-static) .rule__list li:nth-child(n+3) { display: none; }
  .footer__cols > div { gap: 0; }
  .footer__cols a, .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
  .pubs .link { padding-block: 7px; }
  .rule__list li { font-size: 14px; line-height: 1.65; }
  .js .path:not(.is-static) .rule__list li:nth-child(n+4) { display: none; }
  /* موبایل: فقط مرحله‌ی فعال، با یه نوار پیشرفت کوچیک (بقیه فقط برای صفحه‌خوان می‌مونن) */
  .rule__dots { display: flex; gap: 6px; list-style: none; margin: 2px 0 0; padding: 0; }
  .rule__dots li { flex: 1; height: 3px; background: var(--line); transition: background-color 0.3s ease; }
  .rule__dots li.is-on { background: var(--accent); }
  .rule { position: relative; }
  .js .rule:not(.is-static) .rule__step:not(.is-active) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0;
  }

  .case summary, .case__head { grid-template-columns: 1fr; gap: 4px; }
  .par div { grid-template-columns: 1fr; gap: 0; }
  .hero__role { font-size: 21px; }
  .case__body { grid-template-columns: 1fr; gap: 18px; }
  .case__body pre { font-size: 12px; padding: 14px 16px; }

  .pubs tr { display: grid; padding: 14px 12px; }
  .pubs td { padding: 0; width: auto !important; text-align: start !important; font-size: 16px; }
  .pubs tr { grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 4px; }
  .pubs td:first-child { grid-column: 1 / -1; }
  .pubs td:nth-child(2), .pubs td:nth-child(3) { font-size: 14px; }
  .pubs td:nth-child(3)::before { content: "· "; }

  .trip { --rail: 20px; padding-inline-start: calc(var(--rail) + 18px); gap: 56px; margin-top: 40px; }
  .trip__stop { grid-template-columns: 1fr; gap: 16px; }
  .trip__stop::before { inset-inline-start: calc(-1 * (var(--rail) + 18px) + var(--rail) / 2 - 8px); }
  .trip__code { font-size: 12.5px; padding: 14px 16px; }
  .trip__end { padding-inline-start: 0; }
  .trip__end .btn { width: 100%; justify-content: center; }
  .feature { grid-template-columns: 1fr; margin-top: 36px; }

  .row { min-height: 64px; padding: 12px 14px; font-size: 21px; flex-wrap: wrap; gap: 4px 16px; }
  .row__value { font-size: 14px; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 32px; }
  .robot { width: 46px; }
  .term { inset-inline: 10px; top: 8vh; }

  .footer__cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .chat.is-docked { inset-inline: 12px; width: auto; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  /* چت باز روی گوشی: دکمه‌ی «بستن» کنار عنوان، نه زیر آیکون ربات */
  .chat.is-docked .chat__head { grid-template-columns: auto auto 1fr auto; }
  /* بدون JS کلمه‌ی بزرگ نیست و کپشن نباید زیر نوار بالا بره */
  .no-js .hero { padding-top: calc(2 * var(--margin) + 44px); }
}

@media screen and (min-width: 601px) and (max-width: 900px) {
  .rule__list li, .rule__more p { font-size: 16px; line-height: 1.75; }
  .rule__list { max-width: 640px; }
  .rule__role { font-size: 26px; }
}
@media screen and (max-width: 900px) and (max-height: 700px) {
  .js .path:not(.is-static) .rule__list li:nth-child(n+3) { display: none; }
  .js .path:not(.is-static) .rule__lead--scale { display: none; }
}
@media screen and (max-width: 380px) {
  .topbar { gap: 10px; }
  .topnav { gap: 14px; }
  .topnav a, .wordmark { white-space: nowrap; }
  .topnav .topnav__pdf { display: none; }
  .btn { padding: 0 14px; font-size: 14px; white-space: nowrap; }
}
@media screen and (max-width: 480px) {
  .dock { width: 54px; height: 54px; padding: 8px; }
  .row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .row--hello { flex-direction: row; align-items: center; }
  .row__value { text-align: start; }
}
@media (hover: none) { .footer__hint { display: none; } }
@media screen and (max-width: 900px) and (max-height: 640px) {
  .js .path:not(.is-static) .section-title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .mask__inner { transform: none; }
  .js .hero__caption, .js .topbar, .js .chat { opacity: 1; }
  .js .chat__name { visibility: visible; }
  .rule__more, .rule__step, .rule__kw, .plus::before, .plus::after { transition: none; }
  .robot__eye, .dock .dock__eye, .chat.is-thinking .robot__tip, .chat.is-talking .robot__mouth rect { animation: none !important; }
}

/* آیفون افقی (viewport-fit=cover): متن زیر ناچ نره */
.topbar, .hero, main > section, .path, .footer {
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px));
}
.topnav a[hidden] { display: none; }

/* حالت High Contrast ویندوز: لبه‌ها با رنگ‌های سیستم دیده بشن */
@media (forced-colors: active) {
  .chat.is-docked, .term { border: 1px solid CanvasText; }
  .dock, .btn, .chat__send, .chip, .round { border: 1px solid ButtonText; }
  .dock svg { fill: ButtonText; }
}

/* ---------- دوزبانه: لینک تغییر زبان و نسخه‌ی انگلیسی (چپ‌به‌راست) ---------- */
.topnav a.topnav__lang { color: var(--accent); font-weight: 500; }
.topnav a.topnav__lang:hover { color: var(--ink); }
@media screen and (max-width: 900px), screen and (max-height: 560px) {
  /* روی گوشی جای لینک PDF به تغییر زبان می‌رسه؛ دکمه‌ی PDF توی صفحه‌ی اول هست */
  .topnav .topnav__pdf { display: none; }
}
:root[lang="en"] .monument__word,
:root[lang="en"] .chat__name,
:root[lang="en"] .film__year,
:root[lang="en"] .skills__word,
:root[lang="en"] .footer__mark { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; }
:root[lang="en"] .hero__meaning { font-style: normal; }
/* گوشی: اسم کامل انگلیسی کنار منو جا نمی‌شه */
@media screen and (max-width: 480px) { :root[lang="en"] .wordmark__extra { display: none; } }
/* گوشی، نسخه‌ی انگلیسی: سال فیلم بالای برج کوتاه‌تر (سمت راست) می‌شینه، مثل نسخه‌ی فارسی، نه روی رک بلند */
@media screen and (max-width: 900px), screen and (max-height: 560px) {
  :root[dir="ltr"] .film { inset-inline-start: auto; inset-inline-end: var(--margin); justify-items: end; text-align: end; }
}
:root[dir="ltr"] .hero__name, :root[dir="ltr"] .rule__role { text-align: left; }
:root[dir="ltr"] .feature__go svg, :root[dir="ltr"] .round svg { transform: scaleX(-1); }
:root[dir="ltr"] .feature:hover .feature__go svg { transform: scaleX(-1) translateX(-4px); }

/* ---------- نسخه‌ی چاپی (دکمه‌ی «دانلود رزومه» → Save as PDF) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #111; --muted: #444; --accent: #8a6a2a; --line: #ccc; }
  html, body { background: #fff !important; color: #111; font-size: 11pt; line-height: 1.6; }
  #moon, .orbit, .chat, .dock, .term, .topbar, .film, .skip, .footer, .hero__cta, .monument, .bot { display: none !important; }
  .skills__word { text-align: start; }
  .skills__fit { font-size: 16pt !important; }
  .rule__lead:not(.rule__lead--scale) { display: none !important; }
  .js .mask__inner, .js .hero__caption { transform: none !important; opacity: 1 !important; }
  * { opacity: 1 !important; box-shadow: none !important; }
  .hero { min-height: 0; padding: 0; }
  .hero__caption { position: static; max-width: none; }
  .hero__meaning { display: none; }
  .print-head { display: block !important; font-size: 22pt; font-weight: 700; line-height: 1.3; }
  section:not(.hero):not(.path):not(.chat) { padding: 8mm 2mm 0; }
  .mask { margin-inline: 0; padding-inline: 0.05em; overflow: visible; }
  .rule__list li, .skillset__list li, .rule__lead, .feature__text, .case__links--note, .par dd, .facts dd { color: #222 !important; }
  .skillset__list li { background: transparent !important; padding: 0 2mm 0 0; }
  .rule__org, .par dt, .case--feature .case__tags, .skillset__group--core .skillset__title { color: #7a5a1c !important; }
  .rule__step .rule__kw { color: #7a5a1c; }
  .rule__lead--scale { color: #000 !important; }
  .pubs td { word-break: normal; overflow-wrap: anywhere; }
  .rows { max-width: none; }
  .section-title { font-size: 16pt; }
  .intro { display: block; }
  .intro__text { font-size: 11pt; text-indent: 0; }
  .intro__note { margin-top: 3mm; }
  .facts { grid-template-columns: repeat(3, 1fr); margin-top: 4mm; }
  .facts div { padding: 2mm 0; }
  .pin-spacer { padding: 0 !important; height: auto !important; width: auto !important; max-width: none !important; max-height: none !important; }
  .path { position: static !important; transform: none !important; top: auto !important; left: auto !important; width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; }
  .path__inner { min-height: 0; display: block; padding: 0; }
  .path__lede { display: none; }
  .rule__step, .rule__step.is-active { color: #111; padding: 2mm 0; break-inside: avoid; }
  .rule__more { grid-template-rows: 1fr !important; }
  .rule__role { font-size: 13pt; }
  .skills__inner { max-width: none; }
  .case summary, .more > summary { min-height: 0; padding: 1mm 0; }
  .plus { display: none; }
  .case { break-inside: avoid; }
  .case__body { display: block; padding: 0 0 2mm; }
  .case__body pre { display: none; }
  .case__title { font-size: 12pt; }
  .pubs { margin-top: 3mm; }
  .pubs td { padding: 1mm 2mm; font-size: 10pt; }
  .rows { margin-top: 3mm; }
  .row { min-height: 0; padding: 1mm 0; font-size: 11pt; }
  .row--hello { display: none; }
  .skillset__group:last-child { grid-column: auto; }
  a { text-decoration: none; }
}
