﻿/* Persian CRT — unified design tokens */

:root {
  /* Surfaces */
  --page-bg: #f3f4f6;
  --card-bg: #ffffff;
  --surface-soft: #f8fafc;
  --white: #ffffff;
  --silver-bg: #efefef;

  /* Navy darks */
  --nav-bg: #0b1220;
  --dark-section: #0f172a;
  --footer-bg: #0a101c;

  /* Borders & text */
  --border: #e5e7eb;
  --border-soft: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-dark: #1e293b;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --on-dark: #e8eef7;
  --on-dark-2: #94a3b8;
  --on-dark-3: rgba(255, 255, 255, 0.5);
  --on-dark-4: rgba(255, 255, 255, 0.35);
  --on-dark-link: rgba(255, 255, 255, 0.72);
  --on-dark-link-strong: rgba(255, 255, 255, 0.85);
  --on-dark-soft: rgba(255, 255, 255, 0.08);
  --on-dark-line: rgba(255, 255, 255, 0.08);
  --on-dark-border: rgba(255, 255, 255, 0.18);

  /* Primary brand — green */
  --accent: #07ab54;
  --accent-dark: #068f46;
  --accent-dark2: #007137;
  --accent-light: #2fc478;
  --accent-pale: #eef7f1;

  /* Warm accent — amber (forms, tips, highlights) */
  --warm: #f98d00;
  --warm-dark: #d97500;
  --warm-light: #ffa82e;
  --warm-mid: #ffe8cc;
  --warm-pale: #fff7ed;
  --warm-border: #fcd9b0;
  --warm-ink: #9a3412;
  --warm-ring: rgba(249, 141, 0, 0.15);
  --warm-glow: rgba(217, 117, 0, 0.28);
  --warm-soft: rgba(249, 141, 0, 0.06);

  /* Semantic */
  --green: #16a34a;
  --green-pale: #e7faf0;
  --green-ink: #085229;
  --red: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-ink: #7f1d1d;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-ink: #1e3a8a;
  --info-accent: #3b82f6;
  --tg: #229ed9;

  /* Legacy aliases (green primary) */
  --orange: var(--accent);
  --orange-dark: var(--accent-dark);
  --orange-light: var(--accent-light);
  --orange-pale: var(--accent-pale);

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.22);

  --max: 1160px;
  --max-prose: 820px;
  --max-shell: 920px;
  --r: 6px;
  --r-lg: 12px;
  --font: "IRANSansXFaNum", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose-wrap {
  width: 100%;
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* —— Nav —— */
#nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-dark);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 1rem;
  direction: ltr;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  direction: ltr;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.logo-mark {
  flex-shrink: 0;
  display: block;
  width: 22px;
  height: 34px;
}

.logo-text .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-dark-link);
}

.nav-links a:hover {
  color: var(--white);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.5rem 0.875rem;
  border-radius: var(--r);
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-dark);
}

.nav-cta-mobile {
  display: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--on-dark-border);
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 899px) {
  .nav-inner {
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-cta-desktop {
    display: none;
  }

  .nav-panel {
    display: none;
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-dark);
    padding: 0.75rem 1.5rem 1.25rem;
    box-shadow: var(--shadow-lg);
  }

  body.nav-open .nav-panel {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--on-dark-line);
    color: var(--on-dark-link-strong);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-cta-mobile {
    display: inline-flex;
    justify-content: center;
    margin-top: 0.75rem;
    text-align: center;
  }
}

@media (min-width: 900px) {
  .nav-panel {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
    flex: 1;
  }

  .nav-links {
    justify-content: flex-end;
    margin-inline-end: 1rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav-cta-mobile {
    display: none;
  }
}

.stub-section {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
  scroll-margin-top: 90px;
}

.stub-section h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.stub-section p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.75;
  font-size: 0.9375rem;
}

.stub-section-dark {
  max-width: none;
  background: var(--dark-section);
  color: var(--on-dark);
  padding: 2.5rem 1.5rem;
  margin-top: 2rem;
}

.stub-section-dark .prose-wrap {
  max-width: var(--max-prose);
}

.stub-section-dark h2 {
  color: var(--white);
}

.stub-section-dark p {
  color: var(--on-dark-2);
}

.stub-section-dark .section-num {
  color: var(--accent);
}

/* —— Overview —— */
#overview {
  padding: 3.5rem 0 3.5rem;
}

.overview-head {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 640px;
  margin-inline: auto;
  padding: 0 1.5rem;
}

.overview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.875rem;
}

