/* The Wandering Bedouin - one stylesheet for the English and Arabic pages.
   The game's palette: ember-dark grounds, sand gold, parchment ink. */
:root {
  --bg: #140d0a;
  --bg-2: #1d140f;
  --bg-3: #0e0907;
  --card: #261a13;
  --line: #3a281d;
  --frame: #5a3016;
  --gold: #f0c877;
  --gold-hi: #ffe2a6;
  --ember: #e0a45a;
  --ink: #efe4cf;
  --ink-2: #d9c9ad;
  --dim: #b9a88e;
  --outline: #1a1210;
  --pixel: 'Handjet', 'Courier New', monospace;
  --body: 'Alegreya Sans', 'Trebuchet MS', sans-serif;
  --ar: 'Noto Kufi Arabic', 'Handjet', sans-serif;
  --ar-title: 'Reem Kufi', 'Noto Kufi Arabic', sans-serif;
  color-scheme: dark;
}
/* Handjet keeps the dot of its i only at weight 500-600 and from about 28 px
   up (measured in the browser: at 700+ the dot meets the stem at any size,
   and below ~24 px at any weight - the game's own "letter i" problem). So
   every Handjet heading is 500, and small text that has an i uses the body
   face instead. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.55; }
html[lang=ar] body { font-family: var(--ar); font-size: 17px; line-height: 1.8; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; margin: 0; color: var(--gold); }
p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--gold); color: var(--outline); padding: 8px 14px; border-radius: 4px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }

/* Type */
.pixel { font-family: var(--pixel); }
.kicker { font-family: var(--pixel); font-size: 21px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember); }
html[lang=ar] .kicker { font-family: var(--ar); font-size: 17px; letter-spacing: 0; font-weight: 700; }
.h2 { font-family: var(--pixel); font-weight: 500; font-size: clamp(36px, 5vw, 52px); line-height: 1; }
.h3 { font-family: var(--pixel); font-weight: 500; font-size: clamp(30px, 3.4vw, 40px); line-height: 1; }
html[lang=ar] .h2 { font-family: var(--ar); font-size: clamp(30px, 4vw, 44px); line-height: 1.4; }
html[lang=ar] .h3 { font-family: var(--ar); font-size: clamp(24px, 2.8vw, 34px); line-height: 1.5; }
.lead { color: var(--ink-2); max-width: 36em; }
.center { text-align: center; margin-inline: auto; }
.ar-text { font-family: var(--ar); }
.en-text { font-family: var(--body); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 26px; border-radius: 4px; font-family: var(--pixel); font-weight: 500; font-size: 26px; line-height: 1; text-decoration: none; }
html[lang=ar] .btn { font-family: var(--ar); font-weight: 700; font-size: 17px; line-height: 1.6; }
.btn-gold { background: var(--gold); color: var(--outline); box-shadow: 0 4px 0 var(--frame); }
.btn-gold:hover { background: var(--gold-hi); color: var(--outline); }
.btn-line { border: 2px solid var(--gold); color: var(--gold); }
.btn-line svg { flex: none; }
html[dir=rtl] .btn-line svg { transform: scaleX(-1); }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(20, 13, 10, 0.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(4px); }
.nav .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--pixel); font-weight: 500; font-size: 30px; color: var(--gold); text-decoration: none; flex-grow: 1; }
html[lang=ar] .brand { font-family: var(--ar-title); font-weight: 700; }
.nav-links { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; font-family: var(--pixel); font-weight: 500; font-size: 24px; }
html[lang=ar] .nav-links { font-family: var(--ar); font-weight: 500; font-size: 16px; }
.nav-links a:not(.btn) { color: var(--ink-2); text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--gold); }
.nav-links .btn { min-height: 44px; padding: 8px 18px; font-size: 24px; box-shadow: none; }
html[lang=ar] .nav-links .btn { font-size: 16px; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* Hero */
.hero { position: relative; min-height: min(760px, 92vh); display: flex; align-items: flex-end; overflow: hidden; background: var(--outline); }
.hero > img, .hero > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; image-rendering: pixelated; }
/* The game's title card, alive: drawn over the still once its first frame is ready. */
.hero > canvas { opacity: 0; transition: opacity 0.4s ease; }
.hero > canvas.live { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,13,10,0) 30%, rgba(20,13,10,0.8) 62%, rgba(20,13,10,0.93) 100%); }
@media (max-width: 820px) { .hero::after { background: linear-gradient(0deg, rgba(20,13,10,0.95) 35%, rgba(20,13,10,0.2) 100%); } }
.hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 88px; display: flex; }
html[dir=ltr] .hero .wrap { justify-content: flex-end; }
html[dir=rtl] .hero .wrap { justify-content: flex-start; }
.hero-text { max-width: 540px; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-family: var(--pixel); font-weight: 500; font-size: clamp(60px, 9vw, 100px); line-height: 0.9; text-shadow: 0 4px 0 var(--frame); }
html[lang=ar] .hero h1 { font-family: var(--ar-title); font-weight: 700; line-height: 1.15; }
.hero .other-name { font-size: 34px; }
.hero .meta { font-size: 15px; color: var(--dim); }

