/* ============================================
   أسامة محبوب — Base / Reset / Layout
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  /* Subtle Arabic geometric lattice in the background */
  background-image:
    radial-gradient(circle at 15% 20%, var(--glow) 0%, transparent 32%),
    radial-gradient(circle at 85% 75%, var(--glow) 0%, transparent 30%);
  background-attachment: fixed;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ---------- Particles canvas ---------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  z-index: 1000;
  border-radius: 0 0 0 4px;
  box-shadow: 0 0 12px var(--glow);
}

/* ---------- Custom cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1001;
  transform: translate(-50%, -50%);
  display: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--accent);
  opacity: 0.5;
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), opacity 0.25s;
}

body.cursor-hover .cursor-ring {
  width: 60px;
  height: 60px;
  opacity: 0.9;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-dot,
  .cursor-ring {
    display: block;
  }
}

/* ---------- Sections shared ---------- */
main {
  position: relative;
  z-index: 1;
}

.section {
  position: relative;
  padding: clamp(4rem, 10vw, 7rem) 1.25rem;
  max-width: var(--container);
  margin-inline: auto;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-kicker {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--gold-accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.4;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--gold-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Ornament divider ---------- */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.2rem auto 0;
  max-width: 320px;
}

.ornament-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-accent));
}

.ornament-line:last-child {
  background: linear-gradient(90deg, var(--gold-accent), transparent);
}

.ornament-star {
  color: var(--gold-accent);
  font-size: 0.9rem;
  animation: star-spin 8s linear infinite;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  background: transparent;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), backdrop-filter var(--dur-fast);
}

.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transition: transform var(--dur-med) var(--ease-spring);
}

.brand:hover .brand-logo {
  transform: rotate(-12deg) scale(1.08);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-med);
}

.theme-toggle:hover {
  transform: scale(1.12) rotate(8deg);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--accent);
  transition: transform var(--dur-med) var(--ease-spring), opacity var(--dur-fast);
}

:root[data-theme='light'] .icon-moon,
:root[data-theme='dark'] .icon-sun {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

:root[data-theme='light'] .icon-sun,
:root[data-theme='dark'] .icon-moon {
  opacity: 0;
  transform: translateY(150%) rotate(90deg);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  transition: background var(--dur-med);
}

.footer-logo {
  width: 74px;
  margin-inline: auto;
  opacity: 0.9;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-top: 0.8rem;
  color: var(--accent);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.footer-socials a {
  position: relative;
  transition: color var(--dur-fast);
}

.footer-socials a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  right: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold-accent);
  transition: width var(--dur-fast) var(--ease-out);
}

.footer-socials a:hover {
  color: var(--accent);
}

.footer-socials a:hover::after {
  width: 100%;
}

.footer-socials span {
  color: var(--gold-accent);
  font-size: 0.7rem;
  align-self: center;
}

.footer-copy {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}
