/* The Hello sheet every omarali.xyz app shows while a page loads (Omar, 23 Nov 2026). It is omarali.xyz's own
   loading screen (omarali-squarespace dist/oa.css, section 16) made common: a chalk sheet, "Hello" turning through
   the languages of Omar's life, then the sheet slides up.
   Two layers. This stylesheet paints the sheet on its own (body::after), so it shows before any script and on pages
   whose policy allows no script (Arena); with no script it lifts by itself at 1.6 s. hello-loader.js takes over when it
   runs (html.hl-on), keeps the words turning until the page has loaded, then lifts it (html.hl-done); 3 s at most.
   Same-origin only: no fonts of its own. Archivo is the house face every app already declares; the Japanese and
   Arabic words use the system's own fonts. Fixed position, so it adds no height to pages that lock the body. */

:root {
  --hl-chalk: #f6f6f2;
  --hl-ink: #17171b;
  --hl-display: "Archivo", "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
    "Noto Sans CJK JP", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Arial, sans-serif;
  --hl-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --hl-ar: "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, "Arial", sans-serif;
  --hl-ease-lift: cubic-bezier(0.76, 0, 0.24, 1);
}

/* 1. The stylesheet's own sheet: shows from the first paint, before any script. */
@media screen {
  html:not(.hl-on):not(.hl-done) body::after {
    content: "Hello"; position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center;
    background: var(--hl-chalk); color: var(--hl-ink);
    font: 500 clamp(3.2rem, 11vw, 9.5rem)/1.25 var(--hl-display); font-stretch: 112%; letter-spacing: -0.02em;
    pointer-events: none;
    animation: hl-words 3.12s steps(1) 1 both, hl-lift 0.85s var(--hl-ease-lift) 1.6s forwards;
  }
}
@keyframes hl-lift { to { transform: translateY(-100%); visibility: hidden; } }
@keyframes hl-fade { to { opacity: 0; visibility: hidden; } }
@keyframes hl-words {
  0% { content: "Hello"; } 8.33% { content: "Hallo"; } 16.66% { content: "こんにちは"; } 25% { content: "Hola"; }
  33.33% { content: "أهلاً"; } 41.66% { content: "Bonjour"; } 50% { content: "Ciao"; } 58.33% { content: "Olá"; }
  66.66% { content: "Merhaba"; } 75% { content: "Hej"; } 83.33% { content: "Salut"; } 91.66% { content: "Moin"; }
}
@media screen and (prefers-reduced-motion: reduce) {
  html:not(.hl-on):not(.hl-done) body::after { animation: hl-fade 0.5s linear 1.6s forwards; }
}

/* 2. The script's sheet (hello-loader.js): the words rise in one after another, then the sheet lifts. */
.hl-sheet {
  position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; overflow: hidden;
  background: var(--hl-chalk); color: var(--hl-ink);
  transition: transform 0.85s var(--hl-ease-lift), opacity 0.5s ease;
}
.hl-sheet.is-lifting { transform: translateY(-100%); pointer-events: none; }
.hl-sheet.is-fading { opacity: 0; pointer-events: none; }
.hl-line {
  position: relative; height: 1.25em; width: 100%; overflow: hidden; text-align: center;
  font: 500 clamp(3.2rem, 11vw, 9.5rem)/1.25 var(--hl-display); font-stretch: 112%; letter-spacing: -0.02em;
}
.hl-word { position: absolute; inset: 0; animation: hl-in 0.22s cubic-bezier(0.19, 1, 0.22, 1) both; }
.hl-word.is-still { animation: none; }
.hl-word.is-out { animation: hl-out 0.18s cubic-bezier(0.55, 0, 0.45, 1) both; }
.hl-word.is-ja { font-family: var(--hl-ja); font-weight: 400; font-stretch: normal; }
.hl-word.is-ar { font-family: var(--hl-ar); font-weight: 400; font-stretch: normal; letter-spacing: 0; unicode-bidi: isolate; }
@keyframes hl-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes hl-out { to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .hl-word, .hl-word.is-out { animation: none; }
  .hl-word.is-out { visibility: hidden; }
}

/* Never on paper. */
@media print {
  body::after { content: none !important; display: none !important; }
  .hl-sheet { display: none !important; }
}
