@font-face { font-family: "Agrave Pro"; src: local("Agrave Pro"), local("AgravePro"), url("../fonts/AgravePro.woff2") format("woff2"), url("../fonts/AgravePro.otf") format("opentype"); font-display: swap; }
/* Nahed Mohamed portfolio.
   Layout concept: a light, typographic page built on the logo's own colours.
   One dark band (the story) and one pinned horizontal gallery carry the motion. */
:root {
  --aub: #412433;      /* logo: M stem and name */
  --ink: #2a1521;      /* deeper aubergine for the dark band */
  --plum: #7b485f;     /* logo: ribbon, dark end */
  --rose: #d0959f;     /* logo: ribbon, middle */
  --blush: #e2bfc0;    /* logo: UI / UX Designer pill */
  --petal: #eec5c2;    /* logo: ribbon, light end */
  --paper: #fbf7f5;
  --paper-2: #f3eae8;
  --muted: #6a5160;
  --line: rgba(65, 36, 51, 0.14);
  --display: "Agrave Pro", "Instrument Sans", system-ui, sans-serif;
  --text: "Agrave Pro", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4.2vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--aub);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--aub); color: var(--paper); padding: 10px 16px; border-radius: 99px; z-index: 200; }
.skip:focus { top: 12px; }

.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); max-width: 1480px; margin-inline: auto; }
.label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.serif { font-family: var(--display); font-weight: 400; }
.em { font-style: normal; color: var(--plum); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.02; letter-spacing: -0.015em; }
h2 { font-size: clamp(40px, 6.2vw, 92px); }
p { margin: 0; }
.star { width: 1em; height: 1em; display: inline-block; fill: currentColor; vertical-align: -0.1em; }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 300; background: var(--paper); display: grid; place-items: center; transition: clip-path 1s var(--ease), visibility 0s 1s; clip-path: inset(0 0 0 0); }
.intro[hidden] { display: none !important; }
.intro.is-leaving { clip-path: inset(0 0 100% 0); visibility: hidden; }
.intro__stars { position: absolute; inset: 0; pointer-events: none; }
.intro__stars svg { position: absolute; fill: var(--rose); opacity: 0; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0); } 50% { opacity: 0.85; transform: scale(1) rotate(45deg); } }
.intro__logo { width: min(560px, 78vw); opacity: 0; filter: blur(14px); transform: scale(0.96); animation: logoIn 1.3s 0.2s var(--ease) forwards; position: relative; }
@keyframes logoIn { to { opacity: 1; filter: blur(0); transform: none; } }
.intro__meta { position: absolute; left: 0; right: 0; bottom: 6vh; display: flex; justify-content: space-between; align-items: center; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); gap: 16px; }
.intro__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--rose), var(--plum)); transform-origin: left; transform: scaleX(0); }
.intro.is-running .intro__bar { animation: bar 2.3s linear forwards; }
@keyframes bar { to { transform: scaleX(1); } }
.pill-btn { border: 1px solid var(--line); background: transparent; padding: 9px 18px; border-radius: 99px; font-size: 14px; transition: background 0.25s, color 0.25s; }
.pill-btn:hover { background: var(--aub); color: var(--paper); }

