/* ===========================================================
   حسام خالد: الألوان مأخوذة من أيقونة الحاسبة نفسها
   =========================================================== */
:root {
  --ink: #16233A;        /* خلفية الشاشة الداكنة والنصوص */
  --ink-2: #22324F;
  --paper: #EEF1F5;      /* خلفية الصفحة */
  --surface: #FFFFFF;
  --amber: #F2B705;      /* الزرار الأصفر في الحاسبة: لون الأفعال */
  --amber-deep: #C99500;
  --sky: #6BB5E8;        /* شاشة الحاسبة */
  --sky-soft: #D6EAF8;
  --rose-soft: #FBDADB;
  --muted: #5A6578;
  --line: #D5DBE4;

  --font: "Readex Pro", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --wrap: 1120px;
  --header-h: 68px;
  --r-lg: 28px;
  --r-md: 18px;
}

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

:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--amber); color: var(--ink); padding: 10px 16px;
  border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px;
  border-radius: 14px;
  font: 600 1rem/1 var(--font);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: #FFC61A; }
.btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--ink);
  color: #fff;
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(10,18,32,.25); }
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 1.2rem; text-decoration: none;
}
.brand-mark {
  display: grid; grid-template-columns: repeat(2, 9px); gap: 3px;
}
.brand-mark i { width: 9px; height: 9px; border-radius: 3px; background: var(--sky); }
.brand-mark i:first-child { background: var(--amber); }
.brand-mark i:last-child { background: #fff; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  text-decoration: none; font-weight: 500; font-size: .98rem;
  padding: 8px 14px; border-radius: 10px;
  color: rgba(255,255,255,.82);
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.site-nav a.is-active { color: #fff; }
.site-nav .nav-cta {
  background: var(--amber); color: var(--ink); margin-inline-start: 8px; font-weight: 600;
}
.site-nav .nav-cta:hover { background: #FFC61A; color: var(--ink); }

.menu-toggle {
  display: none;
  width: 46px; height: 46px; border-radius: 12px;
  background: transparent; border: 1px solid rgba(255,255,255,.2);
  color: #fff; cursor: pointer; position: relative;
}
.bars, .bars::before, .bars::after {
  position: absolute; left: 50%; width: 20px; height: 2px; margin-left: -10px;
  background: currentColor; border-radius: 2px; transition: transform .25s, opacity .2s;
}
.bars { top: 50%; margin-top: -1px; }
.bars::before, .bars::after { content: ""; left: 0; margin-left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); background: #fff; }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); background: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 64px 0 80px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 56px;
}
.hero-text { align-self: center; }
.hero-hello { color: var(--sky); font-size: 1.15rem; font-weight: 500; }
.hero h1 {
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 14px;
}
.hero-role {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 500;
  color: #fff;
}
.hero-lead {
  max-width: 34em;
  margin-top: 18px;
  color: rgba(255,255,255,.72);
  font-weight: 300;
  font-size: 1.1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }


/* The signature: browser (front end) + deploy terminal (back end & hosting) */
.stack-stage {
  position: relative;
  padding: 8px 0 72px;
  min-height: 420px;
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.22); }
.browser {
  position: relative;
  width: 100%;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(3,8,18,.6);
  direction: ltr;
}
.browser-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: #DCE2EA;
}
.browser-bar .dots i { background: #B7C0CD; }
.url {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 8px; padding: 5px 12px;
  font-size: .82rem; color: var(--muted); line-height: 1.4;
}
.url svg { width: 13px; height: 13px; fill: none; stroke: #1F9D55; stroke-width: 2.4; stroke-linecap: round; }
.page { padding: 18px 22px 26px; }
.page i { display: block; border-radius: 6px; background: var(--paper); }
.pg-nav { display: flex; justify-content: space-between; align-items: center; }
.pg-nav span { display: flex; gap: 8px; }
.pg-nav span i { width: 34px; height: 8px; }
.pg-logo { width: 24px; height: 24px; background: var(--amber) !important; border-radius: 7px !important; }
.pg-hero { padding: 30px 0 24px; display: grid; gap: 10px; }
.pg-h1 { height: 20px; width: 78%; background: var(--ink) !important; }
.pg-h1.short { width: 52%; }
.pg-line { height: 9px; width: 90%; margin-top: 6px; }
.pg-line.short { width: 64%; margin-top: 0; }
.pg-btn { width: 96px; height: 30px; margin-top: 10px; background: var(--amber) !important; border-radius: 8px !important; }
.pg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pg-cards i { height: 64px; background: var(--sky-soft); }

.terminal {
  position: absolute; left: -28px; bottom: 0;
  width: min(330px, 86%);
  background: #0A1220;
  border: 1px solid #2A3A58;
  border-radius: 14px;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,.6);
  font: 400 .84rem/1.9 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: #C9D4E5;
}
.term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-bottom: 1px solid #1E2B42;
  color: #7C8BA3; font-size: .78rem;
}
.term-lines { padding: 12px 16px 14px; }
.term-lines li { white-space: nowrap; overflow: hidden; }
.prompt { color: var(--sky); }
.ok { color: #4ADE80; }
.live { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }

/* One orchestrated moment: the deploy runs, then the site appears */
@media (prefers-reduced-motion: no-preference) {
  .term-lines li { animation: line .01s both; }
  .term-lines li:nth-child(1) { animation-delay: .3s; }
  .term-lines li:nth-child(2) { animation-delay: .8s; }
  .term-lines li:nth-child(3) { animation-delay: 1.2s; }
  .term-lines li:nth-child(4) { animation-delay: 1.6s; }
  .term-lines li:nth-child(5) { animation-delay: 2s; }
  .term-lines li:nth-child(6) { animation-delay: 2.5s; }
  @keyframes line { from { visibility: hidden; } to { visibility: visible; } }
  .page > * { animation: appear .6s ease-out both; }
  .page > :nth-child(1) { animation-delay: 2.6s; }
  .page > :nth-child(2) { animation-delay: 2.75s; }
  .page > :nth-child(3) { animation-delay: 2.9s; }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
  .dot-live { animation: pulse 2s 3s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74,222,128,.05); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Sections ---------- */
.services, .process, .apps, .about, .contact { padding: 96px 0; }
.process { padding-top: 0; }
.contact { padding-top: 0; }
.section-head { max-width: 40em; margin-bottom: 44px; }
.section-head h2, .about-text h2, .contact-intro h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.25;
  font-weight: 700;
}
.section-head p { color: var(--muted); margin-top: 10px; font-size: 1.1rem; }

/* ---------- Services ---------- */
.service-list {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--ink);
}
.service-list li { padding: 32px 0 0; padding-inline-end: 36px; }
.service-list li + li { padding-inline-start: 36px; border-inline-start: 1px solid var(--line); }
.service-list svg {
  width: 30px; height: 30px; fill: none; stroke: var(--ink);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.service-list h3 { font-size: 1.35rem; font-weight: 600; margin-top: 16px; }
.service-list p { color: var(--muted); margin-top: 8px; }

/* ---------- Process ---------- */
.process-grid {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px;
  border-top: 1px solid var(--line); padding-top: 96px;
}
.process .section-head { margin-bottom: 0; }
.steps { counter-reset: step; display: grid; gap: 4px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 64px 18px 0;
  color: var(--muted);
}
.steps li::before {
  content: counter(step, arabic-indic);
  position: absolute; inset-inline-start: 0; top: 14px;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 1.2rem;
  border: 1px solid var(--line);
}
.steps li:last-child::before { background: var(--amber); border-color: var(--amber); }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; inset-inline-start: 21px; top: 62px; bottom: -14px;
  width: 2px; background: var(--line);
}
.steps strong { display: block; color: var(--ink); font-weight: 600; font-size: 1.1rem; }

