/* Dorcas — the site's frame and motion system (shared with the blog): tokens, buttons, top bar, portal, cursor,
   footer, reveals, maintenance page. Page layouts live in site.css. */

:root {
  --void: #0A0814; --night: #110E1F; --night-2: #19142B; --night-3: #231B3B;
  --pink: #FF4A7A; --violet: #7820CE; --coral: #FF6B6B; --shine: #F7647A; --lilac: #B79BFF;
  --teal: #6FADA7; --neon: #7FF5E6; --mist: #C9C4DA; --dim: #8F88A8; --paper: #F6F3FF;
  --line: rgba(183, 155, 255, .13); --line-2: rgba(183, 155, 255, .28);
  --glass: rgba(25, 20, 43, .55);
  --grad: linear-gradient(270deg, #FF4A7A, #7820CE, #FF6B6B, #FF4A7A);
  --grad-text: linear-gradient(100deg, #FF4A7A 0%, #B79BFF 45%, #7FF5E6 100%);
  --ar: Tajawal, "Segoe UI", Tahoma, sans-serif;
  --display: "Noto Kufi Arabic", Tajawal, sans-serif;
  --latin: Unbounded, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1); --ease-io: cubic-bezier(.76, 0, .24, 1);
  --max: 1320px; --pad: clamp(20px, 4vw, 56px);
  --page-bg: var(--void);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--void); }