/* ---------- header ---------- */
.hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding-top: env(safe-area-inset-top, 0px); transition: transform 0.5s var(--ease), background 0.3s; }
.hdr.is-solid { background: rgba(251, 247, 245, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.hdr.is-hidden { transform: translateY(-110%); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 24px; line-height: 1; }
.brand img, .foot img { width: auto; -webkit-mask-image: radial-gradient(ellipse closest-side, #000 88%, transparent 100%); mask-image: radial-gradient(ellipse closest-side, #000 88%, transparent 100%); }
.brand img { height: 46px; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { padding: 8px 14px; border-radius: 99px; font-size: 15px; transition: background 0.25s; }
.nav a:hover { background: var(--paper-2); }
.nav .cta { background: var(--aub); color: var(--paper); margin-left: 8px; }
.nav .cta:hover { background: var(--plum); }
.menu-btn { display: none; border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 8px 16px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { padding-top: 120px; padding-bottom: 40px; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 72px); margin-top: 16px; line-height: 0.98; letter-spacing: -0.02em; }
.hero h1 .ln { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero h1 .ln > span { display: block; transform: translateY(105%); transition: transform 1.2s var(--ease); }
.is-ready .hero h1 .ln > span { transform: none; }
.is-ready .hero h1 .ln:nth-child(2) > span { transition-delay: 0.12s; }
.hero__lede { max-width: 46ch; margin-top: 28px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 99px; background: var(--aub); color: var(--paper); font-weight: 500; transition: background 0.3s, transform 0.3s var(--ease); will-change: transform; border: 1px solid var(--aub); }
.btn:hover { background: var(--plum); border-color: var(--plum); }
.btn--ghost { background: transparent; color: var(--aub); border-color: var(--line); }
.btn--ghost:hover { background: var(--aub); color: var(--paper); border-color: var(--aub); }
.hero__logo { position: relative; transition: transform 0.2s linear; }
.hero__logo img { width: 100%; height: auto; max-width: 760px; margin-inline: auto; transform: translateY(24px); opacity: 0; transition: transform 1.4s 0.25s var(--ease), opacity 1.4s 0.25s; }
.is-ready .hero__logo img { transform: none; opacity: 1; }
.hero__rail { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; margin-top: clamp(36px, 6vw, 80px); padding-top: 22px; border-top: 1px solid var(--line); }
.hero__scroll { display: flex; align-items: center; gap: 10px; }

/* ---------- story (pinned) ---------- */
.story { background: var(--ink); color: var(--petal); position: relative; }
.story__stage { position: relative; }
.story__bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.story__bg svg { position: absolute; fill: var(--plum); opacity: 0.55; }
.chap { padding-block: clamp(72px, 10vw, 140px); border-top: 1px solid rgba(238, 197, 194, 0.14); }
.chap:first-child { border-top: 0; }
.chap__n { font-family: var(--display); font-size: 18px; color: var(--rose); }
.chap h2 { margin-top: 18px; color: var(--paper); }
.chap p { max-width: 52ch; margin-top: 26px; font-size: clamp(17px, 1.6vw, 21px); color: rgba(238, 197, 194, 0.86); }
.chap .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag { border: 1px solid rgba(238, 197, 194, 0.3); padding: 6px 14px; border-radius: 99px; font-size: 14px; }
.story__head { display: flex; justify-content: space-between; gap: 16px; padding-top: 32px; position: relative; z-index: 2; }
.story .label { color: var(--rose); }
.js-pin .story { height: 360vh; }
.js-pin .story__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.js-pin .story__stage .wrap { height: 100%; position: relative; }
.js-pin .chap { position: absolute; top: 0; bottom: 0; left: max(var(--gutter), env(safe-area-inset-left, 0px)); right: max(var(--gutter), env(safe-area-inset-right, 0px)); padding: 0; border: 0; display: flex; flex-direction: column; justify-content: center; opacity: 0; transform: translateY(40px); transition: opacity 0.7s var(--ease), transform 0.9s var(--ease); pointer-events: none; }
.js-pin .chap.is-on { opacity: 1; transform: none; pointer-events: auto; }
.js-pin .chap.is-past { transform: translateY(-40px); }
.story__prog { position: absolute; right: max(var(--gutter), env(safe-area-inset-right, 0px)); bottom: 6vh; left: max(var(--gutter), env(safe-area-inset-left, 0px)); height: 2px; background: rgba(238, 197, 194, 0.18); z-index: 2; display: none; }
.story__prog i { display: block; height: 100%; background: var(--rose); width: 0; }
.js-pin .story__prog { display: block; }
.story__hint { display: none; }
.js-pin .story__hint { display: inline; }

/* ---------- manifesto ---------- */
.manifesto { padding-block: clamp(96px, 14vw, 220px); }
.manifesto p { font-family: var(--display); font-size: clamp(34px, 5.4vw, 82px); line-height: 1.08; max-width: 18em; letter-spacing: -0.01em; }
.manifesto .w { color: rgba(65, 36, 51, 0.2); transition: color 0.4s; }
.manifesto .w.on { color: var(--aub); }
.no-js .manifesto .w, .manifesto.plain .w { color: var(--aub); }
.manifesto small { display: block; margin-top: 36px; }

/* ---------- work ---------- */
.work { background: var(--paper-2); padding-block: clamp(72px, 9vw, 130px); }
.work__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.work__head p { max-width: 34ch; color: var(--muted); }
.work__pin { margin-top: clamp(36px, 5vw, 64px); }
.work__track { display: grid; grid-template-columns: 1fr; gap: clamp(48px, 7vw, 96px); padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); }
.card { display: block; }
.card__cover { position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 16 / 10; background: var(--blush); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease); }
.card:hover .card__cover img { transform: scale(1.04); }
.card__num { position: absolute; left: 16px; top: 14px; font-family: var(--display); font-size: 20px; background: var(--paper); color: var(--aub); padding: 2px 14px; border-radius: 99px; }
.card__body { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; margin-top: 20px; align-items: baseline; }
.card__body h3 { font-size: clamp(30px, 3.4vw, 50px); }
.card__cat { grid-column: 1 / -1; }
.card__body p { color: var(--muted); max-width: 44ch; }
.card__go { justify-self: end; font-size: 14px; border-bottom: 1px solid var(--aub); padding-bottom: 2px; white-space: nowrap; }
.work__foot { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.work__count { display: none; font-family: var(--display); font-size: 22px; }
.js-hscroll .work { padding-bottom: 0; }
.js-hscroll .work__pin { height: var(--pin-h, 300vh); margin-top: 0; }
.js-hscroll .work__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 96px; padding-bottom: 8px; }
.js-hscroll .work__track { display: flex; gap: 4vw; width: max-content; will-change: transform; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); grid-template-columns: none; }
.js-hscroll .card { width: min(54vw, 880px); flex: none; }
.js-hscroll .card__cover { aspect-ratio: auto; height: clamp(200px, calc(100svh - 470px), 540px); }
.js-hscroll .work__count { display: block; }
.js-hscroll .work__foot { margin-top: 28px; padding-bottom: 28px; }
.js-hscroll .work__head-wrap { padding-bottom: 20px; }

/* ---------- about ---------- */
.about { padding-block: clamp(80px, 11vw, 170px); }
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); margin-top: 40px; }
.about__lead { font-family: var(--display); font-size: clamp(28px, 3.2vw, 46px); line-height: 1.15; }
.about__text p + p { margin-top: 18px; }
.about__text { color: var(--muted); max-width: 54ch; }
.principles { margin-top: clamp(48px, 7vw, 96px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.principles > div { padding: 28px 28px 8px 0; }
.principles > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.principles h3 { font-size: 30px; }
.principles p { margin-top: 12px; color: var(--muted); font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 56px; }
.facts dt { margin-bottom: 6px; }
.facts dd { margin: 0; }

/* ---------- experience ---------- */
.exp { background: var(--paper-2); padding-block: clamp(80px, 10vw, 150px); }
.tl { margin-top: 48px; display: grid; gap: 0; }
.tl__row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 80px); padding-block: 36px; border-top: 1px solid var(--line); }
.tl__row:last-child { border-bottom: 1px solid var(--line); }
.tl__when { font-family: var(--display); font-size: 24px; line-height: 1.2; }
.tl__when small { display: block; font-family: var(--text); font-size: 14px; color: var(--muted); margin-top: 6px; }
.tl h3 { font-size: clamp(28px, 3vw, 42px); }
.tl h3 + .label { margin-top: 8px; display: block; }
.tl ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; max-width: 62ch; color: var(--muted); }
.tl li { padding-left: 22px; position: relative; }
.tl li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 1px; background: var(--plum); }
.tl p { color: var(--muted); margin-top: 14px; max-width: 58ch; }