.overview-title {
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.overview-title span {
  color: var(--accent);
}

.overview-sub {
  color: var(--ink-2);
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.7;
}

.overview-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: var(--max-shell);
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

@media (min-width: 640px) {
  .overview-chips {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .overview-chips {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

.overview-banner {
  max-width: var(--max-shell);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.overview-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.overview-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.overview-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.overview-chip-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--silver-bg);
  color: var(--accent-dark2);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overview-chip-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* —— Article / hero —— */
.article-shell {
  width: 100%;
  max-width: var(--max-shell);
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

#article {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 0 3rem;
  overflow: hidden;
}

.article-hero {
  max-width: var(--max-prose);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.article-hero h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.article-hero .lead {
  font-size: 1.0625rem;
  color: var(--ink-2);
  line-height: 1.8;
  margin: 0 0 1rem;
}

.article-hero .lead:last-child {
  margin-bottom: 0;
}

/* —— TOC —— */
.toc-block {
  background: var(--page-bg);
  border-right: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
  margin: 0 auto 2.5rem;
  max-width: var(--max-prose);
}

.toc-title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .toc-list {
    columns: 2;
  }
}

.toc-list li {
  break-inside: avoid;
  margin-bottom: 0.4rem;
}

.toc-list a {
  font-size: 0.875rem;
  color: var(--ink-2);
  font-weight: 500;
}

.toc-list a:hover {
  color: var(--accent);
}

.toc-list .toc-num {
  color: var(--accent);
  font-weight: 800;
  margin-left: 0.35rem;
}

/* —— Sections —— */
.guide-section {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 3rem 1.5rem 0.5rem;
  border-top: 1px solid var(--border);
}

.guide-section:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}

.section-num {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.55rem;
}

.section-num::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.32em 0.55em 0.32em 0;
  border-color: transparent var(--accent) transparent transparent;
  flex-shrink: 0;
}

.guide-section h2 {
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-top: 0;
  border-top: 0;
  scroll-margin-top: 90px;
}

.guide-section:first-of-type h2 {
  border-top: 0;
  padding-top: 0;
}

.guide-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 90px;
}

.guide-section p {
  margin: 0 0 1rem;
  color: var(--ink);
}

.guide-section strong {
  font-weight: 700;
}

.guide-section em {
  font-style: italic;
}

.guide-section ul,
.guide-section ol {
  margin: 0.5rem 0 1.5rem;
  padding-right: 1.35rem;
  padding-left: 0;
}

.guide-section li {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.guide-section li::marker {
  color: var(--accent);
  font-weight: 500;
}

/* —— Callouts —— */
.callout {
  margin: 1.5rem 0;
  padding: 1.125rem 1.375rem;
  border-radius: var(--r);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.callout p {
  margin: 0;
}

.callout-label {
  display: inline-block;
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.callout-tip {
  background: linear-gradient(135deg, var(--warm-pale) 0%, var(--warm-mid) 160%);
  border: 1px solid var(--warm-border);
  border-right-width: 3px;
  border-right-color: var(--warm);
  color: var(--warm-ink);
  box-shadow: 0 1px 0 var(--warm-soft);
}

.callout-tip .callout-label {
  color: var(--warm-dark);
}

.callout-warn {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-right-width: 3px;
  border-right-color: var(--red);
  color: var(--danger-ink);
}

.callout-warn .callout-label {
  color: var(--red);
}

.callout-note {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-right-width: 3px;
  border-right-color: var(--info-accent);
  color: var(--info-ink);
}

.callout-note .callout-label {
  color: var(--info-accent);
}

/* —— Pills —— */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pill.green {
  background: var(--green-pale);
  color: var(--green-ink);
}

.pill.red {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.pill.orange {
  background: var(--warm-pale);
  color: var(--warm-dark);
}

/* —— Charts / figures —— */
.chart-figure {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--page-bg);
  overflow: hidden;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chart-body {
  padding: 1.5rem;
  text-align: center;
}

.diagram-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  display: block;
  width: 100%;
  overflow-x: auto;
}

.diagram-ltr svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.chart-body svg,
.chart-body img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.chart-body img.sample-img,
.chart-body img.diagram-img {
  width: 100%;
  max-height: none;
  object-fit: contain;
  background: transparent;
}

.chart-caption {
  font-size: 0.8125rem;
  color: var(--ink-2);
  margin: 0;
  padding: 0 1.125rem 1rem;
  text-align: right;
  line-height: 1.6;
}

/* —— Tables —— */
.table-wrap,
.trade-table {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow-x: auto;
  background: var(--card-bg);
}

.guide-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0;
}

.guide-section th,
.guide-section td {
  padding: 0.75rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.guide-section th {
  background: var(--page-bg);
  font-weight: 700;
  color: var(--ink);
}

.guide-section tr:last-child td {
  border-bottom: 0;
}

/* —— FAQ —— */
#faq {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
  border-top: 1px solid var(--border);
}

#faq .section-num {
  color: var(--accent);
}

#faq h2 {
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-top: 0;
  border-top: 0;
  scroll-margin-top: 90px;
}

.faq-list {
  margin-top: 0.5rem;
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  list-style: none;
  gap: 1rem;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 1rem;
  line-height: 1;
  transition: 0.15s;
}

.faq-list details[open] .faq-toggle {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.faq-answer {
  padding: 0 0 1.125rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.75;
}

.faq-answer p {
  margin: 0;
}

/* —— PDF CTA (match crttrading.com resource box) —— */
.pdf-section {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.pdf-section .section-num {
  color: var(--warm-dark);
}

.pdf-section .section-num::before {
  border-color: transparent var(--warm) transparent transparent;
}

.pdf-section > h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 1.25rem;
  padding-top: 0;
  border-top: 0;
}

.pdf-block {
  margin: 0;
  background: linear-gradient(135deg, var(--warm-pale) 0%, var(--warm-mid) 100%);
  border: 2px dashed var(--warm);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.pdf-block-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}

.pdf-block-tag {
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--warm-dark);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.pdf-block-copy h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.55rem;
  line-height: 1.35;
}

.pdf-block-copy p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.pdf-form {
  display: grid;
  gap: 0.65rem;
}

.pdf-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--warm-border);
  background: var(--white);
  border-radius: var(--r);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pdf-input:focus {
  border-color: var(--warm);
  box-shadow: 0 0 0 3px var(--warm-ring);
}