html.js-smooth { scroll-behavior: auto; }
body {
  margin: 0; background: var(--page-bg); color: var(--mist); transition: background-color 1.2s var(--ease);
  font: 400 1.0625rem/1.85 var(--ar); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
/* Film grain and a faint HUD grid over everything. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 88px 88px; opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
}
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 900; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--paper); line-height: 1.3; margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 0; }
.latin { font-family: var(--latin); direction: ltr; unicode-bidi: isolate; }
.sr, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; inset-inline-start: 12px; top: 12px; z-index: 3000; background: var(--paper); color: var(--night); padding: 8px 14px; border-radius: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.grad-text { background: var(--grad-text); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: grad 8s ease infinite; }
.gem { display: inline-block; width: .42em; height: .42em; transform: rotate(45deg); background: var(--grad); background-size: 300% 100%; animation: grad 6s ease infinite; flex: none; }

/* ------------------------------------------------------------------ buttons (moving gradient, like the old site) */
@keyframes grad { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn {
  --h: 54px; position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: var(--h); padding: 0 30px; border: 0; border-radius: 0; overflow: hidden; cursor: pointer;
  font: 700 1rem/1 var(--ar); color: #fff; white-space: nowrap; transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.btn span { position: relative; z-index: 2; }
.btn-sm { --h: 44px; padding: 0 20px; font-size: .95rem; border-radius: 0; }
.btn-lg { --h: 64px; padding: 0 40px; font-size: 1.12rem; border-radius: 0; }
.btn-grad { background: var(--grad); background-size: 400% 100%; animation: grad 8s ease infinite; box-shadow: 0 12px 40px -14px rgba(255, 74, 122, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-grad::before { /* the shine that crosses on hover */
  content: ""; position: absolute; inset: 0; z-index: 1; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transition: transform .9s var(--ease);
}
.btn-grad::after { content: ""; position: absolute; inset: 1px; z-index: 0; border-radius: inherit; border: 1px solid rgba(255, 255, 255, .18); }
.btn-grad:hover { box-shadow: 0 18px 60px -12px rgba(255, 74, 122, .95), 0 0 0 1px rgba(255, 255, 255, .2) inset; animation-duration: 2.5s; }
.btn-grad:hover::before { transform: translateX(120%) skewX(-20deg); }
.btn-ghost {
  color: var(--paper); border: 1.5px solid transparent;
  background: linear-gradient(var(--void), var(--void)) padding-box, var(--grad) border-box; background-size: 100% 100%, 400% 100%;
  animation: grad-border 8s ease infinite;
}
@keyframes grad-border { 0%, 100% { background-position: 0 0, 0% 50%; } 50% { background-position: 0 0, 100% 50%; } }
.btn-ghost::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--grad); background-size: 400% 100%; opacity: 0; transition: opacity .45s var(--ease); animation: grad 8s ease infinite; }
.btn-ghost:hover::before { opacity: .9; }

.more { position: relative; display: inline-flex; align-items: center; gap: .5em; font-weight: 700; color: var(--paper); padding-bottom: 4px; }
.more::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1.5px; background: var(--grad); background-size: 300% 100%; animation: grad 6s ease infinite; transform-origin: right; transition: transform .5s var(--ease); }
.more:hover::after { transform: scaleX(.3); }
.more .arr { display: inline-block; transition: transform .4s var(--ease); }
.more:hover .arr { transform: translateX(-6px); }

/* ------------------------------------------------------------------ top bar: logo always on the left */
.mast { position: fixed; inset: 0 0 auto; z-index: 60; padding: 16px var(--pad) 0; transition: transform .55s var(--ease); pointer-events: none; }
.mast-in {
  direction: ltr; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  max-width: 1480px; margin-inline: auto; padding: 8px 10px 8px 14px; border-radius: 0; border: 1px solid transparent; pointer-events: auto;
  transition: background-color .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s;
}
.mast.is-solid .mast-in { background: rgba(10, 8, 20, .62); border-color: var(--line); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); }
.mast.is-hidden { transform: translateY(-130%); }
.mast-logo { display: block; width: 124px; justify-self: start; }
.mast-logo img { width: 100%; height: auto; transition: filter .4s; }
.mast-logo:hover img { filter: drop-shadow(0 0 14px rgba(255, 74, 122, .6)); }
.mast-nav { direction: rtl; display: flex; justify-content: center; align-items: center; gap: 2px; }
.mast-nav > a { position: relative; padding: 10px 14px; border-radius: 0; color: var(--mist); font-weight: 500; font-size: .98rem; transition: color .3s, background-color .3s; }
.mast-nav > a:hover { color: var(--paper); background: rgba(183, 155, 255, .07); }
.mast-nav > a[aria-current="page"] { color: var(--paper); }
.mast-nav > a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 6px; margin-left: -3px; transform: rotate(45deg); background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.mast-menu-extra { display: none; }
.mast-act { display: flex; align-items: center; gap: 10px; justify-self: end; }
.menu-btn { display: none; position: relative; width: 46px; height: 46px; border-radius: 0; border: 1px solid var(--line-2); background: rgba(25, 20, 43, .6); cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.menu-btn span:not(.sr) { width: 20px; height: 2px; border-radius: 0; background: var(--paper); transition: transform .45s var(--ease); }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Glitch on hover (nav, footer mail): two coloured copies of the text jitter for a moment. */
[data-text] { position: relative; }
[data-text]::before, [data-text]::after { content: attr(data-text); position: absolute; inset: 0; padding: inherit; opacity: 0; pointer-events: none; }
[data-text]::before { color: var(--pink); }
[data-text]::after { color: var(--neon); }
[data-text]:hover::before { animation: glitch-a .45s steps(2) 1; }
[data-text]:hover::after { animation: glitch-b .45s steps(2) 1; }
@keyframes glitch-a { 0% { opacity: .9; transform: translate(-3px, 1px); clip-path: inset(0 0 60% 0); } 50% { transform: translate(2px, -1px); clip-path: inset(40% 0 20% 0); } 100% { opacity: 0; transform: none; } }
@keyframes glitch-b { 0% { opacity: .9; transform: translate(3px, -1px); clip-path: inset(55% 0 0 0); } 50% { transform: translate(-2px, 1px); clip-path: inset(10% 0 55% 0); } 100% { opacity: 0; transform: none; } }

@media (max-width: 1080px) {
  .mast-in { padding: 8px 8px 8px 12px; }
  .menu-btn { display: inline-flex; }
  .mast-nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: stretch; justify-content: center; gap: 0;
    padding: 110px var(--pad) 40px; background: radial-gradient(120% 80% at 100% 0%, rgba(120, 32, 206, .35), transparent 60%), var(--void);
    clip-path: circle(0 at calc(100% - 50px) 50px); visibility: hidden; transition: clip-path .8s var(--ease-io), visibility 0s .8s; overflow-y: auto;
  }
  .mast.is-open .mast-nav { clip-path: circle(150% at calc(100% - 50px) 50px); visibility: visible; transition: clip-path .8s var(--ease-io), visibility 0s; }
  .mast.is-open .mast-in { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mast-nav > a { font: 800 clamp(1.8rem, 7vw, 2.6rem)/1.25 var(--display); color: var(--paper); padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(30px); transition: opacity .6s var(--ease), transform .6s var(--ease), color .3s; }
  .mast-nav > a:hover { background: none; color: var(--pink); }
  .mast-nav > a[aria-current="page"]::after { left: auto; right: auto; inset-inline-end: 0; top: 50%; bottom: auto; margin: -3px 0 0; }
  .mast.is-open .mast-nav > a { opacity: 1; transform: none; }
  .mast-nav > a:nth-child(2) { transition-delay: .05s; } .mast-nav > a:nth-child(3) { transition-delay: .1s; } .mast-nav > a:nth-child(4) { transition-delay: .15s; }
  .mast-nav > a:nth-child(5) { transition-delay: .2s; } .mast-nav > a:nth-child(6) { transition-delay: .25s; }
  .mast-menu-extra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; opacity: 0; transition: opacity .6s .3s; }
  .mast.is-open .mast-menu-extra { opacity: 1; }
  .mast-menu-extra .mail { color: var(--paper); font-size: .95rem; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 560px) { .mast-act .btn { display: none; } .mast-logo { width: 112px; } }

/* ------------------------------------------------------------------ the portal (page load and page changes) */
.portal {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(70% 70% at 50% 50%, #1D1036 0%, var(--void) 70%);
  clip-path: circle(150% at var(--px, 50%) var(--py, 50%));
  animation: portal-fallback .6s 4.5s forwards; /* if scripts never run, the page still shows */
}
@keyframes portal-fallback { to { opacity: 0; visibility: hidden; } }
.portal.is-js { animation: none; }
.portal.is-closed { clip-path: circle(0% at var(--px, 50%) var(--py, 50%)); visibility: hidden; }
.portal.is-anim { transition: clip-path .85s var(--ease-io), visibility 0s .85s; }
.portal.is-anim:not(.is-closed) { transition: clip-path .7s var(--ease-io), visibility 0s; }
.portal-warp { position: absolute; inset: 0; width: 100%; height: 100%; }
.portal-core { position: relative; display: grid; justify-items: center; gap: 16px; transition: transform .8s var(--ease-io), opacity .5s; }
.portal.is-closed .portal-core { transform: scale(.7); opacity: 0; }
.portal-logo { position: relative; display: block; width: min(62vw, 340px); }
.portal-logo img { width: 100%; height: auto; filter: drop-shadow(0 0 28px rgba(255, 74, 122, .45)); }
.portal-logo::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%) no-repeat; background-size: 250% 100%;
  -webkit-mask: url("img/logo-h.svg") center / contain no-repeat; mask: url("img/logo-h.svg") center / contain no-repeat;
  animation: shine 1.8s .15s var(--ease) infinite;
}
@keyframes shine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -30% 0; } }
.portal-tag { font-size: clamp(.7rem, 1.4vw, .85rem); letter-spacing: .32em; color: var(--lilac); text-transform: uppercase; min-height: 1.4em; }
.portal-bar { position: relative; width: 150px; height: 2px; background: rgba(183, 155, 255, .18); border-radius: 0; overflow: hidden; }
.portal-bar i { position: absolute; inset: 0; background: var(--grad); background-size: 300% 100%; transform-origin: left; animation: bar 1.4s var(--ease) infinite; }
@keyframes bar { 0% { transform: scaleX(0); } 70% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* ------------------------------------------------------------------ cursor (mouse only) */
.cursor { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; }
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; border-radius: 50%; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; mix-blend-mode: difference; }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(255, 255, 255, .55); mix-blend-mode: difference;
  display: grid; place-items: center; transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background-color .45s, border-color .45s;
}
.cursor-ring b { font: 700 .78rem/1 var(--ar); color: #fff; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.cursor.is-link .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: #fff; border-color: #fff; }
.cursor.is-label .cursor-ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--grad); background-size: 300% 100%; animation: grad 4s infinite; border-color: transparent; mix-blend-mode: normal; }
.cursor.is-label .cursor-ring b { opacity: 1; }
.cursor.is-label .cursor-dot, .cursor.is-hidden { opacity: 0; }
.cursor.is-down .cursor-ring { transform-origin: center; scale: .8; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor [role="tab"], html.has-cursor label { cursor: none; }

/* ------------------------------------------------------------------ reveals (only once scripts run: html.js) */
html.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em 0 .18em; margin: -.14em 0 -.18em; }
.w > span { display: inline-block; }
html.js [data-split] .w > span { transform: translateY(115%) rotate(4deg); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0s)); }
html.js [data-split].is-in .w > span { transform: none; }