/* ---------- skills ---------- */
.skills { padding-block: clamp(80px, 10vw, 150px); }
.skills__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); margin-top: 48px; align-items: start; }
.tool { background: var(--aub); color: var(--paper); border-radius: 6px; padding: 32px; min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.tool b { font-family: var(--display); font-weight: 400; font-size: clamp(52px, 5.6vw, 92px); line-height: 0.9; color: var(--petal); }
.tool p { color: var(--blush); max-width: 24ch; }
.tool .star { position: absolute; right: 22px; top: 18px; font-size: 34px; color: var(--rose); }
.group h3 { font-size: 32px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { padding: 12px 0; border-bottom: 1px solid var(--line); transition: padding-left 0.35s var(--ease), color 0.3s; }
.group li:hover { padding-left: 10px; color: var(--plum); }

/* ---------- contact ---------- */
.contact { background: var(--paper-2); padding-block: clamp(90px, 12vw, 190px) 40px; }
.contact h2 { font-size: clamp(48px, 9vw, 150px); }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: clamp(32px, 5vw, 64px); }
.mail__addr { font-family: var(--display); font-size: clamp(26px, 4.2vw, 64px); line-height: 1.1; overflow-wrap: anywhere; user-select: all; border-bottom: 2px solid var(--blush); }
.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; margin-top: clamp(64px, 9vw, 130px); padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot img { height: 56px; }
.foot__r { display: flex; gap: 16px; align-items: center; }
.foot button { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cursor ---------- */
.cur { position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--plum); pointer-events: none; z-index: 400; opacity: 0; transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), background 0.3s, opacity 0.3s; display: grid; place-items: center; mix-blend-mode: normal; }
.cur span { font-size: 12px; color: var(--paper); opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.cur.is-on { opacity: 1; }
.cur.is-view { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--aub); }
.cur.is-view span { opacity: 1; }
.cur.is-link { width: 36px; height: 36px; margin: -18px 0 0 -18px; background: rgba(123, 72, 95, 0.25); }
@media (hover: none), (pointer: coarse) { .cur { display: none; } }

