/* ==========================================================================
   Abdallh Osama — portfolio
   One typeface (Archivo in two widths), a grayscale page, and one red
   playhead. The timeline fixed to the bottom of the screen is the
   navigation; everything else stays quiet so the work carries the colour.
   Light/dark and the playhead colour are set from the editor.
   ========================================================================== */

/* ---------- tokens ---------- */

:root {
  --paper: #f7f7f7;
  --ink: #000000;
  --graphite: #6f6f6f;
  --rule: #dedede;
  --clip: #e8e8e8;
  --clip-on: #d0d0d0;
  --accent: #f23a1d;    /* playhead red */
  --on-accent: #ffffff;
  --live: #1a9f5a;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --condensed: 78%;     /* display width */

  --pad: clamp(20px, 4vw, 64px);
  --gutter: clamp(16px, 2vw, 32px);
  --timeline-h: 44px;
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #f4f4f4;
  --graphite: #9b9b9b;
  --rule: #262626;
  --clip: #1a1a1a;
  --clip-on: #343434;
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(var(--timeline-h) + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

::selection { background: var(--ink); color: var(--paper); }

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

.skip {
  position: fixed;
  left: 12px;
  top: -64px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: 12px; }

.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 40px 20px; }

html.is-locked { overflow: hidden; }
html.is-locked body { padding-right: var(--sbw, 0px); }

/* While the editor's live preview re-renders, skip every transition. */
html.instant *,
html.instant *::before,
html.instant *::after { transition: none !important; }

/* ---------- the intro: hard cuts on whole frames (25 fps) ---------- */

.cut { opacity: 0; }
.is-loaded .cut { opacity: 1; transition: opacity 0s linear var(--at, 0ms); }

/* ---------- shared pieces ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--graphite);
  transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: currentColor; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  transition: border-color 0.2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- header (scrolls away; the timeline does the navigating) ---------- */

.header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding: 26px var(--pad);
  font-size: 16px;
}
.brand { font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--graphite); transition: color 0.2s; }
.status:hover { color: var(--ink); }
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 40px;
  min-height: calc(100vh - var(--timeline-h));
  min-height: calc(100svh - var(--timeline-h));
  padding: 120px var(--pad) 32px;
}
.hero__title {
  align-self: end;
  max-width: 9.6em;
  font-size: clamp(3rem, 1.9rem + 6.2vw, 8.5rem);
  font-weight: 600;
  font-stretch: var(--condensed);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero__line { display: block; }
.hero__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-size: 16px;
  color: var(--graphite);
}

/* ---------- reel ---------- */

.reel { padding: 0 var(--pad); }
.reel__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--clip);
}
.reel__frame > img,
.reel__frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel__bar {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: clamp(16px, 2.4vw, 32px);
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
}
.reel__title { font-size: clamp(1.5rem, 1rem + 2vw, 3rem); font-weight: 600; font-stretch: var(--condensed); line-height: 1; letter-spacing: -0.02em; }
.reel__play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 16px;
  font-weight: 500;
}
.reel__play svg { width: 11px; height: 11px; }

/* ---------- sections: side label + content on a 12-column grid ---------- */

.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 24px;
  padding: clamp(104px, 11vw, 176px) var(--pad) 0;
}
.section__side,
.section > .section__label { grid-column: 1 / span 3; }
.section__label { font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--graphite); }
.section__body { grid-column: 4 / -1; min-width: 0; }

@media (max-width: 860px) {
  .section__side,
  .section > .section__label,
  .section__body { grid-column: 1 / -1; }
}

/* ---------- work ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 16px; }
.filter { padding: 2px 0; color: var(--graphite); transition: color 0.2s; }
.filter:hover { color: var(--ink); }
.filter.is-active { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

.work__grid { grid-column: 1 / -1; margin-top: 16px; transition: opacity 0.2s; }
.work__grid.is-switching { opacity: 0; }

.work-rows { display: flex; flex-direction: column; gap: clamp(64px, 8vw, 128px); }
.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: start;
}
.work-col { display: flex; flex-direction: column; gap: clamp(64px, 8vw, 128px); min-width: 0; }
.work-col + .work-col { padding-top: clamp(80px, 14vw, 240px); }

.card { min-width: 0; }
.card__link { display: block; }
.card--portrait .card__link { width: min(100%, 74%); }
.work-col + .work-col .card--portrait .card__link { margin-left: auto; }
.work-full .card--portrait .card__link { width: min(100%, 460px); margin-inline: auto; }

.card__media,
.product__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--clip);
}
.card__media > img,
.card__media > video,
.product__media > img,
.product__media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8%;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.6rem);
  font-weight: 600;
  font-stretch: var(--condensed);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--graphite);
}
/* touch screens get a small play mark; mouse users get the cursor label */
.card__play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
}
.card__play svg { width: 11px; height: 11px; margin-left: 2px; }
@media (hover: none) { .card__play { display: grid; } }

