/* علي كاظم — موقع شخصي
   نظام واحد: Noto Naskh Arabic مستضافة محلياً (OFL)، بدون أي طلب خارجي.
   الطبقات: قيم أولية ← دلالية ← مكونات. خصائص منطقية فقط للتخطيط. */

@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoNaskhArabic-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/NotoNaskhArabic-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/NotoNaskhArabic-Bold.ttf") format("truetype");
}

/* ---------- Primitive tokens ---------- */
:root {
  --paper-light: #f7f7f4;
  --surface-light: #ffffff;
  --ink-light: #1a1a17;
  --muted-light: #57554c;
  --line-light: #dcd8cd;
  --line-strong-light: #b9b4a6;
  --gold-light: #9c7c2e;
  --focus-light: #7a5f1d;
  --glass-light: rgba(247, 247, 244, 0.72);

  --paper-dark: #131311;
  --surface-dark: #1d1d1a;
  --ink-dark: #f0eee7;
  --muted-dark: #b5b2a6;
  --line-dark: #35352f;
  --line-strong-dark: #6d6a5e;
  --gold-dark: #c8a45e;
  --focus-dark: #d9b96f;
  --glass-dark: rgba(19, 19, 17, 0.72);

  --wa-green: #128c7e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --space-section: 64px;
  --wrap: 1080px;
  --radius-bar: 18px;
  --radius-btn: 999px;
}

/* ---------- Semantic tokens ---------- */
:root,
[data-theme="light"] {
  color-scheme: light;
  --paper: var(--paper-light);
  --surface: var(--surface-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --line: var(--line-light);
  --line-strong: var(--line-strong-light);
  --gold: var(--gold-light);
  --focus: var(--focus-light);
  --glass: var(--glass-light);
  --shadow-bar: 0 10px 32px rgba(26, 26, 23, 0.1);
  --theme-color: #f7f7f4;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--paper-dark);
  --surface: var(--surface-dark);
  --ink: var(--ink-dark);
  --muted: var(--muted-dark);
  --line: var(--line-dark);
  --line-strong: var(--line-strong-dark);
  --gold: var(--gold-dark);
  --focus: var(--focus-dark);
  --glass: var(--glass-dark);
  --shadow-bar: 0 10px 32px rgba(0, 0, 0, 0.45);
  --theme-color: #131311;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

h1, h2, h3 { line-height: 1.5; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--ink); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a, button { touch-action: manipulation; }

::selection { background: rgba(156, 124, 46, 0.28); }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -72px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  transition: top 200ms var(--ease-out);
}
.skip-link:focus-visible { top: 16px; }

.wrap {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

/* ---------- Floating glass top bar ---------- */
.topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--wrap), calc(100% - 32px));
  z-index: 50;
  border-radius: var(--radius-bar);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-bar);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding-inline: 18px;
}
.wordmark {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.topnav { margin-inline-start: auto; }
.topnav ul { display: flex; gap: 4px; }
.topnav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.7;
  transition: background-color 160ms var(--ease-out);
}
.topnav a:hover { background: rgba(128, 124, 110, 0.14); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.theme-toggle:hover { background: rgba(128, 124, 110, 0.14); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Hero: the one orchestrated entrance ---------- */
.hero {
  min-height: 88svh;
  display: flex;
  align-items: center;
  padding-block: 148px 72px;
}
.hero-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.hero-name {
  font-size: clamp(2.9rem, 12vw, 6.4rem);
  font-weight: 700;
  line-height: 1.35;
}
.hero-rule {
  display: block;
  width: 76px;
  height: 2px;
  margin-block: 26px 22px;
  background: var(--gold);
  transform-origin: right center;
}
.hero-title {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 600;
  line-height: 1.6;
}
.hero-lead {
  max-width: 34rem;
  margin-block-start: 14px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 36px;
}

[data-enter] {
  opacity: 0;
  transform: translateY(10px);
  animation: hero-rise 560ms var(--ease-out) forwards;
}
.hero-name[data-enter] { animation-delay: 40ms; }
.hero-rule[data-enter] {
  opacity: 0;
  transform: scaleX(0);
  animation: hero-rule 560ms var(--ease-out) 160ms forwards;
}
.hero-title[data-enter] { animation-delay: 260ms; }
.hero-lead[data-enter] { animation-delay: 340ms; }
.hero-actions[data-enter] { animation-delay: 420ms; }
@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-rule {
  to { opacity: 1; transform: scaleX(1); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 26px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.7;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }

/* ---------- Sections ---------- */
.section { padding-block: var(--space-section); scroll-margin-top: 96px; }
.section-rule {
  display: block;
  width: 28px;
  height: 2px;
  margin-block-end: 16px;
  background: var(--gold);
}
.section h2 {
  font-size: clamp(1.65rem, 4.5vw, 2.15rem);
  font-weight: 700;
  margin-block-end: 36px;
}

/* ---------- Works: editorial rows, not a card grid ---------- */
.works { border-block-start: 1px solid var(--line); }
.work {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding-block: 30px;
  border-block-end: 1px solid var(--line);
}
.work h3 { font-size: 1.35rem; font-weight: 700; }
.work-body p { margin-block-start: 6px; color: var(--muted); max-width: 36rem; }
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-height: 44px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 160ms var(--ease-out);
}
.work-link:hover { color: var(--gold); }
.work-link .icon { width: 1.1rem; height: 1.1rem; }
.work-note { color: var(--muted); align-self: center; }

/* ---------- Services: hairline rows ---------- */
.services { border-block-start: 1px solid var(--line); }
.services li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 22px;
  border-block-end: 1px solid var(--line);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.7;
}
.services .icon { width: 1.4rem; height: 1.4rem; color: var(--gold); }

/* ---------- Tools: a plain flowing list ---------- */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  border-block-start: 1px solid var(--line);
  padding-block-start: 28px;
}
.tools li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.7;
}
.tools li::before {
  content: "";
  width: 6px; height: 6px;
  flex-shrink: 0;
  background: var(--gold);
}

