:root {
  --bg: #050912;
  --blue: #0a72ff;
  --blue-2: #3d9bff;
  --cyan: #33d6ff;
  --text: #eef2fb;
  --text-2: #a9b4cc;
  --line: rgba(255, 255, 255, 0.12);
  --pill-bg: rgba(5, 9, 18, 0.6);
  --pill-bg-hover: rgba(255, 255, 255, 0.14);
  --foot-bg: rgba(5, 9, 18, 0.72);
  --overlay-1: rgba(255, 255, 255, 0.05);
  --overlay-2: rgba(255, 255, 255, 0.03);
  --seam-shadow: rgba(0, 0, 0, 0.55);
  --seam-ring: rgba(255, 255, 255, 0.08);
  --link-hover: #fff;
  --seam-line-color: rgba(255, 255, 255, 0.28);
  --h2-store-to: #a6ccff;
  --h2-projects-to: #a8efff;
  --store-grad: radial-gradient(1200px 800px at 20% 20%, #0b2a66 0%, #071633 45%, #050b1d 100%);
  --projects-grad: radial-gradient(1200px 800px at 80% 20%, #062f4a 0%, #07172e 45%, #050b1d 100%);
  --store-overlay: radial-gradient(closest-side at 50% 50%, rgba(5, 9, 20, 0.78), rgba(5, 9, 20, 0.15));
  --projects-overlay: radial-gradient(closest-side at 50% 50%, rgba(5, 12, 24, 0.75), rgba(5, 12, 24, 0.1));
  --pcb-bg: #050b1d;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme — same navy/blue brand hue, on white instead of near-black. */
:root[data-theme='light'] {
  --bg: #f5f8fd;
  --text: #0b1830;
  --text-2: #51597a;
  --line: rgba(10, 24, 48, 0.14);
  --pill-bg: rgba(255, 255, 255, 0.75);
  --pill-bg-hover: rgba(10, 24, 48, 0.08);
  --foot-bg: rgba(255, 255, 255, 0.85);
  --overlay-1: rgba(10, 24, 48, 0.05);
  --overlay-2: rgba(10, 24, 48, 0.04);
  --seam-shadow: rgba(10, 24, 48, 0.18);
  --seam-ring: rgba(10, 24, 48, 0.08);
  --link-hover: #0b1830;
  --h2-store-to: #2f6fe0;
  --h2-projects-to: #0f8fae;
  --seam-line-color: rgba(10, 24, 48, 0.22);
  --store-grad: radial-gradient(1200px 800px at 20% 20%, #cfe2ff 0%, #eaf2ff 45%, #f5f8fd 100%);
  --projects-grad: radial-gradient(1200px 800px at 80% 20%, #cdf1ff 0%, #e9f8ff 45%, #f5f8fd 100%);
  --store-overlay: radial-gradient(closest-side at 50% 50%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
  --projects-overlay: radial-gradient(closest-side at 50% 50%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
  --pcb-bg: #f5f8fd;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; overflow: hidden; }
[lang='ar'] body, [lang='ar'] button { font-family: 'Cairo', var(--font-body); }
[lang='ar'] h2, [lang='ar'] .cta { font-family: 'Cairo', var(--font-display); letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: -6px; }
.ic-svg { display: inline-block; flex: none; vertical-align: -0.16em; }

/* Split ---------------------------------------------------------------- */
.split { position: relative; display: flex; height: 100svh; width: 100%; }
.half { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 4vw, 4rem); transition: flex-grow 0.7s var(--ease); isolation: isolate; }
.store { padding-inline-end: clamp(3.5rem, 8vw, 7rem); background: var(--store-grad); }
.projects { padding-inline-start: clamp(3.5rem, 8vw, 7rem); background: var(--projects-grad); }
@media (hover: hover) and (min-width: 821px) {
  .split:hover .half { flex-grow: 0.82; }
  .split .half:hover { flex-grow: 1.28; }
}
.glow { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.store .glow { background: radial-gradient(600px 400px at 50% 55%, rgba(10, 114, 255, 0.35), transparent 70%); }
.projects .glow { background: radial-gradient(600px 400px at 50% 55%, rgba(51, 214, 255, 0.3), transparent 70%); }
.half:hover .glow, .half:focus-visible .glow { opacity: 1; }

/* Content --------------------------------------------------------------- */
.content { position: relative; z-index: 2; text-align: center; max-width: 30rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; animation: rise 0.9s var(--ease) both; }
.projects .content { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--overlay-1); backdrop-filter: blur(8px); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
[lang='ar'] .badge { letter-spacing: 0; font-family: 'Cairo', var(--font-body); font-size: 0.85rem; }
.store .badge .ic-svg { color: var(--blue-2); } .projects .badge .ic-svg { color: var(--cyan); }
h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3.8rem); line-height: 1.05; letter-spacing: -0.03em; }
[lang='ar'] h2 { line-height: 1.3; }
.store h2 { background: linear-gradient(120deg, var(--text) 30%, var(--h2-store-to)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.projects h2 { background: linear-gradient(120deg, var(--text) 30%, var(--h2-projects-to)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.content p { margin: 0; color: var(--text-2); font-size: clamp(0.95rem, 1.25vw, 1.1rem); line-height: 1.6; max-width: 26rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.tags li { padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); font-size: 0.75rem; color: var(--text-2); background: var(--overlay-2); }
.cta { display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 0.4rem; padding: 0.95rem 1.7rem; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #fff; transition: transform 0.35s var(--ease), box-shadow 0.35s, gap 0.35s var(--ease); }
.store .cta { background: linear-gradient(135deg, #1a82ff, #0a5be0); box-shadow: 0 14px 40px rgba(10, 114, 255, 0.45); }
.projects .cta { background: linear-gradient(135deg, #21c6f3, #0a86d8); box-shadow: 0 14px 40px rgba(33, 198, 243, 0.35); }
.half:hover .cta, .half:focus-visible .cta { transform: translateY(-3px); gap: 1rem; }
.store:hover .cta { box-shadow: 0 18px 50px rgba(10, 114, 255, 0.65); }
.projects:hover .cta { box-shadow: 0 18px 50px rgba(33, 198, 243, 0.55); }
[dir='rtl'] .arrow { transform: scaleX(-1); }

/* Seam + logo ------------------------------------------------------------ */
.seam { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.seam-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(transparent, var(--seam-line-color) 20%, var(--seam-line-color) 80%, transparent); }
.seam-logo { --logo: clamp(76px, 8vw, 104px); position: absolute; top: 50%; left: 50%; width: var(--logo); height: var(--logo); transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 0 0 8px var(--seam-ring), 0 20px 60px var(--seam-shadow); animation: pop 0.9s 0.3s var(--ease) both; }
.seam-logo img { height: calc(var(--logo) * 0.58); width: auto; display: block; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } }

/* Language + footer -------------------------------------------------------- */
.topbar { position: fixed; top: max(1rem, env(safe-area-inset-top)); inset-inline-end: 1rem; z-index: 20; display: flex; align-items: center; gap: 0.5rem; }
.lang { padding: 0.5rem 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: var(--pill-bg); backdrop-filter: blur(10px); font-weight: 600; font-size: 0.85rem; transition: background 0.2s; }
.lang:hover { background: var(--pill-bg-hover); }
.theme-toggle { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--pill-bg); backdrop-filter: blur(10px); transition: background 0.2s; }
.theme-toggle:hover { background: var(--pill-bg-hover); }
.foot { position: fixed; z-index: 20; bottom: max(0.9rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--foot-bg); backdrop-filter: blur(12px); font-size: 0.8rem; color: var(--text-2); white-space: nowrap; }
.foot img { height: 26px; width: auto; }
.foot a:hover { color: var(--link-hover); }
.foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-2); opacity: 0.6; }

/* Art: store (PCB) ------------------------------------------------------------ */
.art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.art-pcb .trace { fill: none; stroke: #3d9bff; stroke-opacity: 0.32; stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 6 14; animation: flow linear infinite; }
.art-pcb .trace.solid { stroke-dasharray: none; stroke-opacity: 0.16; }
.art-pcb .pad { fill: var(--pcb-bg); stroke: #3d9bff; stroke-opacity: 0.6; stroke-width: 1.6; }
.art-pcb .chip { fill: rgba(10, 114, 255, 0.08); stroke: #3d9bff; stroke-opacity: 0.4; stroke-width: 1.4; }
@keyframes flow { to { stroke-dashoffset: -200; } }
.store::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--store-overlay); pointer-events: none; }

/* Art: projects (world) ------------------------------------------------------- */
.art-world { perspective: 900px; overflow: hidden; }
.floor { position: absolute; left: -30%; right: -30%; bottom: -25%; height: 85%; transform-origin: 50% 100%; transform: rotateX(62deg); background-image: linear-gradient(rgba(51, 214, 255, 0.28) 1px, transparent 1px), linear-gradient(90deg, rgba(51, 214, 255, 0.28) 1px, transparent 1px); background-size: 64px 64px; animation: grid 6s linear infinite; mask-image: linear-gradient(transparent 0%, #000 45%); -webkit-mask-image: linear-gradient(transparent 0%, #000 45%); }
@keyframes grid { to { background-position: 0 64px; } }
.pins { position: absolute; inset: 0; }
.pin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent), 0 0 24px var(--c); animation: bob 4s ease-in-out infinite; }
.pin::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 46px; background: linear-gradient(color-mix(in srgb, var(--c) 70%, transparent), transparent); }
@keyframes bob { 50% { transform: translateY(-14px); } }
.projects::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--projects-overlay); pointer-events: none; }

/* Mobile: split horizontally -------------------------------------------------------- */
@media (max-width: 820px) {
  .split { flex-direction: column; }
  .half { padding: 1.2rem; }
  .store, .projects { padding-inline: 1.2rem; }
  .seam-line { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 1px; background: linear-gradient(90deg, transparent, var(--seam-line-color) 20%, var(--seam-line-color) 80%, transparent); }
  .seam-logo { --logo: 64px; }
  .content { gap: 0.7rem; }
  .content p { font-size: 0.88rem; }
  .tags { display: none; }
  .pins { opacity: 0.45; }
  .cta { padding: 0.75rem 1.4rem; font-size: 0.95rem; margin-top: 0.1rem; }
  .store .content { padding-bottom: 1.6rem; } .projects .content { padding-top: 1.6rem; padding-bottom: 2.6rem; }
  .foot { font-size: 0.72rem; gap: 0.5rem; padding: 0.4rem 0.8rem; }
  .foot img { height: 20px; }
}
@media (max-height: 560px) and (min-width: 821px) { .content p, .tags { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; } }