/* Sections */
.sec { padding-block: 96px; }
.sec-2 { background: var(--bg-2); border-top: 1px solid var(--line); }
.sec-3 { background: var(--bg-3); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 40px; align-items: center; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot { border-radius: 6px; border: 2px solid var(--line); width: 100%; }
.feature { display: flex; flex-direction: column; gap: 12px; }
.feature .lead { max-width: none; }
.features { display: flex; flex-direction: column; gap: 64px; }

/* Trailer (a click loads YouTube; nothing from YouTube loads before) */
.video { position: relative; aspect-ratio: 16 / 9; border: 2px solid var(--frame); border-radius: 6px; overflow: hidden; background: #000; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video button { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--gold); background: rgba(20,13,10,0.78); color: var(--gold); cursor: pointer; display: grid; place-items: center; }
.video button:hover { background: rgba(90,48,22,0.9); }
.video-note { text-align: center; color: var(--dim); font-size: 15px; }

/* Wanderers */
.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.class { padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
.class h3 { font-family: var(--pixel); font-weight: 500; font-size: 32px; line-height: 1; }
html[lang=ar] .class h3 { font-family: var(--ar); font-size: 24px; line-height: 1.5; }
.class .title { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); }
html[lang=ar] .class .title { letter-spacing: 0; font-weight: 700; }
.class p:last-child { font-size: 16px; color: var(--ink-2); }

/* World gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.gallery figcaption { font-family: var(--pixel); font-weight: 500; font-size: 30px; line-height: 1.1; color: var(--gold); }
html[lang=ar] .gallery figcaption { font-family: var(--ar); font-size: 19px; font-weight: 700; }

/* Bosses */
.bosses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 20px; }
.boss { position: relative; border-radius: 6px; overflow: hidden; border: 2px solid var(--frame); }
.boss img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.boss div { position: absolute; inset-inline: 0; bottom: 0; padding: 48px 24px 18px; background: linear-gradient(0deg, rgba(14,9,7,0.95), rgba(14,9,7,0)); }
.boss h3 { font-family: var(--pixel); font-weight: 500; font-size: 40px; line-height: 1; }
html[lang=ar] .boss h3 { font-family: var(--ar); font-size: 30px; line-height: 1.5; }

/* Get it */
.get { padding-block: 112px; text-align: center; }
.get .stack { align-items: center; max-width: 760px; margin-inline: auto; }
.get h2 { font-family: var(--pixel); font-weight: 500; font-size: clamp(44px, 6vw, 72px); line-height: 0.95; text-shadow: 0 4px 0 var(--frame); }
html[lang=ar] .get h2 { font-family: var(--ar); font-size: clamp(36px, 5vw, 56px); line-height: 1.35; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; width: 100%; text-align: start; }
.facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); }
.facts dt { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); }
html[lang=ar] .facts dt { letter-spacing: 0; font-weight: 700; }
.facts dd { margin: 2px 0 0; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.socials a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 18px; border: 1px dashed #8a6a48; border-radius: 4px; color: var(--ink-2); text-decoration: none; }

/* Footer */
.foot { padding-block: 32px; border-top: 1px solid var(--line); background: var(--bg-3); font-size: 14px; color: var(--dim); }
.foot .wrap { display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--dim); }

