/* m87x.com — Mustafa Maghraby
   Tokens: ink / paper / sign (taxiway yellow) / pool / lane / slate
   Type: Overpass (signage) + Newsreader (narrative) */

@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ink: #0d1e2a;
  --paper: #f1f4f3;
  --sign: #f6c500;
  --pool: #0b5c82;
  --lane: #cbd7dc;
  --slate: #4c5c67;
  --white: #ffffff;

  --sans: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.75rem, 6vw, 4.25rem);
  --step-5: clamp(3.25rem, 11vw, 9rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
  --measure: 36rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pool); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--sign); color: var(--ink); padding: .6rem 1rem; font-family: var(--sans); font-weight: 800; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--lane); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { font-family: var(--sans); font-weight: 800; font-size: 1rem; text-decoration: none; letter-spacing: -0.01em; }
.site-nav ul { list-style: none; display: flex; gap: clamp(.9rem, 2.4vw, 1.75rem); margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { font-family: var(--sans); font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--slate); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: var(--step-5);
  line-height: .92;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
  max-width: 11ch;
}
.hero .lede {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.38;
  max-width: 34rem;
  margin: 0 0 1rem;
}
.hero .facts { font-family: var(--sans); color: var(--slate); font-size: 1rem; line-height: 1.5; max-width: 40rem; margin: 0; }

/* ---------- Route (the one bold element) ---------- */
.route { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.route ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  position: relative;
}
.route ol::before {
  content: ""; position: absolute; left: 0; width: calc(80% + 2rem); top: 1.95rem; height: 4px;
  background: var(--ink); transform-origin: left center;
  animation: taxi 1.4s cubic-bezier(.6,.05,.25,1) .2s both;
}
.route li { position: relative; padding-right: 1rem; }
.sign {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  min-width: 5.5rem; height: 3.9rem; padding: 0 .9rem;
  background: var(--sign); color: var(--ink);
  font-family: var(--sans); font-weight: 900; font-size: 2.1rem; letter-spacing: .02em; line-height: 1;
  border: 3px solid var(--ink);
  padding-top: .3rem;
}
.route li:last-child .sign { background: var(--ink); color: var(--sign); }
.route .when { display: block; font-family: var(--sans); font-weight: 800; font-size: 1rem; margin-top: .9rem; }
.route .what { display: block; font-family: var(--sans); font-size: .95rem; line-height: 1.4; color: var(--slate); max-width: 14rem; margin-top: .2rem; }

@keyframes taxi { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 860px) {
  .route ol { grid-template-columns: 1fr; gap: 1.5rem; }
  .route ol::before { left: 2.6rem; top: 0; bottom: 2rem; width: 4px; height: auto; transform-origin: top center; animation-name: taxi-v; }
  .route li { display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 1rem; align-items: center; }
  .route .when { margin-top: 0; }
  .route .when, .route .what { grid-column: 2; }
  .route .sign { grid-row: 1 / span 2; }
}
@keyframes taxi-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route ol::before { animation: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--lane); }
.section h2 {
  font-family: var(--sans); font-weight: 800; font-size: var(--step-4);
  line-height: 1; letter-spacing: -0.025em; margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}
.section h3 { font-family: var(--sans); font-weight: 800; font-size: var(--step-1); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 5rem); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-family: var(--sans); font-weight: 800; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.02em; margin: 2.75rem 0 1rem; }
.prose h3 { margin-top: 2rem; }

.pull {
  font-family: var(--serif); font-style: italic; font-size: var(--step-2); line-height: 1.3;
  margin: 2rem 0; padding: 0 0 0 1.25rem; border-left: 4px solid var(--sign);
}
.pull cite { display: block; font-style: normal; font-family: var(--sans); font-size: var(--step--1); color: var(--slate); margin-top: .6rem; }