.pdf-submit {
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--warm);
  color: var(--white);
  border: 0;
  font-size: 0.875rem;
  font-weight: 800;
  font-family: inherit;
  padding: 0.8125rem;
  border-radius: var(--r);
  transition: background 0.15s, box-shadow 0.15s;
}

.pdf-submit:hover {
  background: var(--warm-dark);
  box-shadow: 0 6px 16px var(--warm-glow);
}

.pdf-note {
  font-size: 0.75rem;
  color: var(--warm-dark);
  line-height: 1.5;
}

.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;
}

@media (min-width: 720px) {
  .pdf-block {
    padding: 1.75rem;
  }

  .pdf-block-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 1.5rem;
  }
}

/* —— Author (درباره من) —— */
.author-bio {
  max-width: var(--max-prose);
  margin: 3rem auto 1rem;
  padding: 0 1.5rem;
  scroll-margin-top: 90px;
}

.author-bio-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.author-bio-head {
  background: var(--nav-bg);
  padding: 0.625rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.author-bio-head .tag {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.author-bio-head .meta {
  font-size: 0.6875rem;
  color: var(--on-dark-3);
}

.author-bio-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 560px) {
  .author-bio-body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .author-credentials {
    justify-content: center;
  }
}

.author-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-avatar img[src] + .avatar-initials {
  display: none;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.author-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--warm-pale);
  color: var(--warm-dark);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--warm-border);
}

.author-role {
  font-size: 0.875rem;
  color: var(--ink-2);
  margin: 0 0 0.875rem;
}

.author-credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.author-cred {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--page-bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.625rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.author-bio-text {
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.75;
  margin: 0;
}

.author-about {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.75rem 1.75rem;
  background: var(--page-bg);
}

.author-about-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ink);
}

.author-about p {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.8;
}

.author-about p:last-child {
  margin-bottom: 0;
}

/* —— Footer —— */
footer {
  background: var(--footer-bg);
  padding: 3rem 0 1.75rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 2rem 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--on-dark-line);
  margin-bottom: 1.25rem;
}

.footer-col {
  min-width: 0;
}

.footer-col + .footer-col {
  border-right: 1px solid var(--on-dark-line);
  padding-right: 1.25rem;
}

.footer-col-title {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--white);
}

.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.footer-col-list a {
  font-size: 0.8125rem;
  color: var(--on-dark-3);
  transition: color 0.15s;
}

.footer-col-list a:hover {
  color: var(--white);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  direction: ltr;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.footer-logo .logo-mark {
  width: 20px;
  height: 31px;
}

.footer-blurb {
  margin: 0 0 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--on-dark-3);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-social-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--on-dark-soft);
  color: var(--white);
  transition: background 0.15s, transform 0.15s;
}

.footer-social-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.footer-social-telegram:hover {
  background: var(--tg);
}

.footer-contact-list {
  display: grid;
  gap: 0.85rem;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8125rem;
  color: var(--on-dark-3);
}

.footer-contact-item:hover {
  color: var(--white);
}

.footer-contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--on-dark-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--accent);
}

.footer-disc {
  font-size: 0.75rem;
  color: var(--on-dark-4);
  line-height: 1.75;
  margin: 0 0 1.25rem;
}

.footer-disc strong {
  color: var(--warm);
  margin-left: 0.35rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--on-dark-4);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--on-dark-line);
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-col + .footer-col {
    border-right: 0;
    padding-right: 0;
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--on-dark-line);
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.risk-note {
  max-width: var(--max-prose);
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: var(--ink-3);
  line-height: 1.65;
}

.risk-note strong {
  color: var(--ink-2);
}

/* —— Back to top —— */
.back-to-top {
  position: fixed;
  right: max(0.75rem, calc((100vw - min(var(--max-shell), 100vw - 2.5rem)) / 2 - 3.25rem));
  left: auto;
  bottom: 1.5rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--nav-bg);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, background 0.15s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
}

@media (max-width: 1100px) {
  .back-to-top {
    right: 0.85rem;
  }
}