/* Image reveal (site.js / chrome.js RevealImage): opens through a slanted slit while the picture "resolves". */
.rimg { position: relative; display: block; overflow: hidden; isolation: isolate; }
.rimg-c { position: relative; display: block; width: 100%; height: 100%; }
.rimg img { width: 100%; height: 100%; object-fit: cover; }
html.js .rimg-c { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); transition: clip-path 1.15s var(--ease-io); }
html.js .rimg.is-in .rimg-c { clip-path: polygon(0 -25%, 100% 0, 100% 100%, 0 100%); }
html.js .rimg.is-out .rimg-c { clip-path: polygon(0 0, 100% 0, 100% 0, 0 -25%); transition-duration: .75s; }
html.js .rimg img { transform: scale(1.2); filter: saturate(1.8) hue-rotate(-25deg) brightness(1.2); transition: transform 1.7s var(--ease), filter 1.2s var(--ease); }
html.js .rimg.is-in img { transform: none; filter: none; }
.rimg-px { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; image-rendering: pixelated; }
.rimg::after { /* scan bar */
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 22%; z-index: 3; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(127, 245, 230, .35) 45%, rgba(255, 74, 122, .5) 50%, transparent);
  mix-blend-mode: screen; transform: translateY(-100%);
}
.rimg.is-scan::after { animation: scan .95s var(--ease-io) 1; }
@keyframes scan { 0% { opacity: 1; transform: translateY(-100%); } 100% { opacity: 0; transform: translateY(560%); } }