/* ---------- Who started DUBZ (answer block) ---------- */
.answer { background: var(--ink); color: var(--paper); }
.answer .section-inner { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3rem, 8vw, 6rem); }
.answer h2 { font-family: var(--sans); font-weight: 900; font-size: var(--step-4); line-height: 1; letter-spacing: -0.025em; margin: 0 0 1.5rem; color: var(--sign); }
.answer p { max-width: 40rem; font-size: var(--step-1); line-height: 1.45; margin: 0 0 1rem; }
.answer dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; margin: 2.5rem 0 2rem; padding: 1.5rem 0 0; border-top: 1px solid rgba(241,244,243,.25); }
.answer dt { font-family: var(--sans); font-size: var(--step--1); color: var(--lane); }
.answer dd { margin: .25rem 0 0; font-family: var(--sans); font-weight: 800; font-size: var(--step-1); line-height: 1.2; }
@media (max-width: 860px) { .answer dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.answer a.go {
  display: inline-block; font-family: var(--sans); font-weight: 800; font-size: 1rem;
  background: var(--sign); color: var(--ink); text-decoration: none; padding: .85rem 1.25rem .7rem; border: 3px solid var(--sign);
}
.answer a.go:hover { background: transparent; color: var(--sign); }

/* ---------- Track record (a real sequence) ---------- */
.legs { list-style: none; margin: 0; padding: 0; }
.legs li {
  display: grid; grid-template-columns: 7.5rem 4.5rem minmax(0, 1fr);
  gap: 1rem; align-items: baseline; padding: 1.15rem 0; border-bottom: 1px solid var(--lane);
}
.legs li:first-child { border-top: 1px solid var(--lane); }
.legs .yr { font-family: var(--sans); font-weight: 800; font-size: 1rem; }
.legs .code { font-family: var(--sans); font-weight: 900; font-size: .9rem; background: var(--sign); justify-self: start; padding: .25rem .45rem .1rem; border: 2px solid var(--ink); }
.legs .detail { font-size: 1.05rem; line-height: 1.5; }
.legs .detail strong { font-family: var(--sans); font-weight: 800; font-size: 1.05rem; display: block; line-height: 1.3; margin-bottom: .15rem; }
.legs .src { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); }
@media (max-width: 640px) {
  .legs li { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .legs .yr { grid-column: 1 / -1; }
}

/* ---------- Ventures ---------- */
.ventures { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-top: 4px solid var(--ink); }
.venture { padding: 1.75rem 1.75rem 1.5rem 0; }
.venture + .venture { padding-left: 1.75rem; border-left: 1px solid var(--lane); }
.venture .role { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); margin: 0 0 .75rem; }
.venture p { margin: 0 0 1rem; font-size: 1.05rem; }
.venture a.site { font-family: var(--sans); font-weight: 800; font-size: .95rem; }
.venture h3 { font-size: var(--step-3); letter-spacing: -0.02em; }
@media (max-width: 860px) {
  .ventures { grid-template-columns: 1fr; }
  .venture + .venture { padding-left: 0; border-left: 0; border-top: 1px solid var(--lane); }
}

/* ---------- Press ---------- */
.press { list-style: none; margin: 0; padding: 0; columns: 2 22rem; column-gap: 3rem; }
.press li { break-inside: avoid; padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--lane); }
.press .outlet { display: block; font-family: var(--sans); font-weight: 800; font-size: .95rem; }
.press a { font-size: 1.1rem; line-height: 1.4; }
.press .yr { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); }

/* ---------- LinkedIn post ---------- */
.post { max-width: 40rem; }
.post blockquote { margin: 0 0 1.25rem; font-size: var(--step-1); line-height: 1.5; }
.post .embed { margin-top: 1.5rem; background: var(--white); border: 1px solid var(--lane); }
.post .embed iframe { display: block; width: 100%; border: 0; }

/* ---------- Contact / footer ---------- */
.contact p { max-width: 34rem; }
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 800; font-size: 1rem; text-decoration: none;
  background: var(--ink); color: var(--paper); padding: .85rem 1.25rem .7rem; border: 3px solid var(--ink); margin: .5rem .75rem .5rem 0;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.alt { background: transparent; color: var(--ink); }
.btn.alt:hover { background: var(--ink); color: var(--paper); }

.site-foot { border-top: 4px solid var(--ink); padding: 2rem 0 3rem; font-family: var(--sans); font-size: .95rem; color: var(--slate); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-foot a { color: var(--ink); }

/* ---------- Article page ---------- */
.article-head { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem); }
.article-head h1 { font-family: var(--sans); font-weight: 900; font-size: var(--step-4); line-height: .98; letter-spacing: -0.03em; margin: 0 0 1.25rem; max-width: 16ch; }
.article-head .standfirst { font-size: var(--step-1); line-height: 1.45; max-width: 38rem; margin: 0; }
.article-head .byline { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); margin-top: 1.25rem; }
.article-body { padding-bottom: clamp(3rem, 8vw, 6rem); }
.faq dt { font-family: var(--sans); font-weight: 800; font-size: var(--step-1); line-height: 1.3; margin-top: 1.75rem; }
.faq dd { margin: .4rem 0 0; }
.sources { font-family: var(--sans); font-size: .95rem; line-height: 1.5; padding-left: 1.25rem; }
.sources li { margin-bottom: .5rem; }
.crumbs { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); padding-top: 1.25rem; }
.crumbs a { color: var(--slate); }
.legs .code:empty { visibility: hidden; }