/* ---------- Process: a real sequence ---------- */
.process {
  display: grid;
  grid-template-columns: 1fr;
  border-block-start: 1px solid var(--line);
}
.process li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-block: 24px;
  border-block-end: 1px solid var(--line);
}
.process-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.process-name { font-size: 1.2rem; font-weight: 600; }

/* ---------- Contact ---------- */
.contact-lead { color: var(--muted); max-width: 34rem; font-size: 1.12rem; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-block-start: 28px;
}
.phone {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.phone:hover { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Footer ---------- */
.footer {
  border-block-start: 1px solid var(--line);
  padding-block: 36px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer p { font-weight: 600; }
.footer ul { display: flex; gap: 4px; }
.footer a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  transition: background-color 160ms var(--ease-out);
  border-radius: 10px;
}
.footer a:hover { background: rgba(128, 124, 110, 0.14); }

/* ---------- Floating glass bottom nav (mobile only) ---------- */
.bottomnav { display: none; }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .work { grid-template-columns: 1fr auto; align-items: center; }
  .work-link { justify-self: end; }
  .process { grid-template-columns: repeat(2, 1fr); column-gap: 48px; }
}

@media (min-width: 768px) {
  :root { --space-section: 88px; }
  .services { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .process { grid-template-columns: repeat(4, 1fr); column-gap: 32px; }
  .process li { flex-direction: column; align-items: flex-start; gap: 8px; }
  .process-num { font-size: 1.05rem; }
}

/* ---------- Small screens: bottom nav ---------- */
@media (max-width: 767px) {
  body { padding-block-end: 112px; }
  .topnav { display: none; }
  .theme-toggle { margin-inline-start: auto; }
  .topbar-inner { padding-inline: 14px; }
  .bottomnav {
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(430px, calc(100% - 32px));
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: end;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-bar);
  }
  .bottomnav > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 48px;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--muted);
    transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
  }
  .bottomnav > a:hover { color: var(--ink); background: rgba(128, 124, 110, 0.12); }
  .bottomnav > a:active { transform: scale(0.96); }
  .bottomnav .icon { width: 1.3rem; height: 1.3rem; }
  .bottomnav-wa {
    width: 58px; height: 58px;
    margin-block-start: -34px;
    border-radius: 50%;
    background: var(--wa-green);
    color: #ffffff;
    border: 3px solid var(--paper);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    justify-self: center;
  }
  .bottomnav > a.bottomnav-wa { color: #ffffff; padding: 0; min-height: 58px; border-radius: 50%; }
  .bottomnav > a.bottomnav-wa:hover { color: #ffffff; background: #0f7a6e; }
  .bottomnav-wa .icon { width: 1.6rem; height: 1.6rem; }
}

/* ---------- Reduced motion: the entrance rests, nothing stays hidden ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-enter] { opacity: 1; transform: none; animation: none; }
  .hero-rule[data-enter] { opacity: 1; transform: scaleX(1); animation: none; }
}

/* ---------- Reduced transparency: glass becomes near-solid ---------- */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .bottomnav {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  :root, [data-theme="light"] { --glass: rgba(247, 247, 244, 0.96); }
  [data-theme="dark"] { --glass: rgba(19, 19, 17, 0.96); }
}

/* ---------- Higher contrast ---------- */
@media (prefers-contrast: more) {
  :root, [data-theme="light"] { --muted: #3f3d36; --line-strong: #8a8578; }
  [data-theme="dark"] { --muted: #d6d3c8; --line-strong: #8f8c80; }
}
