@font-face {
  font-family: "Mulhim";
  src: url("./assets/mulhim-arabic.ttf") format("truetype");
  font-display: swap;
}

:root {
  --primary: #CD8F56;
  --highlight: #84613B;
  --background: #FFFAEB;
  --safe-inline: max(22px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.story-scrolling { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--background);
  color: var(--background);
  font-family: "Mulhim", Tahoma, Arial, sans-serif;
  overflow-x: hidden;
}
html.story-locked,
html.story-locked body { height: 100%; overflow: hidden; overscroll-behavior: none; }
img { display: block; max-width: 100%; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  right: 12px;
  padding: 10px 16px;
  color: var(--highlight);
  background: var(--background);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.hero-story { position: relative; height: 100svh; min-height: 560px; background: var(--highlight); }
.hero-stage {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: var(--highlight);
}
.mountain-picture, .mountain-photo, .mountain-wash, .film-grain,
.thobe-picture, .thobe-photo, .thobe-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mountain-photo, .thobe-photo { object-fit: cover; will-change: transform, opacity; }
.mountain-photo {
  object-position: center center;
  transform: scale(1.015);
  filter: saturate(.9) contrast(1.03);
}
.mountain-wash {
  z-index: 1;
  background: linear-gradient(180deg, rgba(30,19,11,.18), transparent 36%, rgba(27,17,10,.52)),
              linear-gradient(90deg, rgba(18,12,8,.12), transparent 60%);
  will-change: opacity;
}
.film-grain {
  z-index: 8;
  opacity: .1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.identity-trace {
  position: absolute;
  z-index: 3;
  left: 48%;
  top: 48%;
  width: min(30vw, 480px);
  aspect-ratio: 280 / 220;
  transform: translate(-50%, -50%);
  opacity: 0;
  transform-origin: 50% 50%;
  mix-blend-mode: screen;
  filter: drop-shadow(0 3px 12px rgba(30,17,8,.36));
  will-change: opacity, transform;
}
.trace-piece { --show: 0%; position: absolute; inset: 0; overflow: hidden; }
.trace-piece img { width: 100%; height: 100%; }
.trace-piece-1 { clip-path: polygon(0 0, var(--show) 0, var(--show) 28%, 0 28%); }
.trace-piece-2 { clip-path: polygon(0 22%, var(--show) 22%, var(--show) 48%, 0 48%); }
.trace-piece-3 { clip-path: polygon(0 42%, var(--show) 42%, var(--show) 66%, 0 66%); }
.trace-piece-4 { clip-path: polygon(0 58%, var(--show) 58%, var(--show) 80%, 0 80%); }
.trace-piece-5 { clip-path: polygon(0 72%, var(--show) 72%, var(--show) 100%, 0 100%); }

.thobe-picture {
  z-index: 4;
  opacity: 0;
  transform: scale(1.035);
  will-change: opacity, transform;
}
.thobe-photo { object-position: center center; }
.thobe-wash {
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,250,235,.72), rgba(255,250,235,.02) 44%, rgba(255,250,235,.18));
}

.scene-copy, .final-identity {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 0 var(--safe-inline) max(13svh, 92px);
  opacity: 0;
  transform: translateY(22px);
  pointer-events: none;
  will-change: opacity, transform;
}
.scene-copy p, .scene-copy h1, .final-identity p { margin: 0; font-weight: 400; }
.scene-kicker, .final-kicker {
  color: #F2C38E;
  font-size: clamp(17px, 2vw, 27px);
  line-height: 1.6;
  margin-bottom: 8px !important;
}
.scene-copy h1, .scene-title {
  color: var(--background);
  font-size: clamp(42px, 5.4vw, 84px);
  line-height: 1.28;
  text-shadow: 0 5px 30px rgba(35,20,10,.48);
}

.final-identity {
  justify-content: center;
  padding-bottom: max(7svh, 50px);
  color: var(--highlight);
}
.final-identity img {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.final-identity::before {
  content: "";
  display: block;
  width: clamp(190px, 28vw, 430px);
  height: min(38svh, 350px);
  flex: 0 0 auto;
  margin: 8px 0 12px;
  background: var(--highlight);
  -webkit-mask: url("./assets/mulhim-logo-cropped.svg") center / contain no-repeat;
  mask: url("./assets/mulhim-logo-cropped.svg") center / contain no-repeat;
}
.final-kicker { color: var(--primary); }
.final-tagline { color: var(--highlight); font-size: clamp(24px, 3.2vw, 48px); line-height: 1.5; }

.story-controls {
  position: absolute;
  z-index: 7;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px));
}
.story-next {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 5px 0 0;
  border: 0;
  color: rgba(255,250,235,.92);
  background: transparent;
  font: 400 15px/1.4 "Mulhim", Tahoma, Arial, sans-serif;
  cursor: pointer;
  transition: color .45s ease, opacity .25s ease;
}
.story-next i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,250,235,.48);
  border-radius: 50%;
  font: 400 16px/1 Arial, sans-serif;
  transition: transform .35s ease, background .35s ease, border-color .35s ease;
}
.story-next__arrow { display: block; }
.story-next__replay {
  display: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-story[data-replay="true"] .story-next__arrow { display: none; }
.hero-story[data-replay="true"] .story-next__replay { display: block; }
.story-next:hover i,
.story-next:focus-visible i { transform: translateX(-4px); background: rgba(255,250,235,.1); border-color: currentColor; }
.story-next:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; border-radius: 3px; }
.story-next:disabled { opacity: .48; cursor: wait; }
.hero-story[data-step="4"] .story-next { color: var(--highlight); }
.hero-story[data-step="4"] .story-next i { border-color: rgba(132,97,59,.5); }
.story-progress {
  position: absolute;
  z-index: 7;
  left: max(14px, env(safe-area-inset-left));
  top: 50%;
  width: 1px;
  height: 27svh;
  transform: translateY(-50%);
  background: rgba(255,255,255,.24);
}
.story-progress i { display: block; width: 100%; height: 0; background: var(--background); }
.story-step-count { display: none; }

