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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) rgba(148, 163, 184, 0.18);
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
}

html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(120, 162, 255, 0.9), rgba(72, 118, 255, 0.8));
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .particle-field span {
    animation: none;
  }

}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-fa);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  display: flex;
  flex-direction: column;
}

main > .hero { order: 1; }
main > #fit { order: 2; }
main > #services { order: 3; }
main > #projects { order: 4; }
main > #process { order: 5; }
main > #about { order: 6; }
/* main > #technologies { order: 7; } */
main > #contact { order: 8; }

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* Latin/technical terms (framework names, URLs, code) stay LTR inside RTL text */
.ltr,
[dir="ltr"],
code,
.tech-tag,
.project-tech,
.url-link {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-en);
}

::selection {
  background: var(--accent);
  color: #04070d;
}

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

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: 72px;
  border-bottom: 1px solid var(--border);
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle-field span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
  animation: particle-drift 18s linear infinite;
}

.particle-field span:nth-child(1) { left: 8%; top: 18%; animation-delay: -2s; }
.particle-field span:nth-child(2) { left: 18%; top: 72%; animation-delay: -11s; }
.particle-field span:nth-child(3) { left: 29%; top: 34%; animation-delay: -7s; }
.particle-field span:nth-child(4) { left: 41%; top: 84%; animation-delay: -15s; }
.particle-field span:nth-child(5) { left: 53%; top: 12%; animation-delay: -5s; }
.particle-field span:nth-child(6) { left: 64%; top: 62%; animation-delay: -13s; }
.particle-field span:nth-child(7) { left: 74%; top: 27%; animation-delay: -9s; }
.particle-field span:nth-child(8) { left: 83%; top: 78%; animation-delay: -17s; }
.particle-field span:nth-child(9) { left: 92%; top: 45%; animation-delay: -4s; }
.particle-field span:nth-child(10) { left: 12%; top: 48%; animation-delay: -14s; }
.particle-field span:nth-child(11) { left: 47%; top: 52%; animation-delay: -8s; }
.particle-field span:nth-child(12) { left: 88%; top: 12%; animation-delay: -12s; }

@keyframes particle-drift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.25; }
  50% { transform: translate3d(18px, -28px, 0); opacity: 0.85; }
}

.section-head {
  margin-bottom: var(--space-7);
  max-width: 640px;
}

.section-label {
  display: inline-block;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 56ch;
}

.text-secondary {
  color: var(--text-secondary);
}

.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-link {
  position: absolute;
  right: var(--space-4);
  top: -60px;
  background: var(--accent);
  color: #04070d;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--duration-fast) var(--ease);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--duration-slow) var(--ease),
      transform var(--duration-slow) var(--ease);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}
