/* Opening sequence + discipline slideshow. One dark stage, one easing curve for every move. */
:root {
  --bg: #0E0F10; --fg: #F2F1EE; --muted: rgba(242, 241, 238, .64); --line: rgba(242, 241, 238, .24);
  --f-display: "Schibsted Grotesk", "Noto Kufi Arabic", system-ui, sans-serif;
  --f-body: "Schibsted Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, monospace;
  --crisp: cubic-bezier(.625, .05, 0, 1);
  --gut: clamp(16px, 4vw, 48px);
  --gap: clamp(8px, 1.4vw, 16px);
  --tile: min(7rem, calc((100vw - 32px - 4 * var(--gap)) / 5));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 16px; line-height: 1.5; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
svg, .art img { display: block; width: 100%; height: 100%; }
.art img { object-fit: cover; }

.stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }

/* ---------- slides ---------- */
.slides { position: absolute; inset: 0; z-index: 1; }
.slide { position: absolute; inset: 0; overflow: hidden; visibility: hidden; will-change: transform; }
.slide.is-current { visibility: visible; }
.slide-inner { position: absolute; inset: 0; will-change: transform; }
/* The picture fills the slide exactly as it filled the growing tile, so the hand-off from the intro does not jump. */
.slide-inner .art { position: absolute; inset: 0; }
/* Darkens the image enough for white type, strongest where the text sits. */
.scrim { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(8, 9, 10, .42), transparent 75%),
    linear-gradient(180deg, rgba(8, 9, 10, .45) 0, rgba(8, 9, 10, .08) 30%, rgba(8, 9, 10, .1) 62%, rgba(8, 9, 10, .7) 100%); }
.slide.is-light .scrim { background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(8, 9, 10, .62), transparent 80%), linear-gradient(180deg, rgba(8, 9, 10, .55) 0, rgba(8, 9, 10, .3) 40%, rgba(8, 9, 10, .8) 100%); }

/* ---------- intro strip ---------- */
.intro { position: absolute; inset: 0; z-index: 2; --fade: 14%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%); }
.intro-row { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: var(--gap); direction: ltr; }
.tile { position: relative; flex: none; width: var(--tile); height: var(--tile); border-radius: calc(var(--tile) * .09); overflow: hidden; will-change: transform; }
.tile .art { position: absolute; inset: 0; }
.tile .scrim { opacity: 0; }

/* ---------- interface layer ---------- */
.ui { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: clamp(16px, 3vh, 32px);
  padding: max(var(--gut), env(safe-area-inset-top)) var(--gut) max(20px, env(safe-area-inset-bottom)); }
.ui a, .ui button { pointer-events: auto; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--fg); border-radius: 50%; font-size: 13px; letter-spacing: .04em; }
.logo-name { font-size: 15px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font-family: var(--f-mono); font-size: 12px; padding: 5px 11px; border-radius: 999px; color: var(--muted); transition: background-color .5s var(--crisp), color .5s var(--crisp); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.copy { align-self: center; display: grid; justify-items: center; text-align: center; gap: clamp(14px, 2.4vh, 24px); }
.kicker { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.kicker i { width: 36px; height: 1px; background: var(--line); }
.title { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(2.5rem, 8.5vw, 7.5rem); line-height: .95; letter-spacing: -.045em;
  display: grid; text-wrap: balance; max-width: 12ch; position: relative; }
/* Arabic dots sit well below the line (ي, ب), so the lines and the sentence under the title get more room. */
[dir="rtl"] .title { letter-spacing: 0; line-height: 1.35; font-weight: 700; padding-bottom: .3em; }
.t-layer { grid-area: 1 / 1; }
/* Each word sits in its own window; the word slides through it. */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: .1em .05em; margin: -.1em -.05em; }
/* Arabic letters reach further above and below the line (the dots of ي, ج, ب), so their windows are taller. */
[dir="rtl"] .w { padding-block: .32em; margin-block: -.32em; }
.w > span { display: inline-block; will-change: transform; }
.lede { margin: 0; max-width: 34ch; color: var(--muted); font-size: clamp(15px, 1.2vw, 17px); text-wrap: balance; }

.cta { position: relative; font-size: 14px; font-weight: 500; padding-bottom: 3px; }
.cta::before, .cta::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transition: transform .735s var(--crisp); }
.cta::before { opacity: .35; }
.cta::after { transform: scaleX(0); transform-origin: right; }
@media (hover: hover) { .cta:hover::after { transform: scaleX(1); transform-origin: left; } }

