/* Hazel Films, hazel.sa v3 draft. Layout + look. The roll engine lives in roll.js. */

@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-thin.woff2) format("woff2");font-weight:100;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-light.woff2) format("woff2");font-weight:300;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-semibold.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(fonts/plex-arabic-bold.woff2) format("woff2");font-weight:700;font-display:swap}

:root{
  --red:#D24E39;
  /* header scale: 1 on phones, grows gently to 1.45 on big screens */
  --hu:clamp(1px, calc(0.6px + 0.022vw + 0.022vh), 1.4px);
  /* credits text column and logo wall widths (follow the type size) */
  --col:min(calc(100vw - 2.5rem), 36rem);
  --wall:min(calc(100vw - 1.25rem), 46rem);
  --gut:2rem;                       /* the shared centre gutter */
  --fade-top:clamp(1.75rem, 9vh, 6rem);
  --fade-bot:clamp(1.5rem, 7vh, 4.5rem);
  --blk-gap:4.25rem;                /* space between credit blocks */
}

/* Credits type unit. 16px on phones, ~23px laptop, ~27px 1080p projector, 34px 2560 */
html{font-size:clamp(16px, calc(6px + 0.7vw + 0.75vh), 34px);background:#000;height:100%;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;height:100%;overflow:hidden;position:fixed;inset:0;background:#000;color:#fff;
  font-family:"Plex Arabic","IBM Plex Sans Arabic","Geeza Pro","SF Arabic",system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent}
a{color:inherit;text-decoration:none}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
html.cursor-off,html.cursor-off *{cursor:none!important}