/* Press kit */
.press-head { padding-block: 72px 40px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.press-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 860px) { .press-grid { grid-template-columns: minmax(0, 1fr); } }
.factsheet { position: sticky; top: 88px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 860px) { .factsheet { position: static; } }
.factsheet dl { margin: 0; display: grid; gap: 14px; }
.factsheet dt { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); }
html[lang=ar] .factsheet dt { letter-spacing: 0; font-weight: 700; }
.factsheet dd { margin: 2px 0 0; color: var(--ink); }
.press-body { display: flex; flex-direction: column; gap: 56px; min-width: 0; }
.press-body section { display: flex; flex-direction: column; gap: 16px; }
.press-body h2 { font-family: var(--pixel); font-weight: 500; font-size: 36px; line-height: 1; }
html[lang=ar] .press-body h2 { font-family: var(--ar); font-size: 28px; line-height: 1.5; }
.press-body ul { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.thumbs a { display: block; border: 2px solid var(--line); border-radius: 4px; overflow: hidden; }
.thumbs a:hover { border-color: var(--gold); }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; }
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.logos a { display: grid; place-items: center; min-height: 160px; padding: 20px; background: #2a1d15 repeating-conic-gradient(#2a1d15 0 25%, #241812 0 50%) 0 0 / 20px 20px; border: 2px solid var(--line); border-radius: 4px; }
.placeholder { color: var(--dim); border: 1px dashed #8a6a48; border-radius: 4px; padding: 2px 8px; }

/* Loading screen: the dark of the camp at night, the title and three embers.
   Shown only when scripts run (html.js), so the page never sits behind it. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loader { display: none; }
html.js .loader { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding-inline: 24px;
  background: radial-gradient(ellipse at 50% 62%, rgba(224, 120, 40, 0.16), rgba(20, 13, 10, 0) 55%), var(--bg);
  opacity: 1; visibility: visible; transition: opacity 0.6s ease, visibility 0s linear 0s; }
html.js .loader.done { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }
html.js .loader.leaving { transition-duration: 0.35s; }
.loader img { width: min(560px, 82vw); height: auto; animation: loader-breathe 4.4s ease-in-out infinite; }
.embers { display: flex; gap: 12px; }
.embers i { width: 8px; height: 8px; background: var(--ember); box-shadow: 0 0 10px 2px rgba(224, 120, 40, 0.7); animation: ember 1.2s ease-in-out infinite; }
.embers i:nth-child(2) { animation-delay: 0.2s; }
.embers i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ember { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes loader-breathe { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  html.js .loader, html.js .loader.done { transition: none; }
  .loader img, .embers i { animation: none; opacity: 1; }
  .hero > canvas { transition: none; }
}

/* YouTube and X marks beside their links. */
.icon { flex: none; display: inline-block; vertical-align: middle; }
.socials a { gap: 10px; }
.foot-social { display: inline-flex; gap: 14px; align-items: center; }
.foot-social a { display: inline-flex; color: var(--dim); }
.foot-social a:hover { color: var(--gold); }

/* Screenshot carousel: the game's window frame (stone edge, a gold hairline
   inside), shots that snap into place, pixel arrows and a thumbnail strip. */
.carousel { display: flex; flex-direction: column; gap: 14px; }
.car-frame { position: relative; border: 3px solid var(--frame); border-radius: 6px; background: #000;
  box-shadow: inset 0 0 0 1px rgba(240, 200, 119, 0.35), 0 10px 30px rgba(0, 0, 0, 0.45); overflow: hidden; }
.car-frame::before, .car-frame::after { content: ""; position: absolute; z-index: 2; width: 10px; height: 10px; background: var(--gold); top: 8px; pointer-events: none; box-shadow: 0 0 8px rgba(240, 200, 119, 0.5); }
.car-frame::before { left: 8px; }
.car-frame::after { right: 8px; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.car-slide { flex: 0 0 100%; margin: 0; position: relative; aspect-ratio: 16 / 9; scroll-snap-align: center; scroll-snap-stop: always; }
.car-slide img { width: 100%; height: 100%; object-fit: cover; }
.car-slide figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 56px 28px 22px; font-family: var(--pixel); font-weight: 500; font-size: clamp(26px, 3vw, 36px); line-height: 1; color: var(--gold);
  text-shadow: 0 3px 0 var(--frame), 0 0 6px rgba(0, 0, 0, 0.8); background: linear-gradient(0deg, rgba(14, 9, 7, 0.92), rgba(14, 9, 7, 0)); }
html[lang=ar] .car-slide figcaption { font-family: var(--ar); font-weight: 700; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.5; }
.car-btn { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; display: grid; place-items: center; cursor: pointer;
  background: rgba(20, 13, 10, 0.82); color: var(--gold); border: 2px solid var(--gold); border-radius: 4px; box-shadow: 0 3px 0 var(--frame); }
.car-btn:hover { background: rgba(90, 48, 22, 0.92); }
.car-prev { inset-inline-start: 14px; }
.car-next { inset-inline-end: 14px; }
html[dir=ltr] .car-prev svg, html[dir=rtl] .car-next svg { transform: scaleX(-1); }
.car-count { position: absolute; z-index: 3; top: 14px; inset-inline-end: 28px; margin: 0; font-family: var(--pixel); font-weight: 500; font-size: 24px; color: var(--ink); text-shadow: 0 2px 0 var(--outline); }
html[lang=ar] .car-count { font-family: var(--ar); font-size: 15px; }
.car-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.car-thumbs button { flex: 0 0 auto; width: 112px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid var(--line); border-radius: 3px; background: #000; cursor: pointer; opacity: 0.55; transition: opacity 0.2s ease, border-color 0.2s ease; }
.car-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.car-thumbs button:hover { opacity: 0.85; }
.car-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--gold); box-shadow: 0 0 10px rgba(224, 120, 40, 0.55); }
@media (max-width: 640px) { .car-btn { width: 44px; height: 44px; } .car-thumbs button { width: 84px; } .car-frame::before, .car-frame::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .car-thumbs button { transition: none; } }

