/* ==========================================================================
   Rallye des Fennecs — base: tokens, reset, typography, buttons, topbar,
   footer, utilities, reveal/parallax motion.
   ========================================================================== */

:root {
	--ink: #0d0b0a;
	--coal: #151211;
	--coal-2: #1d1815;
	--coal-3: #26201c;
	--line: rgba(255, 255, 255, .12);
	--line-dark: rgba(13, 11, 10, .12);

	--fox: #ff7a1a;
	--fox-2: #ff9a3d;
	--red: #e2391b;
	--red-2: #c42d12;
	--sand: #f4d9a6;
	--dust: #c98a4b;
	--paper: #f6efe4;
	--paper-2: #ece1d0;
	--green: #1f9d55;

	--text: #f4ede2;
	--muted: rgba(244, 237, 226, .68);
	--muted-dark: rgba(13, 11, 10, .66);

	--f-display: 'Unbounded', 'Cairo', system-ui, sans-serif;
	--f-body: 'Manrope', 'Cairo', system-ui, sans-serif;

	--radius: 20px;
	--radius-lg: 28px;
	--container: 1240px;
	--gutter: clamp(18px, 4vw, 40px);
	--topbar-h: 76px;
	--ease: cubic-bezier(.22, .8, .2, 1);
	--shadow: 0 30px 60px -28px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body.rdf {
	margin: 0;
	background: var(--ink);
	color: var(--text);
	font-family: var(--f-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
body.admin-bar .topbar { top: var(--wp-admin--admin-bar--height, 32px); }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--fox-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--fox); color: #fff; }
[hidden] { display: none !important; }
main { display: block; outline: none; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; background: var(--red); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }
.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.center { text-align: center; margin-top: clamp(28px, 4vw, 48px); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ico { width: 1.25em; height: 1.25em; flex: none; }
[dir="rtl"] .ico-arrow-right, [dir="rtl"] .ico-arrow-left { transform: scaleX(-1); }

/* ---------- Typography ---------- */
.eyebrow {
	display: inline-flex; align-items: center; gap: .8em;
	font: 700 .72rem/1 var(--f-display); letter-spacing: .2em; text-transform: uppercase;
	color: var(--red);
	margin-bottom: 1.1rem;
}
.eyebrow::before {
	content: ""; width: 34px; height: 12px; flex: none;
	background: repeating-linear-gradient(115deg, currentColor 0 4px, transparent 4px 9px);
}
.section--dark .eyebrow, .hero .eyebrow, .pagehero .eyebrow, .cta .eyebrow, .notfound .eyebrow { color: var(--fox-2); }
.eyebrow--chip {
	padding: .75em 1.15em; border-radius: 999px; color: #fff !important;
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px);
	letter-spacing: .14em;
}
.eyebrow--chip::before { display: none; }
.eyebrow--chip .ico { width: 1.4em; height: 1.4em; color: var(--fox-2); }

.h2, .h3, .h4 { font-family: var(--f-display); text-transform: uppercase; line-height: 1.08; letter-spacing: -.01em; font-weight: 700; }
.h2 { font-size: clamp(1.7rem, 3.6vw, 3.1rem); }
.h2--xl { font-size: clamp(1.9rem, 3.7vw, 3.3rem); }
.h3 { font-size: clamp(1.1rem, 1.8vw, 1.5rem); display: flex; align-items: center; gap: .6em; }
.h3 .ico { color: var(--red); }
.h4 { font-size: 1rem; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.7; color: var(--muted-dark); max-width: 62ch; }
.section--dark .lead, .cta .lead, .pagehero .lead, .notfound .lead { color: var(--muted); }
.note { font-size: .85rem; color: var(--muted-dark); max-width: 80ch; margin-top: 1.4rem; line-height: 1.6; }
.section--dark .note { color: var(--muted); }

[dir="rtl"] body, body.rdf-lang-ar { font-family: 'Cairo', var(--f-body); line-height: 1.8; }
body.rdf-lang-ar { --f-display: 'Cairo', 'Unbounded', system-ui, sans-serif; }
body.rdf-lang-ar .h2, body.rdf-lang-ar .h3, body.rdf-lang-ar .h4,
body.rdf-lang-ar .btn, body.rdf-lang-ar .eyebrow, body.rdf-lang-ar .pagehero__title,
body.rdf-lang-ar .hero__title, body.rdf-lang-ar .chip, body.rdf-lang-ar .topbar__nav a {
	text-transform: none; letter-spacing: 0; font-weight: 800;
}
body.rdf-lang-ar .eyebrow { font-size: .9rem; }
body.rdf-lang-ar .h2 { line-height: 1.35; }
body.rdf-lang-ar .h3 { line-height: 1.35; }
body.rdf-lang-ar .h4 { line-height: 1.4; }
body.rdf-lang-ar .lead { line-height: 1.85; }
body.rdf-lang-ar .topbar__nav a { font-size: 1rem; }
body.rdf-lang-ar .btn { font-size: 1rem; }

/* ---------- Buttons ---------- */
.btn {
	position: relative; isolation: isolate; overflow: hidden;
	display: inline-flex; align-items: center; justify-content: center; gap: .7em;
	padding: 1em 1.7em; border-radius: 999px; border: 1.5px solid transparent;
	font: 700 .78rem/1 var(--f-display); letter-spacing: .07em; text-transform: uppercase;
	white-space: nowrap;
	transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.btn .ico { width: 1.3em; height: 1.3em; transition: transform .35s var(--ease); }
.btn:hover .ico-arrow-right { transform: translateX(4px); }
[dir="rtl"] .btn:hover .ico-arrow-right { transform: scaleX(-1) translateX(4px); }
.btn::after {
	content: ""; position: absolute; inset: -20% auto -20% -60%; width: 40%; z-index: -1;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
	transform: skewX(-20deg); transition: transform .8s var(--ease);
}
.btn:hover::after { transform: translateX(520%) skewX(-20deg); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--sm { padding: .85em 1.35em; font-size: .7rem; }
.btn--lg { padding: 1.15em 2em; font-size: .82rem; }
.btn--red { background: linear-gradient(135deg, var(--red), #ff5a2a); color: #fff; box-shadow: 0 14px 30px -12px rgba(226, 57, 27, .85); }
.btn--red:hover { box-shadow: 0 20px 38px -12px rgba(226, 57, 27, .95); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--sand); }
.btn--ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .38); color: #fff; backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgba(255, 255, 255, .18); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--red); }
.btn[disabled] { opacity: .6; pointer-events: none; }

.glass {
	background: linear-gradient(160deg, rgba(34, 28, 24, .62), rgba(16, 13, 12, .55));
	border: 1px solid rgba(255, 255, 255, .16);
	backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.pill { display: inline-flex; align-items: center; gap: .6em; padding: .5em .9em; border-radius: 999px; background: rgba(255, 255, 255, .1); font: 700 .66rem/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; }
.pill--live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(226, 57, 27, .7); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(226, 57, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(226, 57, 27, 0); } }

/* ---------- Top bar (JDX-style red diagonal tab) ---------- */
.topbar {
	position: fixed; inset: 0 0 auto 0; z-index: 80; height: var(--topbar-h);
	display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
	padding-inline-end: var(--gutter);
	background: linear-gradient(180deg, rgba(13, 11, 10, .75), rgba(13, 11, 10, 0));
	transition: background-color .35s, box-shadow .35s, height .35s;
}
.topbar.is-scrolled { background: rgba(13, 11, 10, .88); backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 20px 40px -24px rgba(0, 0, 0, .8); }
.topbar__brand {
	display: flex; align-items: center; gap: 12px; position: relative; z-index: 2;
	padding: 0 clamp(36px, 4.5vw, 64px) 0 var(--gutter);
	background: linear-gradient(135deg, var(--red) 0%, #ff4a24 100%);
	clip-path: polygon(0 0, 100% 0, calc(100% - 34px) 100%, 0 100%);
	box-shadow: 8px 0 24px rgba(226, 57, 27, .35);
}
[dir="rtl"] .topbar__brand { clip-path: polygon(0 0, 100% 0, 100% 100%, 34px 100%); padding: 0 var(--gutter) 0 clamp(36px, 4.5vw, 64px); }
.topbar__brand img { width: 44px; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); transition: transform .5s var(--ease); }
.topbar__brand:hover img { transform: rotate(-8deg) scale(1.08); }
.topbar__brand-text { display: flex; flex-direction: column; line-height: .95; font: 800 .8rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.topbar__brand-text b:last-child:not(:only-child) { font-weight: 500; letter-spacing: .2em; opacity: .9; margin-top: 3px; }
body.rdf-lang-ar .topbar__brand-text { letter-spacing: 0; font-size: 1rem; }

.topbar__nav { flex: 1; display: flex; align-items: center; justify-content: center; }
.topbar__nav ul { display: flex; gap: clamp(8px, 1.6vw, 26px); }
.topbar__nav a {
	position: relative; display: block; padding: 10px 6px;
	font: 600 .8rem/1 var(--f-display); letter-spacing: .13em; text-transform: uppercase; color: rgba(255, 255, 255, .86);
	transition: color .2s;
}
.topbar__nav a::after { content: ""; position: absolute; inset: auto 6px 2px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
[dir="rtl"] .topbar__nav a::after { transform-origin: right; }
.topbar__nav a:hover, .topbar__nav a[aria-current="page"] { color: #fff; }
.topbar__nav a:hover::after, .topbar__nav a[aria-current="page"]::after { transform: scaleX(1); }
.topbar__nav .topbar__cta-mobile { display: none; }
.topbar__tools { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px); }
.lang a { min-width: 34px; text-align: center; padding: 7px 9px; border-radius: 999px; font: 700 .75rem/1 var(--f-display); color: rgba(255, 255, 255, .75); transition: background-color .2s, color .2s; }
.lang a:hover { color: #fff; }
.lang a[aria-current="true"] { background: #fff; color: var(--ink); }
.burger { display: none; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
.burger .burger__close { display: none; }
.burger[aria-expanded="true"] .burger__close { display: block; }
.burger[aria-expanded="true"] .burger__open { display: none; }

@media (max-width: 1060px) {
	.topbar__cta { display: none; }
	.burger { display: inline-flex; }
	.topbar__nav {
		position: fixed; inset: var(--topbar-h) 0 auto 0; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px;
		padding: 18px var(--gutter) 28px; background: rgba(13, 11, 10, .96); backdrop-filter: blur(20px);
		border-bottom: 1px solid var(--line); box-shadow: 0 40px 60px -20px rgba(0, 0, 0, .8);
		transform: translateY(-14px); opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s var(--ease), visibility .3s;
	}
	body.admin-bar .topbar__nav { top: calc(var(--topbar-h) + var(--wp-admin--admin-bar--height, 32px)); }
	.topbar__nav.is-open { transform: none; opacity: 1; visibility: visible; }
	.topbar__nav ul { flex-direction: column; gap: 0; }
	.topbar__nav a { padding: 16px 4px; font-size: .85rem; border-bottom: 1px solid var(--line); }
	.topbar__nav a::after { display: none; }
	.topbar__nav a.topbar__cta-mobile { display: inline-flex; padding: 1.1em 1.6em; border-bottom: 0; font-size: .78rem; color: #fff; justify-content: center; }
}
@media (max-width: 520px) {
	:root { --topbar-h: 66px; }
	.topbar__brand-text { display: none; }
	.topbar__brand { padding-inline-end: 52px; }
	.lang a { min-width: 30px; padding: 6px 7px; }
}

/* ---------- Footer ---------- */
.footer { position: relative; background: var(--ink); color: var(--muted); padding-top: clamp(48px, 6vw, 80px); overflow: hidden; }
.footer__stripe { position: absolute; inset: 0 0 auto 0; height: 12px; background: repeating-linear-gradient(115deg, var(--red) 0 22px, #ff7a1a 22px 30px, transparent 30px 52px); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.1fr; gap: clamp(28px, 4vw, 56px); padding-bottom: 48px; }
.footer__brand img { width: 92px; margin-bottom: 18px; }
.footer__brand p { max-width: 34ch; }
.footer__slogan { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font: 600 .72rem/1.2 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fox-2); }
.footer__slogan span + span::before { content: "/"; margin-inline-end: 14px; color: var(--red); }
.footer h2 { font: 700 .74rem/1 var(--f-display); letter-spacing: .2em; text-transform: uppercase; color: #fff; margin-bottom: 20px; }
.footer__col li + li { margin-top: 10px; }
.footer__col a { transition: color .2s; }
.footer__col a:hover { color: var(--fox-2); }
.footer__contact li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; }
.footer__contact .ico { color: var(--red); margin-top: 3px; }
.footer__follow { margin-top: 26px !important; }
.social { display: flex; gap: 10px; }
.social li + li { margin: 0 !important; }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); color: #fff; transition: background-color .25s, transform .3s var(--ease), border-color .25s; }
.social a:hover { background: var(--red); border-color: var(--red); transform: translateY(-3px); color: #fff; }
.footer__badges { display: grid; gap: 14px; }
.footer__badges img { width: 150px; border-radius: 12px; background: transparent; }
.footer__bar { border-top: 1px solid var(--line); background: #000; }
.footer__bar-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; font-size: .78rem; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(64px, 9vw, 130px); background: var(--paper); color: var(--ink); }
.section--dark { background: var(--coal); color: var(--text); --edge-top: var(--paper); --edge-bot: var(--paper); }
.section--dark::before, .section--dark::after, .cta::after {
	content: ""; position: absolute; left: 0; right: 0; height: clamp(30px, 4.6vw, 72px); z-index: 3; pointer-events: none;
	-webkit-mask: url('../img/mud-edge.svg') center / 100% 100% no-repeat; mask: url('../img/mud-edge.svg') center / 100% 100% no-repeat;
}
.section--dark::before { top: -1px; background: var(--edge-top); transform: scaleY(-1); }
.section--dark::after, .cta::after { bottom: -1px; background: var(--edge-bot, var(--paper)); }
.section__head { max-width: 780px; margin-bottom: clamp(32px, 5vw, 64px); }
.section__head .h2 { margin-bottom: clamp(14px, 2vw, 22px); }
body.rdf-lang-ar .section__head .h2 { margin-bottom: clamp(16px, 2.2vw, 26px); }
.section__head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.mud-edge { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 4; height: clamp(34px, 5vw, 80px); background: var(--paper); pointer-events: none; -webkit-mask: url('../img/mud-edge.svg') center / 100% 100% no-repeat; mask: url('../img/mud-edge.svg') center / 100% 100% no-repeat; }
.mud-edge--top { top: -1px; bottom: auto; transform: scaleY(-1); }

/* ---------- Motion: scroll reveal & parallax ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(42px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes parallax { from { transform: translateY(-7%) scale(1.14); } to { transform: translateY(7%) scale(1.14); } }
@keyframes heroPx { from { transform: translateY(0) scale(1.06); } to { transform: translateY(9%) scale(1.16); } }
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 38%; }
		[data-parallax] { animation: parallax linear both; animation-timeline: view(); animation-range: cover; }
		.hero__img { animation: heroPx linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
		.event__map path, .tl__map path { animation: draw linear both; animation-timeline: view(); animation-range: entry 10% entry 90%; }
	}
	@supports not (animation-timeline: view()) {
		.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
		.js .reveal.is-in { opacity: 1; transform: none; }
		.js .event__map path, .js .tl__map path { stroke-dashoffset: 1000; transition: stroke-dashoffset 1.6s var(--ease) .2s; }
		.js .is-in .event__map path, .js .is-in .tl__map path { stroke-dashoffset: 0; }
	}
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.event__map path, .tl__map path { stroke-dashoffset: 0; }
}