/* Spotlight that follows the mouse on panels (data-spot). */
[data-spot] { position: relative; }
[data-spot]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(183, 155, 255, .16), transparent 60%);
}
[data-spot]:hover::before { opacity: 1; }

/* HUD corner brackets (data-hud) */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--neon); opacity: .7; pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ------------------------------------------------------------------ marquee */
.marquee { overflow: hidden; direction: ltr; }
.marquee-track { display: flex; align-items: center; width: max-content; will-change: transform; }

/* ------------------------------------------------------------------ footer: logo on the left */
.foot { position: relative; margin-top: clamp(70px, 10vw, 140px); border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 8, 20, 0), rgba(120, 32, 206, .1)); overflow: hidden; }
.foot-band { padding: clamp(18px, 3vw, 34px) 0; border-bottom: 1px solid var(--line); }
.foot-band .marquee-track { gap: clamp(24px, 4vw, 56px); padding-inline-end: clamp(24px, 4vw, 56px); }
.foot-band span { font: 800 clamp(2.6rem, 8.5vw, 8rem)/1 var(--latin); color: transparent; -webkit-text-stroke: 1px rgba(183, 155, 255, .45); text-transform: uppercase; white-space: nowrap; transition: color .5s; }
.foot-band:hover span { color: rgba(255, 74, 122, .18); }
.foot-band .gem { width: clamp(16px, 2vw, 28px); height: clamp(16px, 2vw, 28px); }
.foot-grid { direction: ltr; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: clamp(28px, 4vw, 60px); max-width: var(--max); margin-inline: auto; padding: clamp(44px, 6vw, 80px) var(--pad); }
.foot-grid > nav { direction: rtl; display: flex; flex-direction: column; gap: 8px; }
.foot-grid h2 { font: 800 .95rem/1.3 var(--display); width: fit-content; margin-bottom: 10px; background: linear-gradient(90deg, #FF4A7A, #FF6B6B 45%, #B79BFF); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: grad 7s ease infinite; }
.foot-grid nav a { color: var(--mist); font-size: .97rem; width: fit-content; transition: color .3s, transform .4s var(--ease); }
.foot-grid nav a:hover { color: var(--paper); transform: translateX(-4px); }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.foot-brand img { width: 168px; }
.foot-brand p { direction: rtl; text-align: left; max-width: 30ch; color: var(--dim); margin: 0; }
.foot-mail { font-size: clamp(1rem, 1.6vw, 1.25rem); color: var(--paper); }
.foot-phone { color: var(--mist); }
.foot-base { direction: ltr; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; max-width: var(--max); margin-inline: auto; padding: 22px var(--pad) 30px; border-top: 1px solid var(--line); }
.foot-base p { margin: 0; direction: rtl; color: var(--dim); font-size: .9rem; }
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 0; border: 1px solid var(--line-2); background: rgba(25, 20, 43, .4); transition: border-color .3s, background-color .3s, box-shadow .3s; }
.social a:hover { border-color: var(--pink); background: rgba(255, 74, 122, .12); box-shadow: 0 0 22px -4px rgba(255, 74, 122, .7); }
.social svg { width: 18px; height: 18px; fill: var(--paper); }
.to-top { width: 46px; height: 46px; border-radius: 0; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; transition: background-color .3s; }
.to-top:hover { background: rgba(183, 155, 255, .12); }
.to-top svg { width: 20px; height: 20px; fill: var(--paper); }
@media (max-width: 900px) {
  .foot-grid { direction: rtl; grid-template-columns: 1fr 1fr; gap: 30px 20px; }
  .foot-brand { grid-column: 1 / -1; direction: ltr; }
  .foot-grid > nav:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; align-content: start; }
  .foot-grid > nav:last-child h2 { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .foot-grid nav a { font-size: .92rem; } .foot-base { justify-content: center; } }

.maint-flag { position: fixed; z-index: 1500; inset: auto 12px 12px; margin: 0; padding: 10px 16px; border-radius: 0; background: #3a2a00; color: #ffd98a; font-size: .9rem; border: 1px solid #806000; text-align: center; }

/* ------------------------------------------------------------------ maintenance page + game */
.maint { min-height: 100vh; }
.maint-in { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 40px var(--pad); max-width: 900px; margin: auto; }
.maint-logo { width: 160px; }
.maint-title { font-size: clamp(1.8rem, 4.5vw, 3rem); }
.maint-msg { max-width: 56ch; margin: 0; }
.game { position: relative; width: 100%; max-width: 720px; aspect-ratio: 720 / 420; border-radius: 0; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(80% 90% at 50% 0%, #2A1550, #0C0918 70%); box-shadow: 0 30px 80px -30px rgba(120, 32, 206, .7); }
.game-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.game-hud { position: absolute; inset: 12px 16px auto; display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--mist); pointer-events: none; }
.game-hud b { color: var(--paper); font-family: var(--latin); }
.game-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(10, 8, 20, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.game-start[hidden] { display: none; }
.game-start p { margin: 0; }
.game-keys { color: var(--dim); font-size: .9rem; margin-bottom: 10px !important; }
.maint-reach { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.maint-reach > a { color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  body::after { display: none; }
}

/* ------------------------------------------------------------------ random glitches (chrome.js adds .is-gx for ~0.6 s) */
.gx-btn { animation: gx-btn .5s steps(1) both; }
.gx-btn span { animation: gx-split .5s steps(1) both; }
.gx-btn.gx-alt { animation-name: gx-btn-b; }
@keyframes gx-btn {
  0% { transform: none; filter: none; }
  12% { transform: translate(-3px, 1px) skewX(-8deg); filter: hue-rotate(70deg) saturate(1.6); clip-path: inset(0 0 45% 0); }
  24% { transform: translate(4px, 0); clip-path: inset(55% 0 0 0); filter: hue-rotate(-50deg); }
  36% { transform: none; clip-path: none; filter: brightness(1.6); }
  52% { transform: translate(-2px, -1px) skewX(6deg); clip-path: inset(20% 0 30% 0); filter: invert(.12) hue-rotate(160deg); }
  66% { transform: translate(2px, 0); clip-path: none; filter: none; }
  100% { transform: none; filter: none; clip-path: none; }
}
@keyframes gx-btn-b {
  0% { transform: none; }
  15% { transform: scaleX(1.04) translateX(3px); filter: contrast(1.6) hue-rotate(110deg); clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%, 0 60%, 100% 60%, 100% 100%, 0 100%); }
  32% { transform: translateX(-4px); filter: none; clip-path: polygon(0 10%, 100% 10%, 100% 100%, 0 100%); }
  48% { transform: none; filter: brightness(1.8) saturate(0); clip-path: none; }
  60% { filter: none; }
  100% { transform: none; filter: none; clip-path: none; }
}
@keyframes gx-split {
  0%, 100% { text-shadow: none; transform: none; }
  10% { text-shadow: 3px 0 #7FF5E6, -3px 0 #FF4A7A; transform: translateX(2px); }
  30% { text-shadow: -4px 0 #7FF5E6, 4px 0 #FF4A7A; transform: translateX(-3px); }
  55% { text-shadow: 2px 1px #7FF5E6, -2px -1px #B79BFF; transform: none; }
  75% { text-shadow: none; }
}
.gx-card { animation: gx-card .62s steps(1) both; }
.gx-card.gx-alt { animation-name: gx-card-b; }
@keyframes gx-card {
  0% { transform: none; }
  8% { transform: translateX(-6px) skewX(-3deg); clip-path: inset(0 0 62% 0); filter: hue-rotate(60deg) saturate(1.5); box-shadow: 0 0 0 1px #7FF5E6, 0 0 30px -6px #7FF5E6; }
  18% { transform: translateX(7px); clip-path: inset(48% 0 12% 0); filter: hue-rotate(-40deg); }
  28% { transform: none; clip-path: none; filter: brightness(1.35); box-shadow: 0 0 0 1px #FF4A7A, 0 0 30px -6px #FF4A7A; }
  40% { transform: translateX(-3px); clip-path: inset(12% 0 70% 0); filter: none; }
  52% { transform: none; clip-path: none; box-shadow: none; }
  100% { transform: none; clip-path: none; filter: none; }
}
@keyframes gx-card-b {
  0% { opacity: 1; }
  10% { opacity: .55; filter: blur(.6px) contrast(1.8) hue-rotate(120deg); transform: translateY(2px); }
  20% { opacity: 1; filter: none; transform: none; clip-path: polygon(0 0, 100% 0, 100% 20%, 0 20%, 0 26%, 100% 26%, 100% 100%, 0 100%); }
  34% { clip-path: polygon(0 0, 100% 0, 100% 64%, 0 64%, 0 70%, 100% 70%, 100% 100%, 0 100%); transform: translateX(4px); }
  46% { clip-path: none; transform: none; filter: brightness(1.4) saturate(1.6); }
  60% { filter: none; }
  100% { opacity: 1; filter: none; transform: none; clip-path: none; }
}
.gx-img img, .gx-img canvas, .gx-img svg { animation: gx-img .64s steps(1) both; }
.gx-img.gx-alt img, .gx-img.gx-alt svg { animation-name: gx-img-b; }
@keyframes gx-img {
  0% { filter: none; transform: none; }
  8% { filter: drop-shadow(5px 0 0 rgba(255, 40, 90, .8)) drop-shadow(-5px 0 0 rgba(60, 240, 255, .8)); transform: translateX(-4px); clip-path: inset(0 0 58% 0); }
  20% { filter: drop-shadow(-6px 0 0 rgba(255, 40, 90, .8)) drop-shadow(6px 0 0 rgba(60, 240, 255, .8)) hue-rotate(40deg); transform: translateX(5px); clip-path: inset(40% 0 22% 0); }
  32% { filter: saturate(2.4) hue-rotate(-60deg); transform: none; clip-path: none; }
  44% { filter: drop-shadow(3px 0 0 rgba(255, 40, 90, .7)) drop-shadow(-3px 0 0 rgba(60, 240, 255, .7)); clip-path: inset(70% 0 6% 0); transform: translateX(-3px); }
  58% { filter: none; clip-path: none; transform: none; }
  100% { filter: none; transform: none; clip-path: none; }
}
@keyframes gx-img-b {
  0% { filter: none; }
  12% { filter: invert(1) hue-rotate(180deg); transform: scale(1.02); }
  20% { filter: none; transform: none; clip-path: polygon(0 0, 100% 0, 100% 34%, 0 34%, 0 42%, 100% 42%, 100% 100%, 0 100%); }
  34% { transform: translateX(6px); clip-path: polygon(0 0, 100% 0, 100% 74%, 0 74%, 0 80%, 100% 80%, 100% 100%, 0 100%); filter: grayscale(1) contrast(1.8); }
  48% { transform: none; clip-path: none; filter: none; }
  100% { filter: none; transform: none; clip-path: none; }
}
@media (prefers-reduced-motion: reduce) { .is-gx, .is-gx * { animation: none !important; } }
