/* THE SPACE + MEET HASAN + FROM THE CHANNEL. Phone first; uses the tokens in styles.css :root. */

.space {
  --space-h2: clamp(2.125rem, 1.5rem + 2.6vw, 3.75rem);
  position: relative;
  padding-block: 88px 96px;
  background: var(--heather);
  overflow: clip;
}
.space__defs { position: absolute; }
.space h3, .space figure { margin: 0; }
.space__wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- head ---------- */
.space__head { position: relative; }
.space__title {
  margin-top: 14px; max-width: 13ch;
  font-size: var(--space-h2); font-weight: 600; line-height: 1; letter-spacing: -.03em;
}
:lang(ar) .space__title { font-size: calc(var(--space-h2) * 1.04); line-height: 1.3; }
.space__doodle { width: 112px; height: auto; margin-top: 14px; overflow: visible; }
.space__ink {
  fill: none; stroke: var(--pink-deep); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease) .35s;
}
.space__ink + .space__ink { transition-delay: .8s; }
.space__lede { margin-top: 14px; max-width: 40ch; font-size: clamp(1rem, .95rem + .2vw, 1.125rem); line-height: 1.5; }
:lang(ar) .space__lede { line-height: 1.8; }

/* ---------- collage: the night storefront in the door-window shape + two tees ---------- */
.space__collage {
  position: relative; margin-top: 40px;
  aspect-ratio: 1 / 1.16; max-width: 560px;
}
.space__collage figure { margin: 0; }
.space__door, .space__pop { position: absolute; top: 0; inset-inline-start: 0; width: 68%; }
.space__door-art { position: relative; z-index: 1; aspect-ratio: 3 / 4; clip-path: url(#space-door); background: var(--slate); }
/* layered door: silhouettes behind (offset like stacked paper), the cut-out couple in front, unclipped */
.space__door { --sx: 1; }
[dir="rtl"] .space__door { --sx: -1; }
.space__door-back { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 3 / 4; clip-path: url(#space-door); pointer-events: none; }
.space__door-back--1 { background: var(--pink); translate: calc(14px * var(--sx)) 12px; }
.space__door-back--2 { background: var(--pink-deep); translate: calc(28px * var(--sx)) 24px; opacity: .55; }
.space__pop { z-index: 2; aspect-ratio: 3 / 4; pointer-events: none; clip-path: url(#space-pop); }  /* above the polaroids, under the sticker; grounded on the door's curved bottom */
.space__door-pop {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / .3));
}
.space__door .space__chip { z-index: 3; bottom: auto; top: -14px; } /* a tag on top of the arch: the five out front would cover it lower down */
.space__door-art img, .space__tile img { width: 100%; height: 100%; object-fit: cover; }
.space__tile {
  --tilt: 0deg;
  position: absolute; aspect-ratio: 3 / 4; overflow: hidden;
  border: 4px solid var(--paper); border-radius: 22px;
  background: var(--fog);
  box-shadow: 0 18px 40px rgb(43 43 46 / .18);
  rotate: var(--tilt);
}
.space__tile--tee { --tilt: 5deg; top: 2%; inset-inline-end: 0; width: 40%; }
.space__tile--team { --tilt: -4deg; bottom: 1%; inset-inline-end: 7%; width: 37%; }
[dir=rtl] .space__tile--tee { --tilt: -5deg; }
[dir=rtl] .space__tile--team { --tilt: 4deg; }
.space__chip {
  position: absolute; bottom: 7%; inset-inline: 0; width: max-content; max-width: 90%; margin-inline: auto;
  padding: 7px 13px; border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: .75rem; font-weight: 600; line-height: 1.2;
  box-shadow: 0 6px 18px rgb(43 43 46 / .18);
}
.space__chip--sm { bottom: 8px; font-size: .6875rem; padding: 5px 10px; }
:lang(ar) .space__chip { font-size: .8125rem; }
.space__sticker {
  position: absolute; z-index: 2; bottom: 6%; inset-inline-start: -1%;
  display: grid; place-items: center;
  width: 92px; aspect-ratio: 1; padding: 12px; border-radius: 50%;
  background: var(--pink); color: var(--ink);
  font-size: .8125rem; font-weight: 700; line-height: 1.1; text-align: center;
  rotate: -12deg; box-shadow: 0 10px 24px rgb(216 108 152 / .35);
}
[dir=rtl] .space__sticker { rotate: 12deg; }

/* ---------- slate panel: Meet Hasan + From the channel ---------- */
.space__panel {
  margin-top: 64px; padding: 24px 20px 28px;
  border-radius: 32px; background: var(--slate); color: var(--paper);
}
.hasan {
  display: grid; grid-template-columns: 40% 1fr; column-gap: 18px; align-items: center;
  grid-template-areas: "photo kicker" "photo title" "photo body" "follow follow" "socials socials";
  grid-template-rows: auto auto 1fr auto auto;
}
.hasan__photo { grid-area: photo; align-self: start; aspect-ratio: 4 / 5; clip-path: url(#space-tab); background: var(--ink); }
.hasan__photo img { width: 100%; height: 100%; object-fit: cover; }
.hasan__text { display: contents; }
.hasan__text > .kicker { grid-area: kicker; }
.hasan__title { grid-area: title; margin-top: 8px; }
.hasan__body { grid-area: body; align-self: start; margin-top: 8px; }
.hasan__follow { grid-area: follow; margin-top: 20px; margin-bottom: 10px; }
.socials { grid-area: socials; }
.hasan__title { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.75rem); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
:lang(ar) .hasan__title { line-height: 1.35; }
.hasan__handle {
  display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px;
  background: rgb(255 255 255 / .12); color: var(--paper);
  font-size: .8125rem; font-weight: 500; letter-spacing: 0; vertical-align: middle; white-space: nowrap;
}
.hasan__body { font-size: .9375rem; line-height: 1.5; color: rgb(255 255 255 / .86); }
:lang(ar) .hasan__body { line-height: 1.8; }
.hasan__follow { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .78); }
:lang(ar) .hasan__follow { font-size: .8125rem; }
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding-inline: 14px; border-radius: 999px;
  background: var(--mist); color: var(--ink);
  font-size: .9375rem; font-weight: 600; text-decoration: none;
  transition: background-color .25s var(--ease), translate .35s var(--spring);
}
.social svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
@media (hover: hover) { .social:hover { background: var(--pink); translate: 0 -2px; } }
.space__panel :focus-visible { outline-color: var(--paper); box-shadow: 0 0 0 5px var(--ink); }

/* From the channel: phone-shaped looping clips */
.channel { margin-top: 32px; padding-top: 28px; border-top: 1px solid rgb(255 255 255 / .16); }
.channel__title { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); font-weight: 600; line-height: 1.1; letter-spacing: -.015em; }
:lang(ar) .channel__title { line-height: 1.4; }
.channel__sub { margin-top: 8px; max-width: 46ch; font-size: .9375rem; line-height: 1.5; color: rgb(255 255 255 / .82); }
:lang(ar) .channel__sub { line-height: 1.8; }
.channel__strip {
  display: flex; gap: 12px; margin-top: 20px;
  margin-inline: -20px; padding: 6px 20px 10px; scroll-padding-inline: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.channel__strip::-webkit-scrollbar { display: none; }
.clip { flex: 0 0 56%; max-width: 260px; scroll-snap-align: start; }
.clip__link {
  position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; isolation: isolate;
  border-radius: 26px; background: var(--ink); color: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 16px 34px rgb(0 0 0 / .28);
  transition: translate .45s var(--spring), rotate .45s var(--spring), scale .5s var(--spring), box-shadow .45s var(--ease);
}
.clip video { width: 100%; height: 100%; object-fit: cover; transition: scale .7s var(--ease); }
.clip__label {
  position: absolute; bottom: 10px; inset-inline-start: 10px; max-width: calc(100% - 20px);
  padding: 7px 12px; border-radius: 999px;
  background: rgb(233 234 232 / .92); color: var(--ink);
  font-size: .8125rem; font-weight: 600; line-height: 1.2;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.clip__play {
  position: absolute; top: 10px; inset-inline-end: 10px;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--pink);
  transition: scale .35s var(--spring);
}
.clip__play svg { width: 16px; height: 16px; fill: var(--ink); }
@media (hover: hover) {
  .clip__link:hover { translate: 0 -4px; }
  .clip__link:hover video { scale: 1.05; }
  .clip__link:hover .clip__play { scale: 1.12; }
}
.clip__link:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; box-shadow: none; }
.channel__cta { margin-top: 18px; }
.channel__cta:focus-visible { outline-color: var(--paper); }

/* ---------- reveal (only once JS has run, never under reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .space [data-reveal] {
    transition: opacity .8s var(--ease), translate .9s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js .space [data-reveal]:not(.is-in) { opacity: 0; translate: 0 28px; }
  .js .space__head:not(.is-in) .space__ink { stroke-dashoffset: 1; }
}

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .space { padding-block: 112px 120px; }
  .space__wrap { padding-inline: 32px; }
  .space__collage { margin-inline: auto; }
  .space__sticker { bottom: 12%; }
  .space__panel { padding: 36px 36px 40px; }
  .hasan {
    grid-template-columns: 220px 1fr; column-gap: 32px; align-items: center;
    grid-template-areas: none; grid-template-rows: none;
  }
  .hasan__photo { grid-area: auto; align-self: center; }
  .hasan__text { display: flex; flex-direction: column; align-items: flex-start; }
  .hasan__follow { margin-top: 18px; }
  .socials { display: flex; flex-wrap: wrap; }
  .channel__strip { margin-inline: -36px; padding-inline: 36px; scroll-padding-inline: 36px; }
  .clip { flex-basis: 30%; }
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  .space { padding-block: 140px 150px; }
  .space__wrap {
    display: grid; grid-template-columns: 5fr 7fr; column-gap: 56px; align-items: center;
    padding-inline: 48px;
  }
  .space__head { grid-column: 1; }
  .space__collage { grid-column: 2; margin: 0; width: 100%; max-width: 640px; justify-self: end; aspect-ratio: 1 / .88; }
  .space__door, .space__pop { width: 48%; inset-inline-start: 6%; }
  .space__tile--tee { width: 34%; top: 0; inset-inline-end: 0; }
  .space__tile--team { width: 30%; bottom: 0; inset-inline-end: 22%; }
  .space__sticker { width: 112px; font-size: .9375rem; bottom: 10%; inset-inline-start: -2%; }
  .space__panel { grid-column: 1 / -1; margin-top: 96px; padding: 56px; border-radius: 40px; }
  .hasan { grid-template-columns: 300px 1fr; column-gap: 56px; }
  .hasan__body { font-size: 1.0625rem; max-width: 36ch; }
  .channel { margin-top: 48px; padding-top: 40px; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 32px; }
  .channel__head { grid-column: 1; }
  .channel__cta { grid-column: 2; grid-row: 1; margin: 0; }
  .channel__strip {
    grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    margin: 32px 0 0; padding: 0; overflow: visible;
  }
  .clip { max-width: none; }
  .clip:nth-child(odd) .clip__link { rotate: -1.5deg; }
  .clip:nth-child(even) .clip__link { rotate: 1.5deg; translate: 0 18px; }
  [dir=rtl] .clip:nth-child(odd) .clip__link { rotate: 1.5deg; }
  [dir=rtl] .clip:nth-child(even) .clip__link { rotate: -1.5deg; }
  @media (hover: hover) {
    .clip .clip__link:hover { rotate: 0deg; translate: 0 -6px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .social, .clip__link, .clip video, .clip__play, .space__ink { transition: none; }
}

/* ---------- motion v4 ---------- */
@media (hover: hover) {
  .clip__link:hover { scale: 1.05; box-shadow: 0 0 0 2px var(--pink), 0 26px 50px rgb(0 0 0 / .36); }
  .clip .clip__link:hover { z-index: 1; }
}
.clip__link:active { scale: .97; }
.space__sticker { will-change: transform; }
@media (prefers-reduced-motion: reduce) { .clip__link:active { scale: none; } .space__sticker { will-change: auto; } }

/* phones / tablets (Khalid 2026-10-27, "fix this section"): the collage gets taller so the team polaroid sits below the door,
   clear of the people stepping out; the sticker takes the gap under the door */
@media (max-width: 959px) {
  .space__collage { aspect-ratio: 1 / 1.5; }
  .space__door, .space__pop { width: 66%; }
  .space__tile--team { bottom: auto; top: 60%; inset-inline-end: 4%; }
  .space__sticker { bottom: auto; top: 61%; inset-inline-start: 6%; }
}