/* ---------- Apps (secondary) ---------- */
.tile {
  display: grid; place-items: center;
  aspect-ratio: 1; background: var(--tile, #fff);
}
.apps-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px;
}
.apps-intro h2 { font-size: 1.6rem; font-weight: 700; line-height: 1.4; }
.apps-intro p { color: var(--muted); margin-top: 4px; }
.app-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 24px;
}
.app {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--r-md); padding: 14px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.app-icon { width: 56px; box-shadow: none; border-radius: 14px; }
.app-icon img { width: 64%; height: 64%; object-fit: contain; }
.app-body h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.4; }
.app-body p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.app-dl {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: .88rem; font-weight: 500; white-space: nowrap;
}
.app-dl:hover { background: var(--ink-2); }
.app-dl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.install-help { margin-top: 18px; color: var(--muted); font-size: .95rem; }
.install-help summary { cursor: pointer; color: var(--ink); font-weight: 500; width: fit-content; }
.install-help p { margin-top: 8px; max-width: 48em; }

/* ---------- About ---------- */
.about { background: var(--surface); }
.about-grid {
  display: grid; grid-template-columns: 360px 1fr; gap: 64px; align-items: center;
}
.portrait {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  outline: 3px solid var(--amber);
  outline-offset: 10px;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* طبقة شفافة فوق الصورة: كليك يمين أو الضغط المطوّل مش هيوصل للصورة نفسها */
.portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
}
.about-text p { max-width: 36em; margin-top: 16px; font-size: 1.1rem; }
.skills-title { font-size: 1rem; font-weight: 600; margin-top: 32px; color: var(--muted); }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.skills li {
  padding: 6px 14px; border-radius: 10px;
  background: var(--paper); font-weight: 500; font-size: .95rem;
}