.card__meta,
.product__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 14px;
  font-size: 16px;
}
.card__client { color: var(--graphite); }
.card__title { font-size: 18px; font-weight: 500; line-height: 1.3; }
.card__info { color: var(--graphite); text-align: right; }

@media (max-width: 760px) {
  .work-rows { gap: 56px; }
  .work-row { display: flex; flex-direction: column; align-items: stretch; gap: 56px; }
  .work-col { display: contents; }
  .work-col + .work-col { padding-top: 0; }
  .work-row .card { order: var(--o, 0); }
  .card--portrait .card__link { width: 82%; }
  .work-col + .work-col .card--portrait .card__link { margin-left: 0; }
}

.empty { display: grid; justify-items: start; gap: 6px; max-width: 34em; }
.empty__title { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; }
.empty__text { color: var(--graphite); }
.empty .text-link { margin-top: 10px; }

/* ---------- about ---------- */

.about__photo {
  overflow: hidden;
  max-width: 240px;
  margin-top: 20px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--clip);
}
.about__photo > img { width: 100%; height: 100%; object-fit: cover; }

.about__text {
  max-width: 22em;
  font-size: clamp(1.75rem, 1rem + 2.5vw, 3.25rem);
  font-weight: 500;
  font-stretch: 90%;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.about__text p + p { margin-top: 0.55em; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 24px var(--gutter);
  margin-top: clamp(48px, 6vw, 88px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.facts dt { margin-bottom: 4px; font-size: 16px; color: var(--graphite); }
.facts dd { font-size: 18px; }

/* ---------- services ---------- */

.services__list { border-top: 1px solid var(--rule); }
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px var(--gutter);
  padding: clamp(22px, 2.4vw, 32px) 0;
  border-bottom: 1px solid var(--rule);
}
.service__title {
  font-size: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  font-weight: 500;
  font-stretch: 90%;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.service__text { max-width: 30em; color: var(--graphite); }

@media (max-width: 760px) {
  .service { grid-template-columns: 1fr; }
}

/* ---------- shop ---------- */

.shop__title {
  font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem);
  font-weight: 500;
  font-stretch: 90%;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.shop__intro { max-width: 34em; margin-top: 12px; color: var(--graphite); }
.soon { display: grid; justify-items: start; gap: 6px; margin-top: 32px; }
.soon__title { font-size: 22px; font-weight: 500; }
.soon__text { max-width: 34em; color: var(--graphite); }
.soon .text-link { margin-top: 8px; }

.products {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(40px, 4.4vw, 64px) var(--gutter);
  margin-top: 24px;
}
.product__link { display: block; }
.product__media { aspect-ratio: 4 / 3; }
.product__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
.product__name { font-size: 18px; font-weight: 500; }
.product__tag { color: var(--graphite); }
.product__side { text-align: right; white-space: nowrap; }
.product__app { color: var(--graphite); }

/* ---------- contact ---------- */

.contact__title {
  max-width: 9em;
  font-size: clamp(3rem, 1.6rem + 6.6vw, 9rem);
  font-weight: 600;
  font-stretch: var(--condensed);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.contact__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: clamp(40px, 5vw, 72px);
}
.contact__text { color: var(--graphite); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact__email {
  display: inline-block;
  margin-top: clamp(40px, 5vw, 64px);
  font-size: clamp(1.5rem, 1rem + 2.2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

/* ---------- footer ---------- */

.footer { padding: clamp(104px, 11vw, 176px) var(--pad) 24px; overflow: hidden; }
.footer__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px var(--gutter);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
}
.footer__col { grid-column: span 3; }
.footer__end { grid-column: 10 / -1; justify-self: end; }
.footer__label { margin-bottom: 8px; color: var(--graphite); }
.footer__list li + li { margin-top: 2px; }
.footer__list a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__mark { margin-top: clamp(64px, 10vw, 160px); overflow: hidden; }
.footer__fit {
  display: inline-block;
  padding-bottom: 0.06em;
  font-size: 12vw;
  font-weight: 700;
  font-stretch: var(--condensed);
  line-height: 0.82;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--graphite);
}

@media (max-width: 760px) {
  .footer__col { grid-column: span 6; }
  .footer__end { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- the timeline (navigation) ---------- */

.timeline {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  height: calc(var(--timeline-h) + env(safe-area-inset-bottom, 0px));
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.timeline__track {
  position: relative;
  display: flex;
  gap: 2px;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.clip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 3px;
  background: var(--clip);
  color: var(--graphite);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.clip > span { overflow: hidden; text-overflow: ellipsis; }
a.clip:hover { color: var(--ink); }
.clip.is-active { background: var(--clip-on); color: var(--ink); }
.clip--blank { padding: 0; }

.playhead {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
  will-change: transform;
}
.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 9px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}
.timeline.is-scrubbing,
.timeline.is-scrubbing * { cursor: grabbing; }

@media (max-width: 600px) {
  .clip { padding: 0 5px; font-size: 12px; }
}

/* ---------- cursor label over the work (mouse only) ---------- */

.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  pointer-events: none;
  transform: translate3d(-200px, -200px, 0);
}
.cursor__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.35s var(--ease);
}
.cursor__pill svg { width: 9px; height: 9px; }
.cursor.is-on .cursor__pill { transform: translate(-50%, -50%) scale(1); }
html.no-cursor-label .cursor { display: none; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- project / product viewer ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease), visibility 0s 0.5s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}
.modal__bar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: 72px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
}
.modal__count { color: var(--graphite); }
.modal__ctrls { display: flex; align-items: center; gap: 8px; }
.modal__close {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.modal__close:hover { background: var(--ink); color: var(--paper); }
.modal__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 3vw, 40px) var(--pad) clamp(64px, 8vw, 120px);
}

.player {
  position: relative;
  width: min(100%, calc((100svh - 72px - 150px) * var(--ar, 1.7778)));
  min-width: min(100%, 280px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}
.player > iframe,
.player > video,
.player > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.player--image { background: var(--clip); }
.player--image > img,
.player--image > video { object-fit: cover; }
.player__alt { margin-top: 12px; text-align: center; font-size: 14px; color: var(--graphite); }

.detail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px var(--gutter);
  max-width: 1400px;
  margin: clamp(40px, 5vw, 72px) auto 0;
}
.detail__head { grid-column: 1 / span 5; }
.detail__eyebrow { font-size: 16px; color: var(--graphite); }
.detail__title {
  margin-top: 6px;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4.5rem);
  font-weight: 600;
  font-stretch: var(--condensed);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.detail__tagline { margin-top: 14px; color: var(--graphite); }
.detail__side { grid-column: 7 / -1; display: grid; align-content: start; gap: 28px; }
.detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px var(--gutter);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.detail__facts dt { margin-bottom: 4px; font-size: 16px; color: var(--graphite); }
.detail__text { display: grid; justify-items: start; gap: 14px; max-width: 36em; line-height: 1.6; }
.detail__list { display: grid; gap: 6px; padding-left: 1.1em; list-style: disc; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.gallery { display: grid; gap: var(--gutter); max-width: 1400px; margin: clamp(48px, 6vw, 96px) auto 0; }
.gallery img,
.gallery video { width: 100%; height: auto; border-radius: var(--radius); background: var(--clip); }

@media (max-width: 860px) {
  .detail__head,
  .detail__side { grid-column: 1 / -1; }
  .modal__count { display: none; }
}

/* ---------- demo banner (only with ?demo in the address) ---------- */

.demo-note {
  position: fixed;
  left: 50%;
  bottom: calc(var(--timeline-h) + 16px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  padding: 10px 10px 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  transform: translateX(-50%);
}
.demo-note a { padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; white-space: nowrap; }
@media (max-width: 600px) {
  .demo-note { width: calc(100% - 24px); border-radius: 14px; font-size: 13px; line-height: 1.35; }
}

.oops { display: grid; place-items: center; min-height: 100vh; padding: 24px; text-align: center; }
.oops p { max-width: 36rem; margin-top: 12px; color: var(--graphite); }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .cut { opacity: 1 !important; }
}
