/* ==========================================================================
   پایه: ریست، تایپوگرافی، دسترس‌پذیری
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01";
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol {
  margin: 0;
}

h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  font-weight: 800;
  letter-spacing: -0.01em;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: 16px; /* جلوگیری از زوم خودکار iOS */
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* فوکوس برنامه‌ای پس از ناوبری (برای صفحه‌خوان) حلقه نمی‌خواهد */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* اسکرول‌بار ظریف روی دسکتاپ */
@media (hover: hover) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 3px solid var(--bg);
    border-radius: 10px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* ---------- لوگو: لنز + منظره + خورشید ---------- */
.sl-logo {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lg-bg {
  fill: var(--kadr-ink);
}

[data-theme="light"] .lg-bg {
  fill: var(--kadr-ink);
}

:root:not([data-theme="light"]) .lg-bg {
  fill: #212226;
  stroke: rgba(245, 245, 242, 0.12);
  stroke-width: 1;
}

.lg-lens {
  fill: none;
  stroke: var(--kadr-paper);
  stroke-width: 3;
  stroke-dasharray: 85 85;
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-90deg);
}

.lg-land {
  fill: var(--kadr-paper);
}

.lg-sun {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
}

.lg-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.sl-logo.is-animated .lg-lens {
  animation: lgLens 0.9s var(--ease) 0.1s both;
}

.sl-logo.is-animated .lg-land {
  animation: lgLand 0.7s var(--ease) 0.35s both;
}

.sl-logo.is-animated .lg-sun {
  animation: lgSun 0.6s var(--ease-spring) 0.7s both;
}

.sl-logo.is-animated .lg-pulse {
  animation: lgPulse 1s var(--ease) 1.05s both;
}

@keyframes lgLens {
  from { stroke-dashoffset: 85; }
}

@keyframes lgLand {
  from { transform: translateY(12px); }
}

@keyframes lgSun {
  from { transform: translateY(6px) scale(0); }
}

@keyframes lgPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.6); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