/* ---------- background layers: identical to the live site ---------- */
.vid{position:fixed;inset:0;background:url(videoframe2.jpg) center/cover no-repeat}
.vid video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.vid video::-webkit-media-controls,.vid video::-webkit-media-controls-panel,.vid video::-webkit-media-controls-start-playback-button{display:none!important;-webkit-appearance:none}
.dim{position:fixed;inset:0;background:#000;opacity:.5}
.grad{position:fixed;top:0;left:0;right:0;height:calc(140 * var(--hu));background:linear-gradient(#000,rgba(0,0,0,0))}
.outline{position:fixed;top:0;left:0;right:0;height:calc(160 * var(--hu));background:url(outlinebgwhite.png) top center/contain no-repeat;opacity:.4}
.dots{position:fixed;inset:0;background:url(pattern.gif);opacity:.2}

/* ---------- stage: header / credits / footer, one screen ---------- */
.stage{position:fixed;inset:0;height:100vh;height:100dvh;display:flex;flex-direction:column}
.head{flex:none;position:relative;padding-top:env(safe-area-inset-top)}
.topred{position:absolute;top:0;left:0;right:0;height:5px;background:var(--red)}
.head-in{padding-top:5px}

.brand{box-sizing:border-box;display:flex;direction:rtl;justify-content:flex-start;align-items:flex-start;
  width:calc(250 * var(--hu));height:calc(150 * var(--hu));margin:0 auto;padding-top:calc(30 * var(--hu));
  animation:hz-in 1.4s cubic-bezier(.22,.61,.36,1) .15s both}
.brand .mark{flex:none;width:calc(90 * var(--hu));height:calc(90 * var(--hu));background:url(cmred.svg) bottom/contain no-repeat}
.brand .names{margin-inline-start:calc(40 * var(--hu));padding-top:calc(25 * var(--hu));text-align:right}
.brand h1,.brand p{margin:0;line-height:1.3;color:#fff}
.brand h1{font-size:calc(20 * var(--hu));font-weight:500}
.brand p{font-size:calc(16 * var(--hu));font-weight:300}

.works{height:calc(60 * var(--hu));animation:hz-in 1.4s cubic-bezier(.22,.61,.36,1) .45s both}
.works a{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:calc(14 * var(--hu));
  width:calc(220 * var(--hu));height:calc(50 * var(--hu));margin:calc(8 * var(--hu)) auto 0;
  background:#3F403E;color:#fff;border-radius:calc(8 * var(--hu));border-bottom:2px solid var(--red);border-top:1px solid transparent;
  opacity:.8;font-weight:100;font-size:calc(19 * var(--hu));line-height:1;
  transition:background-color .35s cubic-bezier(.22,.61,.36,1),opacity .35s,border-color .35s}
.works img{width:calc(30 * var(--hu));height:calc(30 * var(--hu));display:block}
.works a:hover,.works a:focus-visible{opacity:1;font-weight:700;background:var(--red);border-top:1px solid #fff;border-bottom:1px solid #fff;
  transition:background-color .2s ease-out 50ms,opacity .2s ease-out 50ms,border-color .2s ease-out 50ms}
.works a:focus-visible{outline:2px solid #fff;outline-offset:3px}

@keyframes hz-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---------- the credits window ---------- */
.credits{flex:1 1 auto;min-height:0;position:relative;overflow:hidden;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--fade-top),#000 calc(100% - var(--fade-bot)),transparent 100%);
          mask-image:linear-gradient(to bottom,transparent 0,#000 var(--fade-top),#000 calc(100% - var(--fade-bot)),transparent 100%)}
/* No-JS fallback: a plain CSS roll. roll.js removes this the moment it starts. */
.roll{position:absolute;left:0;right:0;top:100%;animation:roll-fallback 200s linear infinite}
.credits:hover .roll{animation-play-state:paused}
@keyframes roll-fallback{from{top:100%;transform:translateY(0)}to{top:0;transform:translateY(-100%)}}
html.js-roll .credits{touch-action:none}
html.js-roll .roll{animation:none;top:0;will-change:transform}
.roll-clone{position:absolute;left:0;right:0;visibility:hidden}
.roll-clone.on{visibility:visible}

/* reduced motion: no auto roll, a normal scrollable column (works with or without JS) */
@media (prefers-reduced-motion:reduce){
  .credits,html.js-roll .credits{overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .credits::-webkit-scrollbar{display:none}
  .roll,html.js-roll .roll{position:relative;top:0;animation:none;transform:none!important;will-change:auto;padding:var(--fade-top) 0 var(--fade-bot)}
  .roll-clone{display:none}
  .brand,.works{animation-duration:.01s;animation-delay:0s}
}

/* ---------- credit blocks ---------- */
.blk{margin:0 auto var(--blk-gap);width:var(--col)}
.ar{direction:rtl;text-align:right}
.en{direction:ltr;text-align:left}
.blk p{margin:0}

/* the two column credits grid: Arabic left (right aligned), English right (left aligned) */
.statement,.titled{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--gut);align-items:start}

.statement .ar{font-size:1.06rem;line-height:1.85;font-weight:500}
.statement .en{font-size:.9rem;line-height:1.75;font-weight:500;padding-top:.12em}

.titled h2{margin:0 0 .9rem;font-weight:600;line-height:1.4}
.titled h2.ar{font-size:1rem}
.titled h2.en{font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;align-self:end;padding-bottom:.2em}
.titled div.ar{font-size:.9rem;line-height:1.9;font-weight:400}
.titled div.en{font-size:.8rem;line-height:1.85;font-weight:400;padding-top:.1em}
.titled div p+p{margin-top:.9em}

/* credit lines: roles small and tracked, names larger, like a film's end credits */
.credit-lines{display:flex;flex-direction:column;gap:.75rem}
.credit-lines .row{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--gut);row-gap:.1rem;align-items:baseline}
.credit-lines .r{font-weight:300;opacity:.86}
.credit-lines .ar.r{grid-column:1;grid-row:1;font-size:.78rem}
.credit-lines .en.r{grid-column:2;grid-row:1;font-size:.6rem;letter-spacing:.16em;text-transform:uppercase}
.credit-lines .ar.v{grid-column:1;grid-row:2;font-size:.92rem;font-weight:500;line-height:1.6}
.credit-lines .en.v{grid-column:2;grid-row:2;font-size:.8rem;font-weight:500;line-height:1.6}
.credit-lines .r:empty{display:none}
.credit-lines .row.cont{margin-top:-.45rem}
.credit-lines .row.first-of-group{margin-top:1.1rem}
/* wider screens: each language becomes a classic credit pair around its own axis,
   mirrored around the centre gutter:  name | role  ||  role | name  */
@media (min-width:600px){
  .credit-lines{gap:.55rem}
  .credit-lines .row{grid-template-columns:1.12fr .88fr .88fr 1.12fr;column-gap:1.1rem;row-gap:0}
  .credit-lines .ar.v{grid-column:1;grid-row:1;text-align:right}
  .credit-lines .ar.r{grid-column:2;grid-row:1;text-align:left;margin-right:calc(var(--gut) / 2 - .55rem)}
  .credit-lines .en.r{grid-column:3;grid-row:1;text-align:right;margin-left:calc(var(--gut) / 2 - .55rem)}
  .credit-lines .en.v{grid-column:4;grid-row:1}
  .credit-lines .r:empty{display:block}
  .credit-lines .row.cont{margin-top:0}
  .credit-lines .row.first-of-group{margin-top:1.4rem}
}

/* logo wall: optically balanced white logos, no boxes, no lines */
.logos{width:var(--wall);display:flex;flex-wrap:wrap;justify-content:center;list-style:none;padding:0;--cols:3}
.logos li{flex:none;width:calc(100% / var(--cols));aspect-ratio:1.12;display:flex;align-items:center;justify-content:center;margin:0}
.logos img{display:block;width:calc(var(--w) * .95);height:auto;max-height:68%;object-fit:contain}
@media (min-width:640px){.logos{--cols:6}}
@media (min-width:640px) and (max-width:1023px){.logos{width:min(calc(100vw - 2.5rem), 40rem)}}

/* awards: white laurels, poster style */
.awards{width:var(--wall);display:flex;flex-wrap:wrap;justify-content:center;gap:2.6rem 1.5rem}
.award{margin:0;width:min(100%, 17.5rem);display:flex;flex-direction:column;align-items:center}
.award .lw{position:relative;width:8.6rem;color:#fff}
.award svg{display:block;width:100%;height:auto}
.award .yr{position:absolute;left:0;right:0;top:38%;transform:translateY(-50%);text-align:center;font-size:.95rem;font-weight:500;letter-spacing:.08em;direction:ltr}
.award figcaption{display:grid;grid-template-columns:1fr 1fr;column-gap:1.1rem;width:100%;margin-top:.7rem}
.award figcaption .ar b{display:block;font-size:.8rem;font-weight:600;line-height:1.55}
.award figcaption .en b{display:block;font-size:.7rem;font-weight:600;line-height:1.6;padding-top:.08em}
.award figcaption small{display:block;font-size:.66rem;font-weight:300;line-height:1.55;opacity:.86;margin-top:.15rem}
.award figcaption .en small{font-size:.6rem}

/* end card */
.endcard{display:flex;flex-direction:column;align-items:center;padding-top:1rem}
.endcard .mark{width:4.2rem;height:4.2rem;background:url(cmred.svg) center/contain no-repeat;margin-bottom:1.3rem}
.endcard .pair{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--gut);width:100%;align-items:baseline}
.endcard .ec-name .ar{font-size:1.5rem;font-weight:500}
.endcard .ec-name .en{font-size:1.25rem;font-weight:400}
.endcard .ec-line{margin-top:1.1rem;width:100%}
.endcard .ec-line .ar{font-size:.95rem;font-weight:300;line-height:1.8}
.endcard .ec-line .en{font-size:.82rem;font-weight:300;line-height:1.8}
.endcard .ec-personal .pair{margin-bottom:.35rem}
.endcard .ec-personal .ar{font-size:.72rem;font-weight:300;opacity:.86}
.endcard .ec-personal .en{font-size:.6rem;font-weight:300;letter-spacing:.16em;text-transform:uppercase;opacity:.86}
.endcard .to-name{margin:0;text-align:center;font-size:1.35rem;font-weight:500;line-height:1.5;unicode-bidi:plaintext}
.endcard .ec-links{list-style:none;padding:0;margin:2.2rem 0 0;width:100%;display:flex;flex-direction:column;gap:1.05rem}
.endcard .ec-links li{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--gut)}
.endcard .ec-links .ar{font-size:.72rem;font-weight:300;opacity:.86}
.endcard .ec-links .en{font-size:.6rem;font-weight:300;letter-spacing:.16em;text-transform:uppercase;opacity:.86;align-self:center}
.endcard .ec-links a{grid-column:1 / span 2;justify-self:center;font-size:.95rem;font-weight:500;padding:.35rem .6rem;margin-top:.05rem;border-radius:4px;
  border-bottom:1px solid rgba(255,255,255,.28);line-height:1.4;transition:border-color .25s}
.endcard .ec-links a:hover{border-color:var(--red)}
.endcard .ec-links a:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* ---------- footer ---------- */
.foot{flex:none;background:#000;position:relative;z-index:2;
  padding:calc(14 * var(--hu)) env(safe-area-inset-right) calc(14 * var(--hu) + env(safe-area-inset-bottom)) env(safe-area-inset-left)}
.foot ul{direction:ltr;list-style:none;margin:0;padding:0;display:flex;justify-content:center;gap:calc(26 * var(--hu))}
.foot a{display:block;width:calc(40 * var(--hu));height:calc(40 * var(--hu));color:#fff;opacity:.8;border-radius:6px;transition:opacity .25s}
.foot a:hover{opacity:1}
.foot a:focus-visible{opacity:1;outline:2px solid var(--red);outline-offset:4px}
.foot svg{display:block;width:100%;height:100%}

/* ---------- landscape phones: header becomes one row ---------- */
@media (orientation:landscape) and (max-height:520px){
  :root{--fade-top:1.25rem;--fade-bot:1.25rem;--hu:0.85px}
  .grad{height:90px}
  .outline{height:110px}
  .head-in{display:flex;justify-content:center;align-items:center;gap:2.5rem;padding-top:calc(5px + 10px)}
  .brand{margin:0;height:auto;padding-top:0;align-items:center;width:auto}
  .brand .names{padding-top:0;margin-inline-start:20px}
  .works{height:auto}
  .works a{margin:0}
  .foot{padding-top:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  .foot a{width:32px;height:32px}
}