@media (min-width: 701px) {
  .identity-trace {
    width: clamp(360px, 32vw, 560px);
    max-height: 62svh;
  }
  .trace-piece img { object-fit: contain; }
  .scene-copy-3 {
    padding-bottom: max(5svh, 44px);
  }
  .scene-copy-3 .scene-title {
    max-width: 11ch;
  }
  .story-step-count {
    position: absolute;
    z-index: 7;
    left: max(31px, calc(env(safe-area-inset-left) + 18px));
    top: calc(50% + 16svh);
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 250, 235, .46);
    font-family: Georgia, serif;
    font-size: 9px;
    letter-spacing: .08em;
    direction: ltr;
    pointer-events: none;
  }
  .story-step-count span { color: rgba(255, 250, 235, .74); }
  .story-step-count i { width: auto; height: auto; background: none; color: inherit; font-style: normal; }
  .story-step-count small { font: inherit; }
}
.presence {
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--highlight);
  background: var(--background);
  padding: clamp(48px, 6vw, 88px) 0 clamp(64px, 7vw, 100px);
}
.thobe-wash::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(64px, 12svh, 130px);
  background: linear-gradient(to bottom, transparent, var(--background));
}
.presence-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  column-gap: clamp(40px, 6vw, 88px);
  row-gap: 28px;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(40px, 6.7vw, 96px);
  align-items: start;
}
.presence-heading { grid-column: 1; grid-row: 1; align-self: end; }
.presence h2 { margin: 0; font-weight: 400; line-height: 1.35; }
.presence-lead { display: block; font-size: clamp(21px, 1.8vw, 27px); margin-bottom: 10px; }
.presence-headline { display: block; font-size: clamp(42px, 4.4vw, 64px); text-wrap: balance; }
.presence-portrait { grid-column: 2; grid-row: 1 / 3; margin: 0; min-width: 0; }
.presence-portrait picture { display: block; }
.presence-portrait img { width: 100%; height: auto; }
.presence-copy { grid-column: 1; grid-row: 2; min-width: 0; }
.presence-intro { margin: 0; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.8; max-width: 31ch; }
.presence-evidence { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: 1fr minmax(160px, 230px); align-items: center; gap: clamp(28px, 5vw, 80px); width: min(100%, 760px); margin: 44px auto 0; }
.presence-evidence figcaption { border-inline-start: 1px solid rgba(132,97,59,.35); padding-inline-start: 24px; }
.evidence-title { font-size: clamp(26px, 2.8vw, 40px); line-height: 1.4; margin: 0 0 12px; }
.evidence-caption { font-size: 16px; line-height: 1.7; margin: 0; }
.presence-evidence img { width: 100%; height: auto; }
[data-presence-reveal].reveal-ready { transition: opacity .65s ease, transform .65s ease; }
[data-presence-reveal].reveal-ready:not(.is-visible) { opacity: 0; transform: translateY(12px); }
@media (max-width: 700px) {
  .presence { padding-top: 40px; padding-bottom: 52px; }
  .presence-layout { display: flex; flex-direction: column; gap: 0; padding-inline: max(24px, env(safe-area-inset-right), env(safe-area-inset-left)); }
  .presence-heading { margin-bottom: 28px; width: 100%; }
  .presence-lead { font-size: 19px; margin-bottom: 8px; }
  .presence-headline { font-size: clamp(32px, 8.6vw, 46px); line-height: 1.4; }
  .presence-portrait { width: calc(100% + 48px); margin-inline: -24px; align-self: center; }
  .presence-copy { margin-top: 28px; }
  .presence-intro { font-size: 18px; line-height: 1.8; max-width: 32ch; }
  .presence-evidence { width: 100%; grid-template-columns: 1fr minmax(120px, .8fr); gap: 20px; margin: 36px 0 0; }
  .presence-evidence figcaption { padding-inline-start: 16px; }
  .evidence-title { font-size: 24px; }
  .evidence-caption { font-size: 14px; }

}
@media (prefers-reduced-motion: reduce) {
  [data-presence-reveal].reveal-ready { transition: none; }
  [data-presence-reveal].reveal-ready:not(.is-visible) { opacity: 1; transform: none; }
}
@keyframes breathe { 50% { width: 62px; opacity: .42; } }

