:root {
  --bg: #142440;
  --bg-2: #1F3863;
  --card: rgba(150, 205, 245, .09);
  --card-2: rgba(150, 205, 245, .14);
  --line: rgba(170, 215, 248, .18);
  --line-2: rgba(170, 215, 248, .3);
  --text: #F2F3F8;
  --muted: #CFDDF0;
  --dim: #A3B6D3;
  --coral: #78BFF0;
  --pink: #8B79C6;
  --violet: #8B79C6;
  --cyan: #78BFF0;
  --mint: #3DDBB4;
  --gold: #E9B872;
  --sky: #78BFF0;
  --sky-2: #BFE0F9;
  --grad: linear-gradient(115deg, #BFE0F9 0%, #78BFF0 45%, #8B79C6 100%);
  --display: "Tajawal", system-ui, sans-serif;
  --body: "Tajawal", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 28px;
  --wrap: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .arrow { transform: scaleX(-1); }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.b1 { width: 560px; height: 560px; background: #3D7BE8; top: -180px; inset-inline-end: -120px; animation: drift 22s ease-in-out infinite alternate; }
.b2 { width: 440px; height: 440px; background: #8B79C6; top: 38%; inset-inline-start: -200px; opacity: .32; animation: drift 26s ease-in-out infinite alternate-reverse; }
.b3 { width: 560px; height: 560px; background: #78BFF0; bottom: -260px; inset-inline-end: 10%; opacity: .35; animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }
.pattern {
  position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath d='M50 30l6 8 10-2-2 10 8 6-8 6 2 10-10-2-6 8-6-8-10 2 2-10-8-6 8-6-2-10 10 2z' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'/%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

/* ---------- Header ---------- */
.top {
  position: sticky; top: 14px; z-index: 50;
  width: min(var(--wrap), calc(100% - 32px)); margin: 14px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 14px; border-radius: 999px;
  background: rgba(30, 58, 108, .72); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.logo { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); text-decoration: none; font-family: var(--display); font-weight: 700; color: #fff; font-size: 15px; letter-spacing: .02em; box-shadow: 0 6px 20px -6px rgba(139, 121, 198, .6); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--sky-2); background: rgba(120, 191, 240, .1); }
.langs { display: flex; background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.langs a { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 40px; height: 34px; display: grid; place-items: center; border-radius: 999px; transition: background .2s, color .2s; }
.langs a:hover { color: var(--text); }
.langs a.on { background: var(--text); color: var(--bg); }

main { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn-demo {
  --a1: var(--coral); --a2: var(--violet);
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 62px; padding: 0 32px; border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: 18px; color: #fff; text-decoration: none;
  background: linear-gradient(115deg, var(--a1), var(--a2));
  box-shadow: 0 14px 40px -12px var(--a2), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn-demo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 55%, 100% { transform: translateX(120%); } }
.btn-demo:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 50px -12px var(--a2), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-demo:hover .arrow { translate: 4px 0; }
[dir="rtl"] .btn-demo:hover .arrow { translate: -4px 0; }
.btn-demo .arrow { width: 22px; height: 22px; transition: translate .25s; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px; padding: 0 26px; border-radius: 999px;
  font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--text); text-decoration: none;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero-cta .btn-demo { background: linear-gradient(115deg, #245DDA, #3D7BE8 55%, #78BFF0); box-shadow: 0 14px 40px -12px #78BFF0, inset 0 1px 0 rgba(255, 255, 255, .35); }
.hero-cta .btn-demo:hover { box-shadow: 0 22px 50px -12px #78BFF0, inset 0 1px 0 rgba(255, 255, 255, .35); }
.facts dt { color: var(--sky-2); }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; min-height: calc(100vh - 90px); padding: 72px 0 64px; }
.hello { color: var(--muted); font-size: 18px; display: flex; align-items: center; gap: 8px; }
.wave { display: inline-block; transform-origin: 70% 80%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } }
.name {
  margin-top: 6px;
  font-size: clamp(34px, 4.6vw, 54px); font-weight: 700; letter-spacing: -.01em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content;
}
.role { margin-top: 10px; color: var(--muted); font-size: 18px; font-weight: 500; }
.role .sep { color: var(--dim); margin: 0 4px; }
.tagline { margin-top: 26px; font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.45; font-weight: 500; max-width: 30ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.facts { display: flex; gap: 32px; margin: 44px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 2px; }
.facts dt { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }
.facts dd { margin: 0; color: var(--muted); font-size: 14px; }

.hero-art { position: relative; min-height: 440px; display: grid; place-items: center; }
.code-card {
  position: relative; z-index: 2; width: min(460px, 100%);
  border-radius: 22px; overflow: hidden;
  background: rgba(30, 58, 108, .88); border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform .6s ease;
}
[dir="rtl"] .code-card { transform: perspective(1200px) rotateY(8deg) rotateX(4deg); }
.hero-art:hover .code-card { transform: perspective(1200px) rotateY(0) rotateX(0); }
.code-bar, .browser-bar { direction: ltr; display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.code-bar i, .browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.code-bar i:nth-child(2), .browser-bar i:nth-child(2) { background: #FEBC2E; }
.code-bar i:nth-child(3), .browser-bar i:nth-child(3) { background: #28C840; }
.code-bar span { margin-inline-start: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.code-card pre { margin: 0; padding: 20px 18px 22px; font-family: var(--mono); font-size: 13.5px; line-height: 1.9; white-space: pre; overflow-x: auto; color: #D7DBEA; }
.ln { display: inline-block; width: 22px; color: #6E7896; user-select: none; margin-inline-end: 12px; text-align: right; }
.k { color: #FF8AC2; } .v { color: #9CDCFE; } .key { color: #8FB5FF; } .s { color: #FFC48A; } .n { color: #7EE8C8; } .p { color: #7B84A0; }
.caret { display: inline-block; width: 8px; height: 17px; background: var(--coral); vertical-align: -3px; margin-inline-start: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.star { position: absolute; fill: none; stroke-width: 1.2; }
.star svg { width: 100%; height: 100%; overflow: visible; }
.s1 { width: 340px; height: 340px; top: -10px; inset-inline-start: -10px; animation: spin 60s linear infinite; }
.s1 path { stroke: rgba(120, 191, 240, .4); }
.s2 { width: 200px; height: 200px; bottom: 0; inset-inline-end: 0; animation: spin 45s linear infinite reverse; }
.s2 path { stroke: rgba(36, 93, 218, .4); }
@keyframes spin { to { transform: rotate(360deg); } }
.float {
  direction: ltr; unicode-bidi: isolate;
  position: absolute; z-index: 3; font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; background: rgba(40, 72, 128, .9); border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); animation: bob 6s ease-in-out infinite;
}
.f1 { top: 8%; inset-inline-end: 8%; color: #7EE8C8; }
.f2 { top: 44%; inset-inline-start: -2%; color: #FFC48A; animation-delay: -1.5s; }
.f3 { bottom: 10%; inset-inline-start: 16%; color: #FF8AC2; animation-delay: -3s; }
.f4 { bottom: 26%; inset-inline-end: -2%; color: #8FB5FF; animation-delay: -4.5s; }
@keyframes bob { 50% { transform: translateY(-12px); } }

/* ---------- Sections ---------- */
.section { padding: 110px 0 0; }
.sec-head { margin-bottom: 52px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--sky); letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--grad); }
.sec-head h2 { margin-top: 10px; font-size: clamp(32px, 4.2vw, 50px); font-weight: 700; letter-spacing: -.01em; }

/* ---------- Featured projects ---------- */
.projs { display: grid; gap: 40px; }
.proj {
  --a1: var(--violet); --a2: var(--cyan);
  position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 48px; align-items: center;
  padding: 34px; border-radius: 36px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a1) 16%, transparent), transparent 55%),
    radial-gradient(100% 90% at 100% 100%, color-mix(in srgb, var(--a2) 12%, transparent), transparent 55%),
    rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
}
.proj::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a1) 60%, transparent), transparent 35%, transparent 65%, color-mix(in srgb, var(--a2) 50%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.proj.flip .proj-media { order: 2; }
.proj-media { position: relative; min-width: 0; }
.browser {
  position: relative; z-index: 1; border-radius: 20px; overflow: hidden;
  background: #21407A; border: 1px solid var(--line-2);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .8), 0 0 80px -30px var(--a1);
  transition: transform .5s ease;
}
.proj:hover > .proj-media > .browser { transform: translateY(-6px) rotate(-.6deg); }
.proj.flip:hover > .proj-media > .browser { transform: translateY(-6px) rotate(.6deg); }
.browser-bar { padding: 11px 14px; }
.browser-bar i { width: 10px; height: 10px; }
.browser-bar span { flex: 1; margin-inline-start: 10px; padding: 3px 12px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-family: var(--mono); font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.browser-shot { aspect-ratio: 4 / 3; overflow: hidden; }
.browser-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s ease; }
.proj:hover .browser-shot img { transform: scale(1.03); }
.media-ph { height: 100%; display: grid; place-items: center; font-family: var(--display); font-size: 28px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.proj-num {
  position: absolute; z-index: 0; top: -38px; inset-inline-end: -10px;
  font-family: var(--display); font-weight: 700; font-size: 120px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--a1) 45%, transparent);
}
.proj-body { min-width: 0; }
.kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--a1) 75%, white); }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 12px var(--a1); }
.kicker .live { color: var(--mint); display: inline-flex; align-items: center; gap: 6px; }
.kicker .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse-mint 2s infinite; }
@keyframes pulse-mint { 0% { box-shadow: 0 0 0 0 rgba(61, 219, 180, .7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(61, 219, 180, 0); } }
.proj h3 { margin-top: 12px; font-size: clamp(26px, 3vw, 36px); font-weight: 700; }
.lead { margin-top: 12px; color: var(--muted); font-size: 17.5px; }
.ps-wrap { display: grid; gap: 12px; margin-top: 22px; }
.ps { padding: 14px 18px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.ps h4 { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.ps h4::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--a2); transform: rotate(45deg); }
.ps-problem h4::before { background: var(--a1); }
.ps p { margin-top: 4px; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
[dir="rtl"] .chips { justify-content: flex-end; }
.chips li { font-family: var(--mono); font-size: 12.5px; padding: 5px 12px; border-radius: 999px; color: #DDE1EE; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.proj .btn-demo { --a1: inherit; --a2: inherit; }

/* Flip card: drawing on the front, real screenshot on the back */
.card3d { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; perspective: 1600px; border-radius: 22px; }
.card3d-inner { display: grid; transition: transform .9s cubic-bezier(.3, .9, .3, 1); transform-style: preserve-3d; }
.card3d.is-flipped .card3d-inner { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; display: block; position: relative; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
/* hide the face that is turned away (some browsers still draw its labels) */
.face { transition: visibility 0s .4s; }
.card3d:not(.is-flipped) .face.back, .card3d.is-flipped .face.front { visibility: hidden; }
.face.front {
  border-radius: 22px; overflow: hidden; border: 1px solid rgba(120, 191, 240, .28);
  background:
    radial-gradient(90% 80% at 30% 20%, rgba(120, 191, 240, .2), transparent 60%),
    radial-gradient(80% 80% at 90% 100%, color-mix(in srgb, var(--a1) 22%, transparent), transparent 60%),
    linear-gradient(160deg, #2A4F8C, #1F3D72);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .8), 0 0 80px -30px var(--sky);
  transition: transform .5s ease, box-shadow .5s ease, visibility 0s .4s;
}
.face.front { display: grid; place-items: center; }
.face.front .art { display: block; width: 100%; aspect-ratio: 640 / 460; margin-bottom: 30px; }
.face.front .art svg { width: 100%; height: 100%; display: block; }
.card3d:hover .face.front { box-shadow: 0 50px 80px -30px rgba(0, 0, 0, .85), 0 0 110px -25px var(--sky); }
.face .browser { display: block; height: 100%; }
.face .browser-bar { display: flex; }
.face .browser-shot { display: block; }
.hint {
  position: absolute; inset-inline-start: 50%; bottom: 16px; translate: -50% 0; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(30, 58, 108, .78); color: var(--sky-2); border: 1px solid rgba(120, 191, 240, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  transition: background .2s, color .2s;
}
[dir="rtl"] .hint { translate: 50% 0; }
.hint .ico { width: 17px; height: 17px; }
.card3d:hover .hint { background: var(--sky); color: #0B1020; }
.card3d:hover .face.front .hint .ico { animation: turn 1.2s ease-in-out; }
@keyframes turn { to { transform: rotate(360deg); } }
.card3d:focus-visible { outline: 2px solid var(--sky); outline-offset: 6px; }

/* Drawing animations (from the original illustrations) */
.cs-dash { animation: cs-dash 2.4s linear infinite; }
.cs-dash-rev { animation-duration: 3.2s; animation-direction: reverse; }
.cs-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: cs-bar 2.2s ease-in-out infinite alternate; }
.eg-float { animation: eg-float 4s ease-in-out infinite alternate; }
.lb-gap { animation: lb-gap 2.4s ease-in-out infinite alternate; }
@keyframes cs-dash { to { stroke-dashoffset: -32px; } }
@keyframes cs-bar { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
@keyframes eg-float { to { transform: translateY(-10px); } }
@keyframes lb-gap { from { opacity: .35; } to { opacity: 1; } }

/* More projects */
.sub { font-size: 24px; margin: 72px 0 22px; }
.minis { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini { padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: transform .3s, border-color .3s, background .3s; }
.mini:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--card-2); }
.mini-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(120, 191, 240, .22), rgba(139, 121, 198, .2)); border: 1px solid var(--line-2); }
.mini-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--sky-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mini h4 { margin-top: 16px; font-size: 19px; }
.mini p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.mini a { display: inline-block; margin-top: 10px; color: var(--sky); font-weight: 600; font-size: 15px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.about-text { font-family: var(--display); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.65; font-weight: 400; color: #E3E6F0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 9px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--sky), var(--violet), transparent); border-radius: 2px; }
.timeline li { position: relative; padding: 4px 0 28px; padding-inline-start: 44px; }
.tl-dot { position: absolute; inset-inline-start: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 3px solid var(--sky); box-shadow: 0 0 0 6px rgba(120, 191, 240, .15); }
.tl-tag { font-size: 13px; color: var(--sky); font-weight: 600; }
.timeline h3 { margin-top: 4px; font-size: 21px; }
.tl-org { color: var(--muted); margin-top: 2px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill { padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.skill::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; inset-inline-end: -60px; top: -60px; background: radial-gradient(circle, rgba(139, 121, 198, .25), transparent 70%); }
.skill:nth-child(2)::after { background: radial-gradient(circle, rgba(36, 93, 218, .25), transparent 70%); }
.skill:nth-child(3)::after { background: radial-gradient(circle, rgba(120, 191, 240, .3), transparent 70%); }
.skill h3 { font-size: 19px; }
.skill ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
[dir="rtl"] .skill ul { justify-content: flex-end; }
.skill li { font-family: var(--mono); font-size: 14px; padding: 7px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }

/* Contact */
.contact {
  position: relative; overflow: hidden; text-align: center;
  padding: 72px 32px; border-radius: 40px;
  background: linear-gradient(140deg, rgba(36, 93, 218, .14), rgba(139, 121, 198, .1) 35%, rgba(139, 121, 198, .14) 65%, rgba(120, 191, 240, .2));
  border: 1px solid var(--line-2);
}
.contact-glow { position: absolute; width: 520px; height: 520px; left: 50%; top: -260px; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); pointer-events: none; }
.contact .eyebrow { justify-content: center; }
.contact h2 { margin-top: 12px; font-size: clamp(30px, 4.4vw, 52px); font-weight: 700; }
.contact-text { margin: 14px auto 0; color: #D6DAE8; max-width: 52ch; font-size: 18px; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 36px; }
.mail { display: inline-flex; align-items: stretch; border-radius: 999px; background: #fff; color: #141A2E; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); overflow: hidden; max-width: 100%; }
.mail-link { display: inline-flex; align-items: center; gap: 12px; padding: 0 22px 0 26px; min-height: 62px; font-family: var(--display); font-weight: 600; font-size: 18px; text-decoration: none; color: inherit; min-width: 0; }
.mail-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-link .ico { color: #245DDA; }
.copy { display: inline-flex; align-items: center; gap: 8px; border: 0; border-inline-start: 1px solid #E3E6EF; background: #F4F5FA; color: #141A2E; font: inherit; font-weight: 600; font-size: 15px; padding: 0 20px; cursor: pointer; transition: background .2s; }
.copy:hover { background: #E9EBF3; }
.copy.done { color: #0F8A65; }
.btn-ghost.light { border-color: rgba(255, 255, 255, .3); }

/* Footer */
.foot { width: min(var(--wrap), calc(100% - 32px)); margin: 90px auto 0; padding: 28px 0 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 14px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 56px; gap: 40px; }
  .hero-art { min-height: 380px; }
  .proj, .proj.flip { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 22px; }
  .proj.flip .proj-media { order: 0; }
  .proj-num { font-size: 84px; top: -26px; }
  .about-grid { grid-template-columns: 1fr; }
  .skills, .minis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .top { padding: 8px 8px 8px 10px; }
  .hero { padding: 40px 0 24px; }
  .hero-cta .btn-demo, .hero-cta .btn-ghost { flex: 1 1 100%; }
  .facts { gap: 20px; }
  .facts dt { font-size: 24px; }
  .hero-art { min-height: 0; }
  .star, .float { display: none; }
  .code-card, [dir="rtl"] .code-card { transform: none; }
  .code-card pre { font-size: 12px; padding: 16px 12px; }
  .section { padding-top: 80px; }
  .proj, .proj.flip { padding: 14px 14px 22px; border-radius: 28px; }
  .proj-body { padding: 0 6px; }
  .proj-num { display: none; }
  .actions .btn-demo, .actions .btn-ghost { flex: 1 1 100%; }
  .skills, .minis { grid-template-columns: 1fr; }
  .contact { padding: 52px 18px; border-radius: 30px; }
  .mail { flex-direction: column; border-radius: 22px; width: 100%; }
  .mail-link { justify-content: center; padding: 0 16px; font-size: 16px; }
  .copy { border-inline-start: 0; border-top: 1px solid #E3E6EF; justify-content: center; min-height: 50px; }
  .contact-actions .btn-ghost { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- CV, experience & languages ---------- */
.about-main { display: grid; gap: 28px; min-width: 0; }
.tl-tag { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tl-when { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.tl-desc { margin-top: 6px; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.tl-exp .tl-dot { border-color: var(--coral); box-shadow: 0 0 0 6px rgba(36, 93, 218, .15); }
.tl-exp .tl-tag { color: var(--coral); }
.tl-cert .tl-dot { border-color: var(--violet); box-shadow: 0 0 0 6px rgba(139, 121, 198, .15); }
.tl-cert .tl-tag { color: #C7B8F5; }
.tl-cert h3 { font-size: 18px; }

.langs-box { padding: 22px 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.langs-box h3 { font-size: 17px; }
.lg { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 14px; }
.lg li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.lg-name { font-weight: 600; }
.lg-level { color: var(--muted); font-size: 14px; }
.lg-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.lg-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }

.cv-card {
  position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 26px; border-radius: 32px; overflow: hidden;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(120, 191, 240, .16), transparent 60%),
    radial-gradient(80% 100% at 100% 100%, rgba(139, 121, 198, .12), transparent 60%),
    rgba(255, 255, 255, .03);
  border: 1px solid var(--line-2);
}
.cv-paper {
  position: relative; display: block; border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 50px -22px rgba(0, 0, 0, .85), 10px 10px 0 -2px rgba(120, 191, 240, .25), 20px 20px 0 -4px rgba(139, 121, 198, .14);
  transform: rotate(-4deg); transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s;
}
[dir="rtl"] .cv-paper { transform: rotate(4deg); box-shadow: 0 30px 50px -22px rgba(0, 0, 0, .85), -10px 10px 0 -2px rgba(120, 191, 240, .25), -20px 20px 0 -4px rgba(139, 121, 198, .14); }
.cv-paper:hover, [dir="rtl"] .cv-paper:hover { transform: rotate(0) translateY(-6px) scale(1.04); }
.cv-paper img { width: 100%; height: auto; }
.cv-badge { position: absolute; top: 8px; inset-inline-end: 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 6px; background: #245DDA; }
.cv-info h3 { margin-top: 8px; font-size: 24px; font-weight: 700; }
.cv-info > p:not(.eyebrow) { margin-top: 6px; color: var(--muted); font-size: 15.5px; }
.cv-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cv-btns .btn-demo, .cv-btns .btn-ghost { min-height: 52px; padding: 0 22px; font-size: 16px; }
.cv-btns .btn-demo { background: linear-gradient(115deg, #245DDA, #3D7BE8 55%, #78BFF0); --a2: #78BFF0; }

.skill:nth-child(4)::after { background: radial-gradient(circle, rgba(120, 191, 240, .25), transparent 70%); }
.skill:nth-child(5)::after { background: radial-gradient(circle, rgba(139, 121, 198, .25), transparent 70%); }
.skill:nth-child(6)::after { background: radial-gradient(circle, rgba(36, 93, 218, .3), transparent 70%); }

@media (max-width: 680px) {
  .cv-card { grid-template-columns: 1fr; padding: 22px 20px 24px; text-align: center; }
  .cv-paper { width: 150px; margin: 6px auto 4px; }
  .cv-info .eyebrow { justify-content: center; }
  .cv-btns { justify-content: center; }
  .cv-btns .btn-demo, .cv-btns .btn-ghost { flex: 1 1 100%; }
}

.browser-bar span { min-width: 0; }
.card3d, .card3d-inner, .face { min-width: 0; max-width: 100%; }
.cv-card { grid-template-columns: minmax(0, 1fr); }

/* ---------- Enlarge project screenshots ---------- */
.proj:hover .browser-shot img { transform: none; }
.zoom {
  position: absolute; top: 58px; inset-inline-end: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: rgba(30, 58, 108, .82); color: var(--sky-2); border: 1px solid rgba(120, 191, 240, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .3s .5s, visibility 0s .5s, background .2s, color .2s;
}
.zoom .ico { width: 16px; height: 16px; }
.card3d.is-flipped + .zoom { opacity: 1; visibility: visible; }
.card3d:not(.is-flipped) + .zoom { transition: opacity .15s, visibility 0s .15s; }
.zoom:hover { background: var(--sky); color: #0B1020; }
.lightbox {
  width: min(1200px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: #21407A; overflow: hidden; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9);
}
.lightbox::backdrop { background: rgba(10, 16, 34, .8); backdrop-filter: blur(4px); }
.lightbox img { width: 100%; height: auto; max-height: 92vh; object-fit: contain; }
.lb-close {
  position: absolute; top: 10px; inset-inline-end: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(30, 58, 108, .85); color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.lb-close:hover { background: var(--text); color: var(--bg); }

/* ---------- Light and dark bands, like the original site ---------- */
.band { position: relative; isolation: isolate; padding: 110px 0; }
.band::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: -1; }
.dark-band::before { background: #142440; }
.dark-band .sub { margin-top: 0; }
.work-band::before { background: linear-gradient(180deg, #78BFF0 0%, #9FD0F4 55%, #BFE0F9 100%); }
.about-band::before { background: #BFE0F9; }
.skills-band::before { background: linear-gradient(180deg, #BFE0F9 0%, #EAF3FF 100%); }
.about-band { padding-bottom: 40px; }
.skills-band { padding-top: 60px; }
.band + .section:not(.band) { padding-top: 110px; }

.band-light {
  --text: #142440; --muted: #46546A; --dim: #6B7C96;
  --line: rgba(20, 36, 64, .12); --line-2: rgba(20, 36, 64, .2);
  --card: rgba(255, 255, 255, .55); --card-2: rgba(255, 255, 255, .8);
  color: var(--text);
}
.band-light .eyebrow { color: #245DDA; }
.band-light .eyebrow::before { background: #142440; }
.band-light .proj { background: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .8); box-shadow: 0 30px 60px -30px rgba(20, 36, 64, .35); }
.band-light .proj::before { display: none; }
.band-light .kicker { color: #245DDA; }
.band-light .kicker .dot { background: #245DDA; box-shadow: none; }
.band-light .kicker .live { color: #0E8F6E; }
.band-light .kicker .live::before { background: #0E8F6E; }
.band-light .ps { background: #F7FAFF; border-color: #D3E3F8; }
.band-light .ps h4::before { background: #78BFF0; }
.band-light .ps-problem h4::before { background: #245DDA; }
.band-light .chips li, .band-light .skill li { color: #1F3863; background: #EAF3FF; border-color: #D3E3F8; }
.band-light .btn-ghost { border-color: rgba(20, 36, 64, .3); background: rgba(255, 255, 255, .5); }
.band-light .btn-ghost:hover { background: #fff; border-color: #142440; }
.band-light .about-text { color: #142440; }
.band-light .tl-tag { color: #245DDA; }
.band-light .tl-exp .tl-tag { color: #1B4BB5; }
.band-light .tl-exp .tl-dot { border-color: #245DDA; box-shadow: 0 0 0 6px rgba(36, 93, 218, .15); }
.band-light .tl-cert .tl-tag { color: #6A58B0; }
.band-light .tl-dot { background: #fff; }
.band-light .tl-when { background: rgba(255, 255, 255, .6); }
.band-light .timeline::before { background: linear-gradient(#245DDA, #8B79C6, transparent); }
.band-light .langs-box, .band-light .skill { background: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .85); }
.band-light .lg-bar { background: rgba(20, 36, 64, .1); }
.band-light .lg-bar i { background: linear-gradient(90deg, #245DDA, #78BFF0); }
.band-light .cv-card { background: #142440; border-color: transparent; color: #F2F3F8; --text: #F2F3F8; --muted: #C9D6EA; }
.band-light .cv-card .eyebrow { color: #78BFF0; }
.band-light .cv-card .eyebrow::before { background: #78BFF0; }
.band-light .cv-card .btn-ghost { color: #F2F3F8; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }
.band-light .cv-card .btn-ghost:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .5); }
@media (max-width: 680px) {
  .band { padding: 72px 0; }
}