/* ---------- thumbnails ---------- */
.thumbs { justify-self: center; display: flex; gap: 10px; }
[dir="rtl"] .thumbs { flex-direction: row-reverse; }
.thumb { position: relative; width: clamp(44px, 4.4vw, 60px); aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  border: 1px solid transparent; padding: 3px; transition: border-color .75s var(--crisp); }
.thumb.is-current { border-color: var(--fg); }
.thumb .art { width: 100%; height: 100%; border-radius: 6px; overflow: hidden; transition: transform .75s var(--crisp); }
.thumb .bar { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: var(--fg); transform: scaleX(0); transform-origin: left; border-radius: 2px; }
@media (hover: hover) {
  .thumbs:has(.thumb:hover) .art { transform: scale(.825); }
  .thumbs:has(.thumb:hover) .thumb:hover .art { transform: scale(1); }
}

.foot { display: flex; justify-content: space-between; gap: 16px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .foot { letter-spacing: 0; }
.replay { font-family: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--muted); transition: color .4s var(--crisp); }
.replay:hover { color: var(--fg); }

@media (max-width: 640px) {
  .logo-name { display: none; }
  .foot { justify-content: center; }
  .foot #roles { display: none; }
}
@media (max-height: 520px) { .lede { display: none; } }
/* A phone turned sideways: little height, lots of width. Everything stays on one screen: smaller type sized to
   the height, the sentence shown on wider lines, and the thumbnails share the last row with the Replay link. */
@media (max-height: 500px) and (orientation: landscape) {
  .ui { grid-template-rows: auto 1fr auto; gap: 8px;
    padding: max(12px, env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(var(--gut), env(safe-area-inset-left)); }
  .logo-mark { width: 32px; height: 32px; font-size: 11px; }
  .seg button { padding: 4px 9px; font-size: 11px; }
  .copy { gap: 6px; }
  .kicker { font-size: 10px; }
  .title { font-size: clamp(1.6rem, 10vh, 3.2rem); max-width: 18ch; }
  [dir="rtl"] .title { line-height: 1.3; padding-bottom: .2em; }
  .lede { display: block; max-width: 60ch; font-size: 13px; line-height: 1.4; }
  .thumbs, .foot { grid-row: 3; grid-column: 1; }
  .thumbs { gap: 8px; }
  .thumb { width: 34px; padding: 2px; border-radius: 7px; }
  .thumb .art { border-radius: 5px; }
  .foot { align-self: center; pointer-events: none; }
  .foot #roles { display: none; }
  .replay { margin-inline-start: auto; }
  .skip { bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* Shown only while the intro plays. */
.skip { position: absolute; z-index: 4; right: var(--gut); bottom: max(20px, env(safe-area-inset-bottom));
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; transition: color .4s var(--crisp), border-color .4s var(--crisp); }
.skip:hover { color: var(--fg); border-color: var(--fg); }
[dir="rtl"] .skip { right: auto; left: var(--gut); letter-spacing: 0; }

/* While the visitor holds the slide, it eases in very slightly so the pause is felt. */
.slide-inner .art { transition: transform 1.2s var(--crisp); }
.stage.is-held .slide.is-current .art { transform: scale(1.025); }
/* On touch screens a resting finger only pauses the tour; the zoom read as a glitch there. */
@media (hover: none) { .stage.is-held .slide.is-current .art { transform: none; } }

/* Home header: the About button sits beside the language switch. */
.top-end { display: flex; align-items: center; gap: 10px; }
@media (max-width: 420px) { .top-end .about-btn { padding: 9px 12px; } }

