/*
 * Homepage v3 (docs/design/HOMEPAGE_REDESIGN_V3.md), refined by the final UI pass v4 (docs/design/UI_REFINEMENTS_V4.md).
 * UI colours (owner decision v4): softer dark #153F3A, deep teal #00566C, bright teal #00AEB1, tint #EAF3F2, white;
 * the logo colours (#46A583, #06F9BA, #022319) stay in the mark and in small accents. Dark mode: #0D2B34 / #123D43.
 * Geometry follows the isometric axes of the mark (30°, 90°, 150°).
 * Logical properties: one set of rules for LTR and RTL. Motion stops with prefers-reduced-motion.
 */

:root {
  --h3-deep: #153F3A;
  --h3-darkest: #022319;
  --h3-green: #46A583;
  --h3-mint: #00AEB1;
  --h3-logo-mint: #06F9BA;
  --h3-accent-on-dark: #5FD6D8;
  --h3-petrol: #00566C;
  --h3-canvas: #EAF3F2;
  --h3-surface: #FFFFFF;
  --h3-ink: #153F3A;
  --h3-ink-soft: #3F5F5B;
  --h3-line: #CFE1DE;
  --h3-line-strong: #9CC3C0;
  --h3-shadow: 0 1px 2px rgba(21, 63, 58, 0.05), 0 8px 24px rgba(21, 63, 58, 0.07);
  --h3-shadow-hover: 0 2px 4px rgba(21, 63, 58, 0.06), 0 18px 40px rgba(21, 63, 58, 0.13);
  --h3-radius: 14px;
  --h3-gap: clamp(1rem, 2vw, 1.5rem);
  --h3-section: clamp(3.5rem, 6vw, 5.5rem);
  /* Isometric lattice drawn with the mark's axes (cell 40 px high, 69.28 px wide). */
  --h3-lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='69.28' height='40' viewBox='0 0 69.28 40'%3E%3Cpath d='M0 0L69.28 40M69.28 0L0 40M34.64 0V40' fill='none' stroke='%2300AEB1' stroke-opacity='0.2' stroke-width='0.8'/%3E%3C/svg%3E");
  --h3-lattice-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='69.28' height='40' viewBox='0 0 69.28 40'%3E%3Cpath d='M0 0L69.28 40M69.28 0L0 40M34.64 0V40' fill='none' stroke='%235FD6D8' stroke-opacity='0.13' stroke-width='0.8'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --h3-canvas: #0D2B34;
  --h3-surface: #123D43;
  --h3-ink: #F1F7F6;
  --h3-ink-soft: #C3D8D7;
  --h3-line: #285860;
  --h3-line-strong: #3E737A;
  --h3-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --h3-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* ---------------------------------------------------------------- Page gutters (all portal pages) */
.container-xl { padding-inline: clamp(1rem, 3vw, 1.5rem); }

/* ---------------------------------------------------------------- Header (all portal pages) */
.gov-bar { background: var(--h3-deep); font-size: 0.875rem; }
[data-theme="dark"] .gov-bar { background: #0A232B; }
.gov-bar-inner { min-block-size: 3rem; }
.gov-identity { font-weight: 600; letter-spacing: 0.005em; }
.gov-identity span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header { background: color-mix(in srgb, var(--h3-surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-block-end: 1px solid var(--h3-line); padding-block: 0.75rem; }
/* Platform lockup in the header: reduced by about 13 % at every breakpoint (owner decision 2026-11-07: 60 -> 52 px on
   desktop). Accepted by the owner although the French lockup is then about 153 px wide, under the 160 px digital
   minimum of brand-guidelines.md section 6. Geometry and proportions unchanged (height only, width auto). */
.header { --header-logo-h: 52px; }
.header .logo img { block-size: var(--header-logo-h); inline-size: auto; }
/* The Arabic lockup carries its wordmark in a smaller block: it keeps its previous sizes so the text stays legible. */
html[lang="ar"] .header { --header-logo-h: 60px; }
@media (max-width: 991.98px) { html[lang="ar"] .header { --header-logo-h: 52px; } }
@media (max-width: 575.98px) { html[lang="ar"] .header { --header-logo-h: 46px; } }
.navmenu .nav-link { position: relative; color: var(--h3-ink); font-size: 0.975rem; font-weight: 600; padding: 0.55rem 0.85rem; border-radius: 999px; transition: background-color 0.2s ease, color 0.2s ease; }
.navmenu .nav-link:hover { background: color-mix(in srgb, var(--h3-green) 12%, transparent); color: var(--h3-ink); }
.navmenu .nav-link:focus-visible { outline: 3px solid var(--h3-petrol); outline-offset: 2px; }
.navmenu .nav-link.active { box-shadow: none; color: var(--h3-ink); }
.navmenu .nav-link::after { content: ""; position: absolute; inset-inline: 0.85rem; inset-block-end: 0.15rem; block-size: 3px; border-radius: 3px; background: var(--h3-mint); transform: scaleX(0); transition: transform 0.25s ease; }
.navmenu .nav-link.active::after, .navmenu .nav-link:hover::after { transform: scaleX(1); }
.navmenu .dropdown-toggle::after { border: 0; }
[data-theme="dark"] .navmenu .nav-link:focus-visible { outline-color: var(--h3-accent-on-dark); }
.navmenu .nav-link--featured { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--h3-petrol); }
[data-theme="dark"] .navmenu .nav-link--featured { color: var(--h3-accent-on-dark); }
.nav-badge { display: inline-flex; align-items: center; font-family: var(--font-body); font-size: 0.6875rem; font-weight: 800; line-height: 1; letter-spacing: 0.03em; text-transform: uppercase; color: #FFFFFF; background: var(--h3-petrol); border-radius: 999px; padding: 0.28rem 0.5rem; white-space: nowrap; }
html[lang="ar"] .nav-badge { letter-spacing: 0; text-transform: none; font-size: 0.75rem; }
[data-theme="dark"] .nav-badge { color: #0D2B34; background: var(--h3-mint); }
.nav-badge--inline { margin-inline-start: 0.5rem; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.mega-column--featured { background: var(--h3-canvas); outline: 1.5px solid color-mix(in srgb, var(--h3-mint) 55%, transparent); outline-offset: -1.5px; }
.mega-column--featured .rdi-icon { background: var(--h3-petrol); color: #FFFFFF; }
[data-theme="dark"] .mega-column--featured { background: rgba(0, 174, 177, 0.1); }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navmenu .nav-link { padding-inline: 0.55rem; font-size: 0.9rem; }
  .navmenu { gap: 0.4rem; }
}
@media (max-width: 991.98px) {
  .navmenu .nav-link { border-radius: 8px; }
  .navmenu .nav-link::after { inset-inline: 0.25rem auto; inline-size: 3px; block-size: auto; inset-block: 0.4rem; transform: scaleY(0); }
  .navmenu .nav-link.active::after { transform: scaleY(1); }
}

/* ---------------------------------------------------------------- Shared pieces */
.h3-btn { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; border-radius: 10px; padding-inline: 1.4rem; min-block-size: 3.25rem; transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
.h3-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(2, 35, 25, 0.16); }
.h3-btn:active { transform: translateY(1px); box-shadow: none; }
.h3-btn:focus-visible { outline: 3px solid var(--h3-petrol); outline-offset: 3px; }
.h3-btn .bi { transition: transform 0.2s ease; }
.h3-btn:hover .bi-arrow-right { transform: translateX(3px); }
[dir="rtl"] .h3-btn:hover .bi-arrow-right { transform: scaleX(-1) translateX(3px); }
.h3-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.h3-section { padding-block: var(--h3-section); background: var(--h3-surface); }
.h3-section--tint { background: var(--h3-canvas); }
.h3-heading { max-inline-size: 46rem; margin-block-end: clamp(1.5rem, 3vw, 2.25rem); }
.h3-heading h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1.15; color: var(--h3-ink); margin: 0 0 0.5rem; }
.h3-heading p:not(.h3-kicker) { color: var(--h3-ink-soft); font-size: 1.0625rem; margin: 0; }
.h3-kicker { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--h3-petrol); margin-block-end: 0.6rem; }
.h3-kicker::before { content: ""; inline-size: 1.5rem; block-size: 2px; background: currentColor; }
html[lang="ar"] .h3-kicker { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
[data-theme="dark"] .h3-kicker { color: var(--h3-accent-on-dark); }
.h3-kicker--light { color: var(--h3-accent-on-dark); }
.h3-inline-link { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 700; margin-block-start: 0.75rem; }

/* ---------------------------------------------------------------- Hero */
.h3-hero { position: relative; overflow: hidden; background: radial-gradient(60rem 40rem at 85% 45%, color-mix(in srgb, var(--h3-mint) 12%, transparent), transparent 70%), linear-gradient(180deg, var(--h3-surface) 0%, var(--h3-canvas) 100%); border-block-end: 1px solid var(--h3-line); }
[data-theme="dark"] .h3-hero { background: radial-gradient(60rem 40rem at 85% 45%, rgba(0, 174, 177, 0.14), transparent 70%), linear-gradient(180deg, #10353E 0%, #0D2B34 100%); }
.h3-hero-lattice { position: absolute; inset: 0; background-image: var(--h3-lattice); background-size: 69.28px 40px; -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 35%, #000 70%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 35%, #000 70%); animation: h3-lattice-drift 40s linear infinite; pointer-events: none; }
[dir="rtl"] .h3-hero-lattice { -webkit-mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, 0.25) 35%, #000 70%); mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, 0.25) 35%, #000 70%); }
[data-theme="dark"] .h3-hero-lattice { background-image: var(--h3-lattice-light); }
.h3-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(2.5rem, 6vw, 5rem); }
.h3-eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 0.875rem; color: var(--h3-ink); background: var(--h3-surface); border: 1px solid var(--h3-line); border-radius: 999px; padding: 0.3rem 0.9rem 0.3rem 0.7rem; margin-block-end: 1.25rem; box-shadow: var(--h3-shadow); }
.h3-dot { inline-size: 0.6rem; block-size: 0.6rem; border-radius: 50%; background: var(--h3-mint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--h3-mint) 25%, transparent); animation: h3-pulse-dot 2.6s ease-in-out infinite; }
.h3-title { font-size: clamp(2.4rem, 4.4vw, 3.75rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; color: var(--h3-ink); margin: 0 0 1.25rem; text-wrap: balance; }
html[lang="ar"] .h3-title { font-weight: 900; line-height: 1.25; letter-spacing: 0; font-size: clamp(2.5rem, 5vw, 4rem); }
.h3-title-brand { display: block; color: var(--h3-petrol); }
[data-theme="dark"] .h3-title-brand { color: var(--h3-accent-on-dark); }
.h3-title-sub { display: block; font-size: 0.62em; line-height: 1.15; letter-spacing: -0.015em; margin-block-start: 0.35rem; }
html[lang="ar"] .h3-title-sub { font-size: 0.6em; line-height: 1.4; }
.h3-title::after { content: ""; display: block; inline-size: 4.5rem; block-size: 5px; margin-block-start: 1.1rem; border-radius: 5px; background: linear-gradient(90deg, var(--h3-green), var(--h3-mint)); }
[dir="rtl"] .h3-title::after { background: linear-gradient(270deg, var(--h3-green), var(--h3-mint)); }
.h3-lead { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.55; color: var(--h3-ink); font-weight: 500; max-inline-size: 36rem; margin-block-end: 0.75rem; }
.h3-note { color: var(--h3-ink-soft); max-inline-size: 36rem; margin-block-end: 1.25rem; }
.h3-signal { display: inline-flex; align-items: center; gap: 0.6rem; background: var(--h3-surface); border: 1px solid var(--h3-line); border-inline-start: 4px solid var(--h3-mint); border-radius: 10px; padding: 0.55rem 0.9rem; margin-block-end: 1.5rem; font-size: 0.95rem; color: var(--h3-ink); }
.h3-signal .bi { color: var(--h3-petrol); font-size: 1.1rem; }
[data-theme="dark"] .h3-signal .bi { color: var(--h3-accent-on-dark); }
.h3-hero-art { position: relative; justify-self: center; inline-size: min(100%, 36rem); }
.h3-hero-art .hero-art { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
.h3-frame path { fill: none; stroke: var(--h3-green); stroke-opacity: 0.45; stroke-width: 1.2; }
.h3-frame .h3-frame-inner { stroke-dasharray: 4 6; stroke-opacity: 0.35; }
.h3-axes path { stroke: var(--h3-petrol); stroke-opacity: 0.35; stroke-width: 1.2; fill: none; stroke-dasharray: 2 5; }
[data-theme="dark"] .h3-axes path { stroke: var(--h3-accent-on-dark); }
.h3-nodes circle { stroke: var(--h3-surface); stroke-width: 2.5; }
.h3-node--r { fill: var(--h3-green); }
.h3-node--d { fill: var(--h3-logo-mint); }
.h3-node--i { fill: var(--h3-darkest); }
[data-theme="dark"] .h3-node--i { fill: #FFFFFF; }
.h3-nodes .h3-pulse { fill: none; stroke: var(--h3-mint); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: h3-node-pulse 3.2s ease-out infinite; }
.h3-nodes .h3-pulse-2 { animation-delay: 1.05s; }
.h3-nodes .h3-pulse-3 { animation-delay: 2.1s; }
[data-theme="dark"] .h3-mark .h3-mark-anchor { fill: #FFFFFF; }
.h3-mark { filter: drop-shadow(0 18px 30px rgba(21, 63, 58, 0.18)); }
.h3-float { transform-box: fill-box; animation: h3-float 14s ease-in-out infinite; }
.h3-frame-ghost { fill: none; stroke: var(--h3-mint); stroke-opacity: 0.22; stroke-width: 1; stroke-dasharray: 1 7; stroke-linecap: round; }
.h3-links path { fill: none; stroke: var(--h3-mint); stroke-opacity: 0.4; stroke-width: 1; }
.h3-links circle { fill: var(--h3-mint); fill-opacity: 0.75; }
.h3-ticks circle { fill: var(--h3-petrol); fill-opacity: 0.45; }
[data-theme="dark"] .h3-ticks circle, [data-theme="dark"] .h3-links circle { fill: var(--h3-accent-on-dark); }
[data-theme="dark"] .h3-links path, [data-theme="dark"] .h3-frame-ghost { stroke: var(--h3-accent-on-dark); }
/* Pointer parallax (static/js/ui.js sets --h3-px/--h3-py in [-1, 1]); farther layers move more. */
.h3-depth { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.h3-depth-0 { transform: translate(calc(var(--h3-px, 0) * 2px), calc(var(--h3-py, 0) * 2px)); }
.h3-depth-1 { transform: translate(calc(var(--h3-px, 0) * -6px), calc(var(--h3-py, 0) * -5px)); }
.h3-depth-2 { transform: translate(calc(var(--h3-px, 0) * -3px), calc(var(--h3-py, 0) * -3px)); }
.h3-depth-3 { transform: translate(calc(var(--h3-px, 0) * -10px), calc(var(--h3-py, 0) * -8px)); }
.h3-float-b { animation-duration: 17s; animation-delay: -5s; }
.h3-float-c { animation-duration: 20s; animation-delay: -9s; }
.h3-glow { animation: h3-breathe 9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.h3-pillars { display: flex; justify-content: center; gap: 0.5rem 1.25rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0.5rem 0 0; font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--h3-ink-soft); }
.h3-pillars li { display: inline-flex; align-items: center; gap: 0.45rem; }
.h3-pillars li::before { content: ""; inline-size: 0.55rem; block-size: 0.55rem; transform: rotate(45deg) skew(-8deg, -8deg); background: var(--h3-green); }
.h3-pillars li:nth-child(2)::before { background: var(--h3-logo-mint); }
.h3-pillars li:nth-child(3)::before { background: var(--h3-darkest); }
[data-theme="dark"] .h3-pillars li:nth-child(3)::before { background: #FFFFFF; }

/* ---------------------------------------------------------------- Services: one system of four */
.h3-services-section { background: var(--h3-surface); }
.h3-services { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--h3-gap); counter-reset: none; }
.h3-card { position: relative; display: flex; flex-direction: column; background: var(--h3-surface); border: 1px solid var(--h3-line); border-radius: var(--h3-radius); padding: 1.25rem 1.25rem 1.1rem; box-shadow: var(--h3-shadow); transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; overflow: hidden; }
.h3-card::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 4px; background: var(--h3-rail, var(--h3-green)); }
.h3-card:hover { transform: translateY(-4px); box-shadow: var(--h3-shadow-hover); border-color: var(--h3-line-strong); }
.h3-card:focus-within { outline: 3px solid var(--h3-petrol); outline-offset: 3px; }
[data-theme="dark"] .h3-card:focus-within { outline-color: var(--h3-mint); }
.h3-card-top { display: flex; align-items: center; justify-content: space-between; margin-block-end: 0.9rem; }
.h3-card-icon { display: grid; place-items: center; inline-size: 3rem; block-size: 3.4rem; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--h3-tile, var(--h3-deep)); color: var(--h3-tile-fg, #fff); font-size: 1.3rem; }
.h3-card-num { font-family: var(--font-heading); font-weight: 700; font-size: 1.75rem; line-height: 1; color: transparent; -webkit-text-stroke: 1.2px var(--h3-line-strong); }
.h3-card-badge { align-self: flex-start; font-size: 0.78rem; font-weight: 700; color: var(--h3-badge, var(--h3-petrol)); background: color-mix(in srgb, var(--h3-badge, var(--h3-petrol)) 9%, transparent); border-radius: 999px; padding: 0.2rem 0.65rem; margin-block-end: 0.6rem; }
.h3-card h3 { font-size: 1.1875rem; line-height: 1.25; font-weight: 700; margin: 0 0 0.5rem; }
.h3-card-link { color: var(--h3-ink); text-decoration: none; }
.h3-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.h3-card-link:focus-visible { outline: none; }
.h3-card-text { color: var(--h3-ink-soft); font-size: 0.95rem; line-height: 1.5; margin: 0 0 1rem; }
.h3-card-cta { margin-block-start: auto; display: inline-flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; color: var(--h3-cta, var(--h3-petrol)); border-block-start: 1px solid var(--h3-line); padding-block-start: 0.85rem; }
.h3-card-cta .bi { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; border-radius: 50%; background: color-mix(in srgb, var(--h3-cta, var(--h3-petrol)) 10%, transparent); transition: transform 0.2s ease, background-color 0.2s ease; }
.h3-card:hover .h3-card-cta .bi { transform: translateX(3px); background: var(--h3-mint); color: #0D2B34; }
[dir="rtl"] .h3-card:hover .h3-card-cta .bi { transform: scaleX(-1) translateX(3px); }
[data-theme="dark"] .h3-card { --h3-cta: var(--h3-accent-on-dark); --h3-badge: var(--h3-accent-on-dark); }
/* One identity per service, inside the green family: rail pattern + tile. */
.h3-card--innovate_or_pay { --h3-rail: linear-gradient(90deg, var(--h3-mint), var(--h3-logo-mint)); --h3-tile: var(--h3-mint); --h3-tile-fg: #0D2B34; --h3-cta: var(--h3-accent-on-dark); background: radial-gradient(22rem 16rem at 100% 0%, rgba(0, 174, 177, 0.32), transparent 70%), linear-gradient(160deg, #00566C 0%, #153F3A 78%); border-color: transparent; color: #FFFFFF; box-shadow: 0 14px 34px rgba(0, 86, 108, 0.28); }
[dir="rtl"] .h3-card--innovate_or_pay { background: radial-gradient(22rem 16rem at 0% 0%, rgba(0, 174, 177, 0.32), transparent 70%), linear-gradient(200deg, #00566C 0%, #153F3A 78%); }
.h3-card--innovate_or_pay .h3-card-link, .h3-card--innovate_or_pay h3 { color: #FFFFFF; }
.h3-card--innovate_or_pay .h3-card-text { color: #D9ECEA; }
.h3-card--innovate_or_pay .h3-card-badge { color: #0D2B34; background: var(--h3-accent-on-dark); }
.h3-card--innovate_or_pay .h3-card-cta { border-color: rgba(255, 255, 255, 0.22); }
.h3-card--innovate_or_pay .h3-card-cta .bi { background: rgba(255, 255, 255, 0.14); }
.h3-card--innovate_or_pay:hover { box-shadow: 0 20px 44px rgba(0, 86, 108, 0.36); }
.h3-card--innovate_or_pay:focus-within { outline-color: var(--h3-mint); }
[data-theme="dark"] .h3-card--innovate_or_pay { background: radial-gradient(22rem 16rem at 100% 0%, rgba(0, 174, 177, 0.3), transparent 70%), linear-gradient(160deg, #00667F 0%, #0F4650 80%); border-color: rgba(95, 214, 216, 0.45); }
.h3-card-new { margin-inline-start: auto; }
.h3-card-deadline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.875rem; color: #E6F4F3; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; padding: 0.4rem 0.6rem; margin: -0.25rem 0 1rem; }
.h3-card-deadline .bi { color: var(--h3-accent-on-dark); }
.h3-card--internal_rd_expenses { --h3-rail: var(--h3-petrol); --h3-tile: var(--h3-petrol); }
.h3-card--open_innovation_program_expenses { --h3-rail: repeating-linear-gradient(90deg, var(--h3-green) 0 18px, transparent 18px 24px); --h3-tile: var(--h3-green); --h3-tile-fg: var(--h3-deep); }
.h3-card--open_innovation_matching { --h3-rail: linear-gradient(90deg, var(--h3-mint), var(--h3-green)); --h3-tile: color-mix(in srgb, var(--h3-mint) 30%, var(--h3-surface)); --h3-tile-fg: var(--h3-deep); }
[data-theme="dark"] .h3-card--internal_rd_expenses { --h3-tile: #1B7A86; }
[data-theme="dark"] .h3-card--open_innovation_matching { --h3-tile-fg: #FFFFFF; }

/* ---------------------------------------------------------------- Innovate or Pay rules band */
.h3-rules { position: relative; overflow: hidden; background: linear-gradient(135deg, #153F3A 0%, #0E4A52 58%, #00566C 120%); color: #FFFFFF; padding-block: var(--h3-section); }
[data-theme="dark"] .h3-rules { background: linear-gradient(135deg, #0A232B 0%, #123D43 60%, #00566C 130%); }
.h3-rules-lattice { position: absolute; inset: 0; background-image: var(--h3-lattice-light); background-size: 69.28px 40px; opacity: 0.9; pointer-events: none; }
.h3-rules-grid { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.h3-rules h2 { color: #FFFFFF; font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.15; margin-block-end: 0.75rem; }
.h3-rules-intro p { color: #D3E6E4; }
.h3-rules-link { display: inline-flex; gap: 0.45rem; align-items: center; color: var(--h3-accent-on-dark); font-weight: 700; text-decoration: none; border-block-end: 2px solid transparent; transition: border-color 0.2s ease; }
.h3-rules-link:hover, .h3-rules-link:focus-visible { color: var(--h3-accent-on-dark); border-color: var(--h3-accent-on-dark); }
.h3-rules-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--h3-radius); overflow: hidden; }
.h3-rules-list > div { background: rgba(13, 43, 52, 0.55); padding: 1.25rem 1.35rem; backdrop-filter: blur(2px); }
.h3-rules-list dt { font-family: var(--font-heading); font-size: clamp(1.5rem, 2.6vw, 2.125rem); font-weight: 700; line-height: 1.1; color: var(--h3-accent-on-dark); margin-block-end: 0.35rem; }
.h3-rules-list dd { margin: 0; color: #E6F2F1; font-size: 0.95rem; line-height: 1.45; }

/* ---------------------------------------------------------------- How it works */
.h3-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--h3-gap); position: relative; }
.h3-flow::before { content: ""; position: absolute; inset-inline: 1.75rem; inset-block-start: 1.75rem; block-size: 2px; background: repeating-linear-gradient(90deg, var(--h3-line-strong) 0 8px, transparent 8px 14px); }
.h3-flow li { position: relative; }
.h3-flow-num { position: relative; z-index: 1; display: grid; place-items: center; inline-size: 3.5rem; block-size: 3.5rem; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--h3-deep); color: var(--h3-accent-on-dark); font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; margin-block-end: 1rem; transition: background-color 0.2s ease; }
.h3-flow li:hover .h3-flow-num { background: var(--h3-petrol); }
[data-theme="dark"] .h3-flow-num { background: var(--h3-mint); color: #0D2B34; }
.h3-flow h3 { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.35rem; color: var(--h3-ink); }
.h3-flow p { color: var(--h3-ink-soft); margin: 0; font-size: 0.975rem; }

/* ---------------------------------------------------------------- Trust */
.h3-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--h3-gap); }
.h3-trust-item { background: var(--h3-surface); border: 1px solid var(--h3-line); border-radius: var(--h3-radius); padding: 1.35rem; box-shadow: var(--h3-shadow); }
.h3-trust-icon { display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; border-radius: 10px; background: color-mix(in srgb, var(--h3-green) 14%, transparent); color: var(--h3-petrol); font-size: 1.3rem; margin-block-end: 0.85rem; }
[data-theme="dark"] .h3-trust-icon { color: var(--h3-accent-on-dark); }
.h3-trust-item h3 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 0.4rem; color: var(--h3-ink); }
.h3-trust-item p { color: var(--h3-ink-soft); font-size: 0.95rem; margin-block-end: 0.5rem; }
.h3-trust-item a { font-weight: 700; display: inline-flex; gap: 0.35rem; align-items: center; }

/* ---------------------------------------------------------------- News, FAQ */
.h3-news { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--h3-gap); }
.h3-news-item { background: var(--h3-surface); border: 1px solid var(--h3-line); border-radius: var(--h3-radius); padding: 1.25rem; }
.h3-faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.h3-faq-grid .h3-heading { margin-block-end: 0; }

/* ---------------------------------------------------------------- Call to action */
.h3-cta { background: var(--h3-surface); padding-block: 0 var(--h3-section); }
.h3-cta-inner { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; padding: clamp(1.5rem, 4vw, 2.75rem); border-radius: calc(var(--h3-radius) + 6px); background: linear-gradient(120deg, #00566C 0%, #153F3A 75%); color: #FFFFFF; }
[data-theme="dark"] .h3-cta-inner { background: linear-gradient(120deg, #00667F 0%, #0F3A44 75%); }
.h3-cta-inner::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 45%; background-image: var(--h3-lattice-light); background-size: 69.28px 40px; -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); pointer-events: none; }
[dir="rtl"] .h3-cta-inner::after { -webkit-mask-image: linear-gradient(270deg, transparent, #000); mask-image: linear-gradient(270deg, transparent, #000); }
.h3-cta-inner > * { position: relative; z-index: 1; }
.h3-cta h2 { color: #FFFFFF; font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 0.4rem; }
.h3-cta p { color: #D9ECEA; margin: 0; max-inline-size: 38rem; }
.h3-btn-light { background: var(--h3-mint); color: #0D2B34; border: 0; }
.h3-btn-light:hover, .h3-btn-light:focus-visible { background: #3CC5C8; color: #0D2B34; }
.h3-btn-ghost { background: transparent; color: #FFFFFF; border: 1.5px solid rgba(255, 255, 255, 0.55); }
.h3-btn-ghost:hover, .h3-btn-ghost:focus-visible { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; border-color: #FFFFFF; }
.h3-cta .h3-btn:focus-visible { outline-color: var(--h3-accent-on-dark); }

/* ---------------------------------------------------------------- Footer (all portal pages) */
.footer { position: relative; background: linear-gradient(180deg, #153F3A 0%, #10332F 100%); padding-block: 3rem 1.5rem; }
[data-theme="dark"] .footer { background: linear-gradient(180deg, #0A232B 0%, #081C23 100%); }
.footer::before { content: ""; position: absolute; inset: 0; background-image: var(--h3-lattice-light); background-size: 69.28px 40px; opacity: 0.5; -webkit-mask-image: linear-gradient(180deg, #000, transparent 60%); mask-image: linear-gradient(180deg, #000, transparent 60%); pointer-events: none; }
.footer > .container-xl { position: relative; }
.footer h2 { color: var(--h3-accent-on-dark); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; }
html[lang="ar"] .footer h2 { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.footer a { transition: color 0.2s ease; }
.footer a:hover { color: var(--h3-accent-on-dark); text-decoration: none; }
.footer .copyright { align-items: center; }
.footer-legal { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-credit { margin: 0; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.8); }

/* ---------------------------------------------------------------- Motion */
@keyframes h3-lattice-drift { from { background-position: 0 0; } to { background-position: 69.28px 40px; } }
@keyframes h3-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -12px); } }
@keyframes h3-breathe { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes h3-node-pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes h3-pulse-dot { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--h3-mint) 25%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--h3-mint) 10%, transparent); } }
@keyframes h3-rise { from { transform: translateY(12px); } to { transform: none; } }
/* Entrance is decorative only: no fill mode and no delay, so content stays visible if animations do not run. */
.h3-hero-copy { animation: h3-rise 0.7s ease; }
.h3-hero-art { animation: h3-rise 0.9s ease; }
@media (prefers-reduced-motion: reduce) {
  .h3-hero-lattice, .h3-float, .h3-glow, .h3-nodes .h3-pulse, .h3-dot, .h3-hero-copy, .h3-hero-art { animation: none !important; }
  .h3-depth { transform: none !important; transition: none !important; }
  .h3-nodes .h3-pulse { display: none; }
  .h3-card, .h3-btn, .h3-card-cta .bi, .navmenu .nav-link::after { transition: none !important; }
  .h3-card:hover, .h3-btn:hover { transform: none; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1199.98px) {
  .h3-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .h3-hero-grid { grid-template-columns: 1fr; text-align: start; }
  .h3-hero-art { inline-size: min(82%, 26rem); order: -1; margin-block-end: -0.5rem; }
  .h3-hero-lattice { -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.2) 55%, transparent 90%); mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.2) 55%, transparent 90%); }
  .h3-rules-grid, .h3-faq-grid { grid-template-columns: 1fr; }
  .h3-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .h3-flow::before { display: none; }
  .header { --header-logo-h: 45px; }
}
@media (max-width: 767.98px) {
  .h3-trust { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .h3-hero-art { inline-size: min(78%, 18rem); }
  .h3-pillars { font-size: 0.8125rem; gap: 0.35rem 0.9rem; }
  .h3-services { grid-template-columns: 1fr; }
  .h3-rules-list { grid-template-columns: 1fr; }
  .h3-flow { grid-template-columns: 1fr; }
  .h3-flow li { display: grid; grid-template-columns: 3.5rem 1fr; column-gap: 1rem; }
  .h3-flow-num { grid-row: span 2; margin: 0; }
  .h3-actions .h3-btn { flex: 1 1 100%; justify-content: center; }
  .h3-title { font-size: clamp(2.1rem, 9vw, 2.6rem); }
  html[lang="ar"] .h3-title { font-size: clamp(2.1rem, 9vw, 2.6rem); }
  .header { --header-logo-h: 40px; }
  .gov-bar { font-size: 0.8125rem; }
}

/* ---------------------------------------------------------------- Animated R&D&I hero (2026-11-07)
 * Sequence: current symbol artwork -> proposals A-H -> symbol (static/js/ui.js). Each scene holds 2.8 s and cross-fades
 * in 0.85 s with a 5 px rise and a 0.985 -> 1 scale; inside the active scene the teal route draws in, dashed links
 * drift, nodes float 3 px and the connector breathes between 0.98 and 1.02. Only the artwork moves: the stage keeps the
 * size of the symbol scene (in flow), so the text, buttons and layout never shift.
 * No JavaScript: the symbol scene only. Reduced motion: proposal A, still, no sequence. Palette: #00566C, #00AEB1,
 * #192B2A, #EAF3F2, #FFFFFF. */
.h3-hero-grid { z-index: 1; }
.h3-stage {
  position: relative;
  --hs-plane: rgba(0, 86, 108, 0.05); --hs-plane2: rgba(0, 174, 177, 0.12); --hs-edge: rgba(0, 86, 108, 0.30); --hs-edge2: rgba(0, 86, 108, 0.70);
  --hs-soft: #192B2A; --hs-strong: #00AEB1; --hs-deep: #00566C; --hs-line: rgba(0, 86, 108, 0.45); --hs-node: #00566C;
  --hs-card: #FFFFFF; --hs-cut: #F1F7F6; --hs-dot: rgba(0, 86, 108, 0.22);
}
[data-theme="dark"] .h3-stage {
  --hs-plane: rgba(234, 243, 242, 0.06); --hs-plane2: rgba(0, 174, 177, 0.12); --hs-edge: rgba(234, 243, 242, 0.30); --hs-edge2: rgba(234, 243, 242, 0.62);
  --hs-soft: #D3E6E4; --hs-line: rgba(234, 243, 242, 0.40); --hs-node: #EAF3F2; --hs-card: #123D43; --hs-cut: #0F3039; --hs-dot: rgba(234, 243, 242, 0.20);
}
.h3-scene--rdi { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; opacity: 0; }
.js .h3-scene { opacity: 0; transform: translateY(5px) scale(0.985); transform-origin: 50% 55%; transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.85s cubic-bezier(0.4, 0, 0.2, 1); }
.js .h3-scene.is-active { opacity: 1; transform: none; }
.hs-pl { fill: var(--hs-plane); stroke: var(--hs-edge); stroke-width: 1.2; }
.hs-pl2 { fill: var(--hs-plane2); stroke: var(--hs-edge); stroke-width: 1.2; }
.hs-so { fill: var(--hs-soft); }
.hs-st { fill: var(--hs-strong); }
.hs-dp { fill: var(--hs-deep); }
.hs-ol { fill: none; stroke: var(--hs-edge2); stroke-width: 1.6; }
.hs-card { fill: var(--hs-card); stroke: var(--hs-edge); stroke-width: 1.2; }
.hs-cut { fill: var(--hs-cut); }
.hs-ln { fill: none; stroke: var(--hs-line); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.hs-lnd { fill: none; stroke: var(--hs-line); stroke-width: 1.2; stroke-dasharray: 2 6; stroke-linecap: round; }
.hs-lns { fill: none; stroke: var(--hs-strong); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hs-nd { fill: var(--hs-node); }
.hs-dot { fill: var(--hs-dot); }
.hs-nd, .hs-conn { transform-box: fill-box; transform-origin: center; }
.h3-scene.is-active .hs-lns { stroke-dasharray: 1; animation: hs-draw 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1) both; }
.h3-scene.is-active .hs-lnd { animation: hs-dash 6s linear infinite; }
.h3-scene.is-active .hs-nd { animation: hs-node 3s ease-in-out infinite alternate; }
.h3-scene.is-active .hs-conn { animation: hs-conn 2.8s ease-in-out infinite alternate; }
@keyframes hs-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hs-dash { to { stroke-dashoffset: -16; } }
@keyframes hs-node { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes hs-conn { from { transform: scale(0.98); } to { transform: scale(1.02); } }

/* Pause control (WCAG 2.2.2): shown by the script only when the sequence runs. */
.h3-hero-toggle { position: absolute; inset-block-start: 0.25rem; inset-inline-end: 0.25rem; z-index: 2; display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; border-radius: 50%; border: 1px solid var(--h3-line); background: color-mix(in srgb, var(--h3-surface) 82%, transparent); color: var(--h3-ink); opacity: 0.75; transition: opacity 0.2s ease; }
.h3-hero-toggle:hover, .h3-hero-toggle:focus-visible { opacity: 1; }
.h3-hero-toggle:focus-visible { outline: 3px solid var(--h3-petrol); outline-offset: 2px; }
[data-theme="dark"] .h3-hero-toggle:focus-visible { outline-color: var(--h3-accent-on-dark); }

/* Watermark: official one-colour symbol, behind the artwork column only (logical side: follows RTL). */
.h3-watermark { position: absolute; inset-inline-end: -80px; inset-block-end: -140px; inline-size: min(46vw, 620px); pointer-events: none; z-index: 0; }
.h3-watermark img { display: block; inline-size: 100%; block-size: auto; }
.h3-watermark-light { opacity: 0.065; }
.h3-watermark-dark { display: none !important; opacity: 0.055; }
[data-theme="dark"] .h3-watermark-light { display: none !important; }
[data-theme="dark"] .h3-watermark-dark { display: block !important; }
@media (max-width: 991.98px) {
  .h3-watermark { inline-size: 340px; inset-block-start: 30px; inset-block-end: auto; inset-inline-end: -70px; }
}

@media (prefers-reduced-motion: reduce) {
  .h3-scene, .js .h3-scene { transition: none !important; transform: none !important; }
  .h3-scene *, .h3-scene { animation: none !important; }
  .h3-scene--logo, .js .h3-scene--logo.is-active { opacity: 0 !important; }
  .h3-scene[data-scene="a"], .js .h3-scene[data-scene="a"] { opacity: 1 !important; }
  .h3-scene .hs-lns { stroke-dasharray: none !important; }
  .h3-hero-toggle { display: none !important; }
}
/* Paused by the visitor: the active scene stays, its inner motion stops too. */
.h3-stage.is-paused .h3-scene * { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- Hero refinement (2026-11-07): asymmetric breathing
 * Chosen modules breathe independently while their scene is active: grow (1 -> 1.06), recede (1 -> 0.94), gentle grow
 * (1.035 with a 3 px lift), vertical drift (7 px) or horizontal drift (6 px). Durations differ (5.4-8.6 s) and negative
 * delays (d1-d5) desynchronise them, so elements never move together. Validation points light up in turn (v1-v4) when a
 * scene appears; their resting state is lit, which is also the reduced-motion state. Document-like cards use the card
 * surface. Everything stops with prefers-reduced-motion (rules above) and pauses with the hero pause button. */
.hs-mg, .hs-mr, .hs-mgs, .hs-my, .hs-mx, .hs-vp { transform-box: fill-box; transform-origin: center; }
.h3-scene.is-active .hs-mg { animation: hs-grow 6.8s ease-in-out infinite; }
.h3-scene.is-active .hs-mr { animation: hs-recede 7.6s ease-in-out infinite; }
.h3-scene.is-active .hs-mgs { animation: hs-grow-soft 5.4s ease-in-out infinite; }
.h3-scene.is-active .hs-my { animation: hs-drift-y 6.2s ease-in-out infinite; }
.h3-scene.is-active .hs-mx { animation: hs-drift-x 8.6s ease-in-out infinite; }
.h3-scene.is-active .hs-d1 { animation-delay: -1.1s; }
.h3-scene.is-active .hs-d2 { animation-delay: -2.4s; }
.h3-scene.is-active .hs-d3 { animation-delay: -3.6s; }
.h3-scene.is-active .hs-d4 { animation-delay: -4.9s; }
.h3-scene.is-active .hs-d5 { animation-delay: -6.1s; }
@keyframes hs-grow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes hs-recede { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.94); } }
@keyframes hs-grow-soft { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.035); } }
@keyframes hs-drift-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hs-drift-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.hs-vp { fill: var(--hs-strong); stroke: var(--hs-cut); stroke-width: 2; }
.h3-scene.is-active .hs-vp { animation: hs-validate 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }
.h3-scene.is-active .hs-v1 { animation-delay: 0.5s; }
.h3-scene.is-active .hs-v2 { animation-delay: 0.95s; }
.h3-scene.is-active .hs-v3 { animation-delay: 1.4s; }
.h3-scene.is-active .hs-v4 { animation-delay: 1.85s; }
@keyframes hs-validate { from { fill: var(--hs-cut); stroke: var(--hs-edge); transform: scale(0.7); } to { fill: var(--hs-strong); stroke: var(--hs-cut); transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .h3-scene .hs-vp, .h3-scene .hs-mg, .h3-scene .hs-mr, .h3-scene .hs-mgs, .h3-scene .hs-my, .h3-scene .hs-mx { animation: none !important; transform: none !important; }
}
