/* Abobkr Tagalden — portfolio
   Palette is taken from the portrait: deep Nile navy, the blue rim light, a warm off-white, and the gold of the watch. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face { font-family: "Plex Arabic"; src: url("../fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/plex-arabic-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/plex-arabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/plex-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --deep: #08132B;      /* page */
  --night: #0E1D3D;     /* raised surfaces */
  --line: #20345F;      /* rules and borders */
  --blue: #3B7BFF;      /* Blue Nile, the accent */
  --blue-soft: #8FB2FF;
  --white: #ECE8DC;     /* White Nile, main text */
  --mist: #98A5C2;      /* secondary text */
  --gold: #D4A85A;      /* live status only */

  --sans: "Archivo", "Plex Arabic", system-ui, sans-serif;
  --ar: "Plex Arabic", "Archivo", system-ui, sans-serif;

  --step-0: 1.0625rem;                                 /* 17px body */
  --step-1: clamp(1.2rem, 1.1rem + .4vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.3rem + .9vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4: clamp(3.2rem, 2rem + 6vw, 7.5rem);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --max: 1240px;
  --radius-s: 6px;
  --radius-l: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--deep);
  color: var(--white);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { font-family: var(--ar); line-height: 1.75; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--blue-soft); }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 20;
  background: var(--white); color: var(--deep); padding: .6rem 1rem; border-radius: var(--radius-s);
}
.skip:focus { top: 1rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--gutter);
  background: color-mix(in srgb, var(--deep) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nav__mark { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; font-stretch: 112%; letter-spacing: -.01em; }
.nav__mark svg { width: 30px; height: 30px; fill: none; stroke-width: 3; stroke-linecap: round; }
.nav__mark svg path:first-child { stroke: var(--blue); }
.nav__mark svg path:last-child { stroke: var(--white); }
.nav nav { display: flex; align-items: center; gap: clamp(.9rem, 2.5vw, 2rem); }
.nav nav a { text-decoration: none; color: var(--mist); font-size: .95rem; }
.nav nav a:hover { color: var(--white); }
.lang {
  font: inherit; font-size: .95rem; color: var(--white); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem;
}
.lang:hover { border-color: var(--blue); }
.lang span { font-family: var(--ar); }
html[lang="ar"] .lang span { font-family: var(--sans); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 7rem) var(--gutter) clamp(4rem, 10vh, 8rem);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  isolation: isolate;
}
.rivers {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; overflow: visible;
}
.river { fill: none; stroke-linecap: round; }
.river--blue { stroke: var(--blue); stroke-width: 2.5; opacity: .8; }
.river--white { stroke: var(--white); stroke-width: 1.5; opacity: .45; }
.river--joined { stroke: color-mix(in srgb, var(--blue) 60%, var(--white)); stroke-width: 5; opacity: .7; }
html[dir="rtl"] .rivers { transform: scaleX(-1); }

.hero__ar { font-family: var(--ar); color: var(--gold); font-size: var(--step-1); font-weight: 500; margin-bottom: .75rem; }
html[lang="ar"] .hero__ar { display: none; }
.hero__name {
  font-size: var(--step-4);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .92;
}
.hero__name span { display: block; }
.hero__name span:last-child { color: transparent; -webkit-text-stroke: 1.5px var(--white); }
html[lang="ar"] .hero__name { font-family: var(--ar); font-stretch: 100%; letter-spacing: 0; line-height: 1.15; font-weight: 700; }
html[lang="ar"] .hero__name span:last-child { -webkit-text-stroke: 1.2px var(--white); }

.hero__lede { margin-top: 1.75rem; max-width: 34em; font-size: var(--step-1); color: color-mix(in srgb, var(--white) 88%, var(--mist)); line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: .7rem 1.3rem;
  border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .98rem; font-stretch: 105%;
  color: var(--white); background: transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--blue); color: var(--white); }
.btn--solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--solid:hover { background: #2D68E8; border-color: #2D68E8; color: #fff; }

.facts { margin: 2.75rem 0 0; display: grid; gap: .55rem; font-size: .97rem; }
.facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; }
.facts dt { color: var(--mist); }
.facts dd { margin: 0; }

.hero__portrait { margin: 0; position: relative; justify-self: end; width: min(100%, 400px); }
.hero__portrait img {
  width: 100%; aspect-ratio: 13 / 16; object-fit: cover;
  border-radius: 200px 200px var(--radius-l) var(--radius-l);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(59, 123, 255, .45);
}

/* ---------- Sections ---------- */
.work, .more, .about, .contact {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6rem) var(--gutter);
}
.section-head { display: grid; gap: .8rem; margin-bottom: clamp(2rem, 5vh, 3.5rem); max-width: 46rem; }
.section-head h2, .about h2 { font-size: var(--step-3); font-stretch: 118%; letter-spacing: -.025em; }
html[lang="ar"] .section-head h2, html[lang="ar"] .about h2, html[lang="ar"] .contact h2 { font-stretch: 100%; letter-spacing: 0; }
.section-head p { color: var(--mist); }

/* Featured projects: one row each, screenshot on the leading side */
.project { border-top: 1px solid var(--line); padding: clamp(1.75rem, 4vh, 2.5rem) 0 clamp(2.5rem, 6vh, 4rem); }
.project__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.project__head h3 { font-size: var(--step-2); font-stretch: 115%; letter-spacing: -.02em; }
html[lang="ar"] .project__head h3 { font-stretch: 100%; letter-spacing: 0; }
.ar-name { font-family: var(--ar); font-weight: 500; color: var(--mist); font-size: .7em; margin-inline-start: .4rem; }