@media (max-width: 700px) {
  .hero-story { height: 100svh; }
  .identity-trace { left: 43%; top: 52%; width: min(76vw, 356px); }
  .scene-copy {
    left: 0;
    right: auto;
    align-items: stretch;
    text-align: right;
    width: 100%;
    max-width: 100vw;
    padding-right: max(24px, env(safe-area-inset-right));
    padding-left: max(24px, env(safe-area-inset-left));
    padding-bottom: max(13svh, 96px);
  }
  .scene-copy h1, .scene-title { font-size: clamp(38px, 11.6vw, 54px); }
  .scene-kicker, .final-kicker { font-size: 18px; }
  .thobe-wash { background: linear-gradient(180deg, rgba(255,250,235,.86), rgba(255,250,235,.08) 48%, rgba(255,250,235,.05)); }
  .final-identity {
    left: 0;
    right: auto;
    justify-content: flex-start;
    align-items: stretch;
    text-align: right;
    width: 100%;
    padding: max(12svh, 88px) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  }
  .final-identity::before { width: min(58vw, 270px); height: 28svh; margin: 2px -8px 4px 0; }
  .final-tagline { font-size: clamp(27px, 8vw, 38px); }
  .story-progress { left: 10px; }
  .story-step-count {
    position: absolute;
    z-index: 7;
    left: max(24px, env(safe-area-inset-left));
    top: max(26px, calc(env(safe-area-inset-top) + 16px));
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,250,235,.52);
    font: 10px/1 Georgia, serif;
    letter-spacing: .08em;
    direction: ltr;
    pointer-events: none;
  }
  .story-step-count span { color: rgba(255,250,235,.86); }
  .story-step-count i { width: auto; height: auto; background: none; color: inherit; font-style: normal; }
  .story-step-count small { font: inherit; }
  .story-controls { right: max(24px, env(safe-area-inset-right)); }
  .story-next { font-size: 14px; }
  .story-next i { width: 32px; height: 32px; font-size: 15px; }
  .story-next__replay { width: 15px; height: 15px; }
  .hero-story[data-step="4"] .story-step-count { color: rgba(132,97,59,.52); }
  .hero-story[data-step="4"] .story-step-count span { color: var(--highlight); }
}

@media (max-width: 370px) {
  .scene-copy h1, .scene-title { font-size: 38px; }
  .scene-copy { padding-bottom: 88px; }
  .final-identity { padding-top: 72px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .scene-copy { padding-bottom: 44px; }
  .final-identity { justify-content: center; align-items: flex-start; text-align: right; padding: 24px 9vw; }
  .final-identity::before { width: 190px; height: 48svh; }
  .story-controls { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-next, .story-next i { transition: none; }
  .mountain-photo, .identity-trace, .scene-copy, .final-identity, .thobe-picture { will-change: auto; }
}