/* ---------- On camera ---------- */
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.media { margin: 0; }
.media .frame { background: #fff; border: 1px solid var(--lane); max-width: 560px; }
.media .frame iframe { display: block; width: 100%; border: 0; }
.media .frame.video iframe { aspect-ratio: 16 / 9; height: auto; }
.media .frame.post iframe { height: 640px; }
.media figcaption { font-size: 1rem; line-height: 1.5; margin-top: .9rem; max-width: 34rem; }
.media figcaption strong { font-family: var(--sans); font-weight: 800; }
@media (max-width: 860px) { .media-grid { grid-template-columns: 1fr; } }
.post .embed + .btn { margin-top: 1.25rem; }

/* ---------- Photos ---------- */
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 22rem); gap: clamp(2rem, 5vw, 4.5rem); align-items: end; }
.portrait, .story-side .photo { margin: 0; border: 3px solid var(--ink); background: var(--lane); }
.portrait img, .story-side .photo img { display: block; width: 100%; height: auto; }
.story-side .photo { margin-top: clamp(1.5rem, 3vw, 2.5rem); max-width: 20rem; }
@media (max-width: 860px) {
  .hero-top { grid-template-columns: 1fr; }
  .portrait { max-width: 18rem; }
  .story-side .photo { max-width: 18rem; }
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 18rem)); gap: 2rem; margin-top: 1.5rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); }
.photo-grid figcaption { font-family: var(--sans); font-size: .95rem; margin-top: .75rem; line-height: 1.5; }
.photo-grid figcaption a { font-weight: 700; }
.photo-grid figcaption span { display: block; color: var(--slate); font-size: var(--step--1); }
.note { font-family: var(--sans); color: var(--slate); margin: 0; max-width: 40rem; }
.answer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 26rem); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.answer-photo { margin: 0; }
.answer-photo img { display: block; width: 100%; height: auto; border: 3px solid var(--sign); }
.answer-photo figcaption { font-family: var(--sans); font-size: var(--step--1); color: var(--lane); margin-top: .6rem; }
@media (max-width: 860px) { .answer-top { grid-template-columns: 1fr; } }
.prose .fig { margin: 2rem 0 2.25rem; }
.prose .fig img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); }
.prose .fig figcaption { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); margin-top: .6rem; line-height: 1.45; }
.prose .fig.narrow { max-width: 24rem; }
.story-side .photo figcaption { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); padding: .5rem .6rem; background: var(--paper); }

/* ---------- Companies I've built ---------- */
.built { background: #fff; border-top: 1px solid var(--lane); border-bottom: 1px solid var(--lane); padding: clamp(2rem, 5vw, 3rem) 0; }
.built h2 { font-family: var(--sans); font-weight: 800; font-size: 1rem; margin: 0 0 1.25rem; color: var(--slate); }
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.logos li + li { border-left: 1px solid var(--lane); }
.logos a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; min-height: 8.5rem; padding: 1rem; text-decoration: none; color: var(--slate); }
.logos img { display: block; height: auto; max-width: 70%; }
.logos li:nth-child(1) img { width: 190px; }
.logos li:nth-child(2) img { width: 104px; }
.logos li:nth-child(3) img { width: 210px; }
.logos .role { font-family: var(--sans); font-size: var(--step--1); }
.logos a:hover .role, .logos a:focus-visible .role { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) {
  .logos { grid-template-columns: 1fr; }
  .logos li + li { border-left: 0; border-top: 1px solid var(--lane); }
}

/* ---------- Track record photos ---------- */
.legs li { grid-template-columns: 7.5rem 4.5rem minmax(0, 1fr) 9rem; }
.legs .shot { grid-column: 4; align-self: start; }
.legs .shot img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); }
@media (max-width: 640px) {
  .legs li { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .legs .shot { grid-column: 2; max-width: 14rem; margin-top: .5rem; }
}
.logos .mark { display: flex; align-items: center; justify-content: center; height: 3.5rem; width: 100%; }
.logos .mark img { max-width: 70%; }
/* logo strip: larger, calmer */
.built { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.built h2 { font-size: var(--step-1); color: var(--ink); margin-bottom: 2rem; letter-spacing: -0.01em; }
.logos a { min-height: 11rem; gap: 1.1rem; padding: 1.5rem 1rem; transition: background-color .2s ease; }
.logos a:hover, .logos a:focus-visible { background: var(--paper); }
.logos .mark { height: 4.75rem; }
.logos li:nth-child(1) img { width: 250px; }
.logos li:nth-child(2) img { width: 140px; }
.logos li:nth-child(3) img { width: 270px; }
.logos .mark img { max-width: 80%; }
.logos .role { font-size: 1rem; color: var(--slate); }