/* ---------- Contact ---------- */
.contact-panel {
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg);
  padding: 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.contact-intro p { color: rgba(255,255,255,.72); margin-top: 12px; max-width: 30em; font-weight: 300; font-size: 1.1rem; }
.contact-list { display: grid; gap: 10px; }
.contact-list a {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: 16px;
  background: rgba(255,255,255,.06);
  text-decoration: none;
  transition: background-color .2s;
}
.contact-list a:hover { background: rgba(255,255,255,.12); }
.contact-list svg {
  width: 44px; height: 44px; padding: 11px; flex: none;
  border-radius: 12px; background: var(--amber);
  fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.contact-list small { display: block; font-size: .85rem; color: var(--sky); line-height: 1.4; }
.contact-list span span { font-weight: 500; font-size: 1.05rem; word-break: break-all; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0 36px; color: var(--muted); font-size: .92rem; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .app-list { grid-template-columns: 1fr; }
  .terminal { left: -8px; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-text { padding-bottom: 24px; }
  .hero { padding: 48px 0 56px; }
  .stack-stage { max-width: 520px; width: 100%; justify-self: center; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { width: 240px; justify-self: start; margin: 12px; }
  .process-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-panel { grid-template-columns: 1fr; padding: 40px 28px; gap: 28px; }
}

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--ink); padding: 8px 20px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 12px; font-size: 1.05rem; }
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }

  .services, .about, .apps { padding: 72px 0; }
  .contact { padding: 0 0 72px; }
  .process { padding: 0 0 72px; }
  .process-grid { padding-top: 72px; }
  .service-list { grid-template-columns: 1fr; }
  .service-list li, .service-list li + li { padding: 26px 0; border-inline-start: 0; }
  .service-list li + li { border-top: 1px solid var(--line); }
  .apps-panel { padding: 24px 18px; }
  .stack-stage { min-height: 0; padding-bottom: 150px; }
  .terminal { left: 0; width: 88%; font-size: .78rem; }
  .page { padding: 14px 16px 18px; }
  .pg-hero { padding: 20px 0 16px; }
  .pg-cards i { height: 44px; }
}

@media (max-width: 380px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- منع الطباعة ---------- */
.print-block { display: none; }
@media print {
  html, body { background: #fff !important; }
  body > *:not(.print-block) { display: none !important; }
  .print-block {
    display: block !important;
    padding: 40vh 0 0; text-align: center;
    font: 700 24pt/1.6 var(--font); color: #000;
  }
}