/* ---------- reveal ---------- */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 1s var(--ease); }
.js .rv.is-in { opacity: 1; transform: none; }

/* ---------- project pages ---------- */
.proj { padding-top: 140px; }
.proj__back { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.proj h1 { font-size: clamp(56px, 10vw, 160px); margin-top: 28px; }
.proj__lede { max-width: 52ch; margin-top: 28px; font-size: clamp(18px, 1.7vw, 22px); color: var(--muted); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 22px 32px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.meta dt { margin-bottom: 4px; }
.meta dd { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.2; }
.proj__hero { margin-top: 56px; border-radius: 6px; overflow: hidden; background: var(--blush); }
.proj__hero img { width: 100%; height: auto; }
.sec { padding-block: clamp(56px, 8vw, 120px) 0; }
.sec__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 90px); }
.sec h2 { font-size: clamp(36px, 4.6vw, 68px); }
.sec__txt p { color: var(--muted); max-width: 56ch; margin-top: 18px; }
.sec__txt ol, .sec__txt ul.plain { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; max-width: 56ch; }
.sec__txt li b { font-family: var(--display); font-weight: 400; font-size: 22px; display: block; }
.sec__txt li span { color: var(--muted); }
.shot { margin: 40px 0 0; }
.shot button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; height: auto; }
.shot figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }
.next { margin-top: clamp(72px, 10vw, 150px); padding-block: clamp(56px, 8vw, 110px); background: var(--paper-2); }
.next a { display: block; }
.next h2 { font-size: clamp(44px, 8vw, 130px); margin-top: 14px; transition: color 0.3s; }
.next a:hover h2 { color: var(--plum); }
.lb { position: fixed; inset: 0; background: rgba(42, 21, 33, 0.92); z-index: 500; overflow: auto; padding: 56px 16px 32px; }
.lb[hidden] { display: none !important; }
.lb img { width: min(1600px, 100%); height: auto; margin-inline: auto; border-radius: 4px; }
.lb button { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 16px; background: var(--paper); border: 0; border-radius: 99px; padding: 8px 18px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero { padding-top: 96px; }
  .about__grid, .sec__grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .principles > div, .principles > div + div { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .skills__grid { grid-template-columns: 1fr 1fr; }
  .tool { grid-column: 1 / -1; min-height: 220px; }
  .tl__row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-btn { display: block; }
  .nav { position: fixed; left: 0; right: 0; top: calc(72px + env(safe-area-inset-top, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px max(var(--gutter), env(safe-area-inset-left, 0px)) 20px; display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 4px; font-size: 18px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav .cta { margin: 12px 0 0; text-align: center; border-radius: 99px; }
  .skills__grid { grid-template-columns: 1fr; }
  .card__body { grid-template-columns: 1fr; }
  .card__go { justify-self: start; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .rv { opacity: 1; transform: none; }
  .hero h1 .ln > span, .hero__logo img { transform: none; opacity: 1; }
}

.work__head h2 { font-size: clamp(34px, 4.2vw, 64px); margin-top: 10px; }
.work__head .label { color: var(--aub); }
.work__head-wrap { position: relative; z-index: 2; }
.js-hscroll .work__sticky > .wrap { width: 100%; }