.status { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--mist); white-space: nowrap; }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--mist); }
.status--live { color: var(--white); }
.status--live::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(212, 168, 90, .16); }

.project__body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.shot { display: block; margin: 0; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); background: var(--night); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
a.shot:hover img { transform: scale(1.015); }
@media (prefers-reduced-motion: reduce) { a.shot:hover img { transform: none; } }

.project__info { display: grid; gap: 1.1rem; align-content: start; }
.kind { color: var(--blue-soft); font-weight: 500; }
.project__info > p:not(.kind) { color: color-mix(in srgb, var(--white) 86%, var(--mist)); max-width: 36em; }
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.stack li { font-size: .85rem; padding: .25rem .65rem; border-radius: var(--radius-s); background: var(--night); color: var(--mist); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.1rem; margin-top: .35rem; }
.note { font-size: .9rem; color: var(--mist); max-width: 32em; }

/* Index of smaller projects: a dense list, not cards */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(0, 14rem) auto;
  gap: 1.5rem; align-items: center;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.index li > img, .thumb {
  width: 112px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border-radius: var(--radius-s); border: 1px solid var(--line);
}
.thumb {
  display: grid; place-items: center; font-weight: 800; font-stretch: 120%; font-size: 1.05rem; letter-spacing: -.02em;
  background: var(--night); color: var(--white);
}
.thumb--sareea { font-family: var(--ar); font-stretch: 100%; background: #1A2A52; color: #FFB35C; }
.thumb--wasel { background: #0F2E4A; color: #7FD1C7; }
.thumb--pos { background: #1D2547; color: var(--blue-soft); }
.thumb--lexigo { background: #13305A; color: #F2C66D; }
.index__name h3 { font-size: var(--step-1); font-weight: 650; font-stretch: 108%; }
html[lang="ar"] .index__name h3 { font-stretch: 100%; }
.index__name p { color: var(--mist); font-size: .95rem; margin-top: .25rem; max-width: 46em; }
.index__stack { color: var(--mist); font-size: .9rem; }
.index__link { font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--blue-soft); padding: .4rem 0; }
.index__link:hover { color: var(--white); text-decoration: underline; }
.index__link--muted { color: var(--mist); font-weight: 400; }
.index__link--muted:hover { color: var(--mist); text-decoration: none; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); border-top: 1px solid var(--line); }
.about__intro { display: grid; gap: 1.1rem; align-content: start; }
.about__intro p { color: color-mix(in srgb, var(--white) 86%, var(--mist)); max-width: 34em; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 5px; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(var(--blue), var(--line)); }
.timeline li { position: relative; padding-inline-start: 2rem; padding-bottom: 1.8rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--deep); border: 2px solid var(--blue); }
.timeline__when { color: var(--mist); font-size: .9rem; }
.timeline h3 { font-size: var(--step-1); font-weight: 650; margin: .2rem 0 .35rem; }
.timeline li > p:last-child { color: var(--mist); font-size: .97rem; }

.tools { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 2rem; }
.tools h3 { font-size: var(--step-1); font-weight: 650; margin-bottom: 1.2rem; }
.tools dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.tools dt { color: var(--blue-soft); font-weight: 600; margin-bottom: .35rem; }
.tools dd { margin: 0; color: var(--mist); font-size: .95rem; }

/* Contact */
.contact { border-top: 1px solid var(--line); padding-bottom: clamp(4rem, 12vh, 8rem); }
.contact h2 { font-size: var(--step-3); font-stretch: 118%; letter-spacing: -.025em; max-width: 18em; }
.contact > p { color: var(--mist); margin-top: 1rem; max-width: 36em; }
.contact__mail {
  display: inline-block; margin-top: 2rem;
  font-size: clamp(1.4rem, .8rem + 3.2vw, 3.4rem); font-weight: 700; font-stretch: 110%; letter-spacing: -.02em;
  color: var(--white); text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 3px; text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
.contact__mail:hover { color: var(--blue-soft); }
.contact__links { list-style: none; margin: 2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.contact__links a { color: var(--mist); }
.contact__links a:hover { color: var(--white); }

.foot {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 1.5rem var(--gutter) 2.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  color: var(--mist); font-size: .88rem; border-top: 1px solid var(--line);
}

/* ---------- The one moment: the two rivers draw in and meet ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .river { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); }
  .js.ready .river--blue { animation: flow 2.2s cubic-bezier(.45, .05, .25, 1) .15s forwards; }
  .js.ready .river--white { animation: flow 1.9s cubic-bezier(.45, .05, .25, 1) .35s forwards; }
  .js.ready .river--joined { animation: flow 1.1s cubic-bezier(.3, .1, .2, 1) 2.15s forwards; }
  .js .hero__portrait { opacity: 0; transform: translateY(12px); }
  .js.ready .hero__portrait { animation: rise .9s ease-out 1.7s forwards; }
}
@keyframes flow { to { stroke-dashoffset: 0; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .project__body { grid-template-columns: 1fr; }
  .index li { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .index li > img, .thumb { width: 96px; }
  .index__stack { display: none; }
  .tools dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rivers { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero__portrait { justify-self: start; width: min(78%, 340px); order: -1; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav__mark span { display: none; }
  .nav nav { gap: .9rem; }
  .facts div { grid-template-columns: 5.5rem 1fr; }
  .index li { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .index li > img, .thumb { display: none; }
  .tools dl { grid-template-columns: 1fr; }
  .project__head { flex-wrap: wrap; }
}
